/* ============================================================================
   megatrend.css — "taste" theme for Megatrend content pages.
   Reskins the SAME mt-* markup the editorial lessons already emit (so no content
   fragment changes); only the stylesheet swaps. Imports the shared DNA from
   taste-core.css — this file adds ONLY editorial components + a Thai body face
   + the per-trend accent QUARANTINE.

   Taste translation of the NYT/newsprint original:
   - canvas → warm ivory; pure #000 reserved for full-bleed slabs
   - body → Space Grotesk (Latin) + Sarabun (Thai); Playfair italic = rare accent
   - SECTIONING by color-block, not rules: hero / key-players / footer are black slabs
   - per-trend colour QUARANTINED into tiles (stat, term, chart, figure, player tag,
     drop-cap, svg accent) — chrome (links, headings, nav, breadcrumb) stays neutral
   - one shadow, on the floating nav only; every content tile is flat
   ============================================================================ */
@import url('../../../css/taste-core.css?v=6');   /* shared DNA: tokens · base · .serif · pill nav */
@import url('./palette.css');                 /* per-trend --mt-accent via [data-trend] */

:root{
  /* map the editorial vars onto the taste palette; --mt-accent stays per-trend (palette.css) */
  --mt-ink:        var(--dark-warm);
  --mt-ink-soft:   #5b554e;
  --mt-muted:      var(--muted);
  --mt-rule:       #e7e3db;
  --mt-rule-strong:var(--border-medium);
  --mt-accent-ink:  color-mix(in srgb, var(--mt-accent) 78%, var(--dark-warm) 22%);
  --mt-accent-tint: color-mix(in srgb, var(--mt-accent) 12%, var(--bg));
  --mt-accent-tint2:color-mix(in srgb, var(--mt-accent) 20%, var(--bg));
  --mt-accent-line: color-mix(in srgb, var(--mt-accent) 45%, var(--bg));

  --font-sans:  'Space Grotesk','Sarabun',system-ui,sans-serif;  /* BODY: Latin grotesk, Thai falls to Sarabun (looped, reads well long-form) */
  --font-head:  'Space Grotesk','Anuphan',system-ui,sans-serif;  /* HEADERS: Thai = Anuphan (loopless / "หัวตัด", Sukhumvit-like) */
  --font-serif: 'Playfair Display','Noto Serif Thai',Georgia,serif;
  --font-label: 'Space Grotesk','Sarabun',system-ui,sans-serif;

  --measure: 39rem;   /* reading column */
  --wide:    62rem;   /* figures / charts */
}

/* ---- base ---- */
body.mt-lesson{
  color: var(--mt-ink); font-family: var(--font-sans); font-weight: 400;
  font-size: 1.06rem; line-height: 1.85;
}
.mt-lesson img, .mt-lesson svg{ max-width:100%; height:auto; }
/* prose links: neutral chrome — warm underline, contained tint on hover (no accent text) */
.mt-prose a{ color: var(--mt-ink); text-decoration:none; border-bottom:1px solid var(--mt-rule-strong); }
.mt-prose a:hover{ background: var(--mt-accent-tint); border-color: var(--mt-accent-line); }

/* full-bleed container — slabs span edge-to-edge, reading blocks re-center themselves */
.mt-shell{ max-width:none; margin:0; padding:0 0 0; }

/* ---- breadcrumb (sits below the fixed pill nav, on ivory) ---- */
.mt-topbar{ max-width:none; padding:7rem 1.5rem 0; display:flex; gap:.6rem; }
.mt-breadcrumb{ font-family:var(--font-label); font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--mt-muted); display:flex; flex-wrap:wrap; gap:.45rem; }
.mt-breadcrumb a{ color:var(--mt-muted); text-decoration:none; }
.mt-breadcrumb a:hover{ color:var(--mt-ink); }
.mt-breadcrumb .here{ color:var(--mt-ink); }
.mt-breadcrumb .sep{ color:var(--dim); }

