/* ==========================================================================
   UnreaLab — foglio di stile unico, mobile first.
   Ordine: 1 font · 2 variabili · 3 reset · 4 base · 5 layout · 6 componenti
           7 pagine · 8 utilità · 9 movimento ridotto
   Le media query aggiungono regole per schermi più grandi (min-width).
   ========================================================================== */


/* 1. Font (file locali, nessuna richiesta a server esterni) -------------- */

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("../fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("../fonts/atkinson-next.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("../fonts/atkinson-next-italic.woff2") format("woff2");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}


/* 2. Variabili -------------------------------------------------------------- */

:root {
    /* Colori: il verde è quello del green screen */
    --chroma: #00b140;
    --chroma-deep: #007a2e;      /* verde per testi e link su fondo chiaro */
    --chroma-wash: #e4f4e9;
    --ink: #1e2428;              /* testo principale */
    --ink-soft: #4a5358;         /* testo secondario */
    --line: #d3dad5;
    --cyc: #eef1ee;              /* grigio "limbo" per le sezioni alternate */
    --paper: #ffffff;
    --studio: #22292d;           /* fondo scuro di footer e video */
    --studio-text: #cfd8d3;
    --danger: #b3261e;
    --focus: var(--ink);

    /* Tipografia */
    --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
    --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
    --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
    --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
    --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.25rem);
    --step-3: clamp(2rem, 1.5rem + 2.6vw, 3.5rem);
    --step-4: clamp(2.25rem, 1.5rem + 4vw, 4.75rem);

    /* Spazi */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;
    --section: clamp(3rem, 2rem + 5vw, 6rem);

    /* Layout */
    --container: 75rem;
    --gutter: clamp(1rem, 0.5rem + 3vw, 2.5rem);
    --measure: 42rem;                    /* larghezza massima del testo */
    --cut: clamp(1.75rem, 1rem + 4vw, 4.5rem);  /* altezza del taglio diagonale */
    --header-h: 4rem;
    --radius: 3px;

    /* Marcatore di tracking: la croce che si mette sui green screen */
    --marker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23fff' stroke-opacity='.85' stroke-width='2.2'/%3E%3C/svg%3E");
    --marker-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1v14M1 8h14' stroke='%23007a2e' stroke-width='2.4'/%3E%3C/svg%3E");
}


/* 3. Reset essenziale ------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

[hidden] { display: none !important; }


/* 4. Base ------------------------------------------------------------------- */

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    overflow-wrap: break-word;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); line-height: 1.2; }
h4 { font-size: var(--step-0); line-height: 1.3; }

p, li { text-wrap: pretty; }

a { color: var(--chroma-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

strong, b { font-weight: 700; }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

address { font-style: normal; }

::selection { background: var(--chroma); color: var(--ink); }


/* 5. Layout ----------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--cyc { background: var(--cyc); }
.section + .section:not(.section--cyc, .contact, .location) { padding-top: 0; }

.section__head { max-width: var(--measure); margin-bottom: var(--space-6); }
.section__head > * + * { margin-top: var(--space-3); }
.section__head p { color: var(--ink-soft); }

/* Colonne che diventano affiancate su schermi larghi */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }

@media (min-width: 56rem) {
    .split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
    .split--wide-left { grid-template-columns: 3fr 2fr; }
    .split > .slate,
    .split > .callout { align-self: start; position: sticky; top: calc(var(--header-h) + var(--space-5)); }
    .split > img { align-self: start; }
}


/* 6. Componenti ------------------------------------------------------------- */

/* --- Link per saltare al contenuto ----------------------------------------- */
.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -10rem;
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--ink);
    color: var(--paper);
}
.skip-link:focus { top: var(--space-4); }

/* --- Pulsanti --------------------------------------------------------------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 3rem;
    padding: 0.7rem 1.4rem;
    border: 2px solid var(--chroma);
    border-radius: var(--radius);
    background: var(--chroma);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.button:hover { background: var(--chroma-deep); border-color: var(--chroma-deep); color: var(--paper); }

.button--ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.button--ink:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

.button--ghost { background: transparent; border-color: currentColor; color: var(--ink); }
.button--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.button--small { min-height: 2.75rem; padding: 0.5rem 1rem; font-size: 0.9375rem; }

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

/* --- Intestazione e menu ---------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: var(--header-h);
}

.site-header__logo { display: block; flex-shrink: 0; }
.site-header__logo img { width: auto; height: 2.6rem; }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 2.75rem;
    padding: 0 var(--space-3);
    margin-right: calc(-1 * var(--space-3));
    border: 0;
    background: none;
    font-family: var(--font-display);
    font-weight: 700;
}

/* icona a tre linee che diventa una X */
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
    display: block;
    width: 1.375rem;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, background-color 0.2s;
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before,
.nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { transform: translateY(-7px) rotate(-45deg); }

