/* Shared stylesheet for the static content pages under /kien-thuc/ and the
   trust pages (/quyen-rieng-tu/, /dieu-khoan/, ...).

   web_landing/index.html deliberately does NOT link this file: it inlines its
   own CSS for first paint, and test/web/landing_head_test.dart asserts that
   page carries no rel="stylesheet" at all (D-6). The content pages are a
   different trade: they are many, they are text, and one shared cached file
   beats N copies of the same 6 KB. Every token below is copied from that
   page's :root block so the two surfaces cannot look like different sites.

   Served immutable by firebase.json's asset glob, so the -v1 in the filename
   is load-bearing: bump it on every edit or returning visitors keep the old
   sheet forever. Same rule the fonts and og-image carry. */

@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('/fonts/bevietnampro-regular-v1.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('/fonts/bevietnampro-bold-v1.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* Palette from web/icons/tokens.css, via web_landing/index.html. Light theme
   only, matching that page and the app (ThemeMode.light).
   WARP GREEN (#9EFF00) is 1.25:1 on white and can never be text here: it is a
   FILL with void ink on top (16.17:1). Accent text uses the darkened green
   (6.36:1). ION cyan is 1.39:1 on white, so on light surfaces it appears only
   as --ion-ink (6.40:1). */
:root {
  --bg: #ffffff;
  --ink: #101418;        /* 18.50:1 on --bg */
  --dim: #4b5560;        /* 7.59:1 on --bg */
  --line: #e2e6ea;
  --card: #f7f9fa;
  --brand: #3d6b00;      /* 6.36:1 on --bg */
  --fill: #9eff00;       /* backgrounds only */
  --fill-ink: #050609;   /* 16.17:1 on --fill */
  --void: #050609;
  --void-ink: #f2f7ec;   /* 17.76:1 on --void */
  --void-dim: #96a1a8;   /* 7.33:1 on --void */
  --ion-ink: #00668c;    /* 6.40:1 on --bg */
  --ion: #3df0ff;        /* 12.40:1 on --void, void surfaces only */
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --r-control: 8px;
  --r-panel: 12px;
  --r-card: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--brand); }

/* ---- header, identical geometry to the landing page ------------------- */

header {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 62px;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: .2px;
  color: var(--ink); text-decoration: none;
}
nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
nav a { color: var(--dim); text-decoration: none; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); }
.cta {
  display: inline-block; background: var(--fill); color: var(--fill-ink);
  padding: 9px 18px; border-radius: var(--r-control); font-weight: 700;
  text-decoration: none; border: 0; cursor: pointer; font-size: 15px;
}
.cta:hover { filter: brightness(1.06); }
.mark { display: block; width: 26px; height: 26px; border-radius: var(--r-control); }
@media (max-width: 720px) { nav .hide-sm { display: none; } }

.eyebrow {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin: 0 0 10px;
}
.fine { font-size: 12.5px; color: var(--dim); }

/* NOTE on the blocks below: several are <div class="wrap X">, so they inherit
   .wrap's `padding: 0 20px`. Setting the `padding` SHORTHAND here resets the
   horizontal gutter to zero and the text runs into the viewport edge on narrow
   screens. Always set padding-top / padding-bottom longhand on a .wrap element.

   ---- breadcrumb ------------------------------------------------------- */

