/* thaimlmnews.com — design system v2 (Nov 2026)
   Primitive -> semantic tokens. Components use the semantic names only. */
:root {
  /* primitive */
  --navy-950: #061a33; --navy-900: #0b2545; --navy-700: #13406f; --navy-100: #e7eef7;
  --gold-500: #f2b33d; --gold-600: #d99a1e; --gold-50: #fff7e6;
  --red-500: #e63946;
  --gray-900: #141b26; --gray-700: #3a4556; --gray-500: #5e6b7d; --gray-300: #c9d1dc; --gray-200: #e3e8ef; --gray-100: #f3f5f8;
  --white: #fff;

  /* semantic */
  --brand: var(--navy-900); --brand-2: var(--navy-700); --accent: var(--gold-500); --live: var(--red-500);
  --ink: var(--gray-900); --ink-2: var(--gray-700); --muted: var(--gray-500);
  --line: var(--gray-200); --bg: var(--white); --surface: var(--gray-100); --card: var(--white);
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(11,37,69,.06), 0 6px 20px rgba(11,37,69,.07);
  --font: "IBM Plex Sans Thai Looped", "Leelawadee UI", Tahoma, sans-serif;
  --head: "Anuphan", "IBM Plex Sans Thai Looped", "Leelawadee UI", Tahoma, sans-serif;
  --serif: var(--head); /* old name, still used by some views */

  /* category colours (cat_chip adds c0..c5) */
  --c0: #1f6feb; --c1: #d9480f; --c2: #2b8a3e; --c3: #ae3ec9; --c4: #0c8599; --c5: #c2255c;
}
*, *::before, *::after { box-sizing: border-box; }
/* "html body" beats the font rule injected by the old header ad code */
html body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; vertical-align: middle; }
h1, h2, h3 { font-family: var(--head); line-height: 1.4; margin: 0; font-weight: 700; }
.tdi { display: inline-block; vertical-align: middle; flex: none; }
.wrap { width: min(1480px, 100% - 48px); margin-inline: auto; }
@media (max-width: 760px) { .wrap { width: calc(100% - 24px); } }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar + masthead (dark, carries the brand) ---------- */
.topbar { background: var(--navy-950); color: #9fb3cc; font-size: 13px; }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 34px; }
.topbar-links { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar-links a:hover { color: #fff; }
.topbar-social { margin-left: auto; display: flex; gap: 2px; }
.social { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; color: inherit; transition: background .2s; }
.social:hover { background: rgba(255,255,255,.12); color: #fff; }

.masthead { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(6,26,51,.25); }
.masthead-in { display: flex; align-items: center; gap: 24px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--head); font-size: 25px; letter-spacing: .01em; color: #fff; font-weight: 700; }
.brand-text small { font-size: 13px; color: var(--accent); margin-top: 3px; }
.search { display: flex; align-items: center; margin-left: auto; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 4px 4px 18px; width: min(400px, 40vw); color: #fff; }
.search:focus-within { background: #fff; color: var(--ink); }
.search input { flex: 1; border: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; outline: none; min-width: 0; padding: 6px 0; }
.search input::placeholder { color: currentColor; opacity: .7; }
.search button { border: 0; background: var(--accent); color: var(--navy-950); border-radius: 999px; height: 36px; min-width: 36px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; }
.search button:hover { background: var(--gold-600); }
.icon-btn { border: 0; background: transparent; width: 42px; height: 42px; border-radius: 10px; display: none; align-items: center; justify-content: center; cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
/* TH | EN switch (masthead on dark, drawer on white) */
.lang-switch { display: inline-flex; flex: none; padding: 3px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-family: var(--head); font-size: 13px; font-weight: 600; letter-spacing: .04em; line-height: 1; }
.lang-switch a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 999px; color: #c9d6e6; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.is-on { background: var(--accent); color: var(--navy-950); }
.drawer .lang-switch { align-self: flex-start; border-color: var(--line); }
.drawer .lang-switch a { min-height: 34px; padding: 0 14px; color: var(--muted); }
.drawer .lang-switch a:hover { color: var(--ink); }
.drawer .lang-switch a.is-on { color: var(--navy-950); }
.catnav { background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); }
.catnav-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catnav-in::-webkit-scrollbar { display: none; }
.catnav a { white-space: nowrap; padding: 13px 14px 11px; font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--ink-2); border-bottom: 3px solid transparent; }
.catnav a:hover { color: var(--brand); border-bottom-color: var(--gray-300); }
.catnav a.is-on { color: var(--brand); border-bottom-color: var(--accent); }

/* ---------- latest-news ticker: the one moving thing on the page ---------- */
.ticker { background: var(--gold-50); border-bottom: 1px solid #f4e2bb; font-size: 14.5px; }
.ticker-in { display: flex; align-items: center; gap: 14px; height: 42px; }
.ticker-tag { flex: none; display: inline-flex; align-items: center; gap: 7px; background: var(--live); color: #fff; font-family: var(--head); font-weight: 700; font-size: 13.5px; padding: 3px 12px 3px 10px; border-radius: 999px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .25; } }
.ticker-track { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-move { display: flex; width: max-content; animation: ticker 70s linear infinite; }
.ticker:hover .ticker-move, .ticker:focus-within .ticker-move { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker-list { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker-list li { white-space: nowrap; padding-right: 34px; position: relative; }
.ticker-list li::after { content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.ticker-list a { color: var(--ink); font-weight: 500; }
.ticker-list a:hover { color: var(--brand-2); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .ticker-move, .live-dot { animation: none; }
  .ticker-track { overflow-x: auto; }
  .ticker-list[aria-hidden] { display: none; }
}

.drawer { position: fixed; inset: 0; background: rgba(6,26,51,.55); z-index: 100; color: var(--ink); }
.drawer-panel { position: absolute; inset: 0 auto 0 0; width: min(330px, 86vw); background: #fff; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head .icon-btn { display: inline-flex; }
.drawer-head .icon-btn:hover { background: var(--surface); }
.drawer-nav { display: flex; flex-direction: column; }
.drawer-nav a { padding: 11px 6px; font-family: var(--head); font-weight: 600; border-bottom: 1px solid var(--line); }
.drawer-nav a.sub { font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 14px; border: 0; padding: 7px 6px; }
.drawer-nav hr { border: 0; margin: 8px 0; }
.search-drawer { width: 100%; margin: 0; background: var(--surface); border-color: var(--line); color: var(--ink); }
.drawer-social { display: flex; gap: 6px; color: var(--brand); }

/* ---------- ads ---------- */
.ad { position: relative; margin: 24px auto; text-align: center; }
.ad img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.ad-label { display: block; font-size: 11px; color: #94a3b8; letter-spacing: .08em; margin-bottom: 4px; }
.ad-header img, .ad-footer img { border-radius: var(--radius); width: 100%; }
.ad-header .imgimg { height: auto !important; }
.ad-sidebar img { border-radius: 10px; margin-bottom: 14px; width: 100%; }
.ad-sidebar br { display: none; }

/* ---------- chips + meta ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-size: 13px; font-weight: 600; color: var(--cat, var(--brand-2)); margin-bottom: 6px; align-self: flex-start; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.chip:hover { text-decoration: underline; }
.chip.c0 { --cat: var(--c0); } .chip.c1 { --cat: var(--c1); } .chip.c2 { --cat: var(--c2); } .chip.c3 { --cat: var(--c3); } .chip.c4 { --cat: var(--c4); } .chip.c5 { --cat: var(--c5); }
.chip-solid { background: var(--cat, var(--accent)); color: #fff; padding: 3px 11px; border-radius: 6px; }
.chip-solid::before { display: none; }
.chip-solid:hover { text-decoration: none; filter: brightness(1.1); }
.chip-ghost { padding: 0; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.card-meta .views { display: inline-flex; align-items: center; gap: 4px; }
.card-meta-light { color: #d5deea; }

/* ---------- cards: flat, image-led; no box or shadow ---------- */
.card { display: flex; flex-direction: column; min-width: 0; }
.card-media { display: block; overflow: hidden; background: var(--gray-200); aspect-ratio: 16 / 10; border-radius: var(--radius); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-body { padding: 12px 0 0; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 19px; font-weight: 600; line-height: 1.45; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s; }
.card-title a:hover { background-size: 100% 1.5px; }
.card-excerpt { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body .card-meta { margin-top: auto; }
.card-sm { flex-direction: row; gap: 14px; padding: 12px 0; align-items: flex-start; }
.card-sm .card-media { width: 120px; flex: none; border-radius: var(--radius-sm); aspect-ratio: 4 / 3; }
.card-sm .card-body { padding: 0; }
.card-sm .card-title { font-size: 16px; margin-bottom: 4px; }
.card-lg .card-title { font-size: 28px; }
.card-lg .card-media { aspect-ratio: 16 / 9; }
.card-text { padding: 14px 0; border-bottom: 1px solid var(--line); }
.card-text:last-child { border-bottom: 0; }
.card-text .card-title { font-size: 17px; margin-bottom: 4px; }
.card-row { flex-direction: row; gap: 18px; }
.card-row .card-media { width: 280px; flex: none; }
.card-row .card-body { padding: 0; }

/* image tile with the headline on it */
.card-tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy-950); min-height: 0; }
.card-tile .card-media { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.card-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,26,51,0) 20%, rgba(6,26,51,.6) 55%, rgba(6,26,51,.95) 100%); pointer-events: none; }
.card-tile { display: flex; flex-direction: column; justify-content: flex-end; }
.card-tile .card-body { flex: none; position: relative; z-index: 1; margin-top: auto; padding: 16px 18px; color: #fff; }
.card-tile .card-title { font-size: 18px; -webkit-line-clamp: 3; }

.grid { display: grid; gap: 34px 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 40px; margin-top: 30px; margin-bottom: 48px; align-items: start; }

/* section heading: title + rule running to the "see all" link */
.section-head { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; }
.section-head::after { content: ""; order: 1; flex: 1; height: 2px; background: var(--line); }
.section-title { font-size: 26px; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 6px; height: 26px; border-radius: 3px; background: var(--sec, var(--accent)); }
.section-more { order: 2; font-family: var(--head); font-size: 14.5px; font-weight: 600; color: var(--brand-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.section-more:hover { color: var(--sec, var(--brand)); }

/* ---------- home: lead mosaic ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr 1fr; gap: 18px; margin-top: 24px; height: 540px; }
.hero-lead { grid-row: 1 / 3; position: relative; border-radius: 16px; overflow: hidden; background: var(--navy-950); }
.hero-media, .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,26,51,0) 25%, rgba(6,26,51,.55) 50%, rgba(6,26,51,.95) 100%); pointer-events: none; }
.hero-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 32px; z-index: 1; color: #fff; }
.hero-title { font-size: clamp(24px, 2.5vw, 36px); line-height: 1.35; margin-bottom: 10px; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.hero-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.hero-excerpt { margin: 0 0 12px; color: #e2e8f0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 64ch; }
.hero-tiles { grid-row: 1 / 3; display: grid; grid-template-rows: 1fr 1fr; gap: 18px; min-height: 0; }
.hero-tiles .card-tile { display: flex; flex-direction: column; }
.hero-heads { grid-row: 1 / 3; background: var(--surface); border-radius: 16px; padding: 18px 20px 6px; overflow: hidden; display: flex; flex-direction: column; }
.heads-title { font-size: 18px; color: var(--brand); padding-bottom: 8px; border-bottom: 3px solid var(--accent); align-self: flex-start; }
.hero-heads .card-text { padding: 11px 0; }
.hero-heads .card-text .card-title { font-size: 15.5px; -webkit-line-clamp: 2; }
.hero-heads .chip { margin-bottom: 2px; font-size: 12.5px; }
/* home: news slider in place of lead + 2 tiles (views/home.php, site.js data-hero) */
.hero-slider { grid-column: 1 / 3; grid-row: 1 / 3; position: relative; border-radius: 16px; overflow: hidden; background: var(--navy-950); min-height: 0; }
.hero-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.hero-track > .hero-lead { flex: 0 0 100%; border-radius: 0; }
.hero-nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(6, 26, 51, .55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.hero-nav.is-prev { left: 14px; } .hero-nav.is-next { right: 14px; }
.hero-slider:hover .hero-nav, .hero-nav:focus-visible { opacity: 1; }
.hero-nav:hover { background: var(--navy-950); }
.hero-dots { position: absolute; top: 18px; right: 20px; z-index: 2; display: flex; gap: 6px; padding: 7px 9px; border-radius: 999px; background: rgba(6, 26, 51, .5); }
.hero-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .3s, background .3s; }
.hero-dots button[aria-current] { width: 26px; background: var(--accent); }
@media (hover: none) { .hero-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-track { transition: none; } }

/* home: category blocks = lead story + list */
.cat-section { margin: 14px auto 52px; }
.cat-section.c0 { --sec: var(--c0); } .cat-section.c1 { --sec: var(--c1); } .cat-section.c2 { --sec: var(--c2); } .cat-section.c3 { --sec: var(--c3); } .cat-section.c4 { --sec: var(--c4); } .cat-section.c5 { --sec: var(--c5); }
.cat-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.cat-grid > .card-md .card-title { font-size: 24px; }
.cat-grid > .card-md .card-media { aspect-ratio: 16 / 9; }
.cat-list .card-sm { border-bottom: 1px solid var(--line); }
.cat-list .card-sm:first-child { padding-top: 0; }
.cat-list .card-sm:last-child { border-bottom: 0; }
.cat-list .card-sm .card-media { width: 150px; }
.cat-list .card-sm .card-title { font-size: 17px; }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 150px; display: flex; flex-direction: column; gap: 26px; }
.side-box { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.side-title { font-size: 20px; color: var(--brand); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); display: inline-block; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--gray-300); }
.rank li:last-child { border-bottom: 0; }
.rank-n { flex: none; width: 34px; font-family: var(--head); font-size: 30px; line-height: 1; font-weight: 700; color: var(--accent); text-align: center; }
.rank li:nth-child(n+4) .rank-n { color: var(--gray-300); }
.rank a { font-family: var(--head); font-weight: 600; font-size: 15.5px; line-height: 1.45; display: block; margin-bottom: 2px; }
.rank a:hover, .side-list .card-title a:hover { color: var(--brand-2); }
.side-list .card-sm { padding: 10px 0; }
.side-list .card-sm .card-media { width: 96px; }
.side-list .card-sm .card-title { font-size: 15px; }

/* ---------- archive pages ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--brand-2); }
.page-title { font-size: 36px; font-weight: 700; color: var(--brand); }
.page-title small { font-size: 16px; color: var(--muted); font-weight: 500; }
.archive-head { margin-bottom: 26px; padding-bottom: 18px; border-bottom: 2px solid var(--line); }
.archive-sub { color: var(--muted); margin: 6px 0 0; }
.hash { color: var(--accent); }
.feature { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; margin-bottom: 34px; }
.feature-side { background: var(--surface); border-radius: var(--radius); padding: 6px 18px; }
.feature-side .card-sm + .card-sm { border-top: 1px solid var(--gray-300); }
.search-big { width: 100%; max-width: 640px; margin: 14px 0 0; padding: 6px 6px 6px 20px; background: var(--surface); border-color: var(--line); color: var(--ink); }
.search-big input { font-size: 17px; }
.search-big button { height: 44px; padding: 0 20px; }
.author-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.author-card img { border-radius: 50%; }
.author-card strong { display: block; font-size: 18px; }
.author-card span { color: var(--muted); font-size: 14px; }
.author-card p { margin: 6px 0 0; font-size: 14px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 40px 0 10px; flex-wrap: wrap; }
.pager-nums { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-btn, .pager-num { display: inline-flex; align-items: center; gap: 6px; min-width: 42px; height: 42px; padding: 0 14px; justify-content: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.pager-btn:hover, .pager-num:hover { border-color: var(--brand-2); color: var(--brand-2); }
.pager-num.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager-btn.is-off { opacity: .4; }
.pager-gap { padding: 0 4px; align-self: center; color: var(--muted); }

/* ---------- article ---------- */
.article { min-width: 0; }
.article-cats { display: flex; gap: 12px; flex-wrap: wrap; }
.article-title { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.35; margin: 4px 0 14px; color: var(--ink); }
.article-dek { font-size: 19px; color: var(--ink-2); margin: 0 0 18px; }
.lang-note { display: inline-block; margin: 0 0 16px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--gold-50); border-left: 3px solid var(--accent); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.article-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.byline { display: flex; align-items: center; gap: 10px; }
.byline img { border-radius: 50%; }
.byline span { display: flex; flex-direction: column; line-height: 1.3; }
.byline small { color: var(--muted); font-size: 13px; }
.article-meta .views { color: var(--muted); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: #fff; padding: 8px 14px; border-radius: 999px; }
.share-line { background: #06c755; } .share-facebook { background: #1877f2; } .share-twitter { background: #111; } .share-copy { background: var(--gray-200); color: var(--ink); }
.share-btn:hover { filter: brightness(1.08); }
.article-hero { margin: 22px 0 8px; }
.article-hero img { width: 100%; display: block; border-radius: var(--radius); max-height: 600px; object-fit: cover; }
.prose { font-size: 18.5px; line-height: 1.95; color: #1e2733; overflow-wrap: anywhere; max-width: 760px; }
.prose p { margin: 0 0 1.25em; }
.prose img { border-radius: 10px; height: auto; display: block; margin: 1.4em auto; }
.prose a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; }
.prose h1, .prose h2, .prose h3 { margin: 1.4em 0 .6em; color: var(--brand); }
.prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--gold-50); border-radius: 0 10px 10px 0; }
.prose figure { margin: 1.5em auto; max-width: 100%; }
.prose figcaption, .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.prose iframe { max-width: 100%; border-radius: 10px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose [class*="td-pb-span"] { width: 100% !important; }
.prose .source { font-size: 15px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.ad-inline { margin: 24px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 26px 0; color: var(--muted); }
.tags a { background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.tags a:hover { border-color: var(--brand-2); color: var(--brand-2); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.pn { display: block; background: var(--surface); border-radius: 12px; padding: 14px 16px; font-family: var(--head); font-weight: 600; line-height: 1.5; }
.pn small { display: block; color: var(--muted); font-family: var(--font); font-weight: 500; margin-bottom: 4px; }
.pn-next { text-align: right; }
.pn:hover { background: var(--navy-100); }
.related { margin-top: 40px; }
.related .card-title { font-size: 16.5px; }

.notfound { text-align: center; padding: 50px 0 40px; }
.notfound-code { font-family: var(--head); font-size: 110px; font-weight: 700; color: var(--brand); line-height: 1; }
.notfound .search-big { margin: 22px auto; }
.btn-primary { display: inline-block; background: var(--brand); color: #fff; padding: 11px 22px; border-radius: 999px; font-weight: 600; margin-bottom: 40px; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-950); color: #a9b9cd; margin-top: 30px; border-top: 4px solid var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 52px 0 34px; }
.site-footer h3 { color: #fff; font-size: 18px; margin-bottom: 14px; }
.brand-light .brand-text strong { color: #fff; }
.brand-light .brand-text small { color: var(--accent); }
.footer-about p { font-size: 14.5px; line-height: 1.75; }
.footer-social { display: flex; gap: 6px; color: #fff; }
.footer-social .social { background: rgba(255,255,255,.08); width: 38px; height: 38px; }
.footer-links { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a:hover { color: #fff; }
.cols-2 { columns: 2; }
.footer-contact { font-size: 14px; line-height: 1.8; margin-bottom: 14px; }
.footer-contact * { color: inherit !important; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; font-size: 13.5px; color: #8ea2bb; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.to-top.is-on { opacity: 1; pointer-events: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-rows: 1fr 1fr; height: auto; }
  .hero-lead { min-height: 480px; }
  .hero-slider { grid-column: 1 / -1; }
  .hero-heads { grid-column: 1 / -1; grid-row: auto; }
  .hero-heads { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 28px; }
  .hero-heads .heads-title { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .layout, .feature, .cat-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .hero-lead { grid-column: 1 / -1; grid-row: auto; min-height: 400px; }
  .hero-tiles { grid-column: 1 / -1; grid-row: auto; grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .hero-tiles .card-tile { min-height: 230px; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  html body { font-size: 15px; }
  .topbar { display: none; }
  .masthead-in { min-height: 60px; gap: 8px; position: relative; }
  .icon-btn { display: inline-flex; }
  .masthead .search { display: none; }
  .masthead .lang-switch { display: none; } /* phones: the switch lives in the drawer */
  .masthead.is-search .search { display: flex; position: absolute; left: 12px; right: 12px; top: 64px; width: auto; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
  .brand { margin-inline: auto; }
  .brand img { width: 40px; height: 40px; }
  .brand-text strong { font-size: 19px; }
  .brand-text small { display: none; }
  .catnav a { padding: 10px 11px 8px; font-size: 15px; }
  .ticker { font-size: 14px; }
  .ticker-in { height: 38px; gap: 10px; }
  .ticker-move { animation-duration: 55s; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 26px; }
  .grid-4, .related .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .grid-4 .card-title, .related .card-title { font-size: 15px; }
  .grid-4 .card-meta .views, .grid-4 .card-meta span:first-child { display: none; }
  .hero { margin-top: 14px; gap: 12px; grid-template-columns: 1fr; }
  .hero-lead { min-height: 330px; border-radius: 14px; }
  .hero-slider { border-radius: 14px; }
  .hero-track > .hero-lead { border-radius: 0; }
  .hero-dots { top: 12px; right: 14px; }
  .hero-nav { display: none; }
  .hero-body { padding: 18px; }
  .hero-excerpt { display: none; }
  .hero-tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-tiles .card-tile { min-height: 200px; }
  .card-tile .card-body { padding: 12px; }
  .card-tile .card-title { font-size: 15px; }
  .card-tile .chip { display: none; }
  .hero-heads { display: block; padding: 14px 16px 4px; }
  .section-title { font-size: 22px; }
  .section-title::before { height: 22px; }
  .cat-grid { gap: 14px; }
  .cat-grid > .card-md .card-title { font-size: 20px; }
  .cat-list .card-sm .card-media { width: 110px; }
  .cat-list .card-sm:first-child { padding-top: 12px; }
  .card-title { font-size: 18px; }
  .article-hero { margin: 16px -12px 4px; }
  .article-hero img { border-radius: 0; }
  .prose { font-size: 17.5px; line-height: 1.9; }
  .share-btn span { display: none; }
  .share-copy span { display: inline; }
  .prevnext { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .card-row { flex-direction: column; }
  .card-row .card-media { width: 100%; aspect-ratio: 16 / 10; }
  .page-title { font-size: 28px; }
  .pager-btn { padding: 0 10px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
/* ---------- sidebar banners: right column + left rail + strips (views/sidebar.php, ad_split()) ---------- */
.layout { grid-template-areas: "main side" "rail side"; }
.layout > .content { grid-area: main; }
.layout > .sidebar { grid-area: side; position: static; }
.layout > .ad-rail { grid-area: rail; }
.ad-stack { margin: 0; }
.ad-items { display: flex; flex-direction: column; gap: 14px; }
.ad-item img { display: block; width: 100%; height: auto; border-radius: 10px; margin: 0; }
.ad-item br, .ad-item center:empty { display: none; }
.ad-item a { display: block; transition: transform .2s, box-shadow .2s; border-radius: 10px; }
.ad-item a:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(11, 37, 69, .14); }
.ad-rail .ad-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (min-width: 1400px) {
  .layout:has(> .ad-rail) { grid-template-columns: 210px minmax(0, 1fr) 330px; grid-template-areas: "rail main side"; gap: 32px; }
  .ad-rail .ad-items { display: flex; }
}
.ad-rot { display: grid; align-items: start; }
.ad-rot > .ad-item { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.ad-rot > .ad-item.is-on { opacity: 1; visibility: visible; transition: opacity .7s ease; }
@media (max-width: 900px) {
  .layout { grid-template-areas: "main" "side" "rail"; }
  .ad-rail .ad-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .ad-item a, .ad-rot > .ad-item { transition: none; } .ad-item a:hover { transform: none; } }

/* ---------- article photos (lib/content.php layout_images) + lightbox (site.js) ---------- */
.prose .gallery { display: grid; gap: 8px; margin: 1.6em 0; }
.prose .gallery-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prose .gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prose .gallery .gl-item { display: block; overflow: hidden; border-radius: 8px; background: var(--surface); aspect-ratio: 3 / 2; }
.prose .gallery img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; transition: transform .35s ease; }
.prose .gallery .gl-item:hover img { transform: scale(1.04); }
.prose .photo { margin: 1.6em auto; text-align: center; }
.prose .photo img { margin: 0 auto; max-height: 80vh; width: auto; max-width: 100%; }
.prose .gl-item { cursor: zoom-in; }
@media (max-width: 600px) { .prose .gallery-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prose .gallery { gap: 6px; } }
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(6, 26, 51, .94); display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.lb button:hover { background: rgba(255,255,255,.25); }
.lb .lb-x { top: 12px; right: 12px; } .lb .lb-p { left: 12px; top: 50%; translate: 0 -50%; } .lb .lb-n { right: 12px; top: 50%; translate: 0 -50%; }
.lb .lb-c { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #c7d2e3; font-size: 14px; }
@media (max-width: 600px) { .lb { padding: 56px 8px; } .lb .lb-p, .lb .lb-n { top: auto; bottom: 8px; translate: none; } }

/* ---------- wide banner slideshows (lib/ads.php ad_top): top 16:3, bottom 4:1 stage, banners never cropped ---------- */
.ad-top { position: relative; margin-block: 18px 6px; }
.ad-top-stage { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 16 / 3; }
.ad-at-bottom { margin-block: 32px 28px; }
.ad-at-bottom .ad-top-stage { aspect-ratio: 4 / 1; }
.ad-top-track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
.ad-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ad-slide > a, .ad-slide > img { display: block; width: 100%; height: 100%; }
.ad-slide img { width: 100%; height: 100%; object-fit: contain; margin: 0; }
.ad-top-nav { position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(6, 26, 51, .55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.ad-top-nav.is-prev { left: 12px; } .ad-top-nav.is-next { right: 12px; }
.ad-top:hover .ad-top-nav, .ad-top-nav:focus-visible { opacity: 1; }
.ad-top-nav:hover { background: var(--navy-950); }
.ad-top-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.ad-top-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--gray-300); cursor: pointer; transition: width .3s, background .3s; }
.ad-top-dots button[aria-current] { width: 24px; background: var(--accent); }
.ad-top > .ad-label { position: absolute; top: 8px; right: 10px; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px; background: rgba(255, 255, 255, .85); color: var(--muted); }
@media (max-width: 760px) { .ad-top { margin-block: 12px 2px; } .ad-top-stage { border-radius: var(--radius-sm); } .ad-top-nav { display: none; } }
@media (hover: none) { .ad-top-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .ad-top-track { transition: none; } }

@media print {
  .topbar, .masthead, .ticker, .sidebar, .site-footer, .share, .ad, .ad-top, .related, .prevnext, .to-top, .ad-rail { display: none !important; }
  .layout { display: block; }
}

/* ---------- skeleton while loading: shimmer behind images, images fade in once loaded (site.js adds .ld, html.js set in header) ---------- */
@keyframes sk-shine { to { background-position: -200% 0; } }
.card-media, .ad-top-stage, .article-hero, .prose .gallery .gl-item {
  background: linear-gradient(100deg, var(--gray-200) 30%, var(--gray-100) 50%, var(--gray-200) 70%) 0 0 / 200% 100%;
  animation: sk-shine 1.3s linear infinite;
}
.card-tile .card-media, .hero-lead { background: linear-gradient(100deg, #10294a 30%, #1c3a62 50%, #10294a 70%) 0 0 / 200% 100%; animation: sk-shine 1.3s linear infinite; }
:is(.card-media, .ad-top-stage, .article-hero, .gl-item, .hero-lead):has(img.ld) { animation: none; }
.js :is(.card-media, .ad-top-stage, .article-hero, .gl-item, .hero-lead) img:not([fetchpriority]) { opacity: 0; transition: opacity .35s ease, transform .5s ease; animation: sk-reveal 0s 6s forwards; }
@keyframes sk-reveal { to { opacity: 1; } } /* never leave an image hidden if site.js did not run */
.js :is(.card-media, .ad-top-stage, .article-hero, .gl-item, .hero-lead) img.ld { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .card-media, .ad-top-stage, .article-hero, .prose .gallery .gl-item, .card-tile .card-media, .hero-lead { animation: none; }
  .js :is(.card-media, .ad-top-stage, .article-hero, .gl-item, .hero-lead) img { transition: none; }
}
