/**
 * Navbar Samadhi — struttura e interazioni della navbar Optlyx, palette del centro.
 *
 * Pill galleggiante che si stringe allo scroll; sul desktop (>=1024px) le voci
 * centrali "Corsi" e "Il Centro" aprono pannelli che ESPANDONO la barra verso
 * il basso. L'hamburger apre il menu a tendina curvo su ogni viewport.
 *
 * Namespace sxn- (barra) e sxc- (menu curvo) per non collidere con stylesx.css,
 * che continua a servire le vecchie classi finche' non le rimuoviamo.
 */

/* PP Editorial New — stesso file self-hosted degli altri prodotti Optlyx.
 * Esiste solo il peso Light: sui titoli si usa 400, mai il grassetto finto. */
@font-face {
    font-family: 'PP Editorial New';
    src: url('pp-editorial-new-light.ttf') format('truetype');
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --sx-display: 'PP Editorial New', 'Playfair Display', Georgia, serif;
    --sxn-bar-h: 70px;
    --sxn-bar-h-compact: 56px;
    --sxn-panel-h: 244px;
    --sxn-ink: #1f3b32;
    --sxn-ink-soft: #55665f;
    --sxn-line: rgba(31, 59, 50, 0.12);
    --sxn-tint: rgba(141, 163, 153, 0.16);
    --sxn-surface: rgba(253, 252, 248, 0.94);
}

.sxn-wrap {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 32px);
    max-width: 1080px;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.sxn-shell {
    margin: 0 auto;
    max-width: 1080px;
    height: var(--sxn-bar-h);
    background: var(--sxn-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--sxn-line);
    border-radius: 20px;
    box-shadow: 0 4px 22px rgba(31, 59, 50, 0.08);
    overflow: hidden;
    /* Sostituisce lo spring di motion: stessa idea, curva CSS. */
    transition: height .34s cubic-bezier(.22, 1, .36, 1),
        max-width .34s cubic-bezier(.22, 1, .36, 1),
        border-radius .34s cubic-bezier(.22, 1, .36, 1);
}

/* Dynamic island: oltre i 60px di scroll la barra si stringe. */
.sxn-shell[data-compact="true"] {
    height: var(--sxn-bar-h-compact);
    max-width: 840px;
    border-radius: 26px;
}

.sxn-shell[data-open="true"] {
    height: calc(var(--sxn-bar-h) + var(--sxn-panel-h));
    max-width: 1080px;
    border-radius: 26px;
}

.sxn-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--sxn-bar-h);
    padding: 0 10px 0 18px;
    transition: height .34s cubic-bezier(.22, 1, .36, 1);
}

.sxn-shell[data-compact="true"] .sxn-bar {
    height: var(--sxn-bar-h-compact);
}

.sxn-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sxn-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.sxn-shell[data-compact="true"] .sxn-logo img {
    height: 32px;
}

/* ── nav centrale desktop ── */
.sxn-center {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    gap: 2px;
}

@media (min-width: 1024px) {
    .sxn-center {
        display: flex;
    }
}

.sxn-citem {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sx-display);
    font-size: 16px;
    color: var(--sxn-ink-soft);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    transition: background .15s, color .15s;
}

.sxn-citem:hover,
.sxn-citem[data-open="true"] {
    background: var(--sxn-tint);
    color: var(--sxn-ink);
}

.sxn-citem svg {
    transition: transform .25s;
    opacity: .55;
}

.sxn-citem[data-open="true"] svg {
    transform: rotate(180deg);
}

/* ── destra: telefono, CTA, hamburger ── */
.sxn-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sxn-tel {
    display: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--sxn-ink-soft);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 9px;
    transition: background .15s, color .15s;
}

.sxn-tel:hover {
    background: var(--sxn-tint);
    color: var(--sxn-ink);
}

@media (min-width: 640px) {
    .sxn-tel {
        display: inline-flex;
    }
}

.sxn-shell[data-compact="true"] .sxn-tel {
    display: none;
}

.sxn-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--sxn-ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s, transform .15s;
}

.sxn-cta:hover {
    background: #16302a;
    transform: translateY(-1px);
}

.sxn-shell[data-compact="true"] .sxn-cta {
    padding: 8px 14px;
}

