/* public/public-chrome.css — the one header and footer of the public pages, and
   their dark theme (B03, full-site review 27 Oct 2026: M-038, M-065, M-030,
   M-342). The markup is src/publicChrome.js; every public/*.html page and every
   /learn page links this file after its own <style>, so a rule here wins over
   the page's own at the same specificity. Sizes follow docs/UI-CONVENTIONS.md
   and the landing's nav (src/Landing.jsx): 44 px pills, 15 px or more for any
   button, link or label text, 18 px glyphs. */

/* ── Header: logo left; [English], theme, Pricing, Log in right ─────────── */
.topbar.pc-head {
  position: sticky; top: 0; z-index: 50;
  direction: ltr; /* the Persian site keeps the English layout: logo left (UI-CONVENTIONS) */
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0; padding: 10px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, #f3efe5 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.pc-logo { display: inline-flex; align-items: center; min-height: 44px; flex-shrink: 0; }
.pc-logo img { display: block; height: 30px; width: auto; }
.pc-right { display: flex; align-items: center; gap: 8px; }
.pc-head .pc-pill {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 44px; min-width: 44px; padding: 9px 16px; border-radius: 10px;
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  color: #2c2820 !important; opacity: 1 !important; text-decoration: none !important; cursor: pointer;
  background: color-mix(in srgb, #fffdf8 70%, transparent); border: 1px solid #ddd6c6;
}
.pc-head .pc-pill:hover { background: #efeade; }
.pc-head .pc-pill:focus-visible { outline: 2px solid #566036; outline-offset: 2px; }
.pc-head .pc-theme { padding: 8px 10px; }
.pc-head .pc-price { background: transparent; border-color: transparent; }
.pc-sun { display: none; }
@media (max-width: 720px) { .pc-head .pc-price { display: none; } }
/* Signed in on the Persian pricing page: "Open LexiBox" in Persian is long, and with
   the English pill beside it the button was cut at 375. On phones the pill gives way. */
@media (max-width: 480px) { .pc-right.pc-in .lang { display: none; } }
@media (max-width: 400px) {
  .pc-right { gap: 6px; }
  /* A large Text size does not grow the header's own buttons past the phone's edge. */
  .pc-head .pc-pill { padding: 9px 12px; font-size: min(1rem, 17px); }
  .pc-head .pc-theme { padding: 8px 10px; }
}
/* The Persian header has one more button (English): on the narrowest phones
   the row was 21 px wider than the window and Log in was cut. */
@media (max-width: 360px) {
  .topbar.pc-head { padding-inline: 12px; gap: 8px; }
  .pc-logo img { height: 26px; }
  .pc-right { gap: 4px; }
  .pc-head .pc-pill { padding: 9px 8px; }
  .pc-head .pc-theme { padding: 8px 8px; }
}

/* ── Footer: badges, one link row, © + support address ──────────────────── */
.footer.pc-foot {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid #ddd6c6;
  text-align: center; font-size: 0.9375rem; line-height: 1.6; color: #5c584f; opacity: 1 !important;
}
.pc-stores { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 18px; margin-bottom: 10px; }
.pc-stores:empty { display: none; }
.pc-foot .pc-store { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border-radius: 8px; }
.pc-store img { display: block; height: 44px; width: auto; }
/* Social logos (25 Nov 2026): 22 px marks in 44 px tap targets. */
.pc-social { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.pc-foot a.pc-soc { justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 999px; }
.pc-foot a.pc-soc:hover { background: rgba(0,0,0,0.05); text-decoration: none !important; }
.pc-soc svg { display: block; }
.pc-links, .pc-copy { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.pc-foot a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  font-size: 0.9375rem; color: #5c584f !important; opacity: 1 !important; text-decoration: none !important;
}
.pc-foot a:hover { text-decoration: underline !important; text-underline-offset: 2px; }
.pc-foot .sep { margin: 0 2px; color: #8a857a; opacity: 1; }
/* The © line: plain text before the dot has no link padding, so the dot keeps
   8 px on that side (design sweep, 29 Oct 2026: it touched "iLexiBox"). */
.pc-copy .sep { margin-inline: 8px 2px; }
/* The year and the name are one part of the row (span.pc-c, 12 Nov 2026), so
   the space between them is kept and the dot has a part before it to measure. */
/* Phone review M-008 (12 Nov 2026): the © line reads left to right on the
   Persian pages too ("© ۲۰۲۶ LexiBox · address"), as the landing page and the
   app's own footer write it; here it ran right to left, the same line in the
   other order. Only a year, a Latin name and an address stand on it. */
.pc-copy { direction: ltr; }
/* 33 ii (12 Nov 2026): a name or address in a Persian line stays on one line. */
.nw { white-space: nowrap; }
.pc-foot .operator { margin-bottom: 6px; }

/* ── Text size: the learner's own setting (the header's script sets the
   variable from ilexibox_text_scale; without it the pages keep their size) ── */
html { font-size: calc(100% * var(--lx-text-scale, 1)); }
html[lang="fa"] { font-size: calc(106.25% * var(--lx-text-scale, 1)); }

/* ── Text floor (M-030) and line length (M-342) ─────────────────────────── */
.chips a, .go, .note, .updated, .plan .label, .plan .unit, .plan .meta { font-size: 0.9375rem !important; }
.a p, .a li, .how p, .how li, .stuck p, .sub, .wrap > p, section > p { max-width: 68ch; }

/* No picture stands beside the title any more (Rashid, 30 Oct 2026), so the
   title and the line under it use the whole column. */
.wrap > h1 { margin-top: 8px; }

/* The in-app legal viewer (?embed=1) shows the document only. */
.embed .pc-head, .embed .pc-foot { display: none !important; }
@media print { .pc-head, .pc-foot { display: none !important; } }

/* ── Dark: the saved theme of the app (the header's script sets data-theme) ─ */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"], html[data-theme="dark"] body { background: #0e1e22 !important; color: #e4eef0; }
html[data-theme="dark"] body { background: linear-gradient(180deg, #172124 0, #0e1e22 420px) no-repeat, #0e1e22 !important; }
html[data-theme="dark"] body::before { opacity: .06; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 { color: #e4eef0; }
html[data-theme="dark"] a { color: #8cc5cd; }
html[data-theme="dark"] .updated, html[data-theme="dark"] .sub, html[data-theme="dark"] .note,
html[data-theme="dark"] .pool .what, html[data-theme="dark"] .plan .label, html[data-theme="dark"] .plan .unit,
html[data-theme="dark"] .plan .meta, html[data-theme="dark"] .free p, html[data-theme="dark"] .counts .k,
html[data-theme="dark"] .rules .e, html[data-theme="dark"] .chips { color: #9fb9bd !important; }
html[data-theme="dark"] .a, html[data-theme="dark"] .stuck p { color: #c5d6d9; }
html[data-theme="dark"] .q, html[data-theme="dark"] .how, html[data-theme="dark"] .pool, html[data-theme="dark"] .plan,
html[data-theme="dark"] .included, html[data-theme="dark"] .counts li { background: #172124; border-color: #2a383b; }
html[data-theme="dark"] .plan.featured { border-color: #8cc5cd; box-shadow: none; }
html[data-theme="dark"] .notice, html[data-theme="dark"] .intro, html[data-theme="dark"] .stuck,
html[data-theme="dark"] .free, html[data-theme="dark"] .album, html[data-theme="dark"] .chips a,
html[data-theme="dark"] .go { background: #172124; border-color: #2a383b; color: #e4eef0 !important; }
html[data-theme="dark"] .chips a:hover, html[data-theme="dark"] .go:hover { background: #1b272a; }
html[data-theme="dark"] .you { background: #1f2d2a; border-color: #2f4a44; }
html[data-theme="dark"] .q summary::after { background: #1b272a; color: #b9cdd0; }
html[data-theme="dark"] .q summary:focus-visible, html[data-theme="dark"] .more:focus-visible { outline-color: #8cc5cd; }
html[data-theme="dark"] .more { color: #e4eef0; border-top-color: #2a383b; }
html[data-theme="dark"] .plan .pick { border-color: #e4eef0; color: #e4eef0; }
html[data-theme="dark"] .plan .pick:hover { background: #1b272a; }
html[data-theme="dark"] .plan.featured .pick, html[data-theme="dark"] .cta a { background: #e4eef0; color: #0e1e22 !important; }
html[data-theme="dark"] .plan.featured .pick:hover, html[data-theme="dark"] .cta a:hover { background: #f2f8f9; }
html[data-theme="dark"] .rules .t, html[data-theme="dark"] .pool .n { color: #8cc5cd; }
html[data-theme="dark"] .rules li, html[data-theme="dark"] .more, html[data-theme="dark"] th, html[data-theme="dark"] td,
html[data-theme="dark"] hr { border-color: #2a383b; }
html[data-theme="dark"] .topbar.pc-head { background: color-mix(in srgb, #0e1e22 82%, transparent); }
html[data-theme="dark"] .pc-logo img { filter: invert(1); }
html[data-theme="dark"] .pc-head .pc-pill { color: #e4eef0 !important; background: color-mix(in srgb, #172124 70%, transparent); border-color: #2a383b; }
html[data-theme="dark"] .pc-head .pc-price { background: transparent; border-color: transparent; }
html[data-theme="dark"] .pc-head .pc-pill:hover { background: #1b272a; }
html[data-theme="dark"] .pc-sun { display: block; }
html[data-theme="dark"] .pc-moon { display: none; }
html[data-theme="dark"] .footer.pc-foot { color: #9fb9bd; border-top-color: #2a383b; }
html[data-theme="dark"] .pc-foot a { color: #9fb9bd !important; }
html[data-theme="dark"] .pc-foot .sep { color: #6f8589; }
/* Dark gaps (29 Oct 2026, /refund at night: the bold words were the light
   theme's #2a2a25 on the dark page, and the "Monthly subscriptions" note a
   white box): bold text, the highlighted note (refund, delete-account), and
   two signed-in pricing states. */
html[data-theme="dark"] strong { color: #f2f8f9; }
html[data-theme="dark"] .highlight { background: #172124; border-color: #2a383b; border-left-color: #8cc5cd; }
html[data-theme="dark"] .plan .current-tag { background: #1f2d2a; color: #a9d4cb; }
html[data-theme="dark"] .you[data-plan-state="ending"] { background: #2e2619; border-color: #6b5434; }
/* A hyphenated word that must not split across two lines at 375 px
   ("non-refundable" on /refund and /faq, design sweep 4 Nov 2026). */
.nw { white-space: nowrap; }

/* Part B4 (Rashid, 11 Nov 2026): on a phone the bar is solid, so the page's
   text no longer shows through it while scrolling. */
@media (max-width: 720px) {
  .topbar.pc-head { background: #f3efe5; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-theme="dark"] .topbar.pc-head { background: #0e1e22; }
}
