/* The articles (1 Nov 2026): the list (/articles), an article (/articles/<slug>) and the landing's "articles" section.
   The header, footer, buttons and colours are the landing's (style.css); these pages are always light, like the landing.
   The premium touch is the landing's own: the black-and-champagne band (--band) for the list's opening, the side card and
   the closing call, champagne rules above each section heading, a warm "in short" box. Nothing scrolls sideways. */
.articles-page { background:var(--bg) }
.articles-page .site-nav a[aria-current="page"] { color:var(--text); background:var(--surface-2) }
.articles-page .lang-switch { font-weight:500 }
.article-preview { margin:0; padding:10px clamp(16px,4vw,48px); background:var(--warning-soft); color:var(--warning); font-size:14px; font-weight:500; text-align:center }

/* ---------- the list ---------- */
.articles-hero { background:var(--band); color:var(--band-text); box-shadow:var(--band-light); border-bottom:1px solid var(--band-line) }
.articles-hero-inner { max-width:1180px; margin:0 auto; padding:clamp(40px,8vh,88px) clamp(16px,4vw,48px) clamp(36px,6vh,64px) }
.band-eyebrow { display:inline-flex; align-items:center; gap:12px; margin:0 0 16px; color:var(--gold-text); font-size:13px; font-weight:600; letter-spacing:.12em; text-transform:uppercase }
.band-eyebrow::before { content:""; width:32px; height:1px; background:var(--band-line) }
.articles-hero h1 { margin:0; max-width:780px; font-size:clamp(30px,4.4vw,50px); line-height:1.22; letter-spacing:-.02em; font-weight:600 }
.articles-hero h1 + p { margin:16px 0 0; max-width:640px; color:var(--band-muted); font-size:clamp(16px,1.6vw,19px); line-height:1.75 }
.articles-list { max-width:1180px; margin:0 auto; padding:clamp(28px,5vh,56px) clamp(16px,4vw,48px) clamp(48px,8vh,88px) }
.article-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(18px,2.4vw,28px) }
.article-card { position:relative; display:flex; flex-direction:column; min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow); transition:transform var(--normal) var(--ease),box-shadow var(--normal) var(--ease) }
.article-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg) }
.article-card:focus-within { outline:2px solid var(--accent); outline-offset:3px }
.card-cover { display:block; aspect-ratio:1200/630; background:var(--band-ink); overflow:hidden }
.card-cover img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease) }
.article-card:hover .card-cover img { transform:scale(1.025) }
.card-cover-blank { display:block; width:100%; height:100%; background:var(--band) }
.card-text { display:flex; flex:1; flex-direction:column; gap:8px; padding:20px 22px 22px }
.card-tag { margin:0; color:var(--accent); font-size:13px; font-weight:600; letter-spacing:.04em }
.card-title { margin:0; font-size:19px; line-height:1.42; font-weight:600 }
.card-title a { color:var(--text); text-decoration:none }
.card-title a::after { content:""; position:absolute; inset:0 } /* the whole card opens the article */
.card-title a:focus-visible { outline:none }
.card-summary { margin:0; color:var(--text-2); font-size:15px; line-height:1.65; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden }
.card-meta { display:flex; flex-wrap:wrap; gap:8px; margin:auto 0 0; padding-top:8px; color:var(--muted); font-size:13px }
.article-card.large { grid-column:1 / -1; display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) }
.article-card.large .card-text { justify-content:center; gap:12px; padding:clamp(24px,3.2vw,48px) }
.article-card.large .card-title { font-size:clamp(23px,2.5vw,31px); line-height:1.32 }
.article-card.large .card-summary { font-size:16px; -webkit-line-clamp:4 }
.articles-empty { padding:56px 0; text-align:center; color:var(--text-2); font-size:16px }
.articles-empty p { margin:0 }
.articles-empty p + p { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:18px }
.notfound { max-width:640px; margin:0 auto; padding:clamp(56px,12vh,128px) 0 }
/* a short last word is not left alone on its line (Thai titles too) */
.articles-hero h1,.article-head h1,.prose h2,.prose h3,.card-title,.article-band h2,.article-more-head h2 { text-wrap:pretty }
.notfound h1 { margin:0 0 10px; color:var(--text); font-size:clamp(26px,3.4vw,36px) }