.no-js .nav-toggle { display: none; }

/* menu mobile: pannello che scende sotto l'intestazione */
.nav__list,
.nav__sub { list-style: none; padding: 0; }

.js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-2) var(--gutter) var(--space-6);
    background: var(--paper);
    border-bottom: 4px solid var(--chroma);
    box-shadow: 0 1.5rem 2rem -1.5rem rgb(30 36 40 / 0.35);
}
.js .nav.is-open { display: block; }

.no-js .nav { width: 100%; padding-bottom: var(--space-4); }
.no-js .site-header__inner { flex-wrap: wrap; }

.nav__item { border-bottom: 1px solid var(--line); }

.nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 3.5rem;
    padding: var(--space-2) 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}
.nav__link[aria-current="page"],
.nav__item--parent.is-active > .nav__link {
    text-decoration: underline;
    text-decoration-color: var(--chroma);
    text-decoration-thickness: 4px;
    text-underline-offset: 0.3em;
}

.nav__chevron {
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
    transition: transform 0.2s;
}
.nav__parent[aria-expanded="true"] .nav__chevron { transform: translateY(25%) rotate(-135deg); }

.js .nav__sub { display: none; }
.js .nav__parent[aria-expanded="true"] + .nav__sub { display: block; }
.nav__sub { padding-bottom: var(--space-3); }

.nav__sublink {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 2.75rem;
    padding-left: var(--space-1);
    color: var(--ink);
    font-size: 1.0625rem;
    text-decoration: none;
}
.nav__sublink::before {
    content: "";
    flex: 0 0 0.75rem;
    height: 0.75rem;
    background: var(--marker-ink) center / contain no-repeat;
}
.nav__sublink[aria-current="page"] { font-weight: 700; color: var(--chroma-deep); }

@media (min-width: 62rem) {
    :root { --header-h: 5rem; }

    .site-header__logo img { height: 3rem; }
    .nav-toggle { display: none; }

    .js .nav,
    .no-js .nav {
        display: block;
        position: static;
        width: auto;
        max-height: none;
        overflow: visible;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .nav__list { display: flex; align-items: center; gap: var(--space-2); }
    .nav__item { position: relative; border: 0; }

    .nav__link {
        gap: var(--space-2);
        min-height: 2.75rem;
        padding: 0 var(--space-3);
        font-size: 1rem;
    }
    .nav__link:hover { color: var(--chroma-deep); }

    .nav__sub {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 17rem;
        padding: var(--space-3);
        background: var(--paper);
        border-top: 4px solid var(--chroma);
        box-shadow: 0 1rem 2rem -0.5rem rgb(30 36 40 / 0.25);
    }
    .js .nav__item--parent:hover .nav__sub,
    .js .nav__item--parent:focus-within .nav__sub { display: block; }
    .no-js .nav__sub { display: none; }
    .no-js .nav__item--parent:hover .nav__sub,
    .no-js .nav__item--parent:focus-within .nav__sub { display: block; }

    .nav__sublink { padding: 0 var(--space-3); white-space: nowrap; }
    .nav__sublink:hover { background: var(--chroma-wash); }
}

/* --- Hero con slide (home) -------------------------------------------------- */
.hero {
    --focus: var(--paper);
    position: relative;
    background: var(--chroma);
    overflow: hidden;
}

.hero__track { display: grid; }

.hero__slide {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s;
}
.hero__slide.is-active { opacity: 1; visibility: visible; }
.no-js .hero__slide:not(:first-child) { display: none; }

.hero__media { aspect-ratio: 4 / 3; background: var(--studio); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

.hero__panel {
    flex: 1;
    position: relative;
    margin-top: calc(-1 * var(--cut));
    padding: calc(var(--cut) + var(--space-3)) var(--gutter) var(--space-5);
    clip-path: polygon(0 var(--cut), 100% 0, 100% 100%, 0 100%);
}
.hero__panel { background-color: var(--chroma); background-image: var(--marker), var(--marker); background-repeat: no-repeat; background-size: 0.875rem; background-position: right 7% top 1.25rem, right 12% bottom 1.5rem; }

.hero__content { max-width: 34rem; }
.hero__content > * + * { margin-top: var(--space-4); }
.hero__content .button { margin-top: var(--space-5); }

.hero__title {
    font-size: var(--step-4);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.03em;
}
.hero__text { font-size: var(--step-1); line-height: 1.4; max-width: 30rem; }

.hero__controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--gutter) var(--space-4);
}