.sxn-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--sxn-ink);
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s;
}

.sxn-burger:hover {
    background: var(--sxn-tint);
}

/* ── pannello che espande la barra ── */
.sxn-panel {
    height: var(--sxn-panel-h);
    border-top: 1px solid rgba(31, 59, 50, 0.08);
    padding: 14px;
    display: none;
}

@media (min-width: 1024px) {

    .sxn-shell[data-open="true"] .sxn-panel[data-active="true"] {
        display: block;
        animation: sxn-panel-in .24s cubic-bezier(.32, .72, 0, 1) both;
    }
}

@keyframes sxn-panel-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

.sxn-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1fr;
    gap: 10px;
    height: 100%;
}

.sxn-grid-flat {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    height: 100%;
}

.sxn-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sxn-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid rgba(31, 59, 50, 0.1);
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    padding: 14px;
    transition: border-color .2s, background .2s;
}

.sxn-card:hover {
    border-color: var(--col-secondary, #8da399);
    background: var(--col-bg-alt, #f4f7f6);
}

.sxn-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .92;
}

.sxn-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(31, 59, 50, 0) 22%, rgba(20, 38, 32, .78) 100%);
}

.sxn-card-title {
    position: relative;
    font-family: var(--sx-display);
    font-size: 18px;
    line-height: 1.2;
    color: var(--sxn-ink);
}

.sxn-card-desc {
    position: relative;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--sxn-ink-soft);
}

.sxn-card[data-media="true"] {
    background: var(--col-primary, #1f3b32);
    border-color: rgba(31, 59, 50, .3);
}

.sxn-card[data-media="true"] .sxn-card-title {
    color: #fff;
}

.sxn-card[data-media="true"] .sxn-card-desc {
    color: rgba(255, 255, 255, .84);
}

.sxn-mini {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(31, 59, 50, 0.1);
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    padding: 12px 14px;
    transition: border-color .2s, background .2s;
}

.sxn-mini:hover {
    border-color: var(--col-secondary, #8da399);
    background: var(--col-bg-alt, #f4f7f6);
}

.sxn-mini .sxn-card-title {
    font-size: 15px;
}

/* Illustrazioni line-art nelle card piatte. */
.sxn-art {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px 2px;
    min-height: 0;
}

.sxn-art svg {
    width: 100%;
    max-width: 150px;
    height: 100%;
    opacity: .8;
}

/* ═══ menu curvo (hamburger) ═══ */
.sxc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(31, 59, 50, .38);
    border: none;
    padding: 0;
    cursor: default;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
}

.sxc-backdrop[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
}

.sxc-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;
    height: 100dvh;
    width: 100vw;
    max-width: 520px;
    background: var(--col-bg, #fdfcf8);
    color: var(--sxn-ink);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(100%);
    transition: transform .7s cubic-bezier(.76, 0, .24, 1);
    visibility: hidden;
}

.sxc-panel[data-open="true"] {
    transform: none;
    visibility: visible;
}

/* La curva a sinistra del pannello: si distende entrando, come su Optlyx. */
.sxc-curve {
    position: absolute;
    top: 0;
    left: -99px;
    width: 100px;
    height: 100%;
    fill: var(--col-bg, #fdfcf8);
    stroke: none;
    pointer-events: none;
}

.sxc-curve path {
    transition: d 1s cubic-bezier(.76, 0, .24, 1);
}

.sxc-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 76px 36px 24px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (min-width: 768px) {
    .sxc-inner {
        padding: 84px 60px 24px;
    }
}

.sxc-eyebrow {
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--sxn-line);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--sxn-ink-soft);
    font-weight: 600;
}

.sxc-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(31, 59, 50, .1);
    text-decoration: none;
    color: var(--sxn-ink);
    padding: 13px 0;
}

@media (min-width: 768px) {
    .sxc-item {
        padding: 16px 0;
    }
}