/* ---------- an article ---------- */
.article-main { min-width:0; width:100%; max-width:1180px; margin:0 auto; padding:clamp(18px,3vh,30px) clamp(16px,4vw,48px) clamp(40px,7vh,72px) }
.crumbs ol { display:flex; flex-wrap:wrap; gap:4px 8px; margin:0; padding:0; list-style:none; color:var(--muted); font-size:13px }
.crumbs li { min-width:0 }
.crumbs li + li::before { content:"›"; margin-right:8px; color:var(--border-strong) }
.crumbs li[aria-current] { max-width:min(52ch,100%); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.crumbs a { color:var(--muted) }
.crumbs a:hover { color:var(--accent) }
.article-head { max-width:840px; margin:clamp(20px,3.4vh,36px) 0 clamp(22px,3.4vh,32px) }
.article-tags { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; padding:0; list-style:none }
.article-tags li { padding:4px 12px; border-radius:var(--radius-pill); background:var(--accent-soft); color:var(--accent); font-size:13px; font-weight:500 }
.article-head h1 { margin:0; font-size:clamp(28px,4.2vw,46px); line-height:1.24; letter-spacing:-.02em; font-weight:600 }
.article-lead { margin:18px 0 0; max-width:760px; color:var(--text-2); font-size:clamp(17px,1.7vw,20px); line-height:1.75 }
.article-meta { display:flex; flex-wrap:wrap; gap:6px 10px; margin:18px 0 0; color:var(--muted); font-size:14px }
.article-cover { margin:0 0 clamp(28px,4.4vh,44px); aspect-ratio:1200/630; border-radius:var(--radius-lg); overflow:hidden; background:var(--band-ink); box-shadow:var(--shadow-lg) }
.article-cover img { display:block; width:100%; height:100%; object-fit:cover }
.article-layout { display:grid; grid-template-columns:minmax(0,1fr) 296px; gap:clamp(32px,5vw,72px); align-items:start }
.article-column { min-width:0; max-width:740px }
.article-rail { position:sticky; top:calc(var(--header-h) + 24px); display:flex; flex-direction:column; gap:18px }
.toc-rail { padding:20px 22px 14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow) }
.toc-title { margin:0 0 8px; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.1em; text-transform:uppercase }
.toc ol { margin:0; padding:0; list-style:none; counter-reset:toc }
.toc li { counter-increment:toc }
.toc a { display:flex; gap:12px; padding:8px 0; border-top:1px solid var(--border); color:var(--text-2); font-size:14px; line-height:1.5; text-decoration:none }
.toc li:first-child a { border-top:0 }
.toc a::before { content:counter(toc,decimal-leading-zero); flex:none; padding-top:1px; color:var(--gold); font-size:12px; font-weight:600; font-variant-numeric:tabular-nums }
.toc a:hover { color:var(--accent) }
.toc-inline { display:none; margin:0 0 28px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius) }
.toc-inline summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:48px; padding:0 18px; font-weight:600; cursor:pointer; list-style:none }
.toc-inline summary::-webkit-details-marker { display:none }
.toc-inline summary::after { content:""; width:8px; height:8px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:rotate(45deg) translateY(-2px); transition:transform var(--fast) var(--ease) }
.toc-inline[open] summary::after { transform:rotate(-135deg) translateY(-2px) }
.toc-inline ol { padding:0 18px 10px }
.rail-card { padding:24px 22px; border-radius:var(--radius-lg); background:var(--band); color:var(--band-text); box-shadow:var(--band-light),var(--shadow) }
.rail-card p { margin:0 0 16px; color:var(--band-muted); font-size:15px; line-height:1.65 }
.rail-card .btn-primary { width:100%; background:var(--gold); color:var(--band-ink) }
.rail-card .btn-primary:hover { background:var(--gold-text); box-shadow:0 8px 22px rgba(212,181,124,.28) }