.hero__dots { display: flex; flex: 1; gap: var(--space-2); max-width: 22rem; }

.hero__dot {
    position: relative;
    flex: 1;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
}
.hero__dot::before,
.hero__dot-fill {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    margin-top: -2px;
}
.hero__dot::before { background: rgb(30 36 40 / 0.25); }
.hero__dot-fill { background: var(--ink); transform: scaleX(0); transform-origin: left; }
.hero__dot.is-active .hero__dot-fill { animation: hero-progress var(--interval, 6000ms) linear forwards; }
.hero.is-paused .hero__dot.is-active .hero__dot-fill,
.hero.is-static .hero__dot.is-active .hero__dot-fill { animation-play-state: paused; }
.hero.is-static .hero__dot.is-active .hero__dot-fill { animation: none; transform: scaleX(1); }

@keyframes hero-progress { to { transform: scaleX(1); } }

.hero__pause {
    position: relative;
    flex: 0 0 2.75rem;
    height: 2.75rem;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: transparent;
}
/* icona pausa (due barre) / play (triangolo) */
.hero__pause::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.75rem;
    height: 0.875rem;
    border-left: 3px solid var(--ink);
    border-right: 3px solid var(--ink);
}
.hero__pause[aria-pressed="true"]::before {
    width: 0;
    height: 0;
    margin-left: calc(50% - 0.3rem);
    border-top: 0.45rem solid transparent;
    border-bottom: 0.45rem solid transparent;
    border-left: 0.75rem solid var(--ink);
    border-right: 0;
}
.hero.is-static .hero__pause { display: none; }

@media (min-width: 48rem) {
    .hero__media { aspect-ratio: 16 / 9; }
}

@media (min-width: 64rem) {
    .hero__slide { display: block; position: relative; }
    .hero__media { aspect-ratio: auto; height: clamp(32rem, 76vh, 46rem); }

    .hero__panel {
        position: absolute;
        inset: 0 auto 0 0;
        width: min(52%, 46rem);
        margin: 0;
        display: flex;
        align-items: center;
        padding: var(--space-7) calc(var(--cut) * 2.2) calc(var(--space-8) + 1rem) max(var(--gutter), (100vw - var(--container)) / 2);
        clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut) * 1.6) 100%, 0 100%);
    }

    .hero__controls {
        position: absolute;
        left: max(var(--gutter), (100vw - var(--container)) / 2);
        bottom: var(--space-6);
        width: min(30rem, 52% - var(--cut) * 3);
        padding: 0;
    }
}

/* --- Intestazione pagine interne ------------------------------------------- */
.page-hero__panel {
    padding-block: var(--space-7) calc(var(--cut) + var(--space-6));
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
}
.page-hero__panel { background-color: var(--chroma); background-image: var(--marker), var(--marker), var(--marker); background-repeat: no-repeat; background-size: 0.875rem; background-position: right 7% top 1.25rem, left 46% top 1.25rem, left 9% bottom calc(var(--cut) * 0.45); }

.page-hero__text > * { max-width: 52rem; }
.page-hero__title { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.025em; }
.page-hero__lead { margin-top: var(--space-4); font-size: var(--step-1); line-height: 1.45; max-width: 40rem; }

.page-hero__media { margin-top: calc(-1 * var(--cut) + var(--space-3)); position: relative; }
.page-hero__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; max-height: 34rem; }

@media (min-width: 64rem) {
    .page-hero__panel { padding-top: var(--space-8); }
}

