/* ============================================================
   ARTEMIS21 — Journal article shared stylesheet
   Editorial typography, SEO-friendly long-form Thai/EN
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #ffffff;
  --bg-soft: #f6f5f2;
  --bg-cream: #faf8f3;
  --text: #111111;
  --text-soft: #2a2a2a;
  --text-muted: #888888;
  --text-faint: #b8b8b8;
  --rule: #e9e7e2;
  --rule-strong: #d8d6cf;
  --accent: #3a3a36;
  --max: 1320px;
  --measure: 70ch;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Sarabun', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.th, body:lang(th) { font-family: 'Sarabun', 'Inter', sans-serif; }
a { color: inherit; text-decoration: none; transition: opacity 0.25s ease; }
a:hover { opacity: 0.55; }
img { display: block; max-width: 100%; height: auto; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 40px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.num { font-feature-settings: 'tnum'; }

/* ─── header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  z-index: 100;
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0 18px;
}
.header-meta {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}
.header-meta.right { text-align: right; }
.logo {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-align: center;
}
.main-nav {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  background: #fff;
}
.nav-list {
  display: flex;
  justify-content: center;
  gap: 48px;
  list-style: none;
  font-size: 11px;
  letter-spacing: 0.24em;
  font-weight: 500;
  text-transform: uppercase;
}
.nav-list a { position: relative; padding: 4px 0; }
.nav-list a.current { opacity: 0.55; }

/* ─── article hero ───────────────────────────────────────── */
.article-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.crumbs {
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 36px;
}
.crumbs a:hover { opacity: 1; color: var(--text); }
.crumbs span { color: var(--text-faint); }

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.article-tags .tag {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
}

.article-title {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-weight: 300;
  font-size: clamp(32px, 4.4vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  max-width: 22ch;
  margin-bottom: 32px;
}
.article-title em { font-style: italic; font-weight: 300; }

.article-deck {
  font-family: 'Sarabun', sans-serif;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 58ch;
  margin-bottom: 48px;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.article-byline .b-item .eyebrow { display: block; margin-bottom: 6px; }
.article-byline .b-item .v { font-size: 14px; color: var(--text); }

/* ─── featured image ─────────────────────────────────────── */
.article-feature {
  padding: 56px 0 0;
}
.article-feature .media {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-soft);
}
.article-feature .media img {
  width: 100%; height: 100%; object-fit: cover;
}
.article-feature .caption {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─── article body ───────────────────────────────────────── */
.article-body {
  padding: 80px 0 120px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 80px;
}

.toc {
  position: sticky;
  top: 140px;
  align-self: start;
  font-size: 12.5px;
  line-height: 1.7;
}
.toc .toc-label {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.toc ol {
  list-style: none;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 10px;
  padding-left: 28px;
  position: relative;
  font-family: 'Sarabun', sans-serif;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-feature-settings: 'tnum';
}
.toc a { color: var(--text-soft); }
.toc a:hover { color: var(--text); opacity: 1; }
.toc a.active { color: var(--text); font-weight: 500; }

.prose {
  max-width: var(--measure);
  font-family: 'Sarabun', sans-serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-soft);
}
.prose > * + * { margin-top: 1.4em; }
.prose h2 {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 2.6em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}
.prose h2 em { font-style: italic; }
.prose h2 .num {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.prose h3 {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.35;
  color: var(--text);
  margin-top: 2em;
}
.prose p {
  font-family: 'Sarabun', sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-soft);
}
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol {
  padding-left: 1.4em;
  font-family: 'Sarabun', sans-serif;
}
.prose li {
  margin-bottom: 0.6em;
  line-height: 1.8;
}
.prose ul li::marker { color: var(--text-faint); }

.prose blockquote {
  margin: 2em 0;
  padding: 0 0 0 28px;
  border-left: 1px solid var(--text);
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.005em;
}
.prose blockquote cite {
  display: block;
  margin-top: 16px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.prose figure {
  margin: 2.6em 0;
}
.prose figure img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-soft);
}
.prose figcaption {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

/* key-stat callouts */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 2.6em 0;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat .v {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-feature-settings: 'tnum';
  margin-bottom: 8px;
}
.stat .l {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.callout {
  margin: 2em 0;
  padding: 28px 32px;
  background: var(--bg-soft);
  border-left: 2px solid var(--text);
}
.callout .label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.callout p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-family: 'Sarabun', sans-serif;
  font-size: 14.5px;
}
.spec-table th, .spec-table td {
  padding: 14px 0;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.spec-table th {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  width: 38%;
}

.update-log {
  margin: 2.6em 0;
  padding: 24px 28px;
  background: var(--bg-cream);
  border: 1px solid var(--rule-strong);
}
.update-log .label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}
.update-log ul { list-style: none; padding: 0; }
.update-log li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.update-log li:first-child { border-top: none; padding-top: 0; }
.update-log .d {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-top: 3px;
}

/* faq accordion */
.faq { margin: 2.6em 0; }
.faq details {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-soft);
}

/* cta block */
.cta-block {
  margin: 80px 0 0;
  padding: 60px 56px;
  background: #0d0d0d;
  color: #fff;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
}
.cta-block h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.cta-block h3 em { font-style: italic; }
.cta-block p {
  margin-top: 14px;
  color: #a9a7a1;
  font-size: 14.5px;
  line-height: 1.7;
  font-family: 'Sarabun', sans-serif;
}
.cta-block .actions { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cta-block .btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #0d0d0d;
  padding: 16px 28px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
.cta-block .btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

/* author */
.author-card {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: start;
}
.author-card .avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-soft);
  overflow: hidden;
}
.author-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card .who .eyebrow { display: block; margin-bottom: 10px; }
.author-card .who h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 20px;
  margin-bottom: 8px;
}
.author-card .who p {
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 60ch;
}

/* related */
.related-section {
  padding: 100px 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
}
.related-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 28px;
  padding-bottom: 22px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--rule-strong);
}
.related-head h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.01em;
}
.related-head h2 em { font-style: italic; }
.related-head .idx {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.r-card .r-media {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #eaeae5;
  margin-bottom: 16px;
}
.r-card .r-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.r-card:hover .r-media img { transform: scale(1.04); }
.r-card .r-cat {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.r-card .r-title {
  font-family: 'Inter', 'Sarabun', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.35;
}
.r-card .r-title em { font-style: italic; }

/* footer (same as main) */
.site-footer {
  background: #0d0d0d;
  color: #a9a7a1;
  padding: 84px 0 36px;
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 56px;
}
.footer-logo {
  color: #fff;
  font-size: 18px;
  letter-spacing: 0.34em;
  margin-bottom: 22px;
  font-weight: 400;
}
.footer-grid h4 {
  color: #fff;
  margin-bottom: 16px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
.footer-grid p, .footer-grid a { line-height: 1.95; font-size: 13px; }
.footer-bottom {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid #1f1f1f;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6c6a64;
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* reading progress */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--text);
  z-index: 200;
  transition: width 0.05s linear;
}

/* responsive */
@media (max-width: 980px) {
  .article-body {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .toc { position: static; }
  .stat-row { grid-template-columns: 1fr; }
  .cta-block { grid-template-columns: 1fr; padding: 40px 32px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 22px; }
  .header-inner { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .header-meta, .header-meta.right { text-align: center; }
  .nav-list { gap: 22px; font-size: 10px; flex-wrap: wrap; }
  .article-byline { gap: 28px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { flex-direction: column; gap: 10px; }
  .author-card { grid-template-columns: 1fr; }
  .update-log li { grid-template-columns: 1fr; gap: 4px; }
}
