/*
Theme Name: La Monna
Theme URI: https://cooperativalamonna.it
Author: Cooperativa La Monna
Author URI: https://cooperativalamonna.it
Description: Tema moderno, elegante e coinvolgente per la Cooperativa di Comunità La Monna di Scontrone. Storytelling visivo, immagini immersive, design contemporaneo.
Version: 2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lamonna
Tags: cooperativa, comunità, abruzzo, turismo, montagna, premium, modern
*/

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
    /* Brand palette - natura, comunità, tradizione */
    --color-forest-900: #0f2a1d;
    --color-forest-800: #173a29;
    --color-forest-700: #1f4e36;
    --color-forest-600: #2d6a4a;
    --color-forest-500: #3a8159;
    --color-forest-400: #6aa988;

    --color-terracotta-700: #8b3a1f;
    --color-terracotta-600: #b04a26;
    --color-terracotta-500: #c85a32;

    --color-gold-600: #b8862f;
    --color-gold-500: #d4a84a;
    --color-gold-400: #e6c478;
    --color-cream:    #faf6ef;
    --color-cream-2:  #f3ede0;
    --color-sand:     #e8dec7;

    --color-ink-900:  #11201a;
    --color-ink-700:  #2b3a33;
    --color-ink-500:  #54655d;
    --color-ink-300:  #94a39b;
    --color-line:     #e6e3dc;

    /* Aliases retro-compatibili */
    --primary-color:   var(--color-forest-700);
    --color-primary:   var(--color-forest-700);
    --secondary-color: var(--color-terracotta-600);
    --accent-color:    var(--color-gold-500);
    --text-dark:       var(--color-ink-900);
    --text-light:      #ffffff;
    --bg-light:        var(--color-cream);
    --white:           #ffffff;

    /* Shadow scale */
    --shadow-xs: 0 1px 2px rgba(15, 42, 29, 0.06);
    --shadow-sm: 0 2px 6px rgba(15, 42, 29, 0.08);
    --shadow:    0 8px 20px rgba(15, 42, 29, 0.10);
    --shadow-md: 0 14px 32px rgba(15, 42, 29, 0.14);
    --shadow-lg: 0 24px 60px rgba(15, 42, 29, 0.20);
    --shadow-glow: 0 0 0 6px rgba(212, 168, 74, 0.18);

    /* Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    /* Layout */
    --container: 1240px;
    --container-narrow: 960px;
    --header-h: 100px;

    /* Motion */
    --ease: cubic-bezier(.2, .7, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);

    /* Typography */
    --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
    --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--color-ink-700);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, picture, video, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--color-forest-700); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--color-terracotta-600); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    color: var(--color-ink-900);
    letter-spacing: -0.01em;
}

p { color: var(--color-ink-700); }

::selection { background: var(--color-gold-400); color: var(--color-ink-900); }

:focus-visible {
    outline: 3px solid var(--color-gold-500);
    outline-offset: 3px;
    border-radius: 4px;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px,1px,1px,1px);
    width: 1px; height: 1px; overflow: hidden;
}

.skip-link {
    position: absolute;
    left: -9999px; top: 0;
    background: var(--color-forest-800);
    color: #fff;
    padding: 12px 18px;
    z-index: 10000;
}
.skip-link:focus { left: 12px; top: 12px; clip: auto; width: auto; height: auto; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Reveal-on-scroll utility */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   HEADER (fixed overlay, glass)
   ========================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid rgba(15, 42, 29, 0.08);
    transition: transform .35s var(--ease), box-shadow .3s var(--ease);
}

.site-header.is-scrolled {
    background: var(--color-forest-900);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.site-header.scroll-down { transform: translateY(-100%); }
.site-header.scroll-up   { transform: translateY(0); }

/* Pagine senza hero: lascia spazio per l'header fisso */
body .site-content {
    padding-top: var(--header-h);
}
/* Sulla homepage l'hero parte subito sotto l'header fisso */
body.homepage-template .site-content,
body.has-hero-overlay .site-content {
    padding-top: var(--header-h);
}

.header-main { padding: 18px 0; }

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

/* Branding */
.site-branding { display: flex; align-items: center; flex: 0 0 auto; }
.branding-wrapper { display: flex; align-items: center; gap: 18px; line-height: 1; }
.branding-text { display: flex; flex-direction: column; line-height: 1.15; }

.custom-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(15, 42, 29, 0.12), 0 0 0 1px rgba(15, 42, 29, 0.06);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.custom-logo-link:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 10px 26px rgba(15, 42, 29, 0.18), 0 0 0 3px rgba(212, 168, 74, 0.45);
}
.custom-logo {
    display: block;
    height: 64px;
    width: 64px;
    max-height: none;
    object-fit: contain;
    border-radius: 50%;
}
.site-logo { font-size: 2.4em; line-height: 1; }

.site-title {
    font-family: var(--font-display);
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}
.site-title a {
    color: var(--color-forest-800);
    background-image: linear-gradient(120deg, var(--color-forest-700), var(--color-terracotta-600));
    -webkit-background-clip: text;
    background-clip: text;
}

.site-description {
    font-size: .82em;
    color: var(--color-ink-500);
    margin-top: 2px;
    font-family: var(--font-sans);
}