/* --- Testo lungo ------------------------------------------------------------ */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose > h2 { margin-top: 2.2em; }
.prose > h3 { margin-top: 1.8em; }
.prose > h2 + *, .prose > h3 + * { margin-top: 0.6em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .list-markers { list-style: none; padding-left: 0; }
.prose ul > li, .list-markers > li { position: relative; padding-left: 1.75rem; }
.prose ul > li + li, .list-markers > li + li { margin-top: 0.5em; }
.prose ul > li::before,
.list-markers > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--marker-ink) center / contain no-repeat;
}
.prose ol { padding-left: 1.5rem; }
.prose ol > li + li { margin-top: 0.5em; }
.prose ol > li::marker { font-family: var(--font-display); font-weight: 700; color: var(--chroma-deep); }

.lead { font-size: var(--step-1); line-height: 1.5; }
.note { color: var(--ink-soft); font-size: var(--step--1); }

/* --- Argomenti (elenco di temi, non sequenziale) ---------------------------- */
.topics {
    display: grid;
    gap: var(--space-5) var(--space-6);
    padding: 0;
    list-style: none;
}
.topics > li {
    position: relative;
    padding: var(--space-4) 0 0 1.75rem;
    border-top: 1px solid var(--line);
}
.topics > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--space-4) + 0.4em);
    width: 0.8rem;
    height: 0.8rem;
    background: var(--marker-ink) center / contain no-repeat;
}
.topics strong { display: block; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; margin-bottom: var(--space-2); }

@media (min-width: 40rem) { .topics { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .topics--3 { grid-template-columns: repeat(3, 1fr); } }

/* --- Passi numerati (contenuti davvero in sequenza) ------------------------- */
.steps { counter-reset: step; display: grid; gap: var(--space-6); padding: 0; list-style: none; }
.steps > li { counter-increment: step; position: relative; }
.steps > li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: var(--space-3);
    background: var(--chroma);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
}
@media (min-width: 40rem) {
    .steps > li { padding-left: 3.5rem; }
    .steps > li::before { position: absolute; left: 0; top: -0.1em; margin: 0; }
}
.steps h3 { margin-bottom: var(--space-3); }
.steps ul { margin-top: var(--space-3); }

/* --- Scheda dettagli (stile ciak) ------------------------------------------ */
.slate {
    --focus: var(--paper);
    max-width: 36rem;
    background: var(--studio);
    color: var(--paper);
}
.slate::before {
    content: "";
    display: block;
    height: 0.875rem;
    background: repeating-linear-gradient(-55deg, var(--paper) 0 1.1rem, var(--studio) 1.1rem 2.2rem);
}
.slate__title { padding: var(--space-5) var(--space-5) 0; font-size: var(--step-1); }
.slate dl { display: grid; padding: var(--space-3) var(--space-5) var(--space-5); }
.slate dl > div {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: var(--space-3);
    padding-block: var(--space-3);
    border-bottom: 1px solid rgb(255 255 255 / 0.15);
}
.slate dl > div:last-child { border-bottom: 0; }
.slate dt { color: var(--studio-text); font-size: var(--step--1); padding-top: 0.15em; }
.slate dd { hyphens: auto; font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; line-height: 1.35; }
.slate dd.is-price { color: var(--chroma); font-size: var(--step-2); line-height: 1; }

/* --- Riquadro di evidenza --------------------------------------------------- */
.callout {
    padding: var(--space-5);
    border-left: 6px solid var(--chroma);
    background: var(--chroma-wash);
}
.callout > * + * { margin-top: var(--space-3); }
.callout__title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); line-height: 1.25; }

/* --- Schede con immagine (es. lezioni) ------------------------------------- */
.cards { display: grid; gap: var(--space-6); padding: 0; list-style: none; }
.card img { width: 100%; aspect-ratio: 12 / 7; object-fit: cover; }
.card__body { padding-top: var(--space-4); }
.card__body > * + * { margin-top: var(--space-2); }
.card__kicker { color: var(--chroma-deep); font-weight: 700; font-size: var(--step--1); }

@media (min-width: 48rem) { .cards { grid-template-columns: repeat(3, 1fr); gap: var(--space-5); } }

/* --- Elenco corsi (home) --------------------------------------------------- */
.course-list { display: grid; gap: var(--space-4); padding: 0; list-style: none; }

