/* Desktop preferences stay in the header; mobile preferences live in the menu. */
.header-preferences { display:contents; }
.mobile-menu-preferences { display:none; }
:root { color-scheme: light; }
.theme-toggle { display:inline-grid; place-items:center; flex-shrink:0; width:44px; height:44px; padding:0; border:1px solid var(--border-default); border-radius:12px; background:transparent; color:var(--accent-default); }
.theme-toggle:hover { background:var(--soft-accent); }
.theme-icon-sun, [data-theme="dark"] .theme-icon-moon { display:none; }
[data-theme="dark"] .theme-icon-sun { display:block; }
@media (min-width:901px) and (max-width:1400px) {
    .header-inner { gap:12px; }
    .site-header .header-details { display:none; }
}
@media (max-width:900px) {
    .site-header .header-inner { flex-wrap:nowrap; }
    .header-inner .brand { flex:1; }
    .header-inner .site-logo { max-width:100%; }
    .header-preferences { display:none; }
    .site-header-shell .navigation-bar { position:absolute; top:100%; inset-inline:0; box-shadow:0 12px 24px #163f4226; }
    .site-header-shell .main-navigation.open { max-height:calc(100dvh - var(--mobile-header-height, 110px)); }
    .mobile-menu-preferences { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; padding:12px; margin-top:2px; border-radius:12px; background:var(--card-background); }
    .mobile-menu-preferences .language-switcher { border:0; padding:0; }
    html { scroll-padding-top:var(--mobile-header-height, 110px); }
}

/* Bright teal is used for links; filled actions keep a deeper background. */
:root[data-theme="dark"] {
    color-scheme:dark;
    --page-background:#10191c;
    --card-background:#19262b;
    --background-main:var(--card-background);
    --background-secondary-light:#ffffff08;
    --background-secondary-dark:#ffffff18;
    --foreground-main:#edf3f4;
    --foreground-secondary:#b0c1c6;
    --border-default:#34474e;
    --accent-default:#79d5df;
    --accent-hover:#a6e8ee;
    --accent-press:#117f8a;
    --accent-fill:#096670;
    --accent-fill-hover:#0b7b87;
    --accent-transparent-default:#39bec51c;
    --accent-transparent-hover:#39bec530;
    --surface:#213239;
    --soft-accent:var(--accent-transparent-default);
}
[data-theme="dark"] :is(.site-header, .site-header-shell, .navigation-bar, .site-footer, .navigation-bar .main-navigation.open) { background:var(--page-background); color:var(--foreground-main); }
[data-theme="dark"] :is(.site-header .header-inner, .main-navigation .nav-item-heading, .main-navigation .nav-dropdown, .education-footer-card, .benefit-tooltip, .search-field, .filter-buttons button, .skip-link) { background:var(--card-background); color:var(--foreground-main); }
[data-theme="dark"] .navigation-bar.is-stuck { background:var(--card-background); }
[data-theme="dark"] .main-navigation .nav-item-heading:has(.active),
[data-theme="dark"] .main-navigation .nav-item-heading:hover,
[data-theme="dark"] .main-navigation .nav-item-heading:focus-within,
[data-theme="dark"] .main-navigation .nav-dropdown > a:hover { background:var(--soft-accent); color:var(--accent-default); }
[data-theme="dark"] :is(.brand-education, .education-footer-contact-group h3, .site-footer .education-footer-card h2, .breadcrumbs [aria-current], .schedule-panel strong, .search-field input) { color:var(--foreground-main); }
[data-theme="dark"] :is(.header-address span, .header-phone .header-hours, .site-footer .education-footer-identity p, .education-footer-schedule, .education-footer-bottom, .hero-note strong, .fact-grid span, .card-links > a, .section-sidebar nav a, .funding-number, .partners-card-number) { color:var(--foreground-secondary); }
[data-theme="dark"] :is(.header-phone, .site-footer .education-footer-links a, .site-footer .education-footer-contact-group a, .site-footer .education-footer-bottom a) { color:var(--accent-default); }
[data-theme="dark"] .site-footer a:hover { color:var(--accent-hover); }
[data-theme="dark"] .source-note { color:var(--foreground-secondary) !important; }
[data-theme="dark"] .education-footer-bottom { background:var(--background-secondary-light); }
[data-theme="dark"] :is(.brand-divider, .sidebar-title, .funding-block, .residency-facts > .education-fact, .funding-option, .funding-icon, .residency-facts .fact-icon, .document-checklist li, .admission-steps article, .search-field, .filter-buttons button, .icon-tile, .hero-note-icon, .partners-contact, .benefit-tooltip) { border-color:var(--border-default); }
[data-theme="dark"] .brand-divider { background:var(--border-default); }
[data-theme="dark"] :is(.icon-tile, .funding-icon, .residency-facts .fact-icon, .external-resource-icon) { background:var(--surface); }
[data-theme="dark"] :is(.document-checklist li::before, .admission-steps article > span, .admission-platform) { background:var(--soft-accent); color:var(--accent-default); }
[data-theme="dark"] :is(.section-sidebar nav a:hover, .section-sidebar nav a.active, .archive-news-card:hover) { background:var(--soft-accent); border-color:var(--border-default); color:var(--accent-default); }
[data-theme="dark"] .partners-contact { background:linear-gradient(120deg,#17373b,#192b30); }
[data-theme="dark"] .direction-residency { --direction-background:#163539; --direction-border:#2a5457; --direction-accent:#7cdbd3; }
[data-theme="dark"] .direction-courses { --direction-background:#1c2e43; --direction-border:#344d68; --direction-accent:#9dc8ee; }
[data-theme="dark"] .direction-events { --direction-background:#302a40; --direction-border:#514563; --direction-accent:#c7b4e6; }
[data-theme="dark"] .direction-contacts { --direction-background:#352f25; --direction-border:#554c3a; --direction-accent:#dbc39b; }
[data-theme="dark"] :is(.button, .learning-feature, .contact-banner, .back-to-top, .partners-contact-icon),
[data-theme="dark"] :is(.download-list a, .admission-video-links a, .filter-buttons button.selected, .language-option.is-active),
[data-theme="dark"] .document-checklist .document-with-template::before { background:var(--accent-fill); color:var(--accent-on-default); }
[data-theme="dark"] :is(.button:hover, .back-to-top:hover, .download-list a:hover, .admission-video-links a:hover) { background:var(--accent-fill-hover); color:var(--accent-on-default); }
[data-theme="dark"] :is(.button-secondary, .reception-actions .button) { background:var(--soft-accent); color:var(--accent-default); }
[data-theme="dark"] :is(.button-secondary:hover, .reception-actions .button:hover) { background:var(--accent-transparent-hover); color:var(--accent-hover); }
[data-theme="dark"] .contact-banner-actions .contact-banner-whatsapp { background:var(--card-background); color:var(--accent-default); }
[data-theme="dark"] .contact-banner-actions .contact-banner-whatsapp:hover { background:var(--surface); }
[data-theme="dark"] .contact-banner-actions .contact-banner-phone { background:transparent; color:var(--accent-on-default); }
[data-theme="dark"] .contact-banner-actions .contact-banner-phone:hover { background:var(--background-secondary-white); }
[data-theme="dark"] .template-download:disabled { background:var(--surface); color:var(--foreground-secondary); }
[data-theme="dark"] .header-inner .menu-toggle { background:var(--surface); }
[data-theme="dark"] .header-inner .menu-toggle[aria-expanded="true"] { background:var(--accent-fill); }
/* SVG lettering follows the theme while the brand colors stay intact. */
.site-logo-svg { color:var(--foreground-main); }
/* Raster uploads still need a neutral surface for their fixed text colors. */
[data-theme="dark"] .site-logo:has(img) { padding:6px 8px; border-radius:8px; background:#fff; }
[data-theme="dark"] .hero-gallery .gallery-controls { background:var(--card-background); }
[data-theme="dark"] .gallery-nav { background:var(--soft-accent); }
[data-theme="dark"] .gallery-nav:hover { background:var(--accent-fill); color:var(--accent-on-default); }
[data-theme="dark"] :is(.card-links > a, .direction-card h3 .direction-title-arrow, .reception-detail) { background:var(--card-background); border-color:var(--border-default); color:var(--accent-default); }
[data-theme="dark"] .card-links > a:hover { background:var(--soft-accent); }
[data-theme="dark"] .card-links > .card-link-whatsapp { background:#1b382c; color:#a0dfb6; }
[data-theme="dark"] .card-links > .card-link-whatsapp:hover { background:#274b3a; }
[data-theme="dark"] :is(.admission-reception, .reception-detail, .reception-contact) { border-color:var(--border-default); }
[data-theme="dark"] .benefit-info { color:var(--foreground-secondary); }
[data-theme="dark"] :is(.benefit-info:hover, .benefit-info[aria-expanded="true"]) { background:var(--soft-accent); color:var(--accent-default); }