/* the text */
.prose { color:var(--text); font-size:17.5px; line-height:1.85; overflow-wrap:break-word }
.prose p { margin:0 0 1.15em }
.prose h2 { margin:2.3em 0 .75em; font-size:clamp(23px,2.6vw,29px); line-height:1.38; letter-spacing:-.01em; font-weight:600; scroll-margin-top:calc(var(--header-h) + 18px) }
.prose h2::before { content:""; display:block; width:36px; height:2px; margin-bottom:16px; background:var(--gold) }
.prose h3 { margin:1.8em 0 .5em; font-size:clamp(19px,2vw,21px); line-height:1.5; font-weight:600; scroll-margin-top:calc(var(--header-h) + 18px) }
.prose h4 { margin:1.5em 0 .4em; font-size:17.5px; font-weight:600 }
.prose > :first-child { margin-top:0 }
.prose a { color:var(--accent); text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px }
.prose a:hover { color:var(--accent-hover); text-decoration-thickness:2px }
.prose strong { color:var(--text); font-weight:600 }
.prose ul,.prose ol { margin:0 0 1.25em; padding-left:1.5em }
.prose li { margin:.4em 0; padding-left:.2em }
.prose li > ul,.prose li > ol { margin:.4em 0 0 }
.prose ul > li::marker { color:var(--gold) }
.prose ol > li::marker { color:var(--accent); font-weight:600 }
.prose ul.checks { padding-left:0; list-style:none }
.prose li.check { position:relative; padding-left:32px; list-style:none }
.prose li.check::before { content:""; position:absolute; left:1px; top:.5em; width:19px; height:19px; border-radius:50%; background:var(--accent) }
.prose li.check::after { content:""; position:absolute; left:8px; top:calc(.5em + 4px); width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg) }
.prose code { padding:.12em .42em; border:1px solid var(--border); border-radius:6px; background:var(--surface-2); font-family:var(--mono); font-size:.86em; overflow-wrap:anywhere }
.prose pre { margin:0 0 1.35em; padding:16px 18px; border-radius:var(--radius); background:var(--band-ink); color:var(--band-text); font-size:14px; line-height:1.65; overflow-x:auto }
.prose pre code { padding:0; border:0; background:none; color:inherit; font-size:inherit; overflow-wrap:normal }
.prose blockquote { margin:0 0 1.35em; padding:2px 0 2px 18px; border-left:3px solid var(--border-strong); color:var(--text-2) }
.prose blockquote > :last-child { margin-bottom:0 }
.prose hr { margin:2.4em 0; border:0; border-top:1px solid var(--border) }
.callout { margin:1.7em 0 1.9em; padding:22px 24px 18px; border:1px solid #eadcbf; border-radius:var(--radius-lg); background:linear-gradient(180deg,#fcf8f0,#f7f0e2); box-shadow:inset 3px 0 0 var(--gold) }
.prose .callout-title { margin:0 0 10px; color:#6b4f1d; font-weight:600; letter-spacing:.01em }
.callout > :last-child { margin-bottom:0 }
.callout ul.checks li { margin:.5em 0 }
.table-wrap { margin:0 0 1.45em; overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface) }
.prose table { width:100%; border-collapse:collapse; font-size:15.5px; line-height:1.6 }
.prose th,.prose td { padding:11px 14px; border-top:1px solid var(--border); text-align:left; vertical-align:top }
.prose thead th { border-top:0; background:var(--surface-2); color:var(--text); font-size:14px; font-weight:600 }
.prose tbody tr:nth-child(even) td { background:#faf9f6 }
.prose .align-center { text-align:center }
.prose .align-right { text-align:right }
.article-figure { margin:1.7em 0 1.9em }
.article-figure img { display:block; width:100%; height:auto; border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow) }
.prose img { max-width:100% }
.prose .article-cta { margin:1.9em 0 }
.prose .article-cta .btn-primary { min-height:52px; padding:0 28px; color:var(--accent-text); font-size:16px; text-decoration:none }
.missing { padding:0 6px; border-radius:4px; background:var(--danger-soft); color:var(--danger) }

/* ---------- more articles and the closing band ---------- */
.article-more { border-top:1px solid var(--border); background:var(--surface-2) }
.article-more-inner { max-width:1180px; margin:0 auto; padding:clamp(40px,7vh,72px) clamp(16px,4vw,48px) }
.article-more-head { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px 16px; margin-bottom:24px }
.article-more-head h2 { margin:0; font-size:clamp(22px,2.6vw,28px) }
.article-more-head a { font-weight:500 }
.article-band { background:var(--band); color:var(--band-text); box-shadow:var(--band-light); border-top:1px solid var(--band-line) }
.article-band-inner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:20px 32px; max-width:1180px; margin:0 auto; padding:clamp(36px,6vh,60px) clamp(16px,4vw,48px) }
.article-band h2 { margin:0; font-size:clamp(22px,2.8vw,30px); line-height:1.32 }
.article-band p { margin:8px 0 0; max-width:640px; color:var(--band-muted); line-height:1.7 }
.band-button { display:inline-flex; align-items:center; justify-content:center; min-height:50px; padding:0 28px; border-radius:var(--radius-sm); background:var(--gold); color:var(--band-ink); font-weight:600; white-space:nowrap; box-shadow:0 8px 24px rgba(212,181,124,.22); transition:background var(--fast) var(--ease) }
.band-button:hover { background:var(--gold-text); text-decoration:none }

