/* ============================================================================
   VERSIONE A · "ACQUERELLO"  —  Classe 1A · Martiri della Benedicta
   Carta calda, cielo, sole e matite. Materie con codice colore.
   Font: Baloo 2 (titoli) + Atkinson Hyperlegible (testi, alta leggibilità)
   Lavagna avvisi: verde classica con cornice in legno, Caveat + Patrick Hand
   ============================================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Palette */
    --carta: #FBF6EC;
    --inchiostro: #243A52;
    --inchiostro-soft: #56708A;
    --blu: #3E7CB1;
    --blu-scuro: #2A5D8F;
    --cielo: #DCEBF7;
    --cielo-forte: #BBD8EF;
    --sole: #F6BE4F;
    --sole-scuro: #D99B23;
    --sole-chiaro: #FCE9C2;
    --salvia: #5F8C52;
    --salvia-chiara: #E4F0DE;
    --corallo: #E8735A;
    --bianco: #FFFFFF;

    --ombra: 0 10px 24px rgba(36, 58, 82, .10);
    --ombra-forte: 0 16px 34px rgba(36, 58, 82, .16);
    --r: 22px;

    --f-display: 'Baloo 2', 'Nunito', sans-serif;
    --f-body: 'Atkinson Hyperlegible', 'Nunito', sans-serif;
    --f-chalk-title: 'Caveat', cursive;
    --f-chalk-body: 'Patrick Hand', cursive;

    /* Cursore a matita (solo su link e bottoni) */
    --cur-matita: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'><g transform='rotate(45 15 15)'><rect x='11' y='1' width='8' height='4' rx='1.6' fill='%23E8735A'/><rect x='11' y='5' width='8' height='13' fill='%23F6BE4F' stroke='%23243A52' stroke-width='1.4'/><polygon points='11,18 19,18 15,26' fill='%23EFD3A7' stroke='%23243A52' stroke-width='1.4'/><polygon points='13.7,22 16.3,22 15,25.4' fill='%23243A52'/></g></svg>") 7 24, pointer;
    --cur-gesso: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'><rect x='9.5' y='2' width='7' height='18' rx='3.2' transform='rotate(40 13 13)' fill='%23F7F4EA' stroke='%23CFC8B4' stroke-width='1'/></svg>") 4 22, pointer;
}

html { scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
    font-family: var(--f-body);
    color: var(--inchiostro);
    line-height: 1.65;
    background-color: var(--carta);
    background-image: radial-gradient(circle at 8% 4%, rgba(246, 190, 79, .12), transparent 30%),
                      radial-gradient(circle at 92% 12%, rgba(62, 124, 177, .08), transparent 32%);
    background-attachment: fixed;
}

img { max-width: 100%; }

/* Accessibilità */
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
    left: 14px; top: 14px; z-index: 999;
    background: var(--bianco); color: var(--inchiostro);
    padding: .6rem 1.1rem; border-radius: 12px; box-shadow: var(--ombra-forte);
    font-weight: 700; text-decoration: none;
}
:focus-visible { outline: 3px solid var(--corallo); outline-offset: 3px; border-radius: 8px; }

/* Cursore personalizzato su elementi interattivi */
@media (hover: hover) and (pointer: fine) {
    a, button, .btn, .accordion-header, .lang-btn, .menu-toggle { cursor: var(--cur-matita); }
    .page-avvisi .lavagna a { cursor: var(--cur-gesso); }
}

/* ======================= HEADER ======================= */
.site-header {
    position: relative;
    background: linear-gradient(150deg, #5895CC 0%, #3E7CB1 55%, #2E699C 100%);
    color: var(--bianco);
    padding: 2.2rem 0 3.4rem;
    overflow: hidden;
}
.site-header::before {
    /* sole */
    content: '';
    position: absolute; top: -70px; left: -60px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 233, 194, .95) 0%, rgba(246, 190, 79, .55) 45%, transparent 70%);
    pointer-events: none;
}
.site-header::after {
    /* onda che si fonde con la carta */
    content: '';
    position: absolute; left: 0; right: 0; bottom: -1px; height: 30px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'><path d='M0,32 C160,62 340,4 600,28 C860,52 1050,10 1200,34 L1200,60 L0,60 Z' fill='%23FBF6EC'/></svg>") no-repeat center / 100% 100%;
}
.header-container {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    text-align: center; position: relative;
}
.language-switcher {
    position: absolute; top: -1rem; right: 1.2rem;
    display: flex; gap: .5rem; z-index: 5;
}
.lang-btn {
    background: rgba(255, 255, 255, .92);
    border: 2px solid transparent;
    padding: .35rem .75rem; border-radius: 999px;
    font-family: var(--f-body); font-weight: 700; font-size: .95rem;
    color: var(--inchiostro);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.lang-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 0, 0, .18); }