.sxc-item:hover {
    color: var(--col-secondary, #8da399);
}

.sxc-index {
    font-size: 15px;
    color: rgba(31, 59, 50, .4);
    margin-right: 14px;
    min-width: 1.6em;
}

.sxc-heading {
    display: inline-block;
    font-family: var(--sx-display);
    font-size: clamp(26px, 4.4vh, 40px);
    line-height: 1.1;
    letter-spacing: -.01em;
    transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}

.sxc-item:hover .sxc-heading {
    transform: translateX(-10px);
}

/* Ogni lettera sale in sequenza: il ritardo lo scrive il JS. */
.sxc-letter {
    display: inline-block;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.sxc-item:hover .sxc-letter {
    transform: translateY(-3px);
}

/* Su finestre basse le otto voci non ci stanno: si stringono invece di
 * finire tutte dietro allo scroll. */
@media (max-height: 780px) {
    .sxc-inner {
        padding-top: 58px;
        gap: 6px;
    }

    .sxc-item {
        padding: 6px 0;
    }

    .sxc-heading {
        font-size: clamp(21px, 3.4vh, 30px);
    }
}

.sxc-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1300;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sxn-line);
    border-radius: 9999px;
    background: #fff;
    color: var(--sxn-ink);
    cursor: pointer;
}

.sxc-close:hover {
    background: var(--sxn-tint);
}

.sxc-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 36px 24px;
    border-top: 1px solid rgba(31, 59, 50, .08);
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .sxc-foot {
        padding: 18px 60px 28px;
    }
}

.sxc-foot a {
    font-size: 14px;
    color: var(--sxn-ink-soft);
    text-decoration: none;
}

.sxc-foot a:hover {
    color: var(--sxn-ink);
    text-decoration: underline;
}

.sxc-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--sxn-line);
    border-radius: 9999px;
    color: var(--sxn-ink-soft);
}

.sxc-social:hover {
    background: var(--sxn-tint);
    color: var(--sxn-ink);
    text-decoration: none;
}