/* ---------- the landing's section (index.html, public/articles-latest.js) ---------- */
.landing-articles { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(16px,2vw,24px) }
.landing-article { display:flex; flex-direction:column; min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; color:var(--text); box-shadow:var(--shadow); transition:transform var(--normal) var(--ease),box-shadow var(--normal) var(--ease) }
.landing-article:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); text-decoration:none }
.landing-article img,.landing-article-blank { display:block; width:100%; height:auto; aspect-ratio:1200/630; object-fit:cover; background:var(--band) }
.landing-article-text { display:flex; flex:1; flex-direction:column; gap:6px; padding:18px 20px 20px }
.landing-article-tag { color:var(--accent); font-size:13px; font-weight:600 }
.landing-article-title { font-size:17px; line-height:1.45; font-weight:600 }
.landing-article-summary { color:var(--text-2); font-size:14.5px; line-height:1.6; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden }
.landing-article-meta { margin-top:auto; padding-top:6px; color:var(--muted); font-size:13px }
.landing-articles-all { margin:24px 0 0 }

@media (max-width:1060px) {
  /* one column: the track shrinks with the screen (a wide table scrolls inside its own box, never the page) */
  .article-layout { grid-template-columns:minmax(0,760px); justify-content:center }
  .article-rail { display:none }
  .toc-inline { display:block }
  .article-column { max-width:none }
  .crumbs,.article-head,.article-cover { max-width:760px; margin-left:auto; margin-right:auto }
  .article-head { margin-top:clamp(20px,3.4vh,36px); margin-bottom:clamp(22px,3.4vh,32px) }
  .article-cover { margin-bottom:clamp(28px,4.4vh,44px) }
}
@media (max-width:980px) { .article-grid { grid-template-columns:repeat(2,minmax(0,1fr)) } }
@media (max-width:900px) { .landing-articles { grid-template-columns:repeat(2,minmax(0,1fr)) } }
@media (max-width:760px) { .article-card.large { grid-template-columns:1fr } }
@media (max-width:620px) {
  .article-grid,.landing-articles { grid-template-columns:1fr }
  .prose { font-size:17px; line-height:1.82 }
  .article-cover { border-radius:var(--radius); margin-left:-4px; margin-right:-4px }
  .band-button { width:100% }
  .callout { padding:18px 18px 14px }
}
/* The smallest phones: the other language takes the brand's line, as the landing's language picker does (style.css, < 360 px). */
@media (max-width:359px) { .landing > .site-header:has(#header-register:not([hidden])) .lang-switch { grid-area:language; justify-self:end } }
