/* ============================================================
   Classicalia — shared shell: header and footer on every page
   Rendered by /version2/assets/js/shell.js into
     <div data-shell="header" data-active="latin|greek|civ|tools|teach"></div>
     <div data-shell="footer"></div>
   Loads alongside classicalia.css on pages that still use the older
   page templates, and alongside ui.css on pages built on the new ones.
   Everything here is namespaced cx- so it cannot collide with page CSS.
   ============================================================ */

:root {
  --cx-navy: #0E1E3F;
  --cx-ink: #141a2b;
  --cx-muted: #6b7386;
  --cx-rule: #e6e8ee;
  --cx-brand: #1a6fff;
  --cx-sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cx-serif: 'Lora', Georgia, 'Times New Roman', serif;
}

/* ── header ── */
.cx-top { background: var(--cx-navy); color: #fff; font-family: var(--cx-sans); position: relative; z-index: 120; }
.cx-top-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 6px; height: 64px; }
.cx-logo { display: flex; align-items: center; margin-right: 18px; }
.cx-logo img { display: block; height: 18px; width: auto; }
.cx-nav { display: flex; gap: 2px; }
.cx-nav a { font-size: 14.5px; font-weight: 500; color: rgba(255,255,255,.78); padding: 7px 11px; border-radius: 6px; text-decoration: none; white-space: nowrap; }
.cx-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.cx-nav a.on { color: #fff; background: rgba(255,255,255,.12); }
.cx-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cx-signin { font-size: 14.5px; font-weight: 600; color: #fff; padding: 8px 12px; text-decoration: none; border-radius: 6px; }
.cx-signin:hover { background: rgba(255,255,255,.08); }
.cx-start { font-size: 14.5px; font-weight: 700; color: var(--cx-navy); background: #fff; padding: 9px 16px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.cx-start:hover { background: #eaf0ff; }
.cx-switch { font-size: 13.5px; font-weight: 600; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); padding: 7px 12px; border-radius: 7px; text-decoration: none; white-space: nowrap; }
.cx-switch:hover { background: rgba(255,255,255,.2); }
.cx-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--cx-brand); color: #fff; font-family: var(--cx-sans); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; padding: 0; flex: none; }
.cx-burger { display: none; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font: inherit; font-family: var(--cx-sans); font-size: 14px; padding: 7px 12px; border-radius: 6px; cursor: pointer; }

/* account dropdown */
.cx-acct { position: relative; }
.cx-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: #fff; color: var(--cx-ink); border: 1px solid var(--cx-rule); border-radius: 10px; box-shadow: 0 18px 40px rgba(14,30,63,.18); padding: 6px; z-index: 200; }
.cx-pop[hidden] { display: none; }
.cx-pop-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--cx-rule); margin-bottom: 4px; }
.cx-pop-name { font-weight: 700; font-size: 14px; }
.cx-pop-email { font-size: 12px; color: var(--cx-muted); word-break: break-all; }
.cx-pop a, .cx-pop button { display: block; width: 100%; text-align: left; font: inherit; font-family: var(--cx-sans); font-size: 14px; color: var(--cx-ink); background: none; border: 0; padding: 8px 12px; border-radius: 6px; text-decoration: none; cursor: pointer; }
.cx-pop a:hover, .cx-pop button:hover { background: #f3f5f9; }
.cx-pop .cx-signout { color: #b7432f; }

/* mobile menu */
.cx-menu { display: none; background: var(--cx-navy); border-top: 1px solid rgba(255,255,255,.12); padding: 10px 24px 16px; }
.cx-menu[data-open] { display: block; }
.cx-menu a { display: block; color: #fff; font-family: var(--cx-sans); font-size: 16px; font-weight: 500; padding: 10px 0; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.08); }
.cx-menu a:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .cx-nav, .cx-signin, .cx-start { display: none; }
  .cx-burger { display: inline-block; }
  .cx-top-inner { padding: 0 20px; height: 60px; }
}

/* ── footer ── */
.cx-foot { background: #fff; border-top: 1px solid var(--cx-rule); padding: 26px 0; font-family: var(--cx-sans); font-size: 13.5px; color: var(--cx-muted); }
.cx-foot-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px 28px; flex-wrap: wrap; }
.cx-foot img { display: block; height: 14px; width: auto; }
.cx-foot nav { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.cx-foot a { color: var(--cx-muted); text-decoration: none; }
.cx-foot a:hover { color: var(--cx-ink); }
.cx-foot .cx-support { color: var(--cx-brand); font-weight: 600; }

/* ── pages still on the older templates: the navy page headers no longer
      need the room they left for the old absolutely-positioned nav ── */
.header, .page-header, .passage-header, .dash-header { padding-top: 36px !important; }
.hero-inner { padding-top: 56px !important; }
.header .header-sky, .passage-header .header-sky, .dash-header .header-sky { top: 0; }

@media print { .cx-top, .cx-menu, .cx-foot { display: none !important; } }
