/* Dark aviation catalog surfaces. Kept separate from lesson and demo UI. */
:root {
  --cp-night: #031321;
  --cp-panel: rgba(3, 25, 43, .88);
  --cp-panel-soft: rgba(3, 30, 51, .76);
  --cp-cyan: #21b9ed;
  --cp-cyan-soft: #8edfff;
  --cp-white: #f4f9ff;
}

html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,
body.technical-catalog {
  color: var(--cp-white) !important;
  background: radial-gradient(ellipse at 78% 28%, rgba(5, 82, 135, .42), transparent 45%),
    linear-gradient(135deg, #020b14, #041b2d 58%, #010a12) !important;
}
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .shell,
body.technical-catalog .shell { color: var(--cp-white); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .top,
body.technical-catalog .top { border-color: rgba(33, 185, 237, .22); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .back,
body.technical-catalog .back { color: #a9d9ef; }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .eyebrow,
body.technical-catalog .eyebrow { color: var(--cp-cyan-soft); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) h1,
body.technical-catalog h1 { color: #f4f9ff; text-shadow: 0 0 24px rgba(33,185,237,.18); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) header p,
body.technical-catalog header p { color: #c3d8e6; }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .card,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .empty,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .article-card,
body.technical-catalog .card,
body.technical-catalog .empty,
body.technical-catalog .article-card {
  color: var(--cp-white);
  background: linear-gradient(145deg, rgba(4, 39, 64, .88), rgba(2, 19, 34, .91));
  border: 1px solid rgba(33, 185, 237, .7);
  box-shadow: 0 0 0 1px rgba(33,185,237,.08), 0 16px 42px rgba(0,0,0,.3), inset 0 1px 20px rgba(24,131,189,.08);
}
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .card:hover,
body.technical-catalog .card:hover { border-color: #55d2ff; box-shadow: 0 0 24px rgba(33,185,237,.25); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .card h2,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .article-title,
body.technical-catalog .card h2,
body.technical-catalog .article-title { color: #f4f9ff; }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .card p,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .article-note,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .empty p,
body.technical-catalog .card p,
body.technical-catalog .article-note,
body.technical-catalog .empty p { color: #c5d9e7; }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .number,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .go,
body.technical-catalog .number,
body.technical-catalog .go { color: var(--cp-cyan); }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .action,
body.technical-catalog .action { color: #031321; background: linear-gradient(135deg,#4bd0ff,#1499d0); font-weight: 750; }
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) footer,
body.technical-catalog footer { color: #a9c3d4; border-color: rgba(33,185,237,.22); }

/* Technical landing itself, while retaining the existing logo and course cards. */
body.technical-catalog .card { min-height: 285px; }
body.technical-catalog .card h2 { font-size: clamp(23px, 2.4vw, 32px); }
body.technical-catalog .card .course-choice-art { border: 1px solid rgba(142,223,255,.58); border-radius: 13px; }

/* Aviation English catalog home and ICAO 3–6 overview pages only. */
body.night-section[data-view="home"],
body.night-section[data-view="level3"],
body.night-section[data-view="level4"],
body.night-section[data-view="level5"],
body.night-section[data-view="level6"] {
  color: var(--cp-white) !important;
  background: radial-gradient(ellipse at 78% 30%, rgba(5, 82, 135, .38), transparent 45%),
    linear-gradient(135deg, #020b14, #041b2d 58%, #010a12) !important;
}
body.night-section[data-view="home"] .top,
body.night-section[data-view^="level"] .top { border-color: rgba(33,185,237,.22); }
body.night-section[data-view="home"] .back,
body.night-section[data-view^="level"] .back { color: #a9d9ef; }
body.night-section[data-view="home"] #page-header,
body.night-section[data-view^="level"] #page-header { color: var(--cp-white); }
body.night-section[data-view="home"] .eyebrow,
body.night-section[data-view^="level"] .eyebrow { color: var(--cp-cyan-soft); }
body.night-section[data-view="home"] #intro,
body.night-section[data-view^="level"] #intro { color: #c5d9e7; }
body.night-section[data-view="home"] .level-option,
body.night-section[data-view="home"] .routes-link,
body.night-section[data-view="home"] .article-card,
body.night-section[data-view^="level"] .level-intro,
body.night-section[data-view^="level"] .level-course-actions,
body.night-section[data-view^="level"] .article-card,
body.night-section[data-view^="level"] .empty,
body.night-section[data-view^="level"] .lesson-section,
body.night-section[data-view^="level"] .route-grid .card,
body.night-section[data-view^="level"] #content > section:not(.level-intro) {
  color: var(--cp-white);
  background: linear-gradient(145deg, var(--cp-panel), var(--cp-panel-soft));
  border: 1px solid rgba(33,185,237,.72);
  box-shadow: 0 0 0 1px rgba(33,185,237,.08), 0 16px 42px rgba(0,0,0,.3), inset 0 1px 20px rgba(24,131,189,.08);
}
body.night-section[data-view="home"] .level-option:hover,
body.night-section[data-view^="level"] .card:hover { border-color: #55d2ff; box-shadow: 0 0 24px rgba(33,185,237,.25); }
body.night-section[data-view="home"] .level-option h2,
body.night-section[data-view="home"] .routes-link h2,
body.night-section[data-view="home"] .article-title,
body.night-section[data-view^="level"] .level-intro h2,
body.night-section[data-view^="level"] .article-title,
body.night-section[data-view^="level"] #content h2,
body.night-section[data-view^="level"] #content h3 { color: #f4f9ff; }
body.night-section[data-view="home"] .level-option p,
body.night-section[data-view="home"] .routes-link p,
body.night-section[data-view="home"] .article-note,
body.night-section[data-view^="level"] #content p,
body.night-section[data-view^="level"] .article-note,
body.night-section[data-view^="level"] .prose,
body.night-section[data-view^="level"] .intro-translation { color: #c5d9e7; }
body.night-section[data-view="home"] .go,
body.night-section[data-view^="level"] .go { color: var(--cp-cyan); }
body.night-section[data-view="home"] .routes-link,
body.night-section[data-view="home"] .article-card,
body.night-section[data-view^="level"] .article-card { border-radius: 20px; }
body.night-section[data-view="home"] .article-card summary::after,
body.night-section[data-view^="level"] .article-card summary::after { color: var(--cp-cyan); }
body.night-section[data-view^="level"] .level-unified { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(22px,4vw,52px); max-width: none; padding: clamp(24px,4vw,42px); border-radius: 22px; }
body.night-section[data-view^="level"] .level-unified > img { width: 100%; height: auto; max-height: 430px; object-fit: cover; border: 1px solid rgba(87,210,255,.68); border-radius: 20px; }
body.night-section[data-view^="level"] .level-course-actions { padding: clamp(20px,3vw,32px); border-radius: 20px; }
body.night-section[data-view^="level"] .action { color: #031321; background: linear-gradient(135deg,#4bd0ff,#1499d0); border: 1px solid #57d2ff; font-weight: 750; }
body.night-section[data-view^="level"] .action.secondary,
body.night-section[data-view^="level"] .demo-link { color: #e9f8ff; background: rgba(4,29,48,.72); border: 2px solid var(--cp-cyan); }
body.night-section[data-view^="level"] blockquote { color: #eaf7ff; background: rgba(13,82,119,.34); border-color: var(--cp-cyan); }
body.night-section[data-view^="level"] footer { color: #a9c3d4; border-color: rgba(33,185,237,.22); }
body.night-section[data-view="home"] footer { color: #a9c3d4; border-color: rgba(33,185,237,.22); }

@media (max-width: 760px) {
  body.night-section[data-view^="level"] .level-unified { grid-template-columns: 1fr; }
  body.night-section[data-view^="level"] .level-unified > img { order: -1; max-height: 310px; }
}
/* Remove the legacy light sky image overlay on the dark catalog surfaces. */
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body::before,
body.technical-catalog::before,
body.night-section[data-view="home"]::before,
body.night-section[data-view="level3"]::before,
body.night-section[data-view="level4"]::before,
body.night-section[data-view="level5"]::before,
body.night-section[data-view="level6"]::before {
  content: none !important;
  display: none !important;
  background: none !important;
}
/* High-specificity readable foreground for the catalog pages. */
body.technical-catalog,
body.technical-catalog .shell,
body.technical-catalog main,
body.technical-catalog header,
body.technical-catalog header h1,
body.technical-catalog header p,
body.technical-catalog .card h2,
body.technical-catalog .article-title { color: #f4f9ff !important; }
body.technical-catalog header p,
body.technical-catalog .card p,
body.technical-catalog .article-note,
body.technical-catalog .empty p { color: #d4e7f3 !important; }
body.technical-catalog .eyebrow,
body.technical-catalog .number,
body.technical-catalog .go { color: #55d2ff !important; }
body.technical-catalog .back,
body.technical-catalog .top a:not(.brand),
body.technical-catalog footer,
body.technical-catalog footer a { color: #c8e9f8 !important; }
body.night-section[data-view="home"] #page-header,
body.night-section[data-view^="level"] #page-header,
body.night-section[data-view="home"] #page-header h1,
body.night-section[data-view^="level"] #page-header h1,
body.night-section[data-view="home"] #content h1,
body.night-section[data-view^="level"] #content h1,
body.night-section[data-view="home"] #content h2,
body.night-section[data-view^="level"] #content h2,
body.night-section[data-view="home"] #content h3,
body.night-section[data-view^="level"] #content h3,
body.night-section[data-view="home"] #content strong,
body.night-section[data-view^="level"] #content strong { color: #f4f9ff !important; }
body.night-section[data-view="home"] #page-header p,
body.night-section[data-view^="level"] #page-header p,
body.night-section[data-view="home"] #content p,
body.night-section[data-view^="level"] #content p,
body.night-section[data-view="home"] #content li,
body.night-section[data-view^="level"] #content li,
body.night-section[data-view="home"] #content summary,
body.night-section[data-view^="level"] #content summary { color: #d4e7f3 !important; }
body.night-section[data-view="home"] .back,
body.night-section[data-view^="level"] .back,
body.night-section[data-view="home"] footer a,
body.night-section[data-view^="level"] footer a { color: #c8e9f8 !important; }
body.night-section[data-view^="level"] .action { color: #031321 !important; }
body.night-section[data-view^="level"] .action.secondary,
body.night-section[data-view^="level"] .demo-link { color: #e9f8ff !important; }
/* r4: force readable foreground on level overview content and navigation */
body.night-section #page-header h1,
body.night-section #page-header .eyebrow,
body.night-section #page-header p,
body.night-section .level-unified h1,
body.night-section .level-unified h2,
body.night-section .level-unified p,
body.night-section .level-unified .level3-copy,
body.night-section .level-course-actions,
body.night-section .level-course-actions p,
body.night-section .level-course-actions a,
body.night-section .top .cabinet,
body.night-section .top a:not(.brand),
body.night-section #footer-home {
  color: #f4f9ff !important;
}
body.night-section #page-header .eyebrow { color: #8edfff !important; }
body.night-section #page-header p,
body.night-section .level-unified p { color: #d4e7f3 !important; }
body.night-section .site-logo { filter: none !important; }

/* r5: keep light intro badges readable while retaining the night theme. */
body.night-section[data-view="home"] #page-header #intro {
  display: inline-block !important;
  color: #08283a !important;
  background: #e8f5fb !important;
  border: 1px solid #8edfff !important;
  border-radius: 12px !important;
  padding: 10px 18px !important;
  text-shadow: none !important;
}
body.night-section[data-view="level6"] #page-header #intro {
  display: block !important;
  color: #e4f2fb !important;
  background: linear-gradient(145deg, rgba(3,25,43,.94), rgba(3,30,51,.88)) !important;
  border: 1px solid rgba(33,185,237,.72) !important;
  border-radius: 16px !important;
  padding: 18px 22px !important;
  text-shadow: none !important;
}

/* Light criteria header inside the dark catalog. */
body.night-section[data-view^="level"] #content :is(.cp-criteria, .readable-story) > summary :is(.article-title, .article-note) {
  color: #173d55 !important;
}

body.night-section[data-view="demos"] .cp-legal-notice :is(p, a) {
  color: #c5d9e7;
}

body.night-section:is([data-view="home"], [data-view^="level"], [data-view="demos"]) img.site-logo,
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) img.site-logo,
body.technical-catalog img.site-logo,
body:has(#workflow-view[data-technical-folder]) img.site-logo {
  content: url("/captain-position-logo-white-red-e2df471f8b.svg");
  filter: none !important;
}


body.night-section[data-view^=level] #content .readable-story summary .article-read-cta { color: #fff !important; background: #176d88 !important; }

html:is([data-course-key=job],[data-course-key=everyday]) body::before { content: none !important; }
html:is([data-course-key=job],[data-course-key=everyday]) #intro { color: #f4f9ff !important; background: #0b2940 !important; }
html:is([data-course-key=job],[data-course-key=everyday]) :is(.topics,.cp-legal-notice p,.cp-legal-notice a) { color: #a9dfff !important; }
html:is([data-course-key=job],[data-course-key=everyday]) a:focus-visible { outline: 3px solid #8edfff; outline-offset: 4px; }

/* Article and course panels within the dark catalog. */
body.night-section[data-view^="level"] #content :is(
  .cp-tab, .cp-term, .cp-note, .cp-breakdown > *, .cp-criteria-list > *,
  .cp-copy-helper, .cp-expert-intro, .cp-expert-link, .cp-faq,
  .cp-expert-intro .cp-lead, .readable-story > summary, .cp-criteria > summary
),
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body :is(.course-description, .demo-message, .access-message),
body.technical-catalog :is(#technical-content, #lesson-empty, .demo-message, .access-message) {
  background: rgba(12, 49, 75, .82) !important;
  border-color: rgba(85, 210, 255, .45);
  color: #eaf6ff !important;
}

body.night-section[data-view^="level"] #content :is(
  .cp-tab strong, .cp-tab span, .cp-note summary, .cp-note p, .cp-note strong,
  .cp-expert-link strong, .cp-expert-link span, .cp-expert-intro .cp-lead,
  .cp-faq p, .cp-faq summary, .cp-criteria-list dt, .cp-criteria-list dd,
  .readable-story > summary .article-title, .readable-story > summary .article-note,
  .cp-criteria > summary .article-title, .cp-criteria > summary .article-note
),
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .course-description :is(h2,h3,p,li,strong),
body.technical-catalog :is(.demo-message, .access-message) :is(h2,p,strong) {
  color: #eaf6ff !important;
}

body.night-section[data-view^="level"] #content :is(.cp-faq a,.cp-source,.cp-term,.go),
html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) .course-description a {
  color: #8edfff !important;
}

body.night-section[data-view^="level"] #content :is(
  .cp-tab[aria-selected="true"], .cp-tab:hover, .cp-term:hover,
  .cp-term[aria-expanded="true"], .cp-expert-link:hover
) {
  background: #165071 !important;
  border-color: #55d2ff;
}

body.night-section[data-view^="level"] #content :is(.cp-tab,.cp-term,.cp-expert-link,summary):focus-visible {
  outline: 3px solid #8edfff;
  outline-offset: 3px;
}


html[data-course-key=technical] body #intro { background: #0b2940 !important; color: #eaf6ff !important; }

/* Shared surfaces and contrast for the dark course catalogs. */
:is(
  body.night-section:is([data-view="home"],[data-view="demos"],[data-view^="level"]),
  html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,
  body.technical-catalog,
  body:has(.access-message a[href^="/teacher/login/"])
) {
  --cp-text-panel: rgba(10, 42, 66, .85);
  --cp-text-primary: #f4f9ff;
  --cp-text-secondary: #d4e7f3;
  --cp-text-accent: #8edfff;
}
:is(body.night-section:is([data-view="home"],[data-view="demos"],[data-view^="level"]),html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,body.technical-catalog,body:has(.access-message a[href^="/teacher/login/"]))
:is(#page-header, main > header, .course-description, .cp-legal-notice, .demo-results, .demo-hub-body, .prose) {
  background: var(--cp-text-panel) !important;
  color: var(--cp-text-primary);
  border-radius: 16px;
  padding: clamp(12px, 2vw, 24px);
}
:is(body.night-section:is([data-view="home"],[data-view="demos"],[data-view^="level"]),html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,body.technical-catalog,body:has(.access-message a[href^="/teacher/login/"]))
:is(#page-header, main > header, .course-description, .cp-legal-notice, .prose)
:is(h1,h2,h3,p,li,dd) {
  color: var(--cp-text-primary) !important;
}
:is(body.night-section:is([data-view="home"],[data-view="demos"],[data-view^="level"]),html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,body.technical-catalog,body:has(.access-message a[href^="/teacher/login/"]))
:is(.cp-legal-notice a, .prose a:not(.action), .eyebrow, .go) {
  color: var(--cp-text-accent) !important;
}
:is(body.night-section:is([data-view="home"],[data-view="demos"],[data-view^="level"]),html:is([data-course-key="technical"],[data-course-key="job"],[data-course-key="everyday"]) body,body.technical-catalog,body:has(.access-message a[href^="/teacher/login/"])) img.site-logo {
  content: url("/captain-position-logo-white-red-e2df471f8b.svg");
  filter: none !important;
}

