/*
Theme Name: CiaoSchool Vetrina
Theme URI: https://ciaoschool.com
Author: CiaoSchool
Author URI: https://ciaoschool.com
Description: Tema per il sito vetrina di CiaoSchool: stessa identita' visiva del gestionale (colore accento personalizzabile da Personalizza, stesso font Inter), menu principale in alto, e lo stesso pulsante di Lettura facilitata presente nel gestionale.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ciaoschool-vetrina
*/

/* ---------------------------------------------------------------------
   Design token di base: STESSA struttura di public/assets/css/app.css
   nel gestionale (variabili --teal-*/--slate-*/semantiche), cosi' il
   sito vetrina e il gestionale restano visivamente coerenti. I valori
   --teal-* qui sotto sono solo il default: Personalizza > Colore di
   base li sovrascrive per-richiesta (vedi inc/customizer.php), esattamente
   come Impostazioni > Aspetto fa nel gestionale.
--------------------------------------------------------------------- */
:root {
    --teal-50: #f0f9f9;
    --teal-200: #7ae8e8;
    --teal-500: #25d8d7;
    --teal-600: #1FB5B4;
    --teal-700: #188e8d;
    --teal-600-rgb: 31, 181, 180;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --white: #ffffff;

    --surface: var(--white);
    --surface-sunken: var(--slate-50);
    --surface-alt: var(--slate-100);
    --border: var(--slate-200);
    --border-strong: var(--slate-300);
    --text: var(--slate-800);
    --text-body: var(--slate-700);
    --text-muted: var(--slate-500);

    --site-max-width: 72rem;
    --topbar-height: 68px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #1e293b;
        --surface-sunken: #0f172a;
        --surface-alt: #334155;
        --border: #334155;
        --border-strong: #475569;
        --text: #f1f5f9;
        --text-body: #e2e8f0;
        --text-muted: #94a3b8;
    }
}

/* Temi "lettura facilitata" (assets/js/accessibility.js): stessi valori
   del gestionale, ridefiniscono i token semantici cosi' l'intero sito li
   eredita senza regole duplicate. */
html[data-a11y-theme="cream"] {
    --surface: #fdf6e3;
    --surface-sunken: #f8f0dd;
    --surface-alt: #f5ecd7;
    --border: #e0d3ae;
    --border-strong: #cbb98a;
    --text: #4a3f2b;
    --text-body: #5a4d38;
    --text-muted: #7a6c50;
}
html[data-a11y-theme="blue"] {
    --surface: #eef3fb;
    --surface-sunken: #e8eff8;
    --surface-alt: #e2ebf7;
    --border: #c9d8ee;
    --border-strong: #a9c2e2;
    --text: #1f2937;
    --text-body: #33415a;
    --text-muted: #55648e;
}
html[data-a11y-theme="contrast"] {
    --surface: #000000;
    --surface-sunken: #000000;
    --surface-alt: #1a1a1a;
    --border: #d1d5db;
    --border-strong: #d1d5db;
    --text: #e5e7eb;
    --text-body: #e5e7eb;
    --text-muted: #d1d5db;
}

/* Dimensione testo (zoom sull'intero involucro del sito, non solo sul
   contenuto) e spaziatura aumentata: stessa tecnica del gestionale, vedi
   il commento in app.css per il perche' di "zoom" invece di font-size. */
.site-wrapper { zoom: var(--a11y-font-scale, 1); }
html.gs-a11y-spacing .site-content,
html.gs-a11y-spacing .site-content * {
    letter-spacing: 0.04em !important;
    word-spacing: 0.14em !important;
    line-height: 1.85 !important;
}

* { box-sizing: border-box; }

html, body { background: var(--surface-sunken); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 0.75rem; text-wrap: balance; }
p { margin: 0 0 1rem; }

