/* ==========================================================================================
   deliverance.css — the "Demons & Deliverance" course page            (made 2026-10-06)
   Look: "Midnight & Gold" (owner's answer A2) + a "Parchment" light theme (🌗 button).
   Colours live in the two token blocks of §1 only; everything else uses var(--…).
   ------------------------------------------------------------------------------------------
   §1 tokens  §2 base  §3 top bar  §4 hero  §5 buttons  §6 player  §7 tools  §8 notes
   §9 start here  §10 lessons  §11 about / related / footer  §12 dialog  §13 small screens  §14 print
   NOTE: the shared site menu (/css/expanding_menu_php.css) styles .sidenav .collapsible .active
         .content .closebtn .phpmenu and body's font — never use those class names here.
   ========================================================================================== */

/* ---------- §1 TOKENS ---------- */
:root, :root[data-theme="dark"] {
    --bg:          #0b1322;
    --bg-deep:     #070d18;
    --surface:     #111c2f;
    --surface-2:   #17243b;
    --line:        rgba(217, 181, 90, .24);
    --line-strong: rgba(217, 181, 90, .55);
    --gold:        #d9b55a;
    --gold-strong: #f2d283;
    --gold-ink:    #1b1405;
    --text:        #efe7d6;
    --muted:       #b9ae95;
    --accent:      #c0563a;
    --tint:        rgba(217, 181, 90, .10);
    --shadow:      0 14px 40px rgba(0, 0, 0, .45);
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg:          #f5eedf;
    --bg-deep:     #eadfc8;
    --surface:     #fffaf0;
    --surface-2:   #f7efdd;
    --line:        rgba(122, 90, 20, .22);
    --line-strong: rgba(122, 90, 20, .5);
    --gold:        #8a6512;
    --gold-strong: #6b4c08;
    --gold-ink:    #fffaf0;
    --text:        #2a2115;
    --muted:       #6b5d45;
    --accent:      #a8432a;
    --tint:        rgba(138, 101, 18, .09);
    --shadow:      0 12px 32px rgba(80, 60, 20, .16);
    color-scheme: light;
}