/* Navigation */
.main-navigation { display: flex; align-items: center; }
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
}
.main-navigation a {
    position: relative;
    display: inline-block;
    color: var(--color-ink-900);
    font-weight: 500;
    font-size: .96em;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    transition: color .25s var(--ease), background .25s var(--ease);
}
.main-navigation a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background: var(--color-gold-500);
    transition: width .3s var(--ease), left .3s var(--ease);
}
.main-navigation a:hover { color: var(--color-forest-700); background: rgba(58, 129, 89, 0.08); }
.main-navigation a:hover::after { width: 22px; left: calc(50% - 11px); }

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_ancestor > a {
    color: var(--color-forest-800);
    background: rgba(58, 129, 89, 0.10);
}
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after {
    width: 22px; left: calc(50% - 11px);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(15, 42, 29, 0.15);
    color: var(--color-forest-800);
    border-radius: 50%;
    width: 44px; height: 44px;
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: all .25s var(--ease);
}
.menu-toggle:hover { background: var(--color-forest-700); border-color: var(--color-forest-700); }
.menu-toggle:hover .dot { background: #fff; }

.dots-menu { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.dots-menu .dot {
    width: 5px; height: 5px;
    background: var(--color-forest-800);
    border-radius: 50%;
    transition: background .25s var(--ease);
}

/* Login button */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-forest-700);
    color: #fff;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: .92em;
    transition: all .3s var(--ease);
    box-shadow: 0 6px 16px rgba(31, 78, 54, 0.25);
}
.btn-login:hover {
    background: var(--color-forest-800);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(31, 78, 54, 0.32);
}

/* User dropdown */
.user-menu-dropdown { position: relative; }
.user-menu-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 16px 4px 4px;
    background: rgba(58, 129, 89, 0.08);
    border: 1px solid rgba(15, 42, 29, 0.10);
    border-radius: var(--radius-pill);
    color: var(--color-ink-900);
    cursor: pointer;
    height: 44px;
    transition: all .25s var(--ease);
    white-space: nowrap;
}
.user-menu-toggle:hover {
    background: rgba(58, 129, 89, 0.16);
    border-color: var(--color-gold-500);
    box-shadow: var(--shadow-glow);
}
.user-menu-toggle img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.user-avatar-initial {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    color: #fff; font-weight: 700; font-size: 16px;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
}
.user-avatar-initial-large {
    width: 52px; height: 52px; font-size: 22px;
    border: 3px solid var(--color-gold-500);
}

.user-name-desktop { font-size: .9em; font-weight: 600; color: var(--color-ink-900); }
.user-name-mobile { display: none; }

.user-menu-content {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--color-line);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all .25s var(--ease);
    z-index: 1001;
    overflow: hidden;
}
.user-menu-toggle[aria-expanded="true"] + .user-menu-content {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.user-menu-header {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--color-forest-700), var(--color-forest-900));
    color: #fff;
    border-bottom: 3px solid var(--color-gold-500);
}
.user-menu-header .user-name-mobile {
    display: block;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

.user-menu-content a {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 20px;
    color: var(--color-ink-900);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.user-menu-content a:hover { background: var(--color-cream); color: var(--color-forest-700); }
.user-menu-content a:last-child { border-top: 1px solid var(--color-line); color: var(--color-terracotta-600); }
.user-menu-content a:last-child:hover { background: #fbecea; color: var(--color-terracotta-700); }
.user-menu-content i { width: 16px; text-align: center; }

.user-menu-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.user-menu-overlay.active { display: block; opacity: 1; }

/* =========================================================
   HERO SECTION (cinematic)
   ========================================================= */
.hero-section {
    position: relative;
    height: calc(100vh - var(--header-h));
    height: calc(100svh - var(--header-h)); /* mobile: tiene conto della UI del browser */
    min-height: 460px;
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-forest-900), var(--color-forest-700) 50%, var(--color-forest-800));
    color: #fff;
    isolation: isolate;
    margin: 0;
}

.hero-background {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: .55;
    animation: heroKenBurns 22s var(--ease-out) infinite alternate;
}

@keyframes heroKenBurns {
    0%   { transform: scale(1.05) translate(0, 0); }
    100% { transform: scale(1.15) translate(-2%, -1%); }
}

.hero-overlay {
    position: absolute; inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(212, 168, 74, 0.20), transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(184, 74, 38, 0.18), transparent 60%),
        linear-gradient(180deg, rgba(15, 42, 29, 0.55) 0%, rgba(15, 42, 29, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 880px;
    padding: 40px 24px 60px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 5.6vw, 4.8rem);
    font-weight: 600;
    line-height: 1.05;
    margin-bottom: 24px;
    color: #fff;
    text-shadow: 0 2px 30px rgba(0,0,0,0.25);
    animation: heroFadeUp 1s var(--ease-out) .1s both;
}
.hero-title em { font-style: italic; color: var(--color-gold-400); font-weight: 500; }

.hero-subtitle {
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    font-weight: 400;
    max-width: 680px;
    margin: 0 auto 40px;
    opacity: .92;
    color: #fff;
    animation: heroFadeUp 1s var(--ease-out) .25s both;
}

.hero-buttons {
    display: flex; gap: 16px;
    justify-content: center; flex-wrap: wrap;
    animation: heroFadeUp 1s var(--ease-out) .4s both;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-scroll-cue {
    position: absolute;
    bottom: 28px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: .72em;
    letter-spacing: .25em;
    text-transform: uppercase;
    display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
    animation: heroFadeUp 1s var(--ease-out) .7s both;
    z-index: 1;
}
.hero-scroll-cue::after {
    content: '';
    width: 2px; height: 38px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), transparent);
    animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.4) translateY(8px); opacity: .4; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1em;
    letter-spacing: .01em;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
    line-height: 1;
    text-decoration: none;
}
.btn i { transition: transform .25s var(--ease); }
.btn:hover i { transform: translateX(3px); }