.course {
    position: relative;
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3);
    background: var(--paper);
    border: 1px solid var(--line);
}
.course img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.course__title { font-size: var(--step-1); }
.course__title a { color: var(--ink); text-decoration: none; }
.course__title a::after { content: ""; position: absolute; inset: 0; }  /* tutta la scheda è cliccabile */
.course__text { margin-top: var(--space-1); color: var(--ink-soft); font-size: var(--step--1); line-height: 1.45; }
.course:hover { border-color: var(--chroma); box-shadow: inset 6px 0 0 var(--chroma); }
.course:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.course__title a:focus-visible { outline: none; }

@media (min-width: 48rem) {
    .course-list { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
    .course { grid-template-columns: 9rem 1fr; }
}

/* --- Galleria --------------------------------------------------------------- */
.gallery { display: grid; gap: var(--space-3); padding: 0; list-style: none; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 48rem) {
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .gallery > :first-child { grid-column: 1 / -1; }
}

/* --- Tabella prezzi -------------------------------------------------------- */
.price-table { width: 100%; max-width: 36rem; border-collapse: collapse; }
.price-table caption { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); padding-bottom: var(--space-3); }
.price-table th, .price-table td { padding: var(--space-3) var(--space-2); text-align: left; border-bottom: 1px solid var(--line); }
.price-table thead th { border-bottom: 3px solid var(--ink); font-family: var(--font-display); }
.price-table td { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.price-table tbody th { font-weight: 400; }
.price-table td.price-table__hours { font-family: var(--font-body); font-weight: 400; font-size: var(--step--1); }

/* --- Video e mappe con consenso ------------------------------------------- */
.embed {
    --focus: var(--paper);
    position: relative;
    aspect-ratio: var(--ratio, 16 / 9);
    background: var(--studio);
    color: var(--paper);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed.is-loaded .embed__placeholder { display: none; }

.embed__placeholder {
    /* nel flusso: se il testo non entra, il riquadro si allunga invece di tagliarlo */
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
    background-image: var(--marker), var(--marker);
    background-repeat: no-repeat;
    background-size: 0.75rem;
    background-position: right 8% top 14%, left 10% bottom 12%;
}
.embed__note { max-width: 28rem; color: var(--studio-text); font-size: var(--step--1); line-height: 1.45; }

.embed--map { --ratio: 4 / 3; }

.video-grid { display: grid; gap: var(--space-5); }
.video-grid figcaption { margin-top: var(--space-3); font-family: var(--font-display); font-weight: 700; }
@media (min-width: 48rem) { .video-grid { grid-template-columns: repeat(2, 1fr); } }

/* --- Dove siamo ------------------------------------------------------------- */
.location { background: var(--cyc); }
.location__grid { display: grid; gap: var(--space-6); }
.location__info > * + * { margin-top: var(--space-4); }
.location__address { padding-left: var(--space-4); border-left: 4px solid var(--chroma); }
.location__links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.location__photo { margin-top: var(--space-5); width: 100%; }

@media (min-width: 56rem) {
    .location__grid { grid-template-columns: 2fr 3fr; align-items: start; gap: var(--space-8); }
}

/* --- Modulo di contatto ----------------------------------------------------- */
.contact { background: var(--paper); border-top: 1px solid var(--line); }
.contact__grid { display: grid; gap: var(--space-6); }
.contact__intro > * + * { margin-top: var(--space-4); }
.contact__direct { color: var(--ink-soft); }
.contact__direct a { font-weight: 700; }

@media (min-width: 56rem) {
    .contact__grid { grid-template-columns: 2fr 3fr; gap: var(--space-8); }
}

.form { display: grid; gap: var(--space-5); max-width: 36rem; }

.form__alert {
    padding: var(--space-4);
    border-left: 6px solid var(--danger);
    background: #fbeceb;
    color: var(--danger);
    font-weight: 700;
}

.field { display: grid; gap: var(--space-2); }
.field label { font-weight: 700; }
.field__optional { font-weight: 400; color: var(--ink-soft); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.85rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 1rem;    /* almeno 16px: evita lo zoom automatico su iPhone */
    line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus,
.field textarea:focus { border-color: var(--ink); outline: 3px solid var(--chroma); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: var(--step--1); font-weight: 700; }

.field--check { grid-template-columns: auto 1fr; align-items: start; column-gap: var(--space-3); }
.field--check input { width: 1.5rem; height: 1.5rem; margin: 0.1rem 0 0; accent-color: var(--chroma-deep); }
.field--check label { font-weight: 400; }
.field--check .field__error { grid-column: 1 / -1; }

.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit { justify-self: start; }

/* --- Footer ----------------------------------------------------------------- */
.site-footer {
    --focus: var(--paper);
    background: var(--studio);
    color: var(--studio-text);
    font-size: var(--step--1);
}
.site-footer a,
.site-footer .link-button { color: var(--paper); }
.site-footer__inner { display: grid; gap: var(--space-6); padding-block: var(--space-7); }
.site-footer__name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 800; color: var(--paper); line-height: 1; }
.site-footer__brand > * + * { margin-top: var(--space-4); }
.site-footer__brand p:not(.site-footer__name) { max-width: 22rem; }
.site-footer__heading { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--paper); margin-bottom: var(--space-3); }
.site-footer__nav ul { list-style: none; padding: 0; }
.site-footer__nav li a,
.site-footer__nav li .link-button { display: inline-flex; align-items: center; min-height: 2.5rem; }
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-4) var(--space-6);
    border-top: 1px solid rgb(255 255 255 / 0.15);
}