/* ---------- §2 BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden]               { display: none !important; }
html                   { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg) radial-gradient(ellipse 120% 60% at 50% -10%, var(--bg-deep), var(--bg) 70%) no-repeat;
    color: var(--text);
    font: 400 1.0625rem/1.6 "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow-wrap: break-word;
}
h1, h2, h3, h4         { font-family: "Cinzel", Georgia, "Times New Roman", serif; line-height: 1.2; color: var(--gold-strong); }
h2                     { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin: 0 0 .5rem; }
h3                     { font-size: 1.25rem; }
a                      { color: var(--gold-strong); }
a:hover                { color: var(--text); }
img                    { max-width: 100%; height: auto; }
:focus-visible         { outline: 3px solid var(--gold-strong); outline-offset: 2px; border-radius: 6px; }
main                   { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section                { scroll-margin-top: 64px; }
.section-note          { color: var(--muted); margin: 0 0 1rem; }
.skip-link             { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus       { left: 12px; }
.problems              { background: #5a1d14; color: #fff; padding: 12px 16px; border-radius: 10px; margin: 16px 0; }
.problems a            { color: #ffe7a8; }

/* ---------- §3 TOP BAR ---------- */
.topbar {
    position: sticky; top: 0; z-index: 5;          /* the site menu (z-index 10) opens above it */
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    background: rgba(11, 19, 34, .86);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
:root[data-theme="light"] .topbar { background: rgba(245, 238, 223, .9); }
.topbar-space          { flex: 1; }
.topbar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 6px 14px;
    background: transparent; color: var(--text); font: inherit; font-weight: 700; text-decoration: none;
    border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.topbar-btn:hover      { border-color: var(--gold); color: var(--gold-strong); }

/* ---------- §4 HERO ---------- */
.hero {
    max-width: 1180px; margin: 0 auto; padding: 24px 16px 8px;
    display: grid; gap: 22px; align-items: center;
}
.hero-picture img {
    display: block; width: 100%; border-radius: 16px;
    border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.eyebrow               { margin: 0; color: var(--gold); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: .82rem; }
.hero h1 {
    margin: .2rem 0 .3rem;
    font-size: clamp(2.3rem, 7vw, 4.1rem); font-weight: 700; letter-spacing: .02em;
    color: var(--gold-strong);
    background: linear-gradient(180deg, var(--gold-strong) 20%, var(--gold) 90%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.subtitle              { margin: 0 0 .8rem; font-size: 1.2rem; color: var(--text); }
.facts                 { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1rem; padding: 0; }
.facts span            { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; color: var(--muted); font-size: .92rem; background: var(--tint); }
.lead                  { margin: 0 0 1.2rem; font-size: 1.12rem; max-width: 36em; }
.hero-actions          { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- §5 BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 10px 20px;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
    border-radius: 999px; border: 1px solid var(--line-strong);
}
.btn-gold              { background: linear-gradient(180deg, var(--gold-strong), var(--gold)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(217, 181, 90, .25); }
.btn-gold:hover        { filter: brightness(1.07); color: var(--gold-ink); }
.btn-ghost             { background: transparent; color: var(--text); }
.btn-ghost:hover       { border-color: var(--gold); color: var(--gold-strong); }

/* ---------- §6 PLAYER ---------- */
.player-card {
    margin: 18px 0 34px; padding: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    scroll-margin-top: 64px;
}
.player-card:focus     { outline: none; }
.now                   { margin-bottom: 10px; }
.now-series            { margin: 0; color: var(--gold); font-weight: 700; font-size: .92rem; letter-spacing: .04em; }
.now-title             { margin: 2px 0 0; font-size: clamp(1.3rem, 3.2vw, 1.75rem); }
.player-frame {
    position: relative; aspect-ratio: 16 / 9; width: 100%;
    background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
}
.player-frame video, .player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.yt-box                { position: absolute; inset: 0; }
.yt-cover {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 18px; text-align: center; color: #f4ecda;
    background: linear-gradient(rgba(7, 13, 24, .78), rgba(7, 13, 24, .88)), url("../images/hero_640.jpg") center / cover;
}
.yt-note               { margin: 0; max-width: 34em; font-size: .98rem; }
.now-desc              { margin: 12px 0 10px; color: var(--muted); }
.now-desc.is-error     { color: #ffb4a3; }

/* ---------- §7 TOOLS ---------- */
.tools                 { display: flex; flex-wrap: wrap; gap: 8px; }
.tool {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 6px 13px;
    background: var(--surface-2); color: var(--text);
    font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none; line-height: 1;
    border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.tool:hover            { border-color: var(--gold); color: var(--gold-strong); }
.tool[aria-pressed="true"], .tool[aria-checked="true"], .tool[aria-expanded="true"] {
    background: var(--gold); color: var(--gold-ink); border-color: var(--gold);
}
.tool:disabled         { opacity: .4; cursor: not-allowed; }
.switch {
    position: relative; display: inline-block; width: 30px; height: 17px;
    border-radius: 999px; background: var(--bg-deep); border: 1px solid var(--line-strong);
}
.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--muted); transition: transform .15s ease;
}
.tool[aria-checked="true"] .switch           { background: var(--gold-ink); }
.tool[aria-checked="true"] .switch::after    { transform: translateX(13px); background: var(--gold-strong); }
@media (hover: none) and (pointer: coarse) { .tool-keys { display: none; } }

/* ---------- §8 NOTES ---------- */
.notes-panel           { margin-top: 16px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.notes-head            { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notes-head h3         { margin: 0; }
.notes-label           { color: var(--muted); font-size: .92rem; margin: 8px 0 12px; }
.notes-body            { max-width: 72ch; }
.notes-body h3, .notes-body h4 { margin: 1.4em 0 .4em; color: var(--gold-strong); }
.notes-body h4         { font-size: 1.08rem; }
.notes-body p          { margin: 0 0 .9em; }
.notes-body ul, .notes-body ol { padding-left: 1.4em; }
.notes-body blockquote { margin: 1em 0; padding: .2em 1em; border-left: 3px solid var(--gold); color: var(--muted); }
.notes-print-title, .notes-print-source { display: none; }

/* ---------- §9 START HERE ---------- */
.start-here            { margin: 0 0 36px; }
.overviews             { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.overview {
    display: flex; flex-direction: column; text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.overview:hover        { border-color: var(--gold); color: var(--text); }
.overview-pic          { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; }
.overview-pic img      { display: block; width: 100%; height: 100%; object-fit: cover; }
.play-badge {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(7, 13, 24, .72); border: 2px solid var(--gold-strong); color: var(--gold-strong); font-size: 1.4rem;
}
.overview-text         { display: block; padding: 10px 14px 12px; }
.overview-title        { display: block; font-weight: 700; font-size: 1.08rem; }
.overview-desc         { display: block; color: var(--muted); font-size: .92rem; }
.overview.is-current   { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }

/* ---------- §10 LESSONS ---------- */
.lessons               { margin: 0 0 40px; }
.tabs                  { display: flex; gap: 8px; margin: 10px 0 16px; border-bottom: 1px solid var(--line); }
.tab {
    flex: 1 1 0; min-height: 52px; padding: 8px 12px;
    background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
    border: 1px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0;
}
.tab small             { display: block; font-weight: 400; font-size: .82rem; }
.tab[aria-selected="true"] { color: var(--gold-ink); background: var(--gold); }
.tab:hover:not([aria-selected="true"]) { color: var(--gold-strong); border-color: var(--line); }
.no-js .tabs           { display: none; }
.series-name           { margin: 0 0 .3rem; font-size: 1.2rem; }
.series + .series      { margin-top: 28px; }
.js .series + .series  { margin-top: 0; }
.lesson-list           { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lesson                { border-bottom: 1px solid var(--line); }
.lesson-link {
    display: grid; grid-template-columns: 2.6em 1fr auto; gap: 4px 14px; align-items: center;
    padding: 12px 8px; color: var(--text); text-decoration: none; border-radius: 10px;
}
.lesson-link:hover     { background: var(--tint); color: var(--text); }
.lesson-num {
    width: 2.3em; height: 2.3em; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong); color: var(--gold-strong); font-weight: 700; font-variant-numeric: tabular-nums;
}
.lesson-text           { min-width: 0; }
.lesson-title          { display: block; font-weight: 700; font-size: 1.04rem; }
.lesson-desc           { display: block; color: var(--muted); font-size: .93rem; margin-top: 2px; }
.lesson-len            { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag                   { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.lesson.is-current .lesson-link { background: var(--tint); box-shadow: 0 0 0 1px var(--line-strong) inset; }
.lesson.is-current .lesson-num  { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.lesson.is-current .lesson-len::before { content: "▶ "; color: var(--gold-strong); }

/* ---------- §11 ABOUT / RELATED / FOOTER ---------- */
.about, .related       { margin: 0 0 36px; }
.about p               { max-width: 70ch; }
.cards                 { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.card {
    display: flex; gap: 12px; align-items: center; height: 100%;
    padding: 12px 14px; color: var(--text); text-decoration: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.card:hover            { border-color: var(--gold); color: var(--text); }
.card-emoji            { font-size: 1.7rem; line-height: 1; }
.card-title            { display: block; font-weight: 700; }
.card-desc             { display: block; color: var(--muted); font-size: .9rem; }
.footer                { text-align: center; padding: 26px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); }
.footer a              { font-weight: 700; }
.footer .small         { font-size: .88rem; }

/* ---------- §12 KEYS DIALOG ---------- */
.keys {
    max-width: min(420px, calc(100% - 32px)); padding: 20px 24px;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow);
}
.keys::backdrop        { background: rgba(0, 0, 0, .6); }
.keys h2               { font-size: 1.3rem; }
.keys dl               { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.keys dt               { font-weight: 700; color: var(--gold-strong); white-space: nowrap; }
.keys dd               { margin: 0; }

/* ---------- §13 SMALL AND LARGE SCREENS ---------- */
@media (min-width: 900px) {
    .hero              { grid-template-columns: 1.1fr 1fr; gap: 40px; padding-top: 34px; }
}
@media (max-width: 560px) {
    body               { font-size: 1rem; }
    .topbar            { padding: 6px 12px; }
    .player-card       { padding: 12px; margin-left: -4px; margin-right: -4px; border-radius: 14px; }
    #btn-prev span, #btn-next span, #btn-cc span, #dl-video span, #dl-audio span { display: none; }
    #dl-video::after   { content: "MP4"; }
    #dl-audio::after   { content: "MP3"; }
    .tool              { padding: 6px 11px; }
    .lesson-link       { grid-template-columns: 2.4em 1fr; }
    .lesson-len        { grid-column: 2; }
    .btn               { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    html               { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}

/* ---------- §14 PRINT (🖨 prints the open lesson notes only) ---------- */
@media print {
    @page              { margin: 18mm 16mm; }
    body               { background: #fff; color: #000; font: 11.5pt/1.5 Georgia, "Times New Roman", serif; }
    body > *           { display: none !important; }
    body > main        { display: block !important; max-width: none; padding: 0; }
    main > *           { display: none !important; }
    main > .player-card { display: block !important; border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
    .player-card > *   { display: none !important; }
    .player-card > .notes-panel { display: block !important; border: 0; background: none; padding: 0; margin: 0; }
    .notes-head button, .notes-label { display: none !important; }
    .notes-head h3     { font-size: 10pt; color: #555; font-family: inherit; }
    .notes-print-title { display: block; font: 700 18pt/1.25 Georgia, serif; margin: 4pt 0 12pt; color: #000; }
    .notes-print-source { display: block; margin-top: 16pt; padding-top: 6pt; border-top: 1px solid #999; font-size: 9pt; color: #555; }
    .notes-body        { max-width: none; }
    .notes-body h3, .notes-body h4 { color: #000; page-break-after: avoid; }
    .notes-body p      { orphans: 3; widows: 3; }
}