.btn-primary {
    background: linear-gradient(135deg, var(--color-gold-500), var(--color-gold-600));
    color: var(--color-ink-900);
    box-shadow: 0 10px 24px rgba(184, 134, 47, 0.32);
}
.btn-primary:hover {
    color: var(--color-ink-900);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(184, 134, 47, 0.40);
}

.btn-secondary {
    background: transparent;
    color: var(--color-forest-700);
    border-color: var(--color-forest-700);
}
.btn-secondary:hover {
    background: var(--color-forest-700);
    color: #fff;
    transform: translateY(-3px);
}

.hero-section .btn-secondary {
    color: #fff;
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(6px);
}
.hero-section .btn-secondary:hover { background: #fff; color: var(--color-forest-800); }

.btn-ghost { background: transparent; color: var(--color-forest-700); }
.btn-ghost:hover { background: rgba(58,129,89,0.10); }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section-alt { background: var(--color-cream); }
.section-dark { background: var(--color-forest-900); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }

/* Chi Siamo section: riempie tutto lo schermo quando si scrolla tramite ancora */
#chi-siamo {
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100svh - var(--header-h));
    display: flex;
    align-items: center;
    /* padding-top garantisce che il titolo non finisca dietro l'header fisso */
    padding-top: max(var(--header-h), clamp(64px, 9vw, 120px));
}
#chi-siamo .container {
    width: 100%;
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto clamp(40px, 6vw, 72px);
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: .78em;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--color-terracotta-600);
    font-weight: 600;
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: var(--color-ink-900);
    margin-bottom: 18px;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.section-description {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    color: var(--color-ink-500);
    line-height: 1.7;
    margin: 0;
}

/* =========================================================
   CARDS GRID
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    align-items: stretch; /* tutte le celle della stessa riga hanno uguale altezza */
}

/* Tutte le card: flex colonna, si espandono fino a riempire la cella della griglia */
.card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-line);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
    display: flex;
    flex-direction: column;
    height: 100%; /* occupa tutta l'altezza della cella del grid */
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: rgba(212, 168, 74, 0.45);
}

/* --- Wrapper immagine card (garantisce altezza uguale con o senza foto) --- */
.card-image-wrap {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-forest-100, #e8f1ec), var(--color-cream));
    flex-shrink: 0; /* non si restringe mai */
}

img.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease-out);
    display: block;
}
.card:hover img.card-image { transform: scale(1.05); }

/* Placeholder quando non c'è immagine: stesso spazio, sfondo gradient */
.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(58,129,89,0.10), rgba(212,168,74,0.14));
    font-size: 3em;
    color: var(--color-forest-400, #6faa88);
}

/* cards-uniform: forza tutte le card della griglia ad avere le stesse altezze
   dei blocchi interni grazie a CSS Subgrid (supporto moderno) con fallback grid */
.cards-grid.cards-uniform {
    grid-template-rows: auto; /* ogni riga si adatta alla più alta */
}

/* Subgrid: dove supportato allinea immagine + contenuto fra tutte le card */
@supports (grid-template-rows: subgrid) {
    .cards-grid.cards-uniform {
        grid-template-rows: auto;
        /* Ogni card ha 2 righe: immagine | contenuto */
    }
    .cards-grid.cards-uniform .card {
        display: grid;
        grid-row: span 2;
        grid-template-rows: subgrid;
    }
}

.card-content { padding: 28px; display: flex; flex-direction: column; flex: 1; }

.card-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 56px; height: 56px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 1.6em;
    background: linear-gradient(135deg, rgba(58,129,89,0.12), rgba(212,168,74,0.18));
    color: var(--color-forest-700);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.4em;
    color: var(--color-ink-900);
    margin-bottom: 12px;
    line-height: 1.25;
}

.card-text {
    color: var(--color-ink-500);
    margin-bottom: 22px;
    line-height: 1.7;
    flex: 1;
}

.card-link {
    color: var(--color-terracotta-600);
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    align-self: flex-start;
}
.card-link i { transition: transform .25s var(--ease); }
.card-link:hover { color: var(--color-forest-700); }
.card-link:hover i { transform: translateX(4px); }

/* =========================================================
   STATS SECTION
   ========================================================= */
.stats-section {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(212,168,74,0.18), transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(184,74,38,0.18), transparent 55%),
        linear-gradient(135deg, var(--color-forest-900), var(--color-forest-700));
    color: #fff;
    position: relative;
}
.stats-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,0.025) 12px 13px);
    pointer-events: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    text-align: center;
    position: relative;
}

.stat-item { padding: 20px; }

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.8rem);
    font-weight: 600;
    line-height: 1;
    color: var(--color-gold-400);
    margin-bottom: 12px;
    letter-spacing: -.02em;
}

.stat-label {
    font-size: 1em;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .92;
    font-weight: 500;
}

/* =========================================================
   TERRITORY / SPLIT SECTION
   ========================================================= */
.territory-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 5vw, 64px);
    align-items: stretch;
}

.territory-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    width: 100%;
    /* Niente height/min-height: l'altezza è determinata dalla colonna di testo
       grazie ad align-items: stretch del grid genitore */
}
.territory-image-wrapper > picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%; height: 100%;
}
.territory-image { width: 100%; height: 100%; object-fit: cover; }
/* L'immagine "spazio di comunità" è statica: nessuna animazione/hover */

.territory-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(15,42,29,0.45) 100%);
    pointer-events: none;
}
.territory-image-wrapper::after {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: calc(var(--radius-lg) - 8px);
    pointer-events: none;
}