.container { max-width: var(--site-max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ---------------------------------------------------------------------
   Topbar + menu principale in alto
--------------------------------------------------------------------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header-inner {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.site-branding { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.site-branding img { max-height: 38px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: 0.25rem; }
.primary-nav ul { list-style: none; display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; }
.primary-nav li { position: relative; }
.primary-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-body);
}
.primary-nav a:hover { background: var(--surface-alt); color: var(--text); }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a { background: var(--teal-50); color: var(--teal-700); }

/* Sottomenu: stesso linguaggio a "pillola" del menu principale, in un
   pannello sospeso invece che annidato in sidebar (qui il menu e'
   orizzontale, non c'e' spazio per un secondo livello inline). */
.primary-nav .menu-item-has-children > a::after { content: "▾"; margin-left: 0.35rem; font-size: 0.7em; opacity: 0.7; }
.primary-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    gap: 0.15rem;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: flex; }
.primary-nav .sub-menu a { border-radius: 0.5rem; padding: 0.5rem 0.7rem; }

.menu-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 860px) {
    .menu-toggle { display: flex; }
    .primary-nav { display: none; width: 100%; }
    .primary-nav.is-open { display: block; }
    .site-header-inner { flex-wrap: wrap; height: auto; padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .primary-nav ul { flex-direction: column; align-items: stretch; width: 100%; padding: 0.5rem 0 0.75rem; }
    .primary-nav .sub-menu { position: static; box-shadow: none; border: none; padding-left: 0.75rem; display: none; }
    .primary-nav li.is-open > .sub-menu { display: flex; }
}

/* ---------------------------------------------------------------------
   Hero, sezioni, card, pulsanti — stesso linguaggio visivo del
   gestionale (card a bordo sottile, pulsanti pieni/outline arrotondati).
--------------------------------------------------------------------- */
.hero {
    padding: 5rem 0;
    text-align: center;
}
.hero-eyebrow { color: var(--teal-700); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); max-width: 44rem; margin: 0 auto 1rem; }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 38rem; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.site-content { padding: 3rem 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.75rem;
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; margin: 2rem 0; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background: var(--teal-600); color: var(--white); }
.btn-primary:hover { background: var(--teal-700); }
.btn-secondary { background: var(--surface); color: var(--text-body); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); }

.entry-content { max-width: 42rem; margin: 0 auto; font-size: 1.05rem; }
.entry-content h1, .entry-content h2, .entry-content h3 { margin-top: 2rem; }

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.site-footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-nav ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav a:hover { color: var(--text); }

/* ---------------------------------------------------------------------
   Pulsante e pannello di Lettura facilitata — port 1:1 dal gestionale
   (public/assets/tools/accessibility.js + app.css), stesse classi cosi'
   lo stile resta identico senza duplicare le regole con nomi diversi.
--------------------------------------------------------------------- */
.a11y-toggle-btn {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    background: var(--teal-600);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.a11y-toggle-btn:hover { background: var(--teal-700); }
.a11y-toggle-btn svg { width: 1.5rem; height: 1.5rem; }

.a11y-panel-title-icon { display: inline-flex; vertical-align: middle; width: 1.1rem; height: 1.1rem; margin-right: 0.2rem; }
.a11y-panel-title-icon svg { width: 100%; height: 100%; }

.a11y-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 4.75rem;
    width: 300px;
    max-width: calc(100vw - 2rem);
    max-height: 75vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    padding: 1rem;
    z-index: 10000;
    display: none;
}
.a11y-panel.a11y-panel-open { display: block; }

.a11y-panel-title { font-weight: 700; font-size: 0.95rem; margin: 0 0 0.75rem; color: var(--text); }
.a11y-panel-row { margin-bottom: 0.9rem; }
.a11y-panel-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.4rem; }

.a11y-btn-group { display: flex; gap: 0.4rem; }
.a11y-btn {
    flex: 1;
    padding: 0.4rem 0.3rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
}
.a11y-btn:hover { border-color: var(--border-strong); }
.a11y-btn.a11y-btn-active { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }

.a11y-swatches { display: flex; gap: 0.5rem; }
.a11y-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    padding: 0;
}
.a11y-swatch.a11y-swatch-active { border-color: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-600); }

.a11y-reset-link {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.checkbox-option { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; }

.screen-reader-text { position: absolute; left: -9999px; }
