/* Two solid palettes; header and footer stay black in either mode. */
:root, :root[data-theme="light"] {
    color-scheme: light;
    --page: #f2f2f2;
    --section: #eaeaea;
    --surface: #fafafa;
    --surface-muted: #ebebeb;
    --ink: #272727;
    --muted: #666666;
    --line: #dcdcdc;
    --accent: #2459b8;
    --accent-hover: #1d4694;
    --on-accent: #fff;
    --hero-panel: rgba(250,250,250,.92);
    --hero-overlay: rgba(0,0,0,.4);
    --color-bg-light: var(--surface);
    --color-bg-medium: var(--surface-muted);
    --color-text-primary: var(--ink);
    --color-text-secondary: var(--muted);
    --color-accent: var(--accent);
    --color-header-bg: #000;
    --shadow-soft: 0 8px 24px rgba(0,0,0,.06);
    --shadow-medium: 0 14px 36px rgba(0,0,0,.12);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #1b1b1b;
    --section: #222222;
    --surface: #2b2b2b;
    --surface-muted: #353535;
    --ink: #eeeeee;
    --muted: #bcbcbc;
    --line: #484848;
    --accent: #97baff;
    --accent-hover: #bed3ff;
    --on-accent: #101e38;
    --hero-panel: rgba(38,38,38,.94);
    --hero-overlay: rgba(0,0,0,.4);
    --shadow-soft: 0 8px 24px rgba(0,0,0,.14);
    --shadow-medium: 0 14px 36px rgba(0,0,0,.22);
}
:root[data-theme] body { background: var(--page); color: var(--ink); }
:root[data-theme] header, :root[data-theme] footer { background: #000; color: #fff; }
:root[data-theme] .footer-contacts { background: #111; border-color: #292929; }
:root[data-theme] footer :is(h3,h4) { color: #fff; }
:root[data-theme] footer p { color: #bcbcbc; }
.header-actions { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; min-width: 0; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 44px; min-height: 44px; padding: .5rem .8rem; border: 1px solid #444; border-radius: 999px; background: #161616; color: #fff; font: inherit; font-size: .8rem; white-space: nowrap; cursor: pointer; }
.theme-toggle:hover { background: #292929; border-color: #777; }
.theme-icon { font-size: 1.2rem; line-height: 1; }
:root[data-theme] main > section:not(.hero) { background: var(--page); }
:root[data-theme] main > section:nth-child(odd):not(.hero) { background: var(--section); }
:root[data-theme] :is(.campus-item,.dorm-item,.column,.benefit-item,.benefit-info,.program-card,.direction-card,.step-item,.testimonials-container,.about-content,.quote-content,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.news-card,.modal-news-card,.testimonial-card) {
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-soft);
}
:root[data-theme] main :is(h1,h2,h3,h4) { color: var(--ink); }
:root[data-theme] main :is(.news-card,.campus-item,.dorm-item,.column,.benefit-item,.benefit-info,.about-content,.quote-content,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item) :is(p,li) { color: var(--muted); }
:root[data-theme] :is(.info-value,.testimonials-label,.submission-label,.testimonial-icon) { color: var(--accent); }
:root[data-theme] .hero-content {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 48px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.12);
}
:root[data-theme] .hero :is(h1,h2,h3,p) { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
:root[data-theme] :is(.modal-content,.news-modal-content,.full-news-modal-content,.gallery-modal-content,.gallery-viewer-modal-content,.news-submission-dialog) { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-theme] :is(.full-news-title,.full-news-text,.news-submission-panel h2) { color: var(--ink); }
:root[data-theme] :is(.full-news-date,.submission-intro,.submission-media p,.submission-privacy,.submission-footnote,.submission-file-list,.gallery-viewer-caption,.testimonials-text) { color: var(--muted); }
:root[data-theme] :is(.tab-buttons,.tabs-container,.benefit-tabs,.testimonials-tabs,.testimonial-avatar,.testimonial-tag,.submission-close,.news-modal-close,.full-news-modal-close,.full-news-image) { background: var(--surface-muted); color: var(--ink); border-color: var(--line); box-shadow: none; }
:root[data-theme] :is(.tab-button,.tab-btn,.testimonials-theme-btn) { color: var(--muted); }
:root[data-theme] :is(.tab-button,.tab-btn,.testimonials-theme-btn).active { background: var(--accent); color: var(--on-accent); box-shadow: none; }
:root[data-theme] .faculty-text { background: var(--hero-panel); border-color: var(--line); }
:root[data-theme] .faculty-text :is(h1,h3,p) { color: var(--ink); }
:root[data-theme] .faculty-text h1 { background: var(--surface-muted); border-color: var(--line); }
:root[data-theme] :is(.gallery-caption,.lab-video-link), :root[data-theme] .gallery-slide:has(.lab-video) .gallery-caption { background: var(--hero-panel); color: var(--ink); }
:root[data-theme] :is(.hero-cta,.news-read-more,.news-all-button,.gallery-all-button,.submit-news-button,.lab-video-play,.preparatory-cta,.expand-btn) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: none; }
:root[data-theme] :is(.hero-cta,.news-read-more,.news-all-button,.gallery-all-button,.submit-news-button,.lab-video-play,.preparatory-cta):hover { background: var(--accent-hover); color: var(--on-accent); }
:root[data-theme] #news-submission-form :is(input:not([type="hidden"]),textarea) { background: var(--surface-muted); color: var(--ink); border-color: var(--line); }
:root[data-theme] #news-submission-form :is(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
:root[data-theme] .submission-media { border-color: var(--line); }
:root[data-theme] .submission-status { color: #b83a35; }
:root[data-theme="dark"] .submission-status { color: #ffa69c; }
:root[data-theme] .section-title::after { background: var(--accent); }
:root[data-theme] :focus-visible { outline-color: var(--accent); }
@media (hover: hover) {
    :root[data-theme] :is(.campus-item,.dorm-item,.column,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.benefit-item,.benefit-info,.news-card,.modal-news-card):hover {
        background: var(--surface-muted); color: var(--ink); border-color: var(--accent); box-shadow: var(--shadow-medium);
    }
    :root[data-theme] :is(.campus-item,.dorm-item,.column,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.benefit-item,.benefit-info,.news-card,.modal-news-card):hover :is(h3,h4) { color: var(--accent); }
    :root[data-theme] :is(.campus-item,.dorm-item,.column,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.benefit-item,.benefit-info,.news-card,.modal-news-card):hover :is(p,li,.info-note) { color: var(--muted); }
    :root[data-theme] .faculty .campus-item:hover .faculty-text { background: var(--hero-panel); }
    :root[data-theme] .faculty .campus-item:hover .faculty-text :is(h1,p) { color: var(--ink); }
}
@media (min-width: 1401px) { .theme-label { display: none; } }
@media (max-width: 600px) { .theme-label { display: none; } .header-actions { gap: .5rem; } .theme-toggle { padding: .5rem; } }
:root[data-theme] .hamburger-line { background: #fff; }
:root[data-theme] .nav-wrapper { color: #fff; }
:root[data-theme] .nav-toggle { color: #fff; }