.territory-text { min-width: 0; }
.territory-text .section-eyebrow { margin-bottom: 12px; }
.territory-text h3 {
    font-family: var(--font-display);
    color: var(--color-ink-900);
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    margin-bottom: 18px;
    line-height: 1.2;
}
.territory-text p { color: var(--color-ink-500); margin-bottom: 18px; line-height: 1.8; }
.territory-text p:last-of-type { margin-bottom: 0; }
.territory-text p strong { color: var(--color-forest-700); font-weight: 600; }
.territory-text p em { color: var(--color-terracotta-600); font-style: italic; }
.territory-text .cta-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }

/* =========================================================
   TERRITORY CARDS (Il Nostro Territorio)
   ========================================================= */
.territory-section .cards-grid.territory-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.territory-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    height: 100%; /* uguale altezza nella riga */
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.territory-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(58,129,89,0.05), rgba(212,168,74,0.06));
    opacity: 0;
    transition: opacity .4s var(--ease);
}
.territory-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--color-forest-500), var(--color-gold-500));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .5s var(--ease);
}
.territory-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212, 168, 74, 0.5);
    box-shadow: var(--shadow-md);
}
.territory-card:hover::before { opacity: 1; }
.territory-card:hover::after  { transform: scaleX(1); }

.territory-card .card-content {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.territory-card .card-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 64px; height: 64px;
    margin-bottom: 22px;
    font-size: 1.7em;
    color: var(--color-forest-700);
    background: linear-gradient(135deg, rgba(58,129,89,0.12), rgba(212,168,74,0.20));
    border-radius: var(--radius);
    transition: transform .4s var(--ease), background .4s var(--ease), color .4s var(--ease);
}
.territory-card:hover .card-icon {
    transform: rotate(-6deg) scale(1.06);
    background: linear-gradient(135deg, var(--color-forest-700), var(--color-forest-600));
    color: var(--color-gold-400);
}

.territory-card .card-title {
    font-family: var(--font-display);
    font-size: 1.32em;
    color: var(--color-ink-900);
    margin-bottom: 12px;
    line-height: 1.25;
}
.territory-card .card-text {
    color: var(--color-ink-500);
    line-height: 1.7;
    margin-bottom: 0;
    flex: 1;
}
.territory-card .card-text strong { color: var(--color-forest-700); font-weight: 600; }

/* =========================================================
   TERRITORY FEATURES (legacy fallback)
   ========================================================= */
.territory-features {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 24px;
}
.territory-features li {
    padding: 12px 0 12px 40px;
    position: relative;
    color: var(--color-ink-700);
    border-bottom: 1px dashed var(--color-line);
    font-size: .98em;
}
.territory-features li:last-child { border-bottom: none; }
.territory-features li::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 24px; height: 24px;
    transform: translateY(-50%);
    background: var(--color-forest-700);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(58,129,89,0.10);
}
.territory-features li::after {
    content: '✓';
    position: absolute;
    left: 7px; top: 50%;
    transform: translateY(-52%);
    color: #fff;
    font-size: .78em;
    font-weight: 700;
}

/* =========================================================
   CTA SECTION
   ========================================================= */
.cta-section {
    position: relative;
    text-align: center;
    padding: clamp(64px, 8vw, 110px) 24px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(212,168,74,0.30), transparent 55%),
        linear-gradient(135deg, var(--color-terracotta-700), var(--color-terracotta-500));
    color: #fff;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.10) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: .5;
    pointer-events: none;
}
.cta-section > * { position: relative; }
.cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    color: #fff;
    margin-bottom: 18px;
}
.cta-text {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    color: rgba(255,255,255,0.95);
    max-width: 640px;
    margin: 0 auto 32px;
}
.cta-section .btn-primary {
    background: #fff;
    color: var(--color-terracotta-700);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}
.cta-section .btn-primary:hover { background: var(--color-gold-400); color: var(--color-ink-900); }

/* =========================================================
   POSTS / BLOG
   ========================================================= */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    align-items: stretch;
}

.post-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-line);
    box-shadow: var(--shadow-sm);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform .8s var(--ease-out);
}
.post-card:hover .post-thumbnail { transform: scale(1.05); }

.post-content { padding: 26px; display: flex; flex-direction: column; flex: 1; }

.post-meta {
    display: flex; gap: 18px; flex-wrap: wrap;
    font-size: .82em;
    color: var(--color-ink-300);
    margin-bottom: 12px;
    letter-spacing: .03em;
}
.post-meta i { color: var(--color-gold-500); margin-right: 6px; }

.post-title {
    font-family: var(--font-display);
    font-size: 1.35em;
    margin-bottom: 14px;
    line-height: 1.25;
}
.post-title a { color: var(--color-ink-900); }
.post-title a:hover { color: var(--color-terracotta-600); }

.post-excerpt { color: var(--color-ink-500); margin-bottom: 18px; flex: 1; }

.read-more {
    color: var(--color-terracotta-600);
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    align-self: flex-start;
}
.read-more i { transition: transform .25s var(--ease); }
.read-more:hover i { transform: translateX(4px); }

/* =========================================================
   CONTENT TYPOGRAPHY
   ========================================================= */
.entry-content { color: var(--color-ink-700); }
.entry-content h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); margin: 1.4em 0 .5em; }
.entry-content p { margin-bottom: 1.1em; }
.entry-content a { color: var(--color-terracotta-600); border-bottom: 1px solid currentColor; }
.entry-content blockquote {
    border-left: 4px solid var(--color-gold-500);
    padding: 18px 24px;
    background: var(--color-cream);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    margin: 1.6em 0;
}

