:root {
  --ink: #111827;
  --paper: #f3f5f7;
  --white: #ffffff;
  --red: #ef233c;
  --muted: #67707f;
  --line: #d9dee5;
  --max: 1180px;
  --header-height: 72px;
  --font-body: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Manrope", var(--font-body);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  background: var(--white);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.utility-bar {
  color: #c6ccd5;
  background: var(--ink);
  font: 600 .75rem/1 var(--font-label);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.utility-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--white);
  background: rgba(17, 24, 39, .96);
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
}

.header-inner { min-height: var(--header-height); display: flex; align-items: center; gap: 30px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.0625rem/1 var(--font-label);
  letter-spacing: -.04em;
}
.brand > span:last-child > span { color: var(--red); }
.brand-logo { position: relative; display: block; width: 190px; height: 58px; overflow: hidden; flex: 0 0 auto; }
.brand-logo img { position: absolute; top: 48%; left: 50%; width: 205px; max-width: none; transform: translate(-50%, -50%); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--white);
  background: var(--ink);
  border-radius: 3px;
  font: 800 .875rem/1 var(--font-label);
}

.site-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.site-nav a { position: relative; font-size: .9375rem; font-weight: 600; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--red); }
.site-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 2px; background: var(--red); }

.facebook-button, .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 18px;
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  transition: transform .2s ease, background .2s ease;
}
.facebook-button:hover, .primary-action:hover { background: var(--red); transform: translateY(-2px); }
.site-header .facebook-button { color: var(--ink); background: var(--white); }
.site-header .facebook-button:hover { color: var(--white); background: var(--red); }
.menu-toggle { display: none; }

.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
  min-height: 500px;
  padding-block: 54px 60px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font: 700 .75rem/1.2 var(--font-label);
  letter-spacing: .15em;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -.035em;
}
.masthead h1 em { color: var(--red); font-style: normal; }
.masthead-copy { position: relative; z-index: 2; }
.masthead-index {
  position: absolute;
  top: -34px;
  left: -22px;
  z-index: -1;
  color: rgba(17, 24, 39, .055);
  font: 800 clamp(7rem, 15vw, 12rem)/1 var(--font-label);
  letter-spacing: -.1em;
}
.intro { max-width: 620px; margin: 25px 0 28px; color: #3e4653; font-size: 1.125rem; line-height: 1.65; }
.masthead-actions { display: flex; align-items: center; gap: 22px; }
.masthead-actions span { max-width: 280px; color: var(--muted); font-size: .875rem; line-height: 1.55; }

.masthead-visual { position: relative; min-height: 400px; background: var(--ink); overflow: hidden; box-shadow: 18px 18px 0 var(--ink); }
.masthead-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(17,24,39,.74)); }
.masthead-visual img { width: 100%; height: 400px; object-fit: cover; object-position: center; }
.issue-card {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  display: grid;
  min-width: 220px;
  padding: 24px;
  color: var(--white);
  background: var(--red);
}
.issue-card strong { font: 800 1.0625rem/1.2 var(--font-label); letter-spacing: .06em; }
.issue-card span { font-size: .8125rem; line-height: 1.5; opacity: .9; }