.lang-btn.active { background: var(--sole); border-color: rgba(255, 255, 255, .7); }

.brand h1 {
    font-family: var(--f-display);
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800; letter-spacing: .3px;
    text-shadow: 0 2px 0 rgba(36, 58, 82, .25);
    margin-bottom: .35rem;
}
.brand p { font-size: 1.08rem; opacity: .95; font-weight: 400; }

/* ======================= NAV ======================= */
.site-nav {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(36, 58, 82, .08);
    position: sticky; top: 0; z-index: 100;
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: .55rem 1rem;
    display: flex; justify-content: center; flex-wrap: wrap; gap: .3rem;
}
.nav-container a {
    color: var(--inchiostro); text-decoration: none;
    padding: .5rem 1rem; border-radius: 999px;
    font-weight: 700; font-size: .95rem;
    transition: background .25s ease, color .25s ease, transform .25s ease;
}
.nav-container a:hover { background: var(--cielo); color: var(--blu-scuro); transform: translateY(-2px); }
.nav-container a.active { background: var(--sole); color: var(--inchiostro); }
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 1.7rem; padding: .8rem; color: var(--inchiostro);
}

/* ======================= HERO / ORARI ======================= */
.hero { max-width: 1200px; margin: 2.5rem auto 0; padding: 0 2rem; }

.section-title {
    font-family: var(--f-display);
    color: var(--blu-scuro);
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    font-weight: 800; text-align: center; margin-bottom: 1.4rem;
}
.section-title::after {
    /* riga di matita ondulata */
    content: '';
    display: block; width: 150px; height: 12px;
    margin: .45rem auto 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 12'><path d='M3 8 Q 13 2, 23 8 T 43 8 T 63 8 T 83 8 T 103 8 T 123 8 T 145 7' fill='none' stroke='%23F6BE4F' stroke-width='4.5' stroke-linecap='round'/></svg>") no-repeat center / contain;
}

.class-photo-wrap { text-align: center; margin: 1.8rem 0 2.4rem; }
.class-photo {
    display: inline-block; position: relative;
    background: var(--bianco);
    padding: 14px 14px 34px;
    border-radius: 6px;
    box-shadow: var(--ombra-forte);
    transform: rotate(-2deg);
    transition: transform .35s ease;
}
.class-photo:hover { transform: rotate(0deg) scale(1.02); }
.class-photo::before {
    /* scotch */
    content: '';
    position: absolute; top: -14px; left: 50%;
    width: 100px; height: 28px;
    transform: translateX(-50%) rotate(-3deg);
    background: linear-gradient(rgba(246, 190, 79, .55), rgba(246, 190, 79, .45));
    border-left: 1px dashed rgba(217, 155, 35, .5);
    border-right: 1px dashed rgba(217, 155, 35, .5);
}
.class-photo img { display: block; max-width: 280px; width: 100%; height: auto; border-radius: 4px; }

/* Card generiche */
.card {
    background: var(--bianco);
    border-radius: var(--r);
    padding: 1.8rem;
    box-shadow: var(--ombra);
}
.schedule-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.6rem; margin-bottom: 2rem;
}
.schedule-card h3 {
    font-family: var(--f-display);
    color: var(--blu-scuro); font-size: 1.35rem; margin-bottom: .9rem;
}
.schedule-card p { margin-bottom: .5rem; }
.small-note { font-size: .95rem; color: var(--inchiostro-soft); margin-top: .6rem; }