@media (min-width: 48rem) {
    .site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* --- Banner cookie ---------------------------------------------------------- */
.consent {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 90;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    border-top: 6px solid var(--chroma);
    box-shadow: 0 -1rem 3rem rgb(30 36 40 / 0.3);
}
.consent__box { position: relative; padding: var(--space-5) var(--gutter) var(--space-5); }
.consent__title { font-size: var(--step-1); padding-right: 3rem; }
.consent__text { margin-top: var(--space-3); font-size: var(--step--1); line-height: 1.5; }

.consent__close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: none;
}
.consent__close::before,
.consent__close::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.25rem;
    height: 2px;
    background: var(--ink);
    transform: rotate(45deg);
}
.consent__close::after { transform: rotate(-45deg); }

.consent__prefs { margin-top: var(--space-4); }
.consent__prefs fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.consent__option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--cyc);
}
.consent__option input { width: 1.375rem; height: 1.375rem; margin: 0.1rem 0 0; accent-color: var(--chroma-deep); }
.consent__option label { display: grid; gap: var(--space-1); font-size: var(--step--1); line-height: 1.45; }
.consent__option strong { font-size: 1rem; }

.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-4); }
.consent__actions .button { width: 100%; padding-inline: var(--space-3); }
.consent__actions [data-consent-customize],
.consent__actions [data-consent-save] { grid-column: 1 / -1; order: 3; }

@media (min-width: 40rem) {
    .consent {
        inset: auto var(--space-5) var(--space-5) auto;
        width: min(36rem, calc(100% - 2 * var(--space-5)));
        border: 0;
        border-top: 6px solid var(--chroma);
    }
    .consent__box { padding: var(--space-6); }
    .consent__actions { grid-template-columns: repeat(3, auto); justify-content: start; }
    .consent__actions [data-consent-customize],
    .consent__actions [data-consent-save] { grid-column: auto; order: 0; }
}


/* 7. Pagine ----------------------------------------------------------------- */

/* Home: presentazione */
.intro { display: grid; gap: var(--space-6); align-items: center; }
.intro__text > * + * { margin-top: var(--space-4); }
.intro__text .button { margin-top: var(--space-5); }
.intro__image img { width: 100%; }
@media (min-width: 56rem) { .intro { grid-template-columns: 5fr 6fr; gap: var(--space-8); } }

/* Pagine legali: testo lungo e fitto */
.legal .prose { font-size: var(--step--1); line-height: 1.65; max-width: 48rem; }
.legal .prose h2 { font-size: var(--step-1); }
.legal .prose h3 { font-size: 1.0625rem; margin-top: 1.5em; }
.legal .prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.875rem; }
.legal .prose td { padding: var(--space-2); border: 1px solid var(--line); vertical-align: top; }

/* Pagina di conferma / errore */
.message { max-width: var(--measure); }
.message > * + * { margin-top: var(--space-4); }


/* 8. Utilità ---------------------------------------------------------------- */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.stack > * + * { margin-top: var(--space-6); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }


/* 9. Movimento ridotto ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