.reading-strip { color: var(--white); background: var(--red); }
.reading-strip-inner {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.reading-strip-inner::-webkit-scrollbar { display: none; }
.category-filter {
  align-self: stretch;
  padding: 0 22px;
  color: inherit;
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(255,255,255,.34);
  font: 600 .875rem/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.category-filter:first-child { padding-left: 0; border-left: 0; font-family: var(--font-label); letter-spacing: .06em; text-transform: uppercase; }
.category-filter:hover { background: rgba(255,255,255,.1); }
.category-filter.active { color: var(--white); background: rgba(17,24,39,.2); box-shadow: inset 0 -4px 0 var(--white); }
.category-filter:focus-visible { outline: 3px solid var(--white); outline-offset: -4px; }
.filterable-story[hidden], .story-grid[hidden], .published-heading[hidden], .filter-empty[hidden] { display: none !important; }
.filter-empty { margin: 0 0 30px; padding: 24px; color: var(--muted); background: var(--white); border: 1px solid var(--line); }

.latest { padding-block: 82px 112px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-heading h2, .about-section h2 { margin: 0; font-size: clamp(2rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.02em; }
.section-heading > p { margin: 0; color: var(--muted); }

.lead-story { display: grid; grid-template-columns: 1.14fr .86fr; min-height: 520px; background: var(--white); border-top: 5px solid var(--ink); }
.story-image { position: relative; min-height: 520px; overflow: hidden; background: #080a0d; }
.story-image img { width: 100%; height: 100%; object-fit: cover; }
.story-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 65%, rgba(0,0,0,.18)); }
.play-badge { position: absolute; z-index: 2; left: 28px; bottom: 28px; display: grid; place-items: center; width: 58px; height: 58px; padding-left: 4px; color: var(--ink); background: var(--white); border-radius: 50%; }
.story-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 5vw, 66px); border-left: 1px solid var(--line); }
.story-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 13px; color: var(--muted); font-size: .8125rem; font-weight: 600; letter-spacing: .025em; }
.story-meta span { color: var(--red); font-family: var(--font-label); font-weight: 800; letter-spacing: .08em; }
.story-copy h3 { margin: 0; font-size: clamp(2rem, 3vw, 2.4rem); line-height: 1.22; letter-spacing: -.02em; }
.story-copy h3 a:hover { color: var(--red); }
.story-copy p, .story-card p { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.text-link { align-self: flex-start; margin-top: 15px; padding-bottom: 4px; border-bottom: 2px solid var(--red); font-weight: 700; }

.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.story-card { position: relative; padding: 24px 24px 30px; background: var(--paper); }
.story-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 36px;
  left: 36px;
  width: 6px;
  height: 38px;
  background: var(--red);
}
.card-image { display: block; aspect-ratio: 4/3; margin-bottom: 20px; overflow: hidden; background: #dfe3e8; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card-image:hover img { transform: scale(1.035); }
.story-card h3 { margin: 0; font-size: 1.375rem; line-height: 1.38; letter-spacing: -.012em; }
.story-card h3 a:hover { color: var(--red); }
.story-card p { margin-bottom: 0; }

.article-details { margin-top: 20px; border-top: 1px solid var(--line); }
.article-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.article-details summary::-webkit-details-marker { display: none; }
.article-details summary::after { content: "+"; color: var(--red); font: 800 1.4rem/1 var(--font-label); }
.article-details[open] summary::after { content: "−"; }
.article-body { padding: 0 0 10px; color: #414957; }
.article-body p { color: #414957; }
.article-body h4 { margin: 18px 0 8px; color: var(--ink); font-size: 1rem; }
.article-body ul { margin: 8px 0 18px; padding-left: 20px; }
.article-body li { margin: 7px 0; }
.important-note { padding: 14px 16px; background: #fff0f1; border-left: 4px solid var(--red); }
.source-note { margin-top: 18px; font-size: .875rem; line-height: 1.6; }
.source-note a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.status-badge { display: inline-block; margin: 0 5px 5px 0; padding: 4px 8px; color: #fff; background: var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.story-card .article-body { font-size: 1rem; line-height: 1.7; }
.story-card .article-body p { margin-bottom: 12px; }

.graphic { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 4/3; margin-bottom: 20px; padding: 25px; color: var(--white); background: var(--ink); overflow: hidden; }
.graphic::after { content: ""; position: absolute; width: 220px; height: 220px; right: -100px; bottom: -120px; border: 34px solid var(--red); border-radius: 50%; }
.graphic span { font: 800 clamp(3rem, 6vw, 5.4rem)/.82 var(--font-label); letter-spacing: -.06em; }
.graphic small { color: var(--red); font: 700 .75rem/1 var(--font-label); letter-spacing: .12em; }

.about-section { position: relative; color: var(--white); background: var(--ink); overflow: hidden; }
.about-section::before { content: "EDRIV"; position: absolute; right: -20px; bottom: -72px; color: rgba(255,255,255,.035); font: 800 clamp(8rem, 18vw, 18rem)/1 var(--font-label); letter-spacing: -.07em; }
.about-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 60px; padding-block: 82px; }
.about-inner > p { margin: 0; color: #bcc3cf; font-size: 1.0625rem; line-height: 1.7; }
.primary-action.light { color: var(--ink); background: var(--white); white-space: nowrap; }
.primary-action.light:hover { color: var(--white); background: var(--red); }

.site-footer { color: #aeb6c3; background: #0b111c; border-top: 1px solid rgba(255,255,255,.1); }
.footer-inner { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 30px; min-height: 126px; font-size: .875rem; line-height: 1.6; }
.footer-inner p { margin: 0; }
.footer-inner p:last-child { text-align: right; }
.footer-inner a:not(.brand) { text-decoration: underline; text-underline-offset: 3px; }

.article-page { padding-block: 56px 96px; }
.article-header { max-width: 840px; margin: 0 auto 36px; }
.article-header h1 { margin: 12px 0 18px; font-size: clamp(2.35rem, 4vw, 3rem); line-height: 1.17; letter-spacing: -.025em; }
.article-deck { max-width: 760px; margin: 0; color: #3e4653; font-size: 1.1875rem; line-height: 1.65; }
.article-hero { max-width: 960px; margin: 0 auto 44px; background: var(--ink); }
.article-hero img { width: 100%; max-height: 700px; object-fit: cover; }
.article-hero figcaption { padding: 9px 12px; color: #d5d9e0; background: var(--ink); font-size: .8125rem; line-height: 1.5; }
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 220px; justify-content: center; gap: 48px; }
.article-content { font-size: 1.125rem; line-height: 1.72; }
.article-content p { margin: 0 0 1.25em; }
.article-content .article-lead { margin-top: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.65; }
.article-content h2 { margin: 42px 0 14px; font-size: 1.75rem; line-height: 1.38; letter-spacing: -.012em; }
.article-content h3 { margin: 30px 0 10px; font-size: 1.375rem; line-height: 1.4; }
.article-content ul { padding-left: 24px; }
.article-content li { margin: 9px 0; }
.article-content figure { margin: 36px 0; }
.article-content figure img { width: 100%; }
.article-content figcaption { margin-top: 8px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.article-content table { width: 100%; margin: 28px 0; border-collapse: collapse; font-size: 1rem; line-height: 1.55; }
.article-content th, .article-content td { padding: 12px 14px; text-align: left; border: 1px solid var(--line); }
.article-content th { background: #eef0f3; }
.article-source { margin-top: 44px; padding: 20px; background: #eef0f3; border-left: 4px solid var(--red); }
.article-source a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.article-aside { align-self: start; position: sticky; top: 110px; padding-top: 14px; border-top: 4px solid var(--ink); }
.article-aside strong { display: block; margin-bottom: 10px; font: 800 .75rem/1.2 var(--font-label); letter-spacing: .1em; }
.article-aside p { color: var(--muted); font-size: .875rem; line-height: 1.65; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.back-link:hover { color: var(--red); }
.published-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-top: 78px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.published-heading h2 { margin: 0; font-size: clamp(2rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.02em; }
.published-heading .text-link { margin: 0; white-space: nowrap; }
.generated-story-grid { margin-top: 24px; }
.generated-card .text-link { display: inline-block; margin-top: 18px; }
.article-index .section-heading h1 { margin: 0; font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -.025em; }

@media (max-width: 920px) {
  .facebook-button { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; padding: 8px 12px; color: var(--white); border: 1px solid rgba(255,255,255,.55); background: transparent; font: inherit; font-weight: 700; }
  .site-nav { position: absolute; top: var(--header-height); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 14px 20px 22px; color: var(--white); background: var(--ink); border-bottom: 1px solid rgba(255,255,255,.14); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .site-nav a.active::after { display: none; }
  .masthead { grid-template-columns: 1fr; min-height: auto; }
  .masthead-visual { min-height: 380px; box-shadow: 12px 12px 0 var(--ink); }
  .masthead-visual img { height: 380px; }
  .lead-story { grid-template-columns: 1fr; }
  .story-image { min-height: 520px; }
  .story-grid { grid-template-columns: repeat(2, 1fr); }
  .story-card:last-child { grid-column: 1 / -1; }
  .graphic { aspect-ratio: 2/1; }
  .about-inner { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: minmax(0, 760px); }
  .article-aside { position: static; }
  .about-inner .primary-action { justify-self: start; }
  .footer-inner { grid-template-columns: 1fr 1fr; padding-block: 28px; }
  .footer-inner p:last-child { grid-column: 1/-1; text-align: left; }
}

@media (max-width: 620px) {
  :root { --header-height: 66px; }
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .utility-inner { min-height: 27px; }
  .utility-inner span:last-child { display: none; }
  .header-inner { min-height: var(--header-height); }
  .brand-logo { width: 158px; height: 54px; }
  .brand-logo img { width: 178px; }
  .site-nav { top: var(--header-height); }
  .masthead { gap: 36px; padding-block: 46px 58px; }
  .masthead h1 { font-size: clamp(2.75rem, 13vw, 3.6rem); }
  .masthead-actions { align-items: flex-start; flex-direction: column; }
  .masthead-visual, .masthead-visual img { height: 300px; min-height: 300px; }
  .issue-card { min-width: 180px; padding: 18px; }
  .reading-strip-inner { margin-right: 0; width: 100%; padding-left: 14px; }
  .latest { padding-block: 66px 78px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .lead-story { min-height: 0; }
  .story-image { min-height: 420px; }
  .story-copy { padding: 30px 24px 36px; }
  .story-copy h3 { font-size: 1.875rem; }
  .story-grid { grid-template-columns: 1fr; gap: 1px; margin-top: 1px; }
  .story-card:last-child { grid-column: auto; }
  .graphic { aspect-ratio: 4/3; }
  .about-inner { grid-template-columns: 1fr; gap: 28px; padding-block: 58px; }
  .article-page { padding-block: 38px 70px; }
  .article-header h1 { font-size: 2.125rem; line-height: 1.22; }
  .article-deck { font-size: 1.0625rem; }
  .article-content { font-size: 1.0625rem; line-height: 1.72; }
  .article-content .article-lead { font-size: 1.125rem; }
  .article-content h2 { font-size: 1.5rem; }
  .article-content h3 { font-size: 1.25rem; }
  .published-heading { align-items: flex-start; flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .footer-inner p:last-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