/* ====================== HERO — black full-bleed slab ====================== */
/* SAME 2-col grid as chapters: eyebrow in the left rail, all content in the right lane →
   the intro's content column lines up exactly with every chapter below it */
.mt-hero{ background:var(--black); color:var(--ivory); padding:var(--nav-clear,9rem) 1.5rem 4.5rem; display:grid; grid-template-columns:14rem minmax(0,var(--measure)); justify-content:center; gap:0 3.5rem; align-items:start; }  /* same --nav-clear token as .hub-hero → top-space can't drift between the two pages */
.mt-hero > *{ grid-column:2; }
.mt-eyebrow{ grid-column:1; grid-row:1; font-family:var(--font-label); font-size:.74rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--dim); display:flex; flex-direction:column; align-items:flex-start; gap:.6rem; margin:.5rem 0 0; }
.mt-eyebrow::before{ content:""; width:1.8rem; height:2px; background:var(--mt-accent); display:block; } /* trend accent = 1 quarantined tick */
/* node name = the BIG headline */
.mt-nodename{ font-family:var(--font-head); font-weight:700; font-size:clamp(2.4rem,5.2vw,3.6rem); line-height:1.04; letter-spacing:-.02em; color:var(--ivory); margin:0 0 .7rem; }
/* creative hook = the SUBTITLE (smaller, calmer) */
.mt-title{ font-family:var(--font-sans); font-weight:500; font-size:clamp(1.18rem,2.5vw,1.5rem); line-height:1.4; letter-spacing:0; color:#d6d0c6; margin:0 0 1.4rem; }
.mt-deck{ font-family:var(--font-sans); font-weight:400; font-size:clamp(1.05rem,2.2vw,1.2rem); line-height:1.62; color:var(--dim); margin:0 0 1.6rem; }
.mt-meta{ font-family:var(--font-label); font-size:.76rem; color:var(--dim); letter-spacing:.03em; display:flex; flex-wrap:wrap; gap:.4rem 1.3rem; padding-top:1.2rem; border-top:1px solid rgba(240,238,233,.16); }
.mt-meta b{ color:var(--ivory); font-weight:700; }

/* ---- table of contents — same grid + same sticky rail heading as a chapter ---- */
.mt-toc{ display:grid; grid-template-columns:14rem minmax(0,var(--measure)); justify-content:center; gap:0 3.5rem; align-items:start; padding:2.6rem 1.5rem; }
.mt-toc h2{ grid-column:1; grid-row:1 / -1; position:sticky; top:112px; align-self:start; font-family:var(--font-head); font-weight:700; font-size:clamp(1.5rem,2.5vw,2rem); line-height:1.16; letter-spacing:-.01em; text-transform:none; color:var(--mt-ink); margin:0; }
.mt-toc ol{ grid-column:2; }
.mt-toc ol{ margin:0; padding:0; list-style:none; counter-reset:toc; }
.mt-toc li{ counter-increment:toc; }
.mt-toc a{ display:flex; gap:.8rem; align-items:baseline; padding:.3rem 0; color:var(--mt-ink-soft); text-decoration:none; font-size:.98rem; }
.mt-toc a::before{ content:counter(toc,decimal-leading-zero); font-family:var(--font-label); font-size:.74rem; font-weight:700; color:var(--mt-accent); min-width:1.7rem; }
.mt-toc a:hover, .mt-toc a.active{ color:var(--mt-ink); }

/* ====================== PROSE (ivory reading area) ====================== */
/* anchor layout: heading sits in a sticky LEFT column, the chapter body flows on the right */
.mt-chapter{ display:grid; grid-template-columns:14rem minmax(0,var(--measure)); justify-content:center; gap:0 3.5rem; align-items:start; padding:3rem 1.5rem .4rem; scroll-margin-top:6rem; }
.mt-chapter > *{ grid-column:2; min-width:0; }
.mt-chapter > h2{ grid-column:1; grid-row:1 / -1; position:sticky; top:112px; align-self:start; font-family:var(--font-head); font-weight:700; font-size:clamp(1.5rem,2.5vw,2rem); line-height:1.16; letter-spacing:-.01em; margin:0; color:var(--mt-ink); }
.mt-chapter > h2 .num{ font-family:var(--font-label); font-size:.8rem; font-weight:700; color:var(--mt-accent); letter-spacing:.16em; display:block; margin-bottom:.7rem; }
.mt-chapter > h2 .num::after{ content:" —"; color:var(--mt-rule-strong); }
.mt-chapter > h3{ font-family:var(--font-head); font-weight:700; font-size:1.28rem; margin:2rem 0 .2rem; color:var(--mt-ink); }
@media (max-width:1439px){   /* below the 3-col breakpoint: ALL heading blocks stack as one column (hero=toc=chapter) */
  .mt-hero, .mt-toc, .mt-chapter{ grid-template-columns:1fr; gap:0; }
  .mt-hero > *, .mt-toc > *, .mt-toc ol, .mt-chapter > *, .mt-chapter > h2{ grid-column:1; }   /* .mt-toc ol needs the explicit reset (its base grid-column:2 out-specifies '.mt-toc > *') */
  .mt-eyebrow{ grid-row:auto; flex-direction:row; align-items:center; gap:.6rem; margin:0 0 1rem; }
  .mt-eyebrow::before{ width:1.8rem; }
  /* un-stick BOTH the chapter headings AND the TOC heading on mobile (single-column flow) */
  .mt-chapter > h2, .mt-toc h2{ grid-row:auto; position:static; align-self:auto; margin-bottom:.9rem; }
  .mt-chapter > h2{ font-size:clamp(1.7rem,5vw,2.1rem); }
}
.mt-prose p{ margin:1.05rem 0; }
.mt-prose strong{ font-weight:700; color:var(--mt-ink); }
.mt-prose em{ font-style:italic; }
.mt-prose ul, .mt-prose ol{ margin:1rem 0; padding-left:1.3rem; }
.mt-prose li{ margin:.4rem 0; }
.mt-prose ul li::marker{ color:var(--mt-accent); }
/* drop cap — Playfair, trend accent: one decorative glyph = the "serif-italic seasoning" move */
.mt-chapter.lead .mt-prose > p:first-of-type::first-letter{ font-family:var(--font-serif); font-weight:700; float:left; font-size:3.6rem; line-height:.8; padding:.4rem .6rem 0 0; color:var(--mt-accent-ink); }

/* ---- term box (tile, trend accent quarantined inside) ---- */
.mt-term{ margin:1.9rem 0; padding:1.2rem 1.4rem; background:var(--ivory); border-left:3px solid var(--mt-accent); border-radius:0 var(--radius-sm) var(--radius-sm) 0; }
.mt-term .label{ font-family:var(--font-label); font-size:.68rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--mt-accent-ink); display:flex; gap:.45rem; margin-bottom:.35rem; }
.mt-term .label::before{ content:"✦"; }
.mt-term .term{ font-weight:700; font-size:1.04rem; color:var(--mt-ink); }
.mt-term p{ margin:.45rem 0 0; font-size:.98rem; color:var(--mt-ink-soft); line-height:1.7; }