/* Oggi in classe */
.today-card { border: 3px solid var(--sole); position: relative; }
.today-card::after {
    content: '☀️';
    position: absolute; top: -16px; right: 18px;
    font-size: 1.9rem; transform: rotate(12deg);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15));
}
.today-date { font-weight: 700; color: var(--blu-scuro); font-size: 1.08rem; margin-bottom: 1rem; }
.today-list { display: flex; flex-direction: column; gap: .45rem; }
.today-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .5rem .9rem; border-radius: 12px;
    background: var(--cielo); font-weight: 700;
    transition: transform .2s ease;
}
.today-row:hover { transform: translateX(4px); }
.today-hour { color: var(--inchiostro); opacity: .8; font-size: .95rem; }
.today-subject { font-weight: 800; letter-spacing: .3px; }
.today-exit {
    margin-top: 1rem; display: inline-block;
    background: var(--sole); color: var(--inchiostro);
    padding: .45rem 1rem; border-radius: 999px;
    font-weight: 800; font-size: .98rem;
    box-shadow: 0 3px 0 var(--sole-scuro);
}
.today-weekend { color: var(--sole-scuro); font-weight: 800; font-size: 1.12rem; }
.today-empty { color: var(--inchiostro-soft); }

/* ======================= ORARIO SETTIMANALE ======================= */
.weekly { margin-bottom: 1rem; }
.weekly-title {
    font-family: var(--f-display);
    color: var(--blu-scuro); text-align: center;
    font-size: 1.5rem; margin-bottom: 1.4rem;
}
.schedule-table-wrapper { overflow-x: auto; }
.orario-table {
    width: 100%; min-width: 640px;
    border-collapse: separate; border-spacing: 6px;
}
.orario-table th {
    font-family: var(--f-display);
    background: var(--blu-scuro); color: var(--bianco);
    padding: .7rem .4rem; border-radius: 12px;
    font-size: .95rem; letter-spacing: .5px; text-align: center;
}
.orario-table td {
    text-align: center; padding: .6rem .4rem;
    border-radius: 12px; font-weight: 800; font-size: .9rem;
    letter-spacing: .3px;
}
.ora-num { background: var(--cielo); color: var(--blu-scuro); width: 54px; }
.mat-vuoto { background: transparent; color: #C9BFA9; font-weight: 400; }

/* Codice colore materie (tabella, accordion, oggi in classe) */
.mat-ita   { background: #FBDDDD; color: #A83232; }
.mat-mat   { background: #D9E8F8; color: #2A5D8F; }
.mat-sci   { background: #DCF1DF; color: #2F7D46; }
.mat-ing   { background: #E8DEF6; color: #6C46A6; }
.mat-sto   { background: #F6E7C9; color: #8F6B1E; }
.mat-geo   { background: #D6EFEC; color: #177E74; }
.mat-mus   { background: #F9DCEC; color: #AF3B7F; }
.mat-mot   { background: #FFE4CF; color: #C25E14; }
.mat-arte  { background: #DFF6FB; color: #1C7A9C; }
.mat-rel   { background: #FBF3CF; color: #95801C; }
.mat-mensa { background: #FFE9C7; color: #C77800; }
.riga-mensa .mat-mensa { box-shadow: inset 0 0 0 2px rgba(199, 120, 0, .35); }

/* Accordion mobile */
.schedule-accordion { display: none; }
.accordion-item {
    background: var(--cielo);
    border-radius: 16px; margin-bottom: .7rem; overflow: hidden;
}
.accordion-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: .9rem 1.1rem; font-weight: 800; color: var(--blu-scuro);
    user-select: none;
}
.accordion-header:hover { background: var(--cielo-forte); }
.accordion-icon { transition: transform .3s ease; font-size: .85rem; }
.accordion-header.active .accordion-icon { transform: rotate(180deg); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height .45s ease; background: var(--bianco); }
.accordion-content.active { max-height: 620px; }
.accordion-body { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.schedule-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .35rem .2rem;
}
.schedule-time { font-weight: 700; color: var(--inchiostro-soft); font-size: .95rem; }
.schedule-subject {
    font-weight: 800; font-size: .88rem; letter-spacing: .3px;
    padding: .22rem .75rem; border-radius: 999px;
}
.table-note { text-align: center; margin-top: 1.4rem; color: var(--inchiostro-soft); font-size: .96rem; }

/* ======================= SEZIONI CONTENUTO ======================= */
.container { max-width: 1200px; margin: 2.6rem auto; padding: 0 2rem; }
.section {
    background: var(--bianco);
    border-radius: var(--r);
    padding: 2.4rem 2.2rem;
    box-shadow: var(--ombra);
    margin-bottom: 2.4rem;
}
.section h3 {
    font-family: var(--f-display);
    color: var(--blu-scuro); font-size: 1.3rem;
    margin: 1.8rem 0 .9rem;
}
.section p { margin-bottom: .7rem; }
.section a { color: var(--blu); font-weight: 700; text-decoration-color: var(--sole); text-underline-offset: 3px; }
.section a:hover { color: var(--blu-scuro); }

.highlight-box {
    background: var(--sole-chiaro);
    border: 2px dashed var(--sole-scuro);
    border-radius: 18px;
    padding: 1.6rem; margin: 1.6rem 0;
}
.highlight-box h3 { margin-top: 0; }
.eco-box { background: var(--salvia-chiara); border-color: var(--salvia); }
.eco-box h3 { color: var(--salvia); }

.info-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem; margin: 1rem 0 1.4rem;
}
.info-card {
    background: var(--cielo);
    border-radius: 16px; padding: 1.3rem 1.4rem;
    transition: transform .3s ease, box-shadow .3s ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--ombra); }
.info-card h4 {
    font-family: var(--f-display);
    color: var(--blu-scuro); font-size: 1.08rem; margin-bottom: .6rem;
}
.info-card p { margin-bottom: .35rem; }

.fun-list { margin: .6rem 0 .6rem 1.7rem; }
.fun-list li { margin-bottom: .5rem; padding-left: .3rem; }
.fun-list li::marker { content: '✏️ '; }

/* Tabella servizi */
.table-wrap { overflow-x: auto; border-radius: 14px; }
.servizi-table { width: 100%; min-width: 520px; border-collapse: collapse; }
.servizi-table th {
    font-family: var(--f-display);
    background: var(--blu-scuro); color: var(--bianco);
    padding: .8rem 1rem; text-align: left; font-size: .98rem;
}
.servizi-table th:first-child { border-radius: 12px 0 0 0; }
.servizi-table th:last-child { border-radius: 0 12px 0 0; }
.servizi-table td { padding: .8rem 1rem; border-bottom: 2px solid var(--carta); }
.servizi-table tbody tr:nth-child(even) { background: #F4F9FD; }
.servizi-table tbody tr:hover { background: var(--cielo); }

/* Box rappresentante */
.rep-box {
    background: linear-gradient(150deg, #FFFFFF 0%, var(--cielo) 100%);
    border: 3px solid var(--cielo-forte);
    border-radius: 18px;
    padding: 1.8rem 2rem; margin: 1.4rem 0 2rem;
    box-shadow: var(--ombra);
}
.rep-name { color: var(--blu-scuro); margin: 0 0 .3rem !important; }
.rep-role { font-size: 1.08rem; }
.rep-phone { margin-top: .8rem; font-size: 1.05rem; }
.rep-phone a { color: var(--blu-scuro); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.rep-phone a:hover { text-decoration: underline wavy var(--sole); text-underline-offset: 4px; }
.rep-note { margin-top: .4rem; font-size: .95rem; color: var(--inchiostro-soft); }

/* Bottoni */
.btn-row { margin-top: 1.4rem; }
.btn {
    display: inline-block;
    background: var(--sole); color: var(--inchiostro);
    font-family: var(--f-display); font-weight: 700;
    padding: .75rem 1.6rem; border-radius: 999px;
    text-decoration: none !important; font-size: 1.02rem;
    box-shadow: 0 4px 0 var(--sole-scuro);
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 7px 0 var(--sole-scuro); color: var(--inchiostro); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--sole-scuro); }

/* ======================= FOOTER ======================= */
.site-footer {
    background: var(--inchiostro); color: var(--bianco);
    border-top: 6px solid var(--sole);
    padding: 2.4rem 0 1rem; margin-top: 4rem;
}
.footer-content {
    max-width: 1200px; margin: 0 auto 1.5rem; padding: 0 2rem;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem;
}
.footer-section h3 {
    font-family: var(--f-display);
    color: var(--sole); margin-bottom: .9rem; font-size: 1.15rem;
}
.footer-section p, .footer-section a {
    color: rgba(255, 255, 255, .88); text-decoration: none;
    display: block; margin-bottom: .45rem;
    transition: color .25s ease;
}
.footer-section a:hover { color: var(--sole); }
.footer-bottom {
    max-width: 1200px; margin: 0 auto; padding: 1.4rem 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    text-align: center; font-size: .9rem; color: rgba(255, 255, 255, .68);
}

/* ======================= ANIMAZIONI ======================= */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.site-header .brand { animation: rise .7s .08s both; }
.language-switcher { animation: rise .6s .02s both; }
.hero .section-title { animation: rise .7s .16s both; }
.class-photo-wrap { animation: rise .8s .26s both; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.info-grid .reveal:nth-child(2) { transition-delay: .12s; }

/* ============================================================================
   PAGINA AVVISI · LAVAGNA VERDE CON CORNICE IN LEGNO
   ============================================================================ */
.board-wrap { max-width: 1150px; margin: 2.6rem auto 0; padding: 0 1.6rem; }

.cornice {
    background: linear-gradient(135deg, #96613A 0%, #B07845 26%, #7C4E2A 62%, #9A6238 100%);
    border-radius: 22px;
    padding: clamp(10px, 2vw, 18px);
    box-shadow: 0 22px 44px rgba(36, 58, 82, .28),
                inset 0 2px 4px rgba(255, 255, 255, .35),
                inset 0 -3px 6px rgba(0, 0, 0, .3);
}
.lavagna {
    position: relative;
    border-radius: 12px;
    padding: clamp(1.4rem, 3.5vw, 2.8rem);
    background:
        radial-gradient(ellipse at 18% 26%, rgba(255, 255, 255, .06), transparent 42%),
        radial-gradient(ellipse at 76% 62%, rgba(255, 255, 255, .05), transparent 40%),
        radial-gradient(ellipse at 52% 88%, rgba(255, 255, 255, .04), transparent 36%),
        linear-gradient(158deg, #37624F 0%, #2A4E40 55%, #234238 100%);
    box-shadow: inset 0 0 70px rgba(0, 0, 0, .42);
    overflow: hidden;
}
.lavagna::after {
    /* polvere di gesso */
    content: '';
    position: absolute; inset: 0; border-radius: 12px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.55'/></svg>");
    opacity: .10; pointer-events: none; mix-blend-mode: screen;
}

/* Scarabocchi decorativi */
.doodle {
    position: absolute; font-family: var(--f-chalk-title);
    color: rgba(255, 255, 255, .16); pointer-events: none; z-index: 1;
}
.d1 { top: 16px; left: 24px; font-size: 2rem; transform: rotate(-8deg); }
.d2 { bottom: 54px; right: 30px; font-size: 1.9rem; transform: rotate(6deg); }
.d3 { top: 20px; right: 60px; font-size: 1.8rem; transform: rotate(10deg); }
.d4 { bottom: 100px; left: 20px; font-size: 1.8rem; transform: rotate(-12deg); }

.board-intro { text-align: center; position: relative; z-index: 2; margin-bottom: 1.2rem; }
.board-intro h2 {
    font-family: var(--f-chalk-title);
    color: #FBF8EE; font-size: clamp(2.3rem, 5vw, 3.4rem); font-weight: 700;
    text-shadow: 0 0 6px rgba(255, 255, 255, .25);
    letter-spacing: 1px;
}
.board-intro p {
    font-family: var(--f-chalk-body);
    color: #E9E4D4; font-size: 1.2rem; margin-top: .5rem; line-height: 1.7;
}

/* Legenda gessetti */
.legenda {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem;
    margin-bottom: 2rem; position: relative; z-index: 2;
}
.leg {
    font-family: var(--f-chalk-body); font-size: 1.02rem; color: #E9E4D4;
    display: inline-flex; align-items: center; gap: .45rem;
}
.leg::before { content: ''; width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 6px rgba(255,255,255,.25); }
.leg-importante::before { background: #FF9BA4; }
.leg-evento::before { background: #9FE3AC; }
.leg-promemoria::before { background: #FFD98A; }
.leg-info::before { background: #9AD3FF; }

/* Sezioni della bacheca */
.board-section { position: relative; z-index: 2; margin-bottom: 2.6rem; }
.board-title {
    font-family: var(--f-chalk-title);
    color: #FBF8EE; font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 700;
    margin-bottom: 1.2rem;
    text-decoration: underline wavy;
    text-decoration-thickness: 3px;
    text-underline-offset: 10px;
    text-shadow: 0 0 5px rgba(255, 255, 255, .2);
}
.stile-rosso  .board-title { text-decoration-color: #FF9BA4; }
.stile-verde  .board-title { text-decoration-color: #9FE3AC; }
.stile-grigio .board-title { text-decoration-color: #CFD6DD; }
.stile-blu    .board-title { text-decoration-color: #9AD3FF; }
.stile-giallo .board-title { text-decoration-color: #FFD98A; }

/* Mini calendario uscite */
.board-cal { margin-bottom: 1.6rem; }
.board-cal h3 {
    font-family: var(--f-chalk-title);
    color: #EFEBDB; font-size: 1.6rem; text-align: center; margin-bottom: 1rem;
}
.board-cal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.board-cal-item {
    --cal: #9AD3FF;
    border: 2px dashed var(--cal);
    border-radius: 205px 16px 225px 18px / 18px 195px 16px 215px;
    padding: .9rem 1.1rem;
    background: rgba(255, 255, 255, .045);
    display: flex; flex-direction: column; gap: .15rem;
    transition: transform .25s ease, background .25s ease;
}
.board-cal-item:hover { transform: translateY(-4px) rotate(-.4deg); background: rgba(255, 255, 255, .09); }
.board-cal-item.stile-blu { --cal: #9AD3FF; }
.board-cal-item.stile-viola { --cal: #CBA6F7; }
.board-cal-item.stile-arancio { --cal: #FFC58A; }
.board-cal-item.stile-verde { --cal: #9FE3AC; }
.board-cal-item.stile-rosso { --cal: #FF9BA4; }
.cal-data { font-family: var(--f-chalk-title); font-weight: 700; font-size: 1.25rem; color: var(--cal); }
.cal-titolo { font-family: var(--f-chalk-body); color: #FBF8EE; font-size: 1.12rem; }
.cal-dettagli { font-family: var(--f-chalk-body); color: #CFC9B8; font-size: .95rem; }

/* Avvisi scritti col gesso */
.avviso {
    --cat: #9AD3FF;
    position: relative;
    border: 2.5px solid var(--cat);
    border-radius: 255px 18px 225px 20px / 20px 225px 18px 255px;
    background: rgba(255, 255, 255, .05);
    padding: 1.5rem 1.7rem;
    margin-bottom: 1.6rem;
    transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
}
.avviso:hover {
    transform: translateY(-4px) rotate(.25deg);
    background: rgba(255, 255, 255, .085);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
}
.cat-importante { --cat: #FF9BA4; }
.cat-evento { --cat: #9FE3AC; }
.cat-promemoria { --cat: #FFD98A; }
.cat-info { --cat: #9AD3FF; }

.avviso-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem;
}
.avviso .data { font-family: var(--f-chalk-title); font-size: 1.35rem; font-weight: 700; color: #FFE9A8; }
.avviso .categoria {
    font-family: var(--f-chalk-body);
    background: var(--cat); color: #22362D;
    padding: .18rem .95rem; border-radius: 999px;
    font-size: .95rem; letter-spacing: .5px; font-weight: 700;
}
.avviso h3 {
    font-family: var(--f-chalk-title);
    color: #FFFFFF; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700;
    margin-bottom: .7rem; line-height: 1.25;
    text-shadow: 0 0 5px rgba(255, 255, 255, .22);
}
.avviso-body { font-family: var(--f-chalk-body); color: #F2EEE0; font-size: 1.18rem; line-height: 1.75; }
.avviso-body p { margin-bottom: .7rem; }
.avviso-body strong { color: #FFFFFF; font-weight: 700; }
.avviso-body ul { margin: .6rem 0 .9rem 1.6rem; }
.avviso-body li { margin-bottom: .4rem; }
.avviso-body li::marker { content: '› '; color: var(--cat); }
.avviso-body a { color: #9AD3FF; text-decoration: underline; text-underline-offset: 3px; }
.avviso-body a:hover { color: #C8E6FF; }

/* Strumenti dell'avviso: condividi e aggiungi al calendario */
.avviso-tools {
    display: flex; flex-wrap: wrap; gap: .7rem;
    margin-top: 1.1rem; padding-top: .9rem;
    border-top: 1.5px dashed rgba(255, 255, 255, .22);
}
.tool-btn {
    font-family: var(--f-chalk-body); font-size: 1.02rem;
    background: rgba(255, 255, 255, .07);
    border: 2px dashed rgba(255, 255, 255, .5);
    color: #F2EEE0;
    padding: .35rem 1rem; border-radius: 999px;
    text-decoration: none; line-height: 1.4;
    transition: background .25s ease, transform .25s ease;
}
button.tool-btn { appearance: none; }
.tool-btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.tool-btn.wa { border-color: #9FE3AC; color: #CFF3D8; }
.tool-btn.cal { border-color: #FFD98A; color: #FFE9B8; }

/* Link discreto all'area di gestione */
.gestione-row { text-align: center; margin-top: 1.8rem; position: relative; z-index: 2; }
.gestione-link {
    font-family: var(--f-chalk-body); font-size: 1.05rem;
    color: rgba(255, 255, 255, .55);
    text-decoration: underline dashed; text-underline-offset: 4px;
    transition: color .25s ease;
}
.gestione-link:hover { color: #FBF8EE; }

/* Archivio: mezzo cancellato */
.board-section.archivio .avviso { opacity: .78; border-style: dashed; }
.board-section.archivio .avviso:hover { opacity: 1; }

.noscript-warn {
    font-family: var(--f-chalk-body); color: #FFD98A;
    text-align: center; font-size: 1.2rem; padding: 1.5rem 0;
    position: relative; z-index: 2;
}

/* Mensola porta gessi */
.mensola {
    height: 30px; margin: -6px 14px 0;
    background: linear-gradient(#B07845, #7C4E2A 70%, #6A4223);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 20px rgba(36, 58, 82, .25), inset 0 2px 3px rgba(255, 255, 255, .3);
    display: flex; align-items: center; gap: 14px; padding: 0 26px;
}
.gessetto { width: 42px; height: 10px; border-radius: 6px; box-shadow: 0 2px 3px rgba(0, 0, 0, .3); }
.g-bianco { background: #F7F4EA; transform: rotate(-2deg); }
.g-rosa { background: #FF9BA4; transform: rotate(3deg); }
.g-giallo { background: #FFD98A; transform: rotate(-1deg); }
.cimosa {
    margin-left: auto; width: 66px; height: 20px; border-radius: 4px;
    background: linear-gradient(#2A5D8F 0 55%, #C9A15F 55%);
    box-shadow: 0 3px 5px rgba(0, 0, 0, .35);
    transform: rotate(-1.5deg);
}

/* ======================= RESPONSIVE ======================= */
@media (max-width: 768px) {
    .language-switcher { position: static; justify-content: center; margin-bottom: .8rem; }
    .site-header { padding: 1.6rem 0 3rem; }

    .menu-toggle { display: block; margin: 0 auto; }
    .nav-container {
        flex-direction: column; padding: 0; gap: 0;
        max-height: 0; overflow: hidden; transition: max-height .35s ease;
    }
    .nav-container.active { max-height: 600px; padding-bottom: .6rem; }
    .nav-container a { width: 100%; text-align: center; border-radius: 0; padding: .8rem; }
    .nav-container a:hover { transform: none; }

    .hero, .container { padding: 0 1.1rem; }
    .section { padding: 1.7rem 1.3rem; }
    .card { padding: 1.4rem; }

    .schedule-table-wrapper { display: none; }
    .schedule-accordion { display: block; }

    .board-wrap { padding: 0 .8rem; }
    .avviso { padding: 1.2rem 1.1rem; }
    .mensola { margin: -6px 8px 0; }
    .d1 { display: none; }
}

@media (max-width: 480px) {
    .brand h1 { font-size: 1.45rem; }
    .class-photo img { max-width: 220px; }
    .today-card::after { font-size: 1.5rem; }
}

/* ======================= MOVIMENTO RIDOTTO ======================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ======================= STAMPA ======================= */
@media print {
    .site-nav, .language-switcher, .menu-toggle, .btn, .btn-row,
    .schedule-accordion, .mensola, .doodle, .skip { display: none !important; }
    body { background: #fff; }
    .site-header { background: none; color: #000; padding: .5rem 0; }
    .site-header::before, .site-header::after { display: none; }
    .brand h1, .brand p { color: #000; text-shadow: none; }
    .card, .section { box-shadow: none; border: 1px solid #ccc; }
    .schedule-table-wrapper { display: block !important; overflow: visible; }
    .cornice { background: none; padding: 0; box-shadow: none; }
    .lavagna { background: #fff; box-shadow: none; }
    .lavagna::after { display: none; }
    .lavagna, .lavagna * { color: #000 !important; text-shadow: none !important; }
    .avviso { border-color: #999; background: #fff; }
    .avviso .categoria { background: #eee; color: #000; }
    .site-footer { background: none; color: #000; border-top: 2px solid #000; }
    .footer-section h3, .footer-section p, .footer-section a, .footer-bottom { color: #000; }
}