.sxc-foot .sxc-cta {
    background: var(--sxn-ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 9999px;
    text-decoration: none;
    font-size: 14px;
}

.sxc-foot .sxc-cta:hover {
    background: #16302a;
    text-decoration: none;
}

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

@media (prefers-reduced-motion: reduce) {

    .sxn-shell,
    .sxc-panel,
    .sxc-curve path,
    .sxc-heading,
    .sxc-letter {
        transition: none !important;
    }

    .sxn-panel[data-active="true"] {
        animation: none !important;
    }
}

/* ═══ footer ═══
 * Impianto di sito/src/components/SiteFooter.astro: marchio e claim a
 * sinistra, quattro colonne di link a destra, riga finale con copyright e
 * note legali. Palette del centro: fondo verde profondo, testo avorio.
 * Sta qui e non in un file a parte perche' navbar.css e' gia' caricato da
 * tutte le pagine. */
.sxf {
    background: #142620;
    color: var(--col-bg, #fdfcf8);
    border-top: 1px solid rgba(253, 252, 248, .1);
}

.sxf-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 64px 24px 28px;
}

.sxf-top {
    display: grid;
    gap: 44px;
}

@media (min-width: 1024px) {
    .sxf-top {
        grid-template-columns: 1.15fr 2fr;
        gap: 56px;
    }
}

.sxf-logo {
    height: 42px;
    width: auto;
    display: block;
    /* Il lockup e' verde su trasparente: su fondo scuro va schiarito. */
    filter: brightness(0) invert(1);
    opacity: .92;
}

.sxf-claim {
    margin: 20px 0 0;
    max-width: 34ch;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(253, 252, 248, .62);
}

.sxf-socials {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.sxf .sxf-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(253, 252, 248, .2);
    border-radius: 9999px;
    color: rgba(253, 252, 248, .75);
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}

.sxf .sxf-socials a:hover {
    background: rgba(253, 252, 248, .1);
    border-color: rgba(253, 252, 248, .45);
    color: #fff;
}

.sxf-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

@media (min-width: 768px) {
    .sxf-cols {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sxf-heading {
    margin: 0;
    font-family: var(--sx-display);
    font-size: 17px;
    color: var(--col-bg, #fdfcf8);
}

.sxf-cols ul {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

/* Selettori discendenti: le pagine hanno regole `footer a` che altrimenti
 * vincono e riportano i link al colore vecchio. */
.sxf .sxf-cols a {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(253, 252, 248, .62);
    text-decoration: none;
    transition: color .15s;
    /* l'indirizzo email e' piu' lungo della colonna */
    overflow-wrap: anywhere;
}

.sxf .sxf-cols a:hover {
    color: #fff;
}

.sxf-note {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.65;
    color: rgba(253, 252, 248, .55);
}

.sxf .sxf-cols a.sxf-cta {
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: var(--col-bg, #fdfcf8);
    color: #1f3b32;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s, background .15s;
}

.sxf .sxf-cols a.sxf-cta:hover {
    background: #fff;
    transform: translateY(-1px);
}

.sxf-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 52px;
    padding-top: 22px;
    border-top: 1px solid rgba(253, 252, 248, .12);
    font-size: 12px;
    color: rgba(253, 252, 248, .45);
}

@media (min-width: 640px) {
    .sxf-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.sxf-bottom p {
    margin: 0;
}

.sxf .sxf-bottom a {
    color: inherit;
    text-decoration: none;
}

.sxf .sxf-bottom a:hover {
    color: rgba(253, 252, 248, .8);
}

.sxf-by {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sxf-crafted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 10px;
}

.sxf-optlyx {
    height: 13px;
    width: auto;
    display: block;
    opacity: .7;
}

/* ═══ pagine documento (privacy, cookie) ═══
 * Testo lungo, colonna stretta, nessuna decorazione: quel che conta e'
 * che si legga e si trovi il paragrafo giusto. */
.sxdoc {
    background: var(--col-bg, #fdfcf8);
    padding: 150px 24px 90px;
}

.sxdoc-inner {
    max-width: 760px;
    margin: 0 auto;
}

.sxdoc-eyebrow {
    margin: 0 0 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--col-secondary, #8da399);
}

.sxdoc h1 {
    margin: 0;
    font-family: var(--sx-display);
    font-size: clamp(34px, 5.2vw, 58px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--sxn-ink);
}

.sxdoc-lead {
    margin: 22px 0 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #47554f;
}

.sxdoc-meta {
    margin: 28px 0 0;
    padding: 16px 20px;
    border: 1px solid var(--sxn-line);
    border-radius: 16px;
    background: #fff;
    font-size: .85rem;
    line-height: 1.7;
    color: var(--sxn-ink-soft);
}

.sxdoc-body {
    margin-top: 44px;
}

.sxdoc-body h2 {
    margin: 48px 0 0;
    font-family: var(--sx-display);
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--sxn-ink);
}

.sxdoc-body h3 {
    margin: 30px 0 0;
    font-family: var(--sx-display);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--sxn-ink);
}

.sxdoc-body p,
.sxdoc-body li {
    font-size: .97rem;
    line-height: 1.8;
    color: #47554f;
}

.sxdoc-body p {
    margin: 14px 0 0;
}

.sxdoc-body ul {
    margin: 14px 0 0;
    padding-left: 20px;
}

.sxdoc-body li {
    margin-top: 8px;
}

.sxdoc-body a {
    color: var(--sxn-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(31, 59, 50, .3);
}

.sxdoc-body a:hover {
    text-decoration-color: var(--sxn-ink);
}

.sxdoc-body strong {
    color: var(--sxn-ink);
    font-weight: 600;
}

/* Tabella dei cookie: su telefono scorre invece di stringersi. */
.sxdoc-table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid var(--sxn-line);
    border-radius: 16px;
    background: #fff;
}

.sxdoc-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: .87rem;
}

.sxdoc-table th,
.sxdoc-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(31, 59, 50, .08);
    line-height: 1.55;
    color: #47554f;
}

.sxdoc-table th {
    font-weight: 600;
    color: var(--sxn-ink);
    background: var(--col-bg-alt, #f4f7f6);
}

.sxdoc-table tr:last-child td {
    border-bottom: 0;
}

/* Nota che segnala qualcosa da completare o verificare. */
.sxdoc-todo {
    margin: 22px 0 0;
    padding: 16px 20px;
    border-left: 3px solid var(--col-accent, #d6c6b0);
    background: #fdf8ef;
    border-radius: 0 12px 12px 0;
    font-size: .9rem;
    line-height: 1.7;
    color: #5b4b32;
}