/* ---- note (tile, neutral) ---- */
.mt-note{ margin:1.9rem 0; padding:1.1rem 1.3rem; font-size:.96rem; color:var(--mt-ink-soft); background:var(--ivory); border-radius:var(--radius-sm); }
.mt-note .label{ font-family:var(--font-label); font-size:.68rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--mt-muted); margin-bottom:.35rem; }

/* ---- pull stat (Playfair number = serif accent; trend colour) ---- */
.mt-stat{ margin:2.2rem 0; padding-left:1.2rem; border-left:3px solid var(--mt-accent); }
.mt-stat .n{ font-family:var(--font-serif); font-weight:700; font-style:italic; font-size:clamp(2.6rem,6.5vw,3.8rem); line-height:1; color:var(--mt-accent-ink); letter-spacing:-.01em; }
.mt-stat .cap{ font-size:.98rem; color:var(--mt-ink-soft); margin-top:.45rem; max-width:26rem; }

/* ---- pull quote ---- */
.mt-pullquote{ font-family:var(--font-serif); font-style:italic; font-weight:500; font-size:clamp(1.4rem,3vw,1.7rem); line-height:1.4; color:var(--mt-ink); margin:2.4rem 0; padding-left:1.3rem; border-left:3px solid var(--mt-accent-line); }

