/* theme.css — AviatorEDU's own look, matched to the home page (27 Sep 2026):
   deep navy, champagne gold and warm white. Navy for text and structure, a royal
   blue for links and the active state, gold for the one warm accent (buttons,
   progress, the next step). Red is kept for errors. Loaded after the engine
   styles, so anything here overrides them. Course-owned: tools/update-engine.mjs
   never touches this file. Dark mode keeps the engine's dark theme, with the
   light wordmark. */

html:not([data-theme="dark"]) {
  --navy:#14283a; --navy-dark:#0d1d2c; --navy-light:#1f4e79; --navy-2:#1b3550;
  --gold:#d5b678; --gold-dark:#8f7442; --gold-light:#e2c68f;
  --amber:#d5b678; --green:#2a8a63;
  --paper:#f6f4ef; --cream:#eeebe3; --ink:#172536; --muted:#5d6970;
  --card:#ffffff; --line:#dedbd2;
}

/* ---- the page: warm white, like the home page ----------------------------- */
html:not([data-theme="dark"]) body{ background:#f6f4ef; color:var(--ink); }
html:not([data-theme="dark"]) .topbar{background:rgba(246,244,239,.94);border-bottom-color:#dedbd2;}
html:not([data-theme="dark"]) .course-search input{border-color:#dedbd2;background:#fff;}
html:not([data-theme="dark"]) .course-search input:focus{border-color:#1f4e79;box-shadow:0 0 0 3px rgba(31,78,121,.16);}

/* ---- sidebar: white, navy text, gold marker on the active course ---------- */
html:not([data-theme="dark"]) #sidebar{ background:#ffffff; color:#2a3d50; border-right:1px solid #dedbd2; }
html:not([data-theme="dark"]) #sidebar .brand{border-bottom:1px solid #ece9e1;}
html:not([data-theme="dark"]) #sidebar .brand h1{color:#0d1d2c;}
html:not([data-theme="dark"]) #sidebar .brand p{color:#86672f;}
html:not([data-theme="dark"]) .nav-item{color:#34475a;}
html:not([data-theme="dark"]) .nav-item:hover{background:#f4efe3;color:#0d1d2c;}
html:not([data-theme="dark"]) .nav-item.active{background:#f1e9d7;border-left-color:#d5b678;color:#0d1d2c;}
html:not([data-theme="dark"]) .nav-item .status-dot{background:#d6d2c7;}
html:not([data-theme="dark"]) .nav-group-label{color:#86672f;}
html:not([data-theme="dark"]) .nav-sep{background:#ece9e1;}

/* ---- cards and the Flight Path ------------------------------------------- */
html:not([data-theme="dark"]) .fp-track-card,
html:not([data-theme="dark"]) .fp-stat,
html:not([data-theme="dark"]) .cp-panel,
html:not([data-theme="dark"]) .cp-today,
html:not([data-theme="dark"]) .acct-card{border-radius:14px;box-shadow:0 2px 12px rgba(13,29,44,.05);border-color:#dedbd2;}
html:not([data-theme="dark"]) .fp-track-card:hover{border-color:#d5b678;box-shadow:0 6px 22px rgba(13,29,44,.10);}
html:not([data-theme="dark"]) .fp-phase-num{background:#0d1d2c;color:#d5b678;}
html:not([data-theme="dark"]) .fp-track-pill.ready{background:rgba(31,78,121,.10);color:#1f4e79;}
html:not([data-theme="dark"]) .fp-go-card{
  background:linear-gradient(135deg,#0d1d2c 0%,#1b3550 100%);border-color:rgba(213,182,120,.35);
  box-shadow:0 10px 28px rgba(13,29,44,.25);
}
html:not([data-theme="dark"]) .fp-go-btn{background:#d5b678;color:#0d1d2c;box-shadow:0 3px 0 #8f7442;}
html:not([data-theme="dark"]) .fp-go-btn:hover{background:#e2c68f;}
html:not([data-theme="dark"]) .quiz-submit{background:#d5b678;color:#0d1d2c;box-shadow:0 3px 0 #8f7442;}
html:not([data-theme="dark"]) .quiz-submit:hover{background:#e2c68f;}
html:not([data-theme="dark"]) .lesson-head h3{color:#14283a;}
html:not([data-theme="dark"]) .lesson-body a{color:#1f4e79;}
html:not([data-theme="dark"]) .callout{border-left-color:#d5b678;}

/* ---- the wordmark on dark screens ----------------------------------------- */
html[data-theme="dark"] #sidebar .brand img.logo,
html[data-theme="dark"] #topbar-logo{content:url("images/home/wordmark-light.png");}
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) #sidebar .brand img.logo,
  html:not([data-theme="light"]) #topbar-logo{content:url("images/home/wordmark-light.png");}
}
#topbar-logo{height:34px!important;}

/* dark mode keeps the engine's dark surfaces but uses the home page's softer gold */
html[data-theme="dark"]{ --gold:#d5b678; --gold-dark:#8f7442; --gold-light:#e2c68f; --amber:#d5b678; }

/* ---- landing page: daylight instead of the night hangar ------------------- */
html:not([data-theme="dark"]) .lp-hero{background:linear-gradient(160deg,#dcecfb 0%,#f0f7fe 55%,#ffffff 100%);}
html:not([data-theme="dark"]) .lp-hero-overlay{display:none;}
html:not([data-theme="dark"]) .lp-hero h1{color:#15304d;}
html:not([data-theme="dark"]) .lp-hero-sub{color:#3c5b7c;}
html:not([data-theme="dark"]) .lp-eyebrow{color:#2f7fd1;}
html:not([data-theme="dark"]) .lp-nav-links a{color:#2e4c6b;}
html:not([data-theme="dark"]) .lp-nav-links a:hover{color:#15304d;}
html:not([data-theme="dark"]) .lp-nav-logo{filter:drop-shadow(0 8px 18px rgba(27,58,92,.18));}
html:not([data-theme="dark"]) .lp-btn-ghost{color:#1b3a5c;border-color:#9dbde0;}
html:not([data-theme="dark"]) .lp-btn-ghost:hover{background:#e4f0fb;}
html:not([data-theme="dark"]) .lp-dark{background:linear-gradient(180deg,#e6f2fc 0%,#f4f9fe 100%);}
html:not([data-theme="dark"]) .lp-big-num{color:#2f7fd1;}
html:not([data-theme="dark"]) .lp-big-num-label{color:#5f7a95;}
html:not([data-theme="dark"]) .lp-filter-btn.active{background:#2f7fd1;border-color:#2f7fd1;}
html:not([data-theme="dark"]) .lp-footer{background:#e6f2fc;}
html:not([data-theme="dark"]) .lp-footer-name{color:#15304d;}
html:not([data-theme="dark"]) .lp-footer-tagline{color:#5f7a95;}
html:not([data-theme="dark"]) .lp-footer-top{border-bottom-color:#d8e5f1;}
html:not([data-theme="dark"]) .lp-footer-bottom{color:#6f8aa5;border-top-color:#d8e5f1;}
html:not([data-theme="dark"]) .lp-footer-bottom a{color:#2f7fd1;}

/* Lesson figures: FAA handbook drawings and credited photos */
.lesson-body img.figure{display:block;max-width:100%;height:auto;margin-left:auto;margin-right:auto;background:#fff;}
.lesson-body .figure-cap{text-align:center;}
.lesson-body .figure-cap .credit{display:block;opacity:.8;font-size:.7rem;margin-top:2px;}

/* Story/humor opener at the top of a lesson (18 Oct 2026) */
.lesson-opener{font-size:1.06em;line-height:1.6;font-style:italic;color:var(--ink);border-left:3px solid var(--gold,#d6a43b);padding:2px 0 2px 12px;margin:6px 0 14px;}
/* Keep handbook figures from filling a whole iPad screen (18 Oct 2026) */
img.figure{max-height:560px;width:auto;max-width:100%;object-fit:contain;margin-left:auto;margin-right:auto;display:block;}

/* ---------------------------------------------------------------- doors: ported from the template cpe.css lines 1051-1139, 18 Oct 2026 */
.doors-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;margin:0 0 34px;}
.door-card{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;min-height:118px;padding:16px 16px 14px;
  background:linear-gradient(135deg,#0e2440 0%,#1a3a60 100%);color:#fff;border:1px solid rgba(255,255,255,.08);border-radius:14px;
  cursor:pointer;font:inherit;box-shadow:0 4px 0 #061527;transition:transform .08s,box-shadow .08s;touch-action:manipulation;}
.door-card:hover{transform:translateY(-1px);box-shadow:0 5px 0 #061527,0 10px 24px rgba(7,27,47,.18);}
.door-card:active{transform:translateY(2px);box-shadow:0 2px 0 #061527;}
.door-card.done{background:linear-gradient(135deg,#17513f 0%,#1f745b 100%);box-shadow:0 4px 0 #0f3a2c;}
.door-ic{font-size:1.5rem;line-height:1;}
.door-t{font-family:var(--display,inherit);font-weight:800;font-size:1rem;letter-spacing:-.02em;line-height:1.2;}
.door-n{margin-top:auto;font-size:.74rem;color:var(--gold-light,#f1c968);letter-spacing:.04em;text-transform:uppercase;font-weight:700;}
.door-page{max-width:900px;}
.door-back{background:none;border:none;color:var(--muted,#627080);font:inherit;font-size:.86rem;cursor:pointer;padding:0;margin:0 0 16px;}
.door-back:hover{color:var(--navy,#071b2f);text-decoration:underline;}
.door-head{display:flex;gap:16px;align-items:flex-start;margin:0 0 10px;}
.door-head-ic{font-size:2.2rem;line-height:1;flex-shrink:0;width:60px;height:60px;border-radius:16px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#0e2440 0%,#1a3a60 100%);}
.door-h1{font-family:var(--display,inherit);color:var(--navy,#071b2f);font-size:1.6rem;font-weight:800;letter-spacing:-.03em;margin:4px 0 6px;line-height:1.15;}
.door-lead{font-size:.98rem;line-height:1.55;color:var(--ink,#142332);margin:0 0 6px;max-width:680px;}
.door-count{font-size:.76rem;color:var(--muted,#627080);margin:0;text-transform:uppercase;letter-spacing:.06em;font-weight:700;}
.door-sec{font-family:var(--display,inherit);color:var(--navy,#071b2f);font-size:1.05rem;font-weight:800;letter-spacing:-.02em;margin:28px 0 10px;}
.door-note{font-size:.84rem;color:var(--muted,#627080);margin:-4px 0 10px;line-height:1.5;}
.door-list{display:flex;flex-direction:column;gap:10px;}
.door-course{display:flex;gap:14px;align-items:stretch;background:var(--card,#fff);border:1px solid var(--line,#dbe0e2);border-radius:14px;overflow:hidden;cursor:pointer;
  transition:border-color .12s,box-shadow .12s;}
.door-course:hover{border-color:var(--gold,#d6a43b);box-shadow:0 6px 18px rgba(7,27,47,.08);}
.door-course.done{border-color:rgba(31,116,91,.35);}
.door-thumb{width:132px;flex:0 0 132px;object-fit:cover;background:#dde3e9;min-height:96px;}
.door-thumb.blank{background:linear-gradient(135deg,#0e2440 0%,#1a3a60 100%);display:flex;align-items:center;justify-content:center;font-size:1.8rem;color:#fff;}
.door-course-body{flex:1;min-width:0;padding:12px 14px 12px 0;display:flex;flex-direction:column;gap:4px;}
.door-course-top{display:flex;align-items:center;gap:8px;font-size:.72rem;color:var(--muted,#627080);font-weight:700;letter-spacing:.04em;}
.door-course-tag{background:#eef1f4;color:#4a5a6a;border-radius:6px;padding:2px 7px;font-size:.68rem;text-transform:uppercase;}
.door-course-tag.done{background:#e3f4ec;color:#1f745b;}
.door-course-name{font-family:var(--display,inherit);font-weight:800;font-size:1rem;letter-spacing:-.02em;line-height:1.25;color:var(--navy,#071b2f);}
.door-course-desc{font-size:.84rem;line-height:1.45;color:var(--muted,#627080);}
.door-course-foot{display:flex;align-items:center;gap:12px;margin-top:6px;flex-wrap:wrap;}
.door-course-sub{font-size:.76rem;color:var(--muted,#627080);}
.door-bar.fp-unit-bar{flex:1;min-width:80px;max-width:200px;margin:0;background:#dde3e9;}
.door-course .fp-unit-btn{padding:8px 14px;font-size:.84rem;}
.door-course .fp-unit-btn.ghost{background:#eef1f4;color:var(--navy,#071b2f);border:1px solid var(--line,#dbe0e2);}
.door-course.extra .door-course-body{padding:14px 14px 14px 0;justify-content:center;}
.door-next{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;margin:28px 0 10px;padding:16px 18px;text-align:left;
  background:var(--gold,#d6a43b);color:#0a1c2e;border:none;border-radius:14px;font:inherit;font-weight:800;font-size:1.02rem;cursor:pointer;box-shadow:0 4px 0 #9a6f1f;}
.door-next span{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;opacity:.75;}
.door-next:active{transform:translateY(2px);box-shadow:0 2px 0 #9a6f1f;}
@media (max-width:640px){
  .doors-grid{grid-template-columns:1fr 1fr;gap:10px;}
  .door-card{min-height:104px;padding:14px 12px 12px;}
  .door-t{font-size:.92rem;}
  .door-thumb{width:96px;flex-basis:96px;}
  .door-course-desc{display:none;}
  .door-head{gap:12px;} .door-head-ic{width:48px;height:48px;font-size:1.7rem;} .door-h1{font-size:1.3rem;}
}
/* sidebar: doors and the folded full list */
.nav-item.nav-door{gap:8px;}
.nav-door-ic{width:18px;text-align:center;flex-shrink:0;}
.nav-door-n{margin-left:auto;font-size:.68rem;color:#5a718a;font-weight:700;}
.nav-all-toggle{cursor:pointer;display:flex;align-items:center;gap:6px;user-select:none;}
.nav-all-toggle:hover{color:#9bb5cc;}
.nav-all-chev{font-size:.8rem;}
.nav-all-wrap{list-style:none;margin:0;padding:0;}
.nav-all-wrap.folded{display:none;}
.nav-all-list{list-style:none;margin:0;padding:0;}
/* dark mode */
html[data-theme="dark"] body.in-app .door-course{background:var(--card,#172432);}
html[data-theme="dark"] body.in-app .door-course-tag{background:#243547;color:#b7c6d5;}
html[data-theme="dark"] body.in-app .door-course .fp-unit-btn.ghost{background:#243547;color:#e4ebf2;border-color:#2a3a4b;}
html[data-theme="dark"] body.in-app .door-bar.fp-unit-bar{background:#243547;}
html[data-theme="dark"] body.in-app .door-h1, html[data-theme="dark"] body.in-app .door-sec, html[data-theme="dark"] body.in-app .door-course-name{color:var(--ink,#e4ebf2);}
/* doors: photo cards, progress ring, numbered steps */
.door-card.has-photo{background-size:cover;background-position:center;position:relative;overflow:hidden;border-color:rgba(255,255,255,.14);}
.door-card.has-photo::before{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(7,27,47,.18) 0%,rgba(7,27,47,.62) 55%,rgba(7,27,47,.9) 100%);}
.door-card.has-photo>*{position:relative;z-index:1;}
.door-card.has-photo .door-t{text-shadow:0 1px 3px rgba(0,0,0,.6);}
.door-card.has-photo.done::before{background:linear-gradient(180deg,rgba(23,81,63,.25) 0%,rgba(23,81,63,.7) 55%,rgba(23,81,63,.92) 100%);}
.door-top{display:flex;align-items:center;justify-content:space-between;width:100%;}
.door-ring{width:30px;height:30px;transform:rotate(-90deg);}
.door-ring-bg{fill:none;stroke:rgba(255,255,255,.25);stroke-width:3.5;}
.door-ring-fg{fill:none;stroke:var(--gold-light,#f1c968);stroke-width:3.5;stroke-linecap:round;transition:stroke-dasharray .6s;}
.door-card.done .door-ring-fg{stroke:#9fe0c4;}
.door-card{min-height:150px;}
.door-hero{height:150px;border-radius:16px;background-size:cover;background-position:center;margin:0 0 16px;box-shadow:inset 0 -60px 60px -30px rgba(7,27,47,.55);}
.door-step{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--gold,#d6a43b);color:#0a1c2e;font-size:.8rem;font-weight:800;margin-right:10px;vertical-align:middle;}
@media (max-width:640px){ .door-card{min-height:128px;} .door-hero{height:110px;border-radius:12px;} }
/* doors without the little pictures: the ring sits top-right, the title carries the card */
.door-top{justify-content:flex-end;min-height:30px;}
.door-card{gap:4px;}
.door-card .door-t{margin-top:auto;font-size:1.08rem;}
.door-card .door-n{margin-top:2px;}
/* AviatorEDU: most courses have no thumbnail yet; hide the empty navy block instead of showing 196 blanks (18 Oct 2026) */
.door-course .door-thumb.blank{display:none;}
.door-course .door-course-body{padding-left:16px;}
/* Puzzle doors: one picture across the whole grid, each card a window onto its piece (18 Oct 2026) */
.doors-grid.puzzle{background-size:cover;background-position:center;border-radius:16px;overflow:hidden;gap:0;padding:0;box-shadow:0 10px 30px rgba(7,27,47,.18);}
.doors-grid.puzzle .door-card{background:linear-gradient(180deg,rgba(7,27,47,.08) 0%,rgba(7,27,47,.42) 55%,rgba(7,27,47,.82) 100%);border:2px solid var(--paper,#fbfbf8);border-radius:0;box-shadow:none;transform:none;}
.doors-grid.puzzle .door-card:hover{background:linear-gradient(180deg,rgba(7,27,47,.0) 0%,rgba(7,27,47,.3) 55%,rgba(7,27,47,.75) 100%);transform:none;box-shadow:inset 0 0 0 3px var(--gold,#d6a43b);}
.doors-grid.puzzle .door-card.done{background:linear-gradient(180deg,rgba(23,81,63,.25) 0%,rgba(23,81,63,.6) 55%,rgba(23,81,63,.9) 100%);}
.doors-grid.puzzle .door-card .door-t{text-shadow:0 1px 4px rgba(0,0,0,.7);color:#fff;}
html[data-theme="dark"] body.in-app .doors-grid.puzzle .door-card{border-color:var(--paper,#0f1a26);}