.entry-content ul:not(.main-navigation ul):not(.footer-widget ul),
.entry-content ol:not(.main-navigation ol):not(.footer-widget ol),
article .entry-content ul,
article .entry-content ol,
.page-content ul, .page-content ol,
.post-content ul, .post-content ol {
    margin: 18px 0;
    padding-left: 28px;
    line-height: 1.8;
}
.entry-content ul:not(.main-navigation ul):not(.footer-widget ul) { list-style: disc; }
.entry-content ol:not(.main-navigation ol):not(.footer-widget ol) { list-style: decimal; }
.entry-content li { margin-bottom: 8px; color: var(--color-ink-700); }

/* =========================================================
   VIDEO SECTION (chi siamo)
   ========================================================= */
.chi-siamo-hero {
    padding: clamp(80px, 12vw, 140px) 0 clamp(40px, 6vw, 60px);
    background: linear-gradient(180deg, var(--color-cream), #fff);
    text-align: center;
}

.video-section { padding: clamp(40px, 6vw, 80px) 0 clamp(64px, 9vw, 120px); }
.video-container { max-width: 1100px; margin: 0 auto; }
.video-title {
    font-family: var(--font-display);
    text-align: center;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    color: var(--color-ink-900);
    margin-bottom: 14px;
}
.video-description {
    text-align: center;
    color: var(--color-ink-500);
    margin: 0 auto 36px;
    max-width: 680px;
}

.video-wrapper { position: relative; width: 100%; }

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.video-placeholder {
    position: absolute; inset: 0;
    transition: opacity .3s var(--ease);
    background: #000;
    display: flex; align-items: center; justify-content: center;
}
.video-thumb { width: 100%; height: 100%; object-fit: cover; }

.video-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: transform .3s var(--ease);
}
.video-play-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.video-play-btn svg { filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35)); }

.video-placeholder-empty {
    background: var(--color-cream);
    border: 2px dashed var(--color-forest-600);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    color: var(--color-ink-700);
}
.video-placeholder-empty p { margin-bottom: 14px; }

.chi-siamo-content { background: var(--color-cream); }
.valori-section { background: #fff; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    position: relative;
    /* Palette token interne al footer per garantire WCAG AA su sfondo scuro */
    --footer-bg-1: #0a1812;
    --footer-bg-2: #050c08;
    --footer-text:        #e6ece8; /* ~13:1 — body */
    --footer-text-muted:  #b8c4bd; /* ~7.5:1 — descrizioni */
    --footer-text-subtle: #94a39b; /* ~5:1 — copyright */
    --footer-border:      rgba(255,255,255,0.14);
    --footer-surface:     rgba(255,255,255,0.06);

    background:
        radial-gradient(ellipse at 85% 0%, rgba(58,129,89,0.22), transparent 55%),
        radial-gradient(ellipse at 15% 100%, rgba(184,74,38,0.18), transparent 55%),
        linear-gradient(180deg, var(--footer-bg-1) 0%, var(--footer-bg-2) 100%);
    color: var(--footer-text);
    padding: clamp(80px, 9vw, 120px) 0 24px;
    overflow: hidden;
    isolation: isolate;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-forest-500), var(--color-gold-500), var(--color-terracotta-600));
    z-index: 2;
}

.site-footer .container { position: relative; z-index: 1; }

/* Override globali: garantisce che nessun testo interno al footer
   erediti i colori scuri del body (p, span, h*, li, strong, em…) */
.site-footer,
.site-footer p,
.site-footer li,
.site-footer span,
.site-footer strong,
.site-footer em,
.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6 {
    color: var(--footer-text);
}
.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6,
.site-footer strong { color: #fff; }

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 56px;
    margin-bottom: 56px;
}

/* ---- Brand ---- */
.footer-brand { display: flex; flex-direction: column; gap: 20px; }

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    padding: 4px;
    margin: -4px;
    transition: opacity .25s var(--ease);
}
.footer-brand-link:hover { opacity: .92; color: #fff; }
.footer-brand-link:focus-visible {
    outline: 3px solid var(--color-gold-500);
    outline-offset: 4px;
}

.footer-logo {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.10);
    flex-shrink: 0;
}
/* the_custom_logo() emette: <a class="custom-logo-link"><img class="custom-logo"></a>
   Dentro .footer-logo-wrap lo rendiamo simile al cerchio-logo */
.footer-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.footer-logo-wrap .custom-logo-link {
    display: inline-flex;
    pointer-events: none; /* il link esterno è già .footer-brand-link */
}
.footer-logo-wrap .custom-logo,
.footer-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.10);
    flex-shrink: 0;
    display: block;
}
.footer-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    font-size: 2.2em;
    line-height: 1;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.14);
}

.footer-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.footer-brand-title {
    font-family: var(--font-display);
    font-size: 1.45em;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.footer-brand-sub {
    font-size: .82em;
    color: var(--color-gold-400);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}

.footer-brand-desc {
    color: var(--footer-text-muted);
    line-height: 1.75;
    max-width: 380px;
    margin: 0;
}

.footer-social-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.footer-social-label {
    font-size: .82em;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--footer-text-muted);
    font-weight: 600;
}

/* ---- Columns ---- */
.footer-column { color: var(--footer-text); min-width: 0; }

.footer-widget h3,
.site-footer h3,
.footer-column h3 {
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.08em;
    font-weight: 600;
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 14px;
    letter-spacing: .01em;
}
.footer-widget h3::after,
.site-footer h3::after,
.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 36px; height: 2px;
    background: linear-gradient(90deg, var(--color-gold-500), var(--color-terracotta-500));
    border-radius: 2px;
}

.footer-widget ul,
.site-footer ul,
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-widget li,
.site-footer ul li,
.footer-column ul li { padding: 0; margin: 0; }