/* ---- figure (tile, radius 28) ---- */
.mt-figure{ margin:2.6rem auto; max-width:var(--wide); padding:0 1.5rem; }
.mt-figure.col{ max-width:var(--measure); }
/* top-level figures/charts (outside chapters): match the anchor grid's total width so their left edge lines up with the rail */
.mt-body-main > .mt-figure, .mt-body-main > .mt-chartwrap{ max-width:56.5rem; }
/* SVG diagrams keep an ivory tile; photos/illustrations (.frame.bare) are frameless — image rounds itself */
.mt-figure .frame{ background:var(--ivory); border-radius:var(--radius); padding:1.6rem; overflow:hidden; }
.mt-figure .frame.bare{ background:none; padding:0; border-radius:0; overflow:visible; }
.mt-figure .frame.bare img.mt-img{ border-radius:var(--radius); display:block; width:100%; }
.mt-figure svg{ display:block; margin:0 auto; }
.mt-figure figcaption{ font-family:var(--font-label); font-size:.8rem; color:var(--mt-muted); line-height:1.5; margin-top:.8rem; }
.mt-figure figcaption b{ color:var(--mt-ink-soft); font-weight:700; }
/* image placeholder → dark media tile (intentional even before the render is dropped in) */
.mt-imgph{ display:grid; place-items:center; min-height:17rem; text-align:center; background:var(--dark-warm); color:var(--dim); border-radius:var(--radius); font-family:var(--font-label); font-size:.82rem; padding:1.5rem; }