.crumb {
  font-size: 13.5px; color: var(--dim);
  padding-top: 18px; font-family: var(--mono); letter-spacing: .01em;
}
.crumb a { color: var(--dim); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.crumb span { color: var(--line); margin: 0 8px; }
/* The trailing crumb is a full page title, which overflows a 390px
   viewport as one unbroken line. */
.crumb { overflow-wrap: anywhere; }

/* ---- article ---------------------------------------------------------- */

.head { padding-top: 20px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
h1 {
  font-size: clamp(27px, 4.4vw, 40px);
  line-height: 1.14; letter-spacing: -.015em;
  margin: 0 0 14px; font-weight: 700; max-width: 34ch;
}
.lede {
  font-size: clamp(16.5px, 1.6vw, 18.5px); color: var(--dim);
  margin: 0; max-width: 66ch;
}

article { padding: 8px 0 10px; }
article h2 {
  font-size: clamp(20px, 2.4vw, 26px); line-height: 1.2;
  letter-spacing: -.01em; font-weight: 700;
  margin: 44px 0 14px; padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 40ch;
}
article h2:first-child { margin-top: 26px; }
article h3 {
  font-size: 17px; font-weight: 700; margin: 28px 0 8px; max-width: 44ch;
}
article p, article ul, article ol { max-width: 68ch; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 16px; padding-left: 22px; }
article li { margin: 0 0 8px; }
article li > strong { color: var(--ink); }
article strong { font-weight: 700; }

/* A defined-term list: the palace names, the star names. A plain <ul> of
   "Name: prose" reads as a wall; the label gets the mono voice instead, the
   same one the bento tile titles use on the landing page. */
.terms { list-style: none; padding: 0; margin: 0 0 16px; max-width: 68ch; }
.terms li {
  border-top: 1px solid var(--line); padding: 13px 0 0; margin: 0 0 13px;
}
.terms li:first-child { border-top: 0; padding-top: 0; }
.terms b {
  display: block; font-family: var(--mono); font-size: 14px;
  font-weight: 600; letter-spacing: .02em; color: var(--ion-ink);
  margin: 0 0 3px;
}

/* Pulled-out statement. Not a quotation: nothing here is quoted, so no
   quote marks and no italics. */
.pull {
  margin: 34px 0; padding: 0 0 0 20px;
  border-left: 3px solid var(--fill);
  font-size: clamp(17px, 1.8vw, 20px); line-height: 1.45;
  font-weight: 700; max-width: 46ch;
}

/* A caveat panel. Used for the review-status note and the not-a-prediction
   note, both of which the project is required to keep visible. */
.note {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 16px 18px;
  margin: 30px 0; max-width: 68ch;
}
.note p { margin: 0; font-size: 14.5px; color: var(--dim); max-width: none; }
.note p + p { margin-top: 10px; }
.note b { color: var(--ink); }

/* ---- table of contents ------------------------------------------------ */

.toc {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-panel); padding: 16px 20px 18px;
  margin: 26px 0 0; max-width: 68ch;
}
.toc p {
  margin: 0 0 8px; font-family: var(--mono); font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.toc li { margin: 0 0 5px; }

/* ---- card grid, used by the /kien-thuc/ hub --------------------------- */

.grid {
  display: grid; gap: 14px; margin: 30px 0 0;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.tile {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 18px 20px;
}
.tile:hover { border-color: var(--ion-ink); }
.tile h2 {
  margin: 0 0 6px; padding: 0; border: 0; font-size: 17px;
  font-weight: 700; color: var(--ink); max-width: none;
}
.tile p { margin: 0; font-size: 14.5px; color: var(--dim); max-width: none; }

/* ---- closing call to action ------------------------------------------ */

.endcta {
  background: var(--void); color: var(--void-ink);
  border-radius: var(--r-panel); padding: 28px 26px;
  margin: 46px 0 10px; max-width: 68ch;
}
.endcta h2 {
  margin: 0 0 8px; padding: 0; border: 0; color: var(--void-ink);
  font-size: clamp(19px, 2.2vw, 24px); max-width: 30ch;
}
.endcta p { margin: 0 0 18px; color: var(--void-dim); font-size: 15px; max-width: 56ch; }

/* ---- read next ------------------------------------------------------- */

.next { padding-top: 34px; padding-bottom: 6px; border-top: 1px solid var(--line); margin-top: 40px; }
.next > p {
  margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}

/* ---- footer, identical to the landing page --------------------------- */

footer {
  background: var(--void); color: var(--void-dim);
  padding: 34px 0 46px; font-size: 14px; margin-top: 60px;
}
footer a { color: var(--void-ink); text-decoration: none; margin-right: 18px; line-height: 2.1; }
footer a:hover { color: var(--ion); }
footer .rule { margin-top: 14px; color: var(--void-dim); }

/* ---- ad slot, same collapse behaviour as the landing page ------------- */

.ad-slot { margin: 34px auto 6px; min-height: 100px; max-width: 68ch; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { min-height: 0; margin: 0; }