.footer-widget a,
.site-footer ul a,
.footer-column ul a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--footer-text);
    text-decoration: none;
    transition: color .25s var(--ease), transform .25s var(--ease);
    border-radius: 4px;
}
.footer-widget a i,
.site-footer ul a i,
.footer-column ul a i {
    color: var(--color-gold-400);
    font-size: .82em;
    transition: transform .25s var(--ease), color .25s var(--ease);
    width: 14px;
    text-align: center;
}
.footer-widget a:hover,
.site-footer ul a:hover,
.footer-column ul a:hover {
    color: #fff;
    transform: translateX(4px);
}
.footer-widget a:hover i,
.site-footer ul a:hover i,
.footer-column ul a:hover i { color: var(--color-gold-400); transform: scale(1.2); }

.footer-widget a:focus-visible,
.site-footer ul a:focus-visible {
    outline: 2px solid var(--color-gold-500);
    outline-offset: 3px;
}

/* ---- Contact list ---- */
.footer-contact-list {
    list-style: none; padding: 0; margin: 0 0 24px;
}
.footer-contact-list li {
    display: flex; gap: 14px;
    color: var(--footer-text);
    padding: 12px 0;
    line-height: 1.55;
    border-bottom: 1px solid var(--footer-border);
}
.footer-contact-list li:last-child { border-bottom: none; }
.footer-contact-list i {
    color: var(--color-gold-400);
    margin-top: 5px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1em;
}
.footer-contact-list strong { color: #fff; font-weight: 700; }
.footer-contact-list a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color .25s var(--ease);
    display: inline;
    padding: 0;
    border-bottom: 1px solid transparent;
}
.footer-contact-list a:hover {
    color: var(--color-gold-400);
    border-bottom-color: currentColor;
}

.footer-cta {
    align-self: flex-start;
    margin-top: 4px;
    width: 100%;
    justify-content: center;
}

/* ---- Social ---- */
.social-links { display: flex; gap: 10px; }
.social-links a {
    display: inline-flex;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: var(--footer-surface);
    border: 1px solid var(--footer-border);
    border-radius: 50%;
    color: #fff;
    transition: all .3s var(--ease);
    padding: 0;
}
.social-links a:hover {
    background: var(--color-gold-500);
    color: var(--color-ink-900);
    transform: translateY(-3px);
    border-color: var(--color-gold-500);
    box-shadow: 0 10px 24px rgba(212,168,74,0.40);
}
.social-links a:focus-visible {
    outline: 3px solid var(--color-gold-500);
    outline-offset: 4px;
}

/* ---- Bottom bar ---- */
.footer-bottom {
    border-top: 1px solid var(--footer-border);
    padding-top: 26px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-bottom-left { color: var(--footer-text-muted); font-size: .92em; line-height: 1.6; }
.footer-bottom-left p { margin: 0; color: inherit; }
.footer-bottom-left strong { color: #fff; font-weight: 700; }
.footer-credit { font-size: .92em; color: var(--footer-text-subtle); margin-top: 4px !important; }

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: var(--footer-surface);
    border: 1px solid var(--footer-border);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: .92em;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    transition: all .3s var(--ease);
    font-family: var(--font-sans);
}
.back-to-top i { transition: transform .3s var(--ease); }
.back-to-top:hover {
    background: var(--color-gold-500);
    color: var(--color-ink-900);
    border-color: var(--color-gold-500);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(212,168,74,0.40);
}
.back-to-top:hover i { transform: translateY(-3px); }
.back-to-top:focus-visible {
    outline: 3px solid var(--color-gold-500);
    outline-offset: 4px;
}

@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
    }
    .footer-brand { grid-column: 1 / -1; }
    .footer-brand-desc { max-width: 100%; }
}

@media (max-width: 600px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
    }
    .site-footer { padding-top: clamp(64px, 14vw, 90px); }
    .footer-brand-title { font-size: 1.25em; }
    .footer-logo { width: 60px; height: 60px; padding: 6px; }
    .footer-bottom {
        justify-content: center;
        text-align: center;
        flex-direction: column-reverse;
        gap: 24px;
    }
    .back-to-top { width: 100%; justify-content: center; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    .territory-section .cards-grid.territory-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .territory-content {
        grid-template-columns: 1fr;
        gap: 36px;
        align-items: stretch;
    }
    .territory-image-wrapper {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
        max-height: 460px;
    }
    .territory-text { text-align: left; }
}