/* ---- SVG diagram helpers (trend accent quarantined in the figure tile) ---- */
.mt-svg{ font-family:var(--font-label); }
.mt-svg .ink{ stroke:var(--mt-ink); } .mt-svg .ink-fill{ fill:var(--mt-ink); }
.mt-svg .accent{ stroke:var(--mt-accent); } .mt-svg .accent-fill{ fill:var(--mt-accent); }
.mt-svg .muted{ stroke:var(--mt-rule-strong); }
.mt-svg .label{ fill:var(--mt-ink); font-size:13px; font-weight:500; }
.mt-svg .label-sm{ fill:var(--mt-muted); font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
.mt-svg .num{ fill:var(--mt-accent); font-size:12px; font-weight:700; }

/* ---- data charts — wrapped in an ivory tile; bars use trend accent (charts.js reads --mt-accent) ---- */
.mt-chartwrap{ max-width:var(--wide); margin:2.6rem auto; padding:1.6rem; background:var(--ivory); border-radius:var(--radius); }
.mt-chartwrap.col{ max-width:var(--measure); }
.mt-chartwrap .chart-head{ font-family:var(--font-head); font-weight:700; font-size:1.08rem; color:var(--mt-ink); margin-bottom:.2rem; }
.mt-chartwrap .chart-sub{ font-family:var(--font-label); font-size:.8rem; color:var(--mt-muted); margin-bottom:1rem; line-height:1.5; }
.mt-chart{ width:100%; min-height:4rem; }
.mt-chart svg{ display:block; }
.mt-chartwrap .chart-src{ font-family:var(--font-label); font-size:.74rem; color:var(--mt-muted); margin-top:.8rem; }
.mt-chartwrap .chart-src b{ color:var(--mt-ink-soft); font-weight:700; }

/* ====================== KEY PLAYERS — flows like the rest of the content (no black slab) ====================== */
/* a centred light block (matches the wide content blocks); the CONTAINER holds the width so head / note /
   grid all share ONE left edge → the note lines up with the cards even though its JSON carries an inline margin. */
.mt-players{ color:var(--mt-ink); margin:3rem auto 0; max-width:72rem; padding:0 1.5rem 1rem; }
.mt-players > *{ max-width:none; margin-inline:0; }
.mt-players > .head{ font-family:var(--font-label); font-size:.72rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--mt-muted); margin-bottom:1.2rem; }
.mt-player-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(15rem,1fr)); gap:12px; background:none; border:0; }
.mt-player{ background:var(--ivory); color:var(--mt-ink); border:1px solid var(--mt-rule-strong); border-radius:var(--radius-sm); padding:1.2rem 1.3rem; min-width:0; }   /* subtle border so the tile reads on the light page bg; min-width:0 keeps columns equal */
.mt-player .top{ display:flex; align-items:baseline; justify-content:space-between; gap:.3rem .55rem; flex-wrap:wrap; }
.mt-player .name{ font-weight:700; font-size:1.04rem; color:var(--mt-ink); min-width:0; flex:1 1 auto; }
.mt-player .name .mt-np{ white-space:nowrap; }                       /* keep "Oracle ● /" as one unbreakable unit */
.mt-player .name .mt-np-sep{ margin-left:.32rem; color:var(--mt-dim); font-weight:500; }
.mt-player .name a.mt-player-link{ color:inherit; text-decoration:none; border-bottom:1px solid var(--mt-rule-strong); }
.mt-player .name a.mt-player-link:hover{ border-color:var(--mt-accent); background:var(--mt-accent-tint); }
.mt-player .tick{ font-family:var(--font-label); font-size:.72rem; font-weight:700; color:var(--mt-accent-ink); flex:0 1 auto; text-align:right; }   /* wrap-able → won't force column width */
.mt-player .where{ font-family:var(--font-label); font-size:.72rem; color:var(--mt-muted); letter-spacing:.03em; margin-top:.15rem; }
/* inline 2yr EOW sparkline under the name (JS-filled; empty box removes itself if no price history) */
.mt-player .mt-spark{ margin-top:.5rem; padding-block:.45rem; line-height:0; }
.mt-player .mt-spark .mt-spark-svg{ display:block; width:100%; height:auto; overflow:visible; opacity:.92; }   /* height follows the viewBox aspect → uniform scale, even stroke, no stretch */
.mt-player .mt-spark-stat{ margin-top:.4rem; font-family:var(--font-label); font-size:.7rem; font-weight:700; letter-spacing:.01em; line-height:1.2; display:flex; flex-wrap:wrap; align-items:baseline; }
.mt-player .mt-spark-stat .dur{ color:var(--mt-muted); font-weight:500; margin-left:.3em; }
.mt-player .mt-spark-stat .sep{ color:var(--mt-dim); margin:0 .35rem; }
/* legend dot after a name part — colour matches its line (multi-line cards only) */
.mt-player .name .mt-leg{ display:inline-block; width:.5rem; height:.5rem; border-radius:50%; background:var(--lc); margin-left:.32rem; vertical-align:.04em; }
.mt-player .what{ font-size:.93rem; color:var(--mt-ink-soft); line-height:1.6; margin-top:.6rem; }
.mt-player .tag{ display:inline-block; margin-top:.8rem; font-family:var(--font-label); font-size:.62rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--mt-accent-ink); background:var(--mt-accent-tint2); padding:.2rem .6rem; border-radius:var(--pill); }

/* ---- responsive: wide screens → full-bleed hero + a wide 3-col body (rail | content | stocks) ----
   .mt-body wraps the reading content (JS). Narrow = transparent (children flow as before).
   Wide = a 3-col grid in a 1560px band; hero/footer stay edge-to-edge with their colour, but their
   CONTENT sits in the SAME band (padding-inline:max(48px, 50% - 732px), where 732 = (1560-96)/2). */
