/* ===========================================================================
   Mr.Wang Chinese — learning-area pages
   ---------------------------------------------------------------------------
   Shared styles for pronunciation.html / vocabulary.html / grammar.html. The
   three pages are structurally identical; only the copy and the accent colour
   differ, and the accent comes from the body class:

     <body class="area-page ap-pronunciation">

   Same design language as the home page (Lora display + Outfit UI, the sand /
   white banding, the 1200px measure). Load after style.css and site-nav.css.
   =========================================================================== */

/* The --ap-* names below are unchanged and every rule in this file still reads
   them. They are now ALIASES of assets/theme.css, which loads first on all
   three pages. The literals they replaced were a cool slate-grey ramp; the
   theme's neutrals are warm and faintly green, which is what the rest of the
   site uses. Change a value in theme.css, not here. */
body.area-page {
  --ap-ink:       var(--t-ink);      /* headings, and the solid-button hover fill */
  --ap-muted:     var(--t-muted);    /* ledes and card copy      5.2:1 on white */
  /* Was #9ca3af — 2.5:1 on white, and every use of it is TEXT (.ap-eyebrow,
     .ap-strip em), so it takes --t-muted. The theme's --t-faint sits at that
     old lightness and is labelled decoration-only for exactly this reason. */
  --ap-soft:      var(--t-muted);
  --ap-body:      var(--t-ink-2);    /* body copy               10.3:1 on white */
  --ap-line:      var(--t-line-soft);
  --ap-line-soft: var(--t-line-soft);  /* declared here since the file was written
                                          but never referenced. Kept, not deleted. */
  --ap-sand:      var(--t-sand);     /* the alternate band, now the site's sand */
  --ap-green:     var(--t-green);    /* .ap-card action label     5.0:1 on white */

  --ap-ui:      var(--t-ui);
  --ap-display: var(--t-display);

  margin: 0;
  color: var(--ap-ink);
  /* Flat white, like the home page — the shared --site-bg wash would otherwise
     show through as a tinted circle behind the hero. */
  background: var(--t-white);
}

/* Accent per area.
   These are the site's learning-area hues, taken from theme.css §3. This file
   previously declared #3b5fa0 / #c4602a / #7c5cbf under a comment claiming they
   matched the home page's four-area palette. They never did: at the time the
   home page's four were #3a72c4 / #3d9163 / #e07b3c / #8663d6, and these were
   near-miss copies with no deep variant at all, so small labels and filled
   buttons were painted with a vivid mark. (Only three of those four still read
   that way — theme.css has since deepened the vocabulary mark from #e07b3c to
   #d66f2f so it clears 3:1 on its own tint. Do not treat the list above as the
   current palette; §3 of theme.css is.) White on the old vocabulary accent was
   4.16:1; on the theme's vocabulary MARK it is 3.40:1. Hence three tokens per
   area, not two:

     --ap-accent      the vivid MARK. Dots, edges, fills, large marks only.
     --ap-accent-ink  the same hue carried deep enough to be TYPE and to hold
                      white at 4.5:1. Filled buttons and small labels take this.
     --ap-tint        the surface the other two sit on.

   Characters is the fourth area and has its own page (hanzi.html), so only
   three of the four appear here. */
body.ap-pronunciation {
  --ap-accent:     var(--t-area-pron-mark);
  --ap-accent-ink: var(--t-area-pron-ink);    /* 8.0:1 white-on, 7.1:1 on tint */
  --ap-tint:       var(--t-area-pron-tint);
}
body.ap-vocabulary {
  --ap-accent:     var(--t-area-vocab-mark);
  --ap-accent-ink: var(--t-area-vocab-ink);   /* 5.6:1 white-on, 5.1:1 on tint */
  --ap-tint:       var(--t-area-vocab-tint);
}
body.ap-grammar {
  --ap-accent:     var(--t-area-gram-mark);
  --ap-accent-ink: var(--t-area-gram-ink);    /* 8.1:1 white-on, 7.0:1 on tint */
  --ap-tint:       var(--t-area-gram-tint);
}
body.ap-hsk {                                  /* the HSK pages, hsk*.html (2026-10-31; 11-02) */
  --ap-accent:     var(--t-area-hsk-mark);
  --ap-accent-ink: var(--t-area-hsk-ink);     /* 6.0:1 white-on, 5.4:1 on tint (blue since 2026-11-03) */
  --ap-tint:       var(--t-area-hsk-tint);
}
body.ap-read {                                 /* reading.html — Reading, under Practice (2026-11-01) */
  --ap-accent:     var(--t-area-read-mark);
  --ap-accent-ink: var(--t-area-read-ink);    /* 6.0:1 white-on, 5.4:1 on tint */
  --ap-tint:       var(--t-area-read-tint);
}