@media (max-width: 600px) {
    .territory-section .cards-grid.territory-cards {
        grid-template-columns: 1fr;
    }
    .territory-image-wrapper {
        aspect-ratio: 4 / 3;
        max-height: none;
        border-radius: var(--radius);
    }
    .territory-image-wrapper::after { inset: 10px; border-radius: calc(var(--radius) - 6px); }
    .territory-features {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .territory-features li { padding: 11px 0 11px 36px; font-size: .95em; }
}

@media (max-width: 820px) {
    .header-main { padding: 12px 0; }
    .header-content { min-height: 60px; }
    .custom-logo { height: 52px; width: 52px; }
    .custom-logo-link { padding: 4px; }
    .branding-wrapper { gap: 12px; }

    .main-navigation {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--color-line);
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s var(--ease);
        box-shadow: var(--shadow);
    }
    .main-navigation.active { max-height: 80vh; }
    .main-navigation ul { flex-direction: column; gap: 0; padding: 12px 16px 18px; }
    .main-navigation a {
        display: block;
        padding: 14px 16px;
        border-radius: var(--radius-sm);
        border-bottom: 1px solid var(--color-line);
        width: 100%;
    }
    .main-navigation a::after { display: none; }
    .main-navigation li:last-child a { border-bottom: none; }

    .menu-toggle { display: inline-flex; }

    .user-name-desktop { display: none; }
    .user-menu-toggle { padding: 4px; width: 44px; height: 44px; justify-content: center; gap: 0; }
    .user-menu-content { min-width: 260px; }

    .btn-login span { display: none; }
    .btn-login { padding: 10px 14px; }

    .hero-content { padding: 90px 20px 70px; }
    .hero-buttons .btn { width: 100%; max-width: 280px; justify-content: center; }
    .hero-scroll-cue { display: none; }

    .stats-grid { gap: 24px; }
    .cards-grid { grid-template-columns: 1fr; gap: 22px; }
    .posts-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .site-title { font-size: 1.1em; }
    .custom-logo { height: 44px; width: 44px; }
    .custom-logo-link { padding: 3px; }
    .site-description { display: none; }
    .container { padding: 0 18px; }
    .btn { padding: 13px 24px; font-size: .95em; }
    .stat-item { padding: 12px; }
    .card-content { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-background { animation: none; }
}

/* =========================================================
   v2.1 — MODERN HEADER & HERO (overrides)
   ========================================================= */

/* ---------- HEADER: solid dark forest, always ---------- */
.site-header {
    background: var(--color-forest-900);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    transition: box-shadow .3s var(--ease), transform .35s var(--ease);
}
.site-header::before { content: none; }
.site-header.is-scrolled {
    background: var(--color-forest-900);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- WP Admin Bar compatibility ----------
   WordPress aggiunge html { margin-top: 32px !important; } quando l'admin bar è visibile.
   L'header è position:fixed: va spostato sotto la barra. L'hero è in calc(100vh - header)
   e finirebbe sotto la admin bar lasciando un margine: lo compensiamo. */
.admin-bar .site-header { top: 32px; }
.admin-bar .hero-section {
    height: calc(100vh - var(--header-h) - 32px);
    height: calc(100svh - var(--header-h) - 32px);
}
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
    .admin-bar .hero-section {
        height: calc(100vh - var(--header-h) - 46px);
        height: calc(100svh - var(--header-h) - 46px);
    }
}
/* Quando si scrolla, WordPress rende l'admin bar position:fixed solo > 600px
   altrimenti la barra scorre via con la pagina */
@media screen and (max-width: 600px) {
    .admin-bar .site-header { top: 0; }
    .admin-bar .hero-section {
        height: calc(100vh - var(--header-h));
        height: calc(100svh - var(--header-h));
    }
}

/* Logo with subtle gradient ring */
.custom-logo-link {
    position: relative;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.custom-logo-link::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 140deg, var(--color-gold-500), var(--color-terracotta-600), var(--color-forest-500), var(--color-gold-500));
    z-index: -1;
    opacity: 0;
    transition: opacity .4s var(--ease);
    filter: blur(2px);
}
.custom-logo-link:hover::before { opacity: .85; }

/* Site title: light gradient suitable for dark header */
.site-title a {
    background-image: linear-gradient(120deg, #ffffff 0%, #f3ede0 40%, var(--color-gold-400) 70%, #ffffff 100%);
    background-size: 220% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: background-position .8s var(--ease);
}
.site-title a:hover { background-position: 100% 50%; }

.site-description { color: rgba(255, 255, 255, 0.72); }

/* Nav: light text on dark header */
.main-navigation a {
    font-weight: 600;
    letter-spacing: .01em;
    color: rgba(255, 255, 255, 0.88);
}
.main-navigation a::after {
    bottom: 6px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-gold-500), var(--color-terracotta-500));
    border-radius: 2px;
}
.main-navigation a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_ancestor > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Login button: gold gradient with shimmer */
.btn-login {
    background: linear-gradient(135deg, var(--color-gold-500) 0%, var(--color-gold-600) 100%);
    color: var(--color-ink-900);
    box-shadow: 0 6px 18px rgba(184, 134, 47, 0.40), inset 0 0 0 1px rgba(255,255,255,0.20);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-login:hover {
    background: linear-gradient(135deg, var(--color-gold-400) 0%, var(--color-gold-500) 100%);
    color: var(--color-ink-900);
    box-shadow: 0 10px 24px rgba(184, 134, 47, 0.55), inset 0 0 0 1px rgba(255,255,255,0.30);
}
.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .7s var(--ease);
    z-index: -1;
}
.btn-login:hover::before { transform: translateX(120%); }