.mt-body, .mt-body-main{ display:contents; }
.mt-players-rail{ display:none; }

@media (min-width:1440px){
  /* hero + footer: colour stays full-bleed; their CONTENT sits in the same 1560 band as the body */
  .mt-hero{ padding-inline:max(48px, calc(50% - 732px)); grid-template-columns:13rem minmax(0,1fr) 26rem; column-gap:3rem; justify-content:normal; }
  .mt-hero > *{ grid-column:2; }
  .mt-hero > .mt-eyebrow{ grid-column:1; grid-row:1; }
  .mt-footer{ padding-inline:max(48px, calc(50% - 732px)); }
  .mt-topbar{ padding-inline:max(48px, calc(50% - 732px)); }

  /* body = flexbox sticky-sidebar: [ reading column (flex:1) | stock rail (26rem) ], centred in 1560.
     align-items:stretch makes the rail as TALL as the reading column → the inner reliably sticks. */
  .mt-body{ display:flex; gap:3rem; align-items:stretch; max-width:1560px; margin:0 auto; padding:2.6rem 48px 2.6rem; }   /* padding top AND bottom = always-present whitespace between hero/footer and the body (incl. the rail) */
  .mt-body-main{ display:block; flex:1 1 auto; min-width:0; }
  /* article blocks: internal 2-col (heading rail | content) filling the reading column */
  .mt-body-main > .mt-toc, .mt-body-main > .mt-chapter{ grid-template-columns:13rem minmax(0,1fr); column-gap:3rem; justify-content:normal; padding-left:0; padding-right:0; }
  .mt-body-main > .mt-toc{ padding-top:0; }   /* align the TOC top with the rail head */
  .mt-body-main > .mt-figure, .mt-body-main > .mt-chartwrap{ max-width:none; }

  .mt-body .mt-players{ display:none; }   /* hide the in-flow slab wherever it's nested — rail replaces it (rail copies re-shown below) */
  /* rail = a flex column stretched to the reading column's height; the sticky lives in the inner so it
     pins reliably. Long list → inner scrolls (thin scrollbar), 32px bottom gap, padding so the last
     card never jams the frame. Sticks at 112px = a clear gap below the floating nav. */
  .mt-players-rail{ display:block; flex:0 0 26rem; }
  .mt-players-rail-inner{ position:sticky; top:112px; max-height:calc(100vh - 144px); overflow-y:auto; overscroll-behavior:contain; padding-bottom:1.4rem; scrollbar-width:none; -ms-overflow-style:none; }   /* scroll, no visible scrollbar */
  .mt-players-rail .mt-players{ display:block; background:none; color:var(--mt-ink); margin:0; padding:0; max-width:none; }
  .mt-players-rail .mt-players + .mt-players{ margin-top:1.6rem; }
  .mt-players-rail .mt-players > .head{ color:var(--mt-muted); font-size:.68rem; margin-bottom:.9rem; }
  .mt-players-rail .mt-player-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }   /* 2 EQUAL cards per row (minmax(0,…) forces equal width) */
  .mt-players-rail .mt-player{ background:var(--ivory); color:var(--mt-ink); padding:.85rem .95rem; border-radius:var(--radius-sm); }
  .mt-players-rail .mt-player .what{ font-size:.84rem; line-height:1.5; margin-top:.45rem; }   /* show the short story in the rail too */
  .mt-players-rail .mt-player .tag{ margin-top:.55rem; }
  .mt-players-rail-inner::-webkit-scrollbar{ display:none; }   /* hide scrollbar (Chrome/Safari) */

  /* end-of-lesson hub directory: sit in the SAME content column as the chapters (rail col empty) so it lines up */
  .mt-body-main > .mt-hubnav{ display:grid; grid-template-columns:13rem minmax(0,1fr); column-gap:3rem; max-width:none; margin:3rem 0 0; padding:0; }
  .mt-body-main > .mt-hubnav > *{ grid-column:2; }
}

