/* nav.css — the WHOLE header's styles, loaded as an external stylesheet in <head>
   so the server-rendered menu (see nav_header.py) is fully styled at first paint:
   no flash of unstyled content, no layout shift. Covers the brand bar, the page
   subtitle, and all the dropdown/link styles (these used to be injected by nav.js;
   nav.js now only injects them as a fallback when the menu isn't server-rendered).
   Served at /nav.css by both servers (revalidate-cacheable). */

.rnav-bar{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:6px 16px; margin-bottom:4px;
}
.rnav-brand{
  font-size:1.4rem; font-weight:800; color:#122150; text-decoration:none;
  white-space:nowrap; letter-spacing:-.01em;
}
.rnav-brand:hover{ color:#122150; text-decoration:none; }

/* reserve the menu row's height so it doesn't jump when nav.js builds it */
#site-nav{ min-height:32px; }

/* the per-page name, demoted to a subtitle under the fixed wordmark */
.page-title{ font-size:1.1rem; font-weight:700; margin:12px 0 8px; color:#1a1a1a; }

/* --- menu/dropdown styles (were injected by nav.js; now here so the server-
   rendered menu is styled at first paint — no flash of unstyled menu). --- */
.rnav{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; font-size:.9rem; }
.rnav a{ color:var(--accent,#1a73e8); text-decoration:none; white-space:nowrap; }
.rnav a:hover{ text-decoration:underline; }
.rnav .rnav-cur{ font-weight:700; color:#111; }
.rnav-search{ display:inline-flex; margin:0 2px 0 0; }
.rnav-search input{ width:124px; height:30px; padding:0 12px; border:1px solid rgba(0,0,0,.25); border-radius:15px; background:#fafafa; font-size:.85rem; transition:width .15s ease; }
.rnav-search input:focus{ width:184px; outline:none; border-color:var(--accent,#1a73e8); }
.rnav-grp{ position:relative; }
.rnav-btn{ background:none; border:0; margin:0; padding:2px; cursor:pointer; color:var(--accent,#1a73e8); font:inherit; font-size:.9rem; white-space:nowrap; }
.rnav-btn:hover{ text-decoration:underline; }
.rnav-btn.rnav-cur{ font-weight:700; color:#111; }
.rnav-caret{ font-size:.7em; opacity:.65; margin-left:3px; }
.rnav-menu{ position:absolute; right:0; top:100%; margin-top:6px; min-width:172px; background:#fff; border:1px solid rgba(0,0,0,.18); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.14); padding:4px; z-index:1000; display:none; }
.rnav-menu.rnav-open{ display:block; }
.rnav-menu a{ display:block; padding:9px 12px; border-radius:6px; color:#222; font-size:.9rem; white-space:nowrap; }
.rnav-menu a:hover{ background:#f1f5ff; color:var(--accent,#1a73e8); text-decoration:none; }

@media (max-width:560px){ .rnav-brand{ font-size:1.25rem; } .rnav-menu{ right:auto; left:0; } }

/* --- mobile header: ☰ burger + right-side drawer (≤860px) -------------------
   Same markup as desktop; the drawer is just #site-nav re-styled as a fixed
   panel with every dropdown group expanded into a labelled section. Toggled by
   body.rnav-drawer-open (wired in nav.js). --- */
.rnav-burger{ display:none; background:none; border:0; padding:2px 8px; cursor:pointer;
  font-size:1.5rem; line-height:1; color:#122150; }
.rnav-scrim{ display:none; }
@media (max-width:860px){
  #site-nav{ min-height:0; }
  #site-nav > .rnav-burger{ display:inline-flex; margin-left:auto; }
  #site-nav > .rnav-search, #site-nav > a, #site-nav > .rnav-grp{ display:none; }
  body.rnav-drawer-open .rnav-scrim{ display:block; position:fixed; inset:0;
    background:rgba(0,0,0,.45); z-index:1190; }
  body.rnav-drawer-open #site-nav{
    display:flex; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:2px;
    position:fixed; top:0; right:0; bottom:0; width:min(320px,86vw); z-index:1200;
    background:#fff; box-shadow:-12px 0 34px rgba(0,0,0,.25);
    padding:52px 14px 24px; overflow-y:auto; overscroll-behavior:contain;
  }
  body.rnav-drawer-open #site-nav > .rnav-burger{
    display:inline-flex; position:absolute; top:10px; right:10px; margin:0;
    font-size:1.6rem; color:#555; }
  body.rnav-drawer-open #site-nav > .rnav-search{ display:flex; margin:0 0 10px; }
  body.rnav-drawer-open #site-nav > .rnav-search input{ width:100%; }
  body.rnav-drawer-open #site-nav > .rnav-search input:focus{ width:100%; }
  body.rnav-drawer-open #site-nav > a{ display:block; padding:10px 8px;
    font-size:1rem; border-radius:8px; }
  body.rnav-drawer-open #site-nav > .rnav-grp{ display:block; }
  /* group buttons stay tappable — sections start collapsed and toggle open,
     same accordion behavior as the desktop dropdowns (shared click handler) */
  body.rnav-drawer-open #site-nav .rnav-btn{ display:flex; align-items:center;
    justify-content:space-between; width:100%; text-align:left; padding:10px 8px;
    font-size:1rem; border-radius:8px; }
  body.rnav-drawer-open #site-nav .rnav-btn:hover{ text-decoration:none; background:#f1f5ff; }
  body.rnav-drawer-open #site-nav .rnav-caret{ font-size:.8em; }
  body.rnav-drawer-open #site-nav .rnav-btn[aria-expanded="true"] .rnav-caret{
    display:inline-block; transform:rotate(180deg); }
  /* the menu opens/closes via .rnav-open exactly like desktop; only the
     presentation changes (inline section instead of a floating dropdown) */
  body.rnav-drawer-open #site-nav .rnav-menu{ position:static; margin:0;
    min-width:0; border:none; box-shadow:none; padding:0; }
  body.rnav-drawer-open #site-nav .rnav-menu a{ padding:10px 8px 10px 22px;
    font-size:1rem; border-radius:8px; white-space:normal; }
  body.rnav-drawer-open{ overflow:hidden; }   /* the page behind doesn't scroll */
}

/* --- site footer (server-injected before </body> by nav_header.inject) --- */
.site-footer{ margin-top:48px; border-top:1px solid rgba(0,0,0,.1); background:#fafbfc; }
.site-footer-inner{
  max-width:1180px; margin:0 auto; padding:18px 14px;
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px;
  font-size:.82rem; color:#777;
}
.site-footer .sf-brand{ font-weight:800; color:#122150; letter-spacing:-.01em; }
.site-footer .sf-links{ display:flex; flex-wrap:wrap; gap:6px 16px; }
.site-footer .sf-links a{ color:#555; text-decoration:none; white-space:nowrap; }
.site-footer .sf-links a:hover{ color:var(--accent,#1a73e8); text-decoration:underline; }
.site-footer .sf-legal{ margin-left:auto; text-align:right; color:#999; }
@media (max-width:560px){ .site-footer .sf-legal{ margin-left:0; text-align:left; width:100%; } }

/* --- canonical page width -------------------------------------------------
   Every page's content sits in <div class="container">. THIS is the single
   source of the site width — new pages just use the class and inherit 1180px;
   they should NOT redeclare max-width (that is how the footer/legal pages drifted
   narrower). nav.css loads on every page, after each page's own <style>. --- */
.container{ max-width:1180px; margin-left:auto; margin-right:auto; }

/* --- admin count bubble (unresolved suggestions / messages) --- */
.rnav-badge{
  display:inline-block; min-width:18px; height:18px; padding:0 5px; margin-left:6px;
  border-radius:9px; background:#d93025; color:#fff; font-size:.68rem; font-weight:700;
  line-height:18px; text-align:center; vertical-align:middle;
}

/* ---- ReposterCta (nav.js): sign-in / upgrade call-to-actions ------------- */
/* Every restriction notice gets a CTA (decided 2026-07-09): signed-out ->
   create an account; under-tiered -> see plans. Popup + cap-banner styles. */
.cta-ovl{
  /* Above EVERY other overlay — the ⚙ Settings modal is 9999 (settings.js) and
     was covering the locked-voice CTA (2026-07-10). */
  position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,.4);
  display:flex; align-items:center; justify-content:center;
}
.cta-box{
  background:#fff; border-radius:12px; max-width:400px; width:92%; padding:22px;
  box-shadow:0 12px 40px rgba(0,0,0,.3);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
.cta-box h3{ margin:0 0 8px; font-size:1.15rem; color:#111; }
.cta-box p{ margin:0 0 16px; color:#444; font-size:.95rem; line-height:1.45; }
.cta-box .cta-go{
  display:inline-block; background:#1a73e8; color:#fff; border:none;
  border-radius:8px; padding:10px 20px; font-size:.95rem; font-weight:600;
  cursor:pointer; text-decoration:none;
}
.cta-box .cta-alt{
  margin-left:14px; background:none; border:none; color:#666; font-size:.9rem;
  cursor:pointer; text-decoration:none;
}
/* Locked (non-teacher) Teaching menu: visible but subdued; nav.js turns item
   clicks into the upgrade popup. */
.rnav-locked > .rnav-btn{ opacity:.55; }
.rnav-locked .rnav-menu a{ opacity:.55; }
/* The Shared-library tab strip (2026-08-01, ReposterLibTabs in nav.js):
   🔗 Shared with me · 🌍 Common · 🎓 Teacher on /library?view=… and
   /texts?view=…. .locked = under-entitled (click opens the CTA, no switch). */
.libtabs{ display:flex; gap:6px; margin:10px 0 14px; flex-wrap:wrap; }
.libtab{
  padding:7px 14px; border:1px solid rgba(0,0,0,.18); border-radius:18px;
  background:#fafafa; cursor:pointer; font-size:.92rem; color:#333;
  user-select:none; white-space:nowrap;
}
.libtab:hover{ border-color:var(--accent,#1a73e8); color:var(--accent,#1a73e8); }
.libtab.sel{
  background:var(--accent,#1a73e8); border-color:var(--accent,#1a73e8);
  color:#fff; font-weight:600;
}
.libtab.sel:hover{ color:#fff; }
.libtab.locked{ opacity:.55; }
.libtab.locked::after{ content:' 🔒'; font-size:.85em; }
/* Faceted library filter (ReposterLibFilter in nav.js, 2026-08-02): labeled
   multi-select chip rows — Level / Topic / Source — on the clips and texts
   library pages. OR within a row, AND across rows. */
.libfilter{ margin-top:14px; }
.libfilter .lf-row{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:6px 0 0; }
.libfilter .lf-lab{ font-size:.78rem; font-weight:600; color:#888; min-width:52px; }
.libfilter .lf-chip{
  display:inline-block; padding:4px 12px; font-size:.83rem;
  border:1px solid rgba(0,0,0,.3); border-radius:16px; cursor:pointer;
  background:#fff; color:#333; user-select:none; white-space:nowrap;
}
.libfilter .lf-chip:hover{ border-color:var(--accent,#1a73e8); color:var(--accent,#1a73e8); }
.libfilter .lf-chip .lf-n{ color:#999; font-size:.75rem; }
.libfilter .lf-chip.sel{ background:var(--accent,#1a73e8); color:#fff; border-color:var(--accent,#1a73e8); }
.libfilter .lf-chip.sel:hover{ color:#fff; }
.libfilter .lf-chip.sel .lf-n{ color:#dbe7ff; }
.libfilter .lf-clear{
  font:inherit; font-size:.8rem; padding:3px 12px; border:1px solid rgba(0,0,0,.25);
  border-radius:14px; background:#fff; color:#c5221f; cursor:pointer;
}
.libfilter .lf-clear:hover{ border-color:#c5221f; }
/* Cap banner at the top of a page (Free-tier limits), bold statement + CTA. */
.cap-banner{
  margin:10px 0; padding:10px 14px; border:1px solid #f9ab00; background:#fef7e0;
  border-radius:8px; font-size:.92rem; color:#333;
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.cap-banner .cta-go{
  background:#1a73e8; color:#fff; border:none; border-radius:7px; padding:7px 14px;
  font-size:.85rem; font-weight:600; cursor:pointer; text-decoration:none;
  margin-left:auto; white-space:nowrap;
}
/* Preview screenshot inside the CTA popup (anon audit 2026-07-10). */
.cta-box .cta-img{
  display:block; width:100%; border:1px solid rgba(0,0,0,.14); border-radius:8px;
  margin:0 0 14px; box-shadow:0 4px 14px rgba(0,0,0,.10);
}