/* Menu toggle (mobile): light icon on dark header */
.menu-toggle {
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.menu-toggle:hover {
    background: var(--color-gold-500);
    border-color: var(--color-gold-500);
}
.menu-toggle:hover .dot { background: var(--color-ink-900); }
.dots-menu .dot { background: #fff; }

/* User dropdown trigger on dark header */
.user-menu-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--color-gold-500);
}
.user-name-desktop { color: #fff; }

/* Mobile dropdown panel: keep dark theme */
@media (max-width: 820px) {
    .main-navigation {
        background: linear-gradient(180deg, rgba(15, 42, 29, 0.98), rgba(10, 28, 19, 0.98));
        border-bottom: 1px solid rgba(255, 255, 255, 0.10);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
    .main-navigation a {
        color: rgba(255, 255, 255, 0.92);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .main-navigation a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
}

/* ---------- HERO: modern cinematic ---------- */
.hero-section.hero-modern {
    /* darker, richer base gradient with depth */
    background:
        radial-gradient(ellipse at 25% 20%, rgba(45, 106, 74, 0.55), transparent 55%),
        radial-gradient(ellipse at 75% 80%, rgba(139, 58, 31, 0.4), transparent 60%),
        linear-gradient(160deg, var(--color-forest-900) 0%, var(--color-forest-800) 50%, #0a1c13 100%);
}

.hero-section.hero-modern .hero-overlay {
    background:
        radial-gradient(ellipse at 18% 25%, rgba(212, 168, 74, 0.18), transparent 50%),
        radial-gradient(ellipse at 82% 85%, rgba(184, 74, 38, 0.20), transparent 55%),
        linear-gradient(180deg, rgba(10, 28, 19, 0.40) 0%, rgba(10, 28, 19, 0.55) 55%, rgba(10, 28, 19, 0.85) 100%);
}

/* Subtle noise/grain layer */
.hero-grain {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .18;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Floating colored orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}
.hero-orb--gold {
    width: 420px; height: 420px;
    top: -120px; left: -100px;
    background: radial-gradient(circle, rgba(230, 196, 120, 0.65), transparent 70%);
    animation: heroOrbFloat 14s var(--ease-out) infinite alternate;
}
.hero-orb--terra {
    width: 480px; height: 480px;
    bottom: -160px; right: -120px;
    background: radial-gradient(circle, rgba(200, 90, 50, 0.55), transparent 70%);
    animation: heroOrbFloat 18s var(--ease-out) infinite alternate-reverse;
}
@keyframes heroOrbFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(40px, -30px, 0) scale(1.12); }
}

/* Decorative mountain silhouette at bottom */
.hero-mountains {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    width: 100%;
    height: clamp(90px, 13vw, 180px);
    z-index: 1;
    pointer-events: none;
    display: block;
}

/* Hero content & badge */
.hero-section.hero-modern .hero-content {
    z-index: 2;
    padding: 60px 24px 110px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 14px;
    margin-bottom: 28px;
    font-family: var(--font-sans);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-pill);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    animation: heroFadeUp 1s var(--ease-out) both;
}
.hero-badge-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--color-gold-400);
    box-shadow: 0 0 0 0 rgba(230, 196, 120, 0.7);
    animation: heroPulse 2.2s ease-in-out infinite;
}
@keyframes heroPulse {
    0%   { box-shadow: 0 0 0 0 rgba(230, 196, 120, 0.7); }
    70%  { box-shadow: 0 0 0 12px rgba(230, 196, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 196, 120, 0); }
}

/* Refined title */
.hero-section.hero-modern .hero-title {
    font-size: clamp(2.6rem, 6vw, 5.2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.02;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
}
.hero-section.hero-modern .hero-title em {
    font-style: italic;
    background: linear-gradient(120deg, var(--color-gold-400), var(--color-gold-500) 40%, #f3d98a 70%, var(--color-gold-400));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: heroShimmer 6s linear infinite;
    position: relative;
}
@keyframes heroShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.hero-section.hero-modern .hero-subtitle {
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    max-width: 640px;
    opacity: .94;
    margin-bottom: 36px;
    text-shadow: 0 2px 14px rgba(0,0,0,0.25);
}

/* Primary CTA in hero: keep gold but stronger glow */
.hero-section.hero-modern .btn-primary {
    background: linear-gradient(135deg, #ecc56a 0%, var(--color-gold-500) 50%, var(--color-gold-600) 100%);
    box-shadow: 0 12px 30px rgba(184, 134, 47, 0.45), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hero-section.hero-modern .btn-primary:hover {
    box-shadow: 0 18px 40px rgba(184, 134, 47, 0.55), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Highlights strip */
.hero-highlights {
    list-style: none;
    margin: 44px 0 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 28px;
    animation: heroFadeUp 1s var(--ease-out) .55s both;
}
.hero-highlights li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.hero-highlights li:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 168, 74, 0.55);
    transform: translateY(-2px);
}
.hero-highlights i { color: var(--color-gold-400); font-size: .95em; }

/* Scroll cue: animated mouse */
.hero-section.hero-modern .hero-scroll-cue {
    bottom: 24px;
    z-index: 2;
    color: rgba(255,255,255,0.85);
}
.hero-section.hero-modern .hero-scroll-cue::after { display: none; }
.hero-scroll-mouse {
    width: 22px;
    height: 36px;
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 12px;
    position: relative;
    display: block;
}
.hero-scroll-mouse::before {
    content: '';
    position: absolute;
    top: 6px; left: 50%;
    width: 3px; height: 8px;
    border-radius: 2px;
    background: var(--color-gold-400);
    transform: translateX(-50%);
    animation: scrollWheel 1.6s ease-in-out infinite;
}
.hero-scroll-label {
    font-size: .68rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    opacity: .85;
}
@keyframes scrollWheel {
    0%   { transform: translate(-50%, 0); opacity: 1; }
    60%  { transform: translate(-50%, 12px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 0; }
}

/* Responsive */
@media (max-width: 820px) {
    .hero-section.hero-modern .hero-content { padding: 100px 20px 120px; }
    .hero-badge { font-size: .72rem; padding: 7px 14px 7px 12px; margin-bottom: 22px; }
    .hero-highlights { gap: 8px 14px; margin-top: 32px; }
    .hero-highlights li { padding: 7px 14px; font-size: .82rem; }
    .hero-orb--gold { width: 280px; height: 280px; }
    .hero-orb--terra { width: 320px; height: 320px; }
    .hero-mountains { height: 80px; }
    .hero-section.hero-modern .hero-scroll-cue { display: none; }
}

@media (max-width: 480px) {
    .hero-highlights li:nth-child(n+3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-orb, .hero-badge-dot, .hero-section.hero-modern .hero-title em,
    .hero-scroll-mouse::before { animation: none !important; }
}
