/* electronics-engineering — modalità scura (2026).
 * Attiva con html[data-theme="dark"], impostato prima del disegno della pagina da uno script nell'head (functions.php):
 * scelta salvata dallo studente (pulsante luna/sole in testata) oppure, alla prima visita, quella del sistema.
 * Le variabili di modern.css cambiano valore; sotto, gli elementi con colori chiari scritti direttamente.
 * Formule (immagini nere su fondo trasparente): invertite. Figure: restano su una scheda bianca. */

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #121b2e;
    --surface-2: #17223a;
    --line: #233150;
    --line-2: #2e3e60;
    --text: #e5ecf6;
    --text-2: #b3bfd3;
    --text-3: #8391a8;
    --brand: #6ea8ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .25);
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] body.ee, html[data-theme="dark"] body.ee.custom-background { background: var(--bg) !important; color: var(--text); }

/* Testata, menu, ricerca */
html[data-theme="dark"] .ee-header { background: rgba(11, 18, 32, .86); }
html[data-theme="dark"] .ee-header.is-scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, .4); }
@media (max-width: 980px) { html[data-theme="dark"] .ee-header { background: #0b1220; } }
html[data-theme="dark"] .ee .ee-mega-head:hover, html[data-theme="dark"] .ee .ee-year-list a:hover { background: hsl(var(--h, 210) 35% 18%); }
html[data-theme="dark"] .ee-hero-search { background: #121b2e; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .ee-hero-search input { color: var(--text); }
html[data-theme="dark"] .home .ee-header:not(.is-scrolled) .ee-langswitch .is-current { background: #e5ecf6; }

/* Colori per materia: tinte chiare → tinte scure */
html[data-theme="dark"] .ee .ee-chip { background: hsl(var(--h, 210) 35% 17%); color: hsl(var(--h, 210) 80% 78%); border-color: hsl(var(--h, 210) 35% 30%); }
html[data-theme="dark"] .ee .ee-chip:hover { background: hsl(var(--h, 210) 35% 23%); }
html[data-theme="dark"] .ee-year-num, html[data-theme="dark"] .ee-syl-n,
html[data-theme="dark"] .ee-mega-ic { background: hsl(var(--h, 210) 35% 18%) !important; color: hsl(var(--h, 210) 80% 75%) !important; }
html[data-theme="dark"] .ee .ee-lang.is-on { background: hsl(var(--h, 210) 35% 18%); color: hsl(var(--h, 210) 80% 78%); border-color: hsl(var(--h, 210) 35% 34%); }
html[data-theme="dark"] .ee-article-head, html[data-theme="dark"] .ee-listing-head { background: linear-gradient(180deg, hsl(var(--h, 210) 40% 13%), var(--bg)); }
html[data-theme="dark"] .ee-listing-head .ee-kicker { color: hsl(var(--h, 210) 80% 70%); }

/* Testo delle lezioni */
html[data-theme="dark"] .ee-prose { color: #d6dfec; }
html[data-theme="dark"] .ee-prose a { text-decoration-color: rgba(110, 168, 255, .4); }
html[data-theme="dark"] .ee-prose img[src*="quicklatex"], html[data-theme="dark"] .ee-prose img[src*="ql-cache"],
html[data-theme="dark"] .ee-prose img.ql-img-inline-formula, html[data-theme="dark"] .ee-prose img.ql-img-displayed-equation { filter: invert(.92) hue-rotate(180deg); }
html[data-theme="dark"] .ee-prose figure:not(.wp-block-table), html[data-theme="dark"] .ee-prose .wp-caption { background: var(--surface); }
html[data-theme="dark"] .ee-prose figure:not(.wp-block-table) img:not([src*="ql-cache"]):not([src*="quicklatex"]) { background: #fff; padding: 6px; }
html[data-theme="dark"] .ee-prose pre, html[data-theme="dark"] .ee-prose pre.wp-block-code { background: #070d19; border-color: #1e2a44; }
html[data-theme="dark"] .ee-prose .ee-archive-note { background: #2a2210; border-color: #5c4a1c; color: #f3d898; }
html[data-theme="dark"] .ee-syl-list li.is-deep .ee-syl-n { background: #3a2e0c !important; color: #f6d77a !important; box-shadow: inset 0 0 0 1px #6b5414; }
html[data-theme="dark"] .ee .ee-xl-deep, html[data-theme="dark"] .ee-xlinks.is-deep { background: #2a2210; border-color: #5c4a1c; color: #f3d898; }
html[data-theme="dark"] .ee-article-hero img { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* Area di studio, guida, account */
html[data-theme="dark"] .ee-st-ok[aria-pressed="true"] { background: #12351f; color: #86efac; }
html[data-theme="dark"] .ee-st-review[aria-pressed="true"] { background: #3a2a0a; color: #fcd34d; }
html[data-theme="dark"] .ee-st-no[aria-pressed="true"] { background: #3f1515; color: #fca5a5; }
html[data-theme="dark"] .ee-sec-ai { color: #c4b5fd; border-color: #3b2f6b; }
html[data-theme="dark"] .ee-sec-ai:hover { background: #1f1838; color: #ddd6fe; }
html[data-theme="dark"] .ee-sec-ask { background: #2a1a0c; border-color: #7c4a16; color: #fdba74; }
html[data-theme="dark"] .ee-note, html[data-theme="dark"] .ee-st-note .note { background: #0f1729; color: var(--text); }
html[data-theme="dark"] .ee-ai-p { background: linear-gradient(135deg, #1b1533, #141d38); border-color: #3b2f6b; color: #ddd6fe; }
html[data-theme="dark"] .ee-ai-svc button[aria-pressed="true"] { background: #1f1838; color: #c4b5fd; border-color: #7c3aed; }
html[data-theme="dark"] .ee-btn-s[aria-pressed="true"] { background: #14223f; }
html[data-theme="dark"] .ee-sb-hint, html[data-theme="dark"] .ee-acc-strip, html[data-theme="dark"] .ee-guide-try,
html[data-theme="dark"] .ee-home-study-in { background: linear-gradient(135deg, #131d36, #18163a); border-color: #2a3560; }
html[data-theme="dark"] .ee-acc-strip.is-in { background: #0f2a1a; border-color: #1e5a35; color: #86efac; }
html[data-theme="dark"] .ee-sb-review, html[data-theme="dark"] .ee-c-review, html[data-theme="dark"] .ee-kpi-review b, html[data-theme="dark"] .ee-st-age.is-due { color: #fbbf24; }
html[data-theme="dark"] .ee-sb-no, html[data-theme="dark"] .ee-c-no, html[data-theme="dark"] .ee-kpi-no b { color: #f87171; }
html[data-theme="dark"] .ee-c-ok, html[data-theme="dark"] .ee-acc-ok, html[data-theme="dark"] .ee-guide-tip, html[data-theme="dark"] .ee-note-saved { color: #86efac !important; }
html[data-theme="dark"] .ee-done-badge, html[data-theme="dark"] .ee-st-note .st-ok { background: #12351f; color: #86efac; }
html[data-theme="dark"] .ee-st-note .st-review { background: #3a2a0a; color: #fcd34d; }
html[data-theme="dark"] .ee-st-note .st-no { background: #3f1515; color: #fca5a5; }
html[data-theme="dark"] .ee-f-ok { background: #12351f; color: #86efac; }
html[data-theme="dark"] .ee-f-note { background: #3a2a0a; color: #fcd34d; }
html[data-theme="dark"] .ee-f-ai { background: #261c4a; color: #c4b5fd; }
html[data-theme="dark"] .ee-f-pdf { background: #0c2a3d; color: #7dd3fc; }
html[data-theme="dark"] .ee-acc-in { background: #0f1729; color: var(--text); }
html[data-theme="dark"] .ee-acc-msg { color: #f87171; }
html[data-theme="dark"] .ee-sec-flash { animation-name: eeflashdark; }
@keyframes eeflashdark { 0%, 40% { box-shadow: 0 0 0 4px #5c4a1c; border-radius: 12px; } 100% { box-shadow: none; } }
html[data-theme="dark"] .ee-st-flash { animation-name: eestflashdark; }
@keyframes eestflashdark { 0%, 35% { box-shadow: 0 0 0 6px #1e3a6b; border-radius: 12px; } 100% { box-shadow: none; } }

/* Commenti (wpDiscuz) */
html[data-theme="dark"] #wpdcom, html[data-theme="dark"] #wpdcom .wpd-comment-text, html[data-theme="dark"] #wpdcom .wpd-comment-text p { color: var(--text-2) !important; }
html[data-theme="dark"] #wpdcom .wpd-thread-head, html[data-theme="dark"] #wpdcom .wpd-comment .wpd-comment-wrap { border-color: var(--line) !important; }
html[data-theme="dark"] #wpdcom .wpd-thread-info, html[data-theme="dark"] #wpdcom .wpd-thread-filter .wpdf-sorting,
html[data-theme="dark"] #wpdcom .wpd-comment-footer, html[data-theme="dark"] #wpdcom .wpd-comment-date { color: var(--text-3) !important; }
html[data-theme="dark"] #wpdcom .ql-editor, html[data-theme="dark"] #wpdcom .ql-container, html[data-theme="dark"] #wpdcom .ql-toolbar,
html[data-theme="dark"] #wpdcom input[type="text"], html[data-theme="dark"] #wpdcom input[type="email"], html[data-theme="dark"] #wpdcom input[type="url"],
html[data-theme="dark"] #wpdcom textarea { background: #0f1729 !important; color: var(--text) !important; border-color: var(--line-2) !important; }
html[data-theme="dark"] #wpdcom .ql-editor.ql-blank::before { color: var(--text-3) !important; }
html[data-theme="dark"] #wpdcom .ql-toolbar button svg .ql-stroke { stroke: var(--text-3) !important; }
html[data-theme="dark"] #wpdcom .ql-toolbar button svg .ql-fill { fill: var(--text-3) !important; }
html[data-theme="dark"] #wpdcom .wpd-comment-author, html[data-theme="dark"] #wpdcom .wpd-comment-author a { color: #6ee7b7 !important; }

/* Stelle (YASR) e varie */
html[data-theme="dark"] .ee-article-rating, html[data-theme="dark"] .yasr-vv-text-container { color: var(--text-3); }
html[data-theme="dark"] .ee-pick { color: #3d2a00; }

/* Pulsante luna/sole */
.ee-theme-btn .ee-ic-sun { display: none; }
html[data-theme="dark"] .ee-theme-btn .ee-ic-sun { display: block; }
html[data-theme="dark"] .ee-theme-btn .ee-ic-moon { display: none; }

/* Correzioni dopo la prima prova */
html[data-theme="dark"] .ee-btn-p, html[data-theme="dark"] .ee-guide-cta .ee-btn-p { background: #2563eb; border-color: #2563eb; color: #fff !important; }
html[data-theme="dark"] .ee-btn-p[aria-pressed="true"] { background: #16a34a; border-color: #16a34a; }
html[data-theme="dark"] .ee-study-pill, html[data-theme="dark"] .ee-study-pill:hover { color: #fff !important; }
html[data-theme="dark"] .ee-widgets .current-cat > .avhec-widget-line { background: #14223f; }
html[data-theme="dark"] .ee .page-numbers.current { background: #2563eb; border-color: #2563eb; }
html[data-theme="dark"] .ee-langswitch .is-current { background: #e5ecf6; color: #0b1220; }

/* Riquadro del programma in fondo alla lezione, avviso di traduzione, widget */
html[data-theme="dark"] .ee-syl-box { background: linear-gradient(135deg, #131d36, #18163a); border-color: #2a3560; }
html[data-theme="dark"] .ee .ee-syl-pn > a, html[data-theme="dark"] .ee-syl-pn > span { background: rgba(11, 18, 32, .55); border-color: #2a3560; color: var(--text); }
html[data-theme="dark"] .ee-syl-pn > span:empty { background: none; border: 0; }
html[data-theme="dark"] .ee .ee-syl-pn > a:hover { border-color: var(--brand); }
html[data-theme="dark"] .ee-tr-note { background: #131d36; border-color: #2a3560; }
html[data-theme="dark"] .ee-widgets .avhec-widget-line:hover .ee-n, html[data-theme="dark"] .ee .ee-widgets .widget_archive a:hover { background: #1b2a4d; }