.ap-main { font-family: var(--ap-ui); }
.ap-main *, .ap-main *::before, .ap-main *::after { box-sizing: border-box; }
/* :where() carries zero specificity: these resets still beat the browser
   defaults — link colour, and the UA button chrome, since any author
   declaration outranks the UA origin whatever its specificity — but they lose
   to every class rule. As plain descendant selectors they were (0,1,1): the
   `a` rule ate the text colour of every filled button, and the `button` rule
   ate the FILL of the one real <button> in .ap-main, the "Send feedback" CTA
   on all three pages, leaving .ap-btn-solid (0,1,0) transparent with inherited
   text — a primary CTA with no button visible at all. */
:where(.ap-main) a { color: inherit; text-decoration: none; }
:where(.ap-main) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ── Banding ──────────────────────────────────────────────────────────────── */
.ap-section { padding: 5.5rem 1.5rem; }
.ap-wrap    { max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px)  { .ap-section { padding-left: 3rem; padding-right: 3rem; } }
@media (min-width: 1024px) { .ap-section { padding-left: 5rem; padding-right: 5rem; } }
.ap-sand { background: var(--ap-sand); }
.ap-tinted { background: var(--ap-tint); }

.ap-eyebrow {
  margin: 0 0 1.25rem;
  color: var(--ap-soft);
  font-size: .75rem; letter-spacing: .2em; text-transform: uppercase;
}
.ap-h2 {
  margin: 0;
  font-family: var(--ap-display);
  font-size: 2.25rem; font-weight: 700; line-height: 1.25;
  color: var(--ap-ink);
}
@media (min-width: 768px) { .ap-h2 { font-size: 2.75rem; } }
.ap-lede {
  max-width: 44rem; margin: 1.5rem 0 0;
  color: var(--ap-muted); font-size: 1.0625rem; font-weight: 300; line-height: 1.7;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.ap-hero { border-bottom: 1px solid var(--ap-line); background: var(--ap-tint); }
.ap-hero-inner { max-width: 1200px; margin: 0 auto; }

.ap-hero h1 {
  margin: 0;
  font-family: var(--ap-display);
  font-size: 3rem; font-weight: 700; line-height: 1.08; letter-spacing: -.02em;
  color: var(--ap-ink);
}
@media (min-width: 768px) { .ap-hero h1 { font-size: 4rem; } }

/* Small uppercase type on the tinted hero — the ink, never the mark. */
.ap-hero .ap-eyebrow { color: var(--ap-accent-ink); }
.ap-hero .ap-lede { margin-top: 1.5rem; color: var(--ap-body); font-size: 1.125rem; }

/* Honest status marker — these areas have a published path, not yet lessons. */
.ap-status {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 2rem; padding: .5rem 1rem; border-radius: var(--t-r-pill);
  /* Both literals kept on purpose: an alpha white and an alpha hairline that
     read against whichever area tint is behind them. The theme has no
     alpha-neutral token (no --t-ink-rgb), and an opaque hairline here would
     show as a warm ring sitting on a cool or violet tint. */
  background: rgba(255, 255, 255, .8); border: 1px solid rgba(15, 23, 42, .06);
  font-size: .8125rem; font-weight: 500; color: var(--ap-body);
}
/* The one genuine mark on the page: a 7px dot, no type on it. */
.ap-status i {
  width: .4375rem; height: .4375rem; border-radius: var(--t-r-pill);
  background: var(--ap-accent); flex-shrink: 0;
}

.ap-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.ap-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .875rem 1.75rem; border-radius: var(--t-r-pill);
  font-size: .875rem; font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
/* Filled, with small white text on it: the ink. On the mark, white would be
   3.40:1 for vocabulary and 4.40:1 for grammar — both short of 4.5:1. */
.ap-btn-solid   { background: var(--ap-accent-ink); color: var(--t-white); }
.ap-btn-solid:hover { background: var(--ap-ink); color: var(--t-white); }
/* This border is the control's ONLY visual boundary, so it has to clear 3:1.
   The alpha hairline it replaced, rgba(15, 23, 42, .15), composited to
   #c9d1de / #dad0cb / #d0ccdd over the pronunciation / vocabulary / grammar
   tints — 1.36:1 on all three. The old comment claimed the alpha was needed
   because the button also sat inside .ap-ask; it does not. There is exactly
   one .ap-btn-outline per page, in the hero, on --ap-tint (and .ap-ask is that
   same tint regardless). One known background means an opaque token works:
   --ap-accent-ink measures 7.12 / 5.07 / 7.00:1 on those tints and keeps the
   edge in the area's own hue. */
.ap-btn-outline { border: 1px solid var(--ap-accent-ink); color: var(--ap-body); }
.ap-btn-outline:hover { border-color: var(--ap-ink); color: var(--ap-ink); }

/* ── The four stages ──────────────────────────────────────────────────────── */
.ap-stage-grid { display: grid; gap: 1rem; margin-top: 3rem; }
@media (min-width: 640px)  { .ap-stage-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ap-stage-grid { grid-template-columns: repeat(4, 1fr); } }

.ap-stage {
  display: flex; flex-direction: column;
  padding: 1.75rem 1.5rem; border-radius: var(--t-r-md);
  background: var(--ap-tint);
}
/* "01"–"04" at .75rem on the tint — small type, so the ink. */
.ap-stage-n {
  margin-bottom: 1rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  color: var(--ap-accent-ink);
}
.ap-stage h3 {
  margin: 0 0 .5rem;
  font-family: var(--ap-display); font-size: 1.0625rem; font-weight: 700; line-height: 1.35;
  color: var(--ap-ink);
}
.ap-stage p { margin: 0; color: var(--ap-muted); font-size: .875rem; font-weight: 300; line-height: 1.65; }

/* ── What is available today ──────────────────────────────────────────────── */
.ap-card-grid { display: grid; gap: 1rem; margin-top: 3rem; }
@media (min-width: 768px) { .ap-card-grid { grid-template-columns: repeat(3, 1fr); } }

.ap-card {
  display: flex; flex-direction: column;
  padding: 1.75rem; border-radius: var(--t-r-md);
  background: var(--t-white); border: 1px solid var(--ap-line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ap-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--t-sh-2);
}
.ap-card h3 {
  margin: 0 0 .5rem;
  font-family: var(--ap-display); font-size: 1.0625rem; font-weight: 700;
  color: var(--ap-ink);
}
.ap-card p { flex: 1; margin: 0 0 1.25rem; color: var(--ap-muted); font-size: .875rem; font-weight: 300; line-height: 1.65; }
.ap-card span {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .875rem; font-weight: 500; color: var(--ap-green);
  transition: gap .2s ease;
}
.ap-card:hover span { gap: .625rem; }
/* On the HSK pages, and Reading under them, the action label takes the area's blue (2026-11-03, Yi: the section
   in a colour of its own, apart from the home page's coral); site-ui.css does the same for the filled button. */
body.ap-hsk .ap-card span, body.ap-read .ap-card span { color: var(--ap-accent-ink); }

/* ── Feedback band ────────────────────────────────────────────────────────── */
.ap-ask {
  padding: 4rem 2.5rem; border-radius: 1.5rem;
  background: var(--ap-tint); text-align: center;
}
@media (min-width: 768px) { .ap-ask { padding-left: 5rem; padding-right: 5rem; } }
.ap-ask .ap-h2 { font-size: 2rem; }
.ap-ask p { max-width: 34rem; margin: 1rem auto 2rem; color: var(--ap-body); font-weight: 300; line-height: 1.7; }
.ap-ask .ap-btn { justify-content: center; }

/* ── Other areas strip ────────────────────────────────────────────────────── */
.ap-strip { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .ap-strip { grid-template-columns: repeat(3, 1fr); } }
.ap-strip a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.125rem 1.5rem; border-radius: 1rem;
  background: var(--ap-sand);
  font-size: .9375rem; font-weight: 500; color: var(--ap-ink);
  transition: background .15s ease;
}
/* One step down from --ap-sand, so the hover still reads as a press. */
.ap-strip a:hover { background: var(--t-sunk); }
.ap-strip a em { font-style: normal; color: var(--ap-soft); font-weight: 400; }

@media print {
  .ap-actions, .ap-ask, .ap-strip { display: none !important; }
}