/* ====================== FOOTER — dark slab ====================== */
.mt-footer{ background:var(--dark-warm); color:var(--dim); margin:0; padding:2.6rem 1.5rem 3.4rem; font-family:var(--font-label); font-size:.8rem; line-height:1.6; }
.mt-footer > *{ max-width:var(--measure); margin-inline:auto; }
.mt-sources{ margin-top:1.3rem; }
.mt-sources h3{ font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:var(--ivory); margin:0 0 .5rem; }
.mt-sources ol{ margin:0; padding-left:1.2rem; }
.mt-sources li{ margin:.25rem 0; }
.mt-sources a{ color:var(--dim); text-decoration:none; border-bottom:1px solid rgba(240,238,233,.2); }
.mt-sources a:hover{ color:var(--ivory); }

/* ---- live hub directory (pills) ---- */
.mt-hubnav{ max-width:var(--measure); margin:2.6rem auto; padding:0 1.5rem; }
.mt-hubnav-up{ display:inline-block; font-family:var(--font-label); font-size:.72rem; font-weight:700; letter-spacing:.04em; color:var(--mt-accent-ink); text-decoration:none; margin-bottom:.6rem; }
.mt-hubnav-up:hover{ text-decoration:underline; }
.mt-hubnav > .head{ font-size:.88rem; color:var(--mt-muted); margin-bottom:.7rem; }
.mt-hubnav > .head b{ color:var(--mt-ink); }
.mt-hubnav > .head .cnt{ font-family:var(--font-label); font-size:.68rem; font-weight:700; color:var(--mt-muted); margin-left:.3rem; }
.mt-hubnav-grid{ display:flex; flex-wrap:wrap; gap:.45rem; }
.mt-hubcard{ display:inline-flex; align-items:center; padding:.3rem .8rem; border-radius:var(--pill); background:var(--ivory); text-decoration:none; }
.mt-hubcard .nm{ font-size:.76rem; color:var(--mt-ink); } .mt-hubcard .badge{ display:none; }
.mt-hubcard.done .nm{ color:var(--mt-accent-ink); }
.mt-hubcard.done:hover{ background:var(--mt-accent-tint); }
.mt-hubcard.soon{ opacity:.5; }
.mt-hubcard.here{ background:var(--black); } .mt-hubcard.here .nm{ color:var(--ivory); }

/* ---- responsive ---- */
@media (max-width:720px){
  body.mt-lesson{ font-size:1.02rem; }
  .mt-hero{ padding:var(--nav-clear,9rem) 1.25rem 3rem; }   /* same top-space token on mobile too */
  .mt-chapter{ padding-left:1.25rem; padding-right:1.25rem; }
  /* tap-to-zoom for vector diagrams: default = fit (unchanged); tap → real size + horizontal scroll; tap again = fit.
     .mt-zoomable is added by lesson.js only to figures that contain an <svg> (diagrams, not photos). Caption unaffected. */
  .mt-figure.mt-zoomable .frame{ position:relative; cursor:zoom-in; }
  .mt-figure.mt-zoomable:not(.mt-zoomed) .frame::after{ content:"⤢ แตะเพื่อขยาย"; position:absolute; right:.5rem; bottom:.5rem; font-family:var(--font-label); font-size:.62rem; font-weight:700; letter-spacing:.02em; color:var(--mt-muted); background:rgba(247,246,242,.85); border:1px solid var(--mt-rule-strong); border-radius:9999px; padding:.2rem .55rem; pointer-events:none; }
  .mt-figure.mt-zoomed .frame{ overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; scrollbar-width:none; -ms-overflow-style:none; cursor:zoom-out; }
  .mt-figure.mt-zoomed .frame::-webkit-scrollbar{ display:none; }
  .mt-figure.mt-zoomed .frame > svg{ width:720px; max-width:none; }
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.001ms!important; transition-duration:.001ms!important; }
}
