/* =========================================================
   RICORDI APPESI — Editorial Premium (Social House Inspired)
   ========================================================= */

:root {
    --bg:          #F0EDE8;
    --bg-alt:      #E8E4DE;
    --bg-dark:     #1A1A1A;
    --text:        #1A1A1A;
    --text-muted:  #7A7570;
    --text-light:  #F0EDE8;
    --accent:      #828F70;
    --gold:        #C5A059;
    --border:      1px solid rgba(26,26,26,0.12);
    --border-color:rgba(26,26,26,0.12);

    --font-display:'Playfair Display', Georgia, serif;
    --font-sans:   'Inter', system-ui, -apple-system, sans-serif;

    --radius:      16px;
    --radius-lg:   24px;
    --radius-pill: 100px;

    --header-h:    80px;
    --container:   1280px;
    --gutter:      clamp(24px, 5vw, 80px);

    --ease:        cubic-bezier(0.16, 1, 0.3, 1);
    --transition:  0.4s var(--ease);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul { list-style: none; }

/* === CONTAINER === */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

/* === TYPOGRAPHY === */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; }
.section-label {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 16px;
}
.section-title { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 20px; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border: var(--border);
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--text); }
.btn-outline:hover { background: var(--text); color: var(--bg); }
.btn-light { background: var(--bg); color: var(--text); border-color: var(--bg); }
.btn-light:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ================================================================
   HEADER — Social House style (clean top bar with thin borders)
   ================================================================ */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(240, 237, 232, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: var(--border);
    display: flex;
    align-items: center;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo-link img,
.custom-logo-link img,
.custom-logo { height: 44px !important; width: auto !important; max-width: 180px !important; object-fit: contain; }

/* Hamburger */
.hamburger-wrap { display: flex; align-items: center; gap: 16px; }
.menu-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.hamburger-circle {
    width: 48px; height: 48px;
    border: 1.5px solid var(--text);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}
.hamburger-circle:hover { background: var(--text); }
.hamburger-circle:hover span { background: var(--bg); }
.hamburger-circle span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: var(--transition); }

/* === FULLSCREEN MENU OVERLAY === */
.menu-overlay {
    position: fixed; inset: 0;
    background: var(--bg-dark);
    z-index: 2000;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 40px var(--gutter);
    padding-bottom: max(40px, env(safe-area-inset-bottom));
    height: 100vh;
    height: 100dvh;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease);
}
.menu-overlay.open { opacity: 1; pointer-events: all; }
.menu-overlay[hidden] { display: none; }
body.menu-open { overflow: hidden; }
.menu-overlay-header { display: flex; justify-content: flex-end; margin-bottom: 40px; }
.menu-close {
    width: 48px; height: 48px;
    border: 1.5px solid rgba(240,237,232,0.3);
    border-radius: 50%;
    background: transparent;
    font-family: var(--font-sans);
    line-height: 1;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--bg); font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition);
}
.menu-close:hover { background: var(--bg); color: var(--bg-dark); }
.menu-nav { flex: 1; display: flex; align-items: center; }
.menu-nav ul { width: 100%; }
.menu-nav li { border-bottom: 1px solid rgba(240,237,232,0.1); }
.menu-nav a {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s, transform 0.5s var(--ease), color 0.3s;
}
.menu-overlay.open .menu-nav a {
    opacity: 1;
    transform: translateY(0);
}
.menu-nav li:nth-child(1) a { transition-delay: 0.15s; }
.menu-nav li:nth-child(2) a { transition-delay: 0.25s; }
.menu-nav li:nth-child(3) a { transition-delay: 0.35s; }
.menu-nav li:nth-child(4) a { transition-delay: 0.45s; }
.menu-nav li:nth-child(5) a { transition-delay: 0.55s; }
.menu-nav li:nth-child(n+6) a { transition-delay: 0.6s; }
.menu-nav a:hover { color: var(--gold); padding-left: 16px; }
.menu-nav a::after { content: '→'; font-family: var(--font-sans); font-size: 1.2rem; opacity: 0; transition: opacity 0.3s; }
.menu-nav a:hover::after { opacity: 1; }
.menu-footer { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 40px; border-top: 1px solid rgba(240,237,232,0.1); }
.menu-footer a { color: rgba(240,237,232,0.5); font-size: 0.85rem; transition: color 0.3s; }
.menu-footer a:hover { color: var(--text-light); }
.social-links { display: flex; gap: 24px; }

/* ================================================================
   HERO
   ================================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: calc(var(--header-h) + 40px);
    padding-bottom: 80px;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.hero-title {
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-desc { font-size: 1.1rem; color: var(--text-muted); max-width: 460px; line-height: 1.7; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* Hero Visual */
.hero-visual { position: relative; }
.hero-img-main {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 4/5;
    box-shadow: 0 20px 60px rgba(26,26,26,0.1);
}
.hero-img-main img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
    position: absolute;
    bottom: -20px; left: -20px;
    background: #000000;
    color: var(--text-light);
    padding: 20px 24px;
    border-radius: var(--radius);
}
.hero-badge-number { font-family: var(--font-display); font-size: 2rem; display: block; }
.hero-badge-text { font-size: 0.75rem; letter-spacing: 0.05em; opacity: 0.7; }

/* ================================================================
   MARQUEE
   ================================================================ */
.marquee-wrap {
    border-top: var(--border);
    border-bottom: var(--border);
    padding: 20px 0;
    overflow: hidden;
}
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee-content { display: flex; gap: 40px; align-items: center; padding-right: 40px; white-space: nowrap; }
.marquee-content span {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================================================================
   PROJECT SECTION (Sage Background — Faenza Story)
   ================================================================ */
.project-section {
    background: var(--accent);
    color: var(--text-light);
    padding-block: clamp(80px, 12vw, 160px);
}
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: center; }
.project-content .section-label { color: rgba(240,237,232,0.6); }
.project-content h2 { font-size: clamp(2rem, 4.5vw, 3.8rem); margin-bottom: 24px; letter-spacing: -0.02em; }
.project-content p { font-size: 1.05rem; line-height: 1.8; margin-bottom: 20px; opacity: 0.85; }
.project-visual { border-radius: var(--radius-lg); overflow: hidden; }
.project-visual img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.project-video-embed { margin-top: 30px; border-radius: var(--radius); overflow: hidden; }
.project-video-embed iframe { border-radius: var(--radius); }

/* ================================================================
   SERVICES — Editorial Card Grid
   ================================================================ */
.services-section { padding-block: clamp(80px, 12vw, 160px); }
.section-header { margin-bottom: 60px; display: flex; justify-content: space-between; align-items: flex-end; }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 36px 28px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.service-card:hover { transform: translateY(-6px); border-color: var(--border-color); box-shadow: 0 16px 48px rgba(26,26,26,0.08); }
.service-icon { font-size: 2rem; margin-bottom: 16px; display: block; }
.service-title { font-size: 1.15rem; margin-bottom: 10px; }
.service-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ================================================================
   WHY SECTION (Stats + CTA)
   ================================================================ */
.why-section { padding-block: clamp(80px, 10vw, 140px); border-top: var(--border); }
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.why-content h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 20px; }
.why-content p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.8; margin-bottom: 30px; }
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stat-item { text-align: center; padding: 28px 16px; border: var(--border); border-radius: var(--radius); display: flex; flex-direction: column-reverse; align-items: center; }
.stat-number { font-family: var(--font-display); font-size: 2.5rem; display: block; margin-bottom: 4px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }

/* ================================================================
   CTA SECTION
   ================================================================ */
.cta-section {
    background: var(--bg-dark);
    color: var(--text-light);
    padding-block: clamp(80px, 12vw, 140px);
    text-align: center;
}
.cta-section .section-label { color: var(--gold); }
.cta-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 20px; }
.cta-desc { color: rgba(240,237,232,0.6); max-width: 500px; margin: 0 auto 36px; font-size: 1.05rem; }

/* ================================================================
   CONTACT PAGE
   ================================================================ */
.contact-premium-section { padding-block: clamp(80px, 12vw, 160px); padding-top: calc(var(--header-h) + 60px); }
.contact-header { text-align: center; max-width: 600px; margin: 0 auto 60px; }
.contact-header .page-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 16px; }
.page-subtitle { font-size: 12px; margin-bottom: 16px; }
.contact-header .page-title em { font-style: italic; color: var(--accent); }
.contact-grid { display: grid; grid-template-columns: 1fr 380px; gap: 60px; align-items: start; }
.contact-form-wrap {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: clamp(32px, 5vw, 56px);
    border: var(--border);
}
.contact-form-wrap h2 { font-size: 1.4rem; margin-bottom: 32px; }
.form-group { margin-bottom: 28px; position: relative; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text);
    transition: var(--transition);
    outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(130,143,112,0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7570' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-submit { width: 100%; justify-content: center; margin-top: 8px; }
.form-success { background: #e8f5e9; color: #2e7d32; border-radius: 10px; padding: 16px; margin-bottom: 24px; font-size: 0.9rem; text-align: center; }

.contact-info-side-wp { display: flex; flex-direction: column; gap: 20px; }
/* Effetto hover per il tasto di WhatsApp */
.whatsapp-card:hover {
    transform: translateY(-3px);
    background-color: #1ebe57 !important; /* Un verde leggermente più scuro */
}

.contact-info-side { display: flex; flex-direction: column; gap: 20px; }
.info{
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
    border: var(--border);
}
.info-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 32px;
    border: var(--border);
}
.info-card.sage { background: var(--accent); color: var(--text-light); border-color: transparent; }
.info-card h3 { font-size: 1.1rem; margin-bottom: 12px; }
.info-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 6px; }
.info-card.sage p { color: rgba(240,237,232,0.8); }
.info-card a { border-bottom: 1px solid var(--border-color); }
.info-card a:hover { color: var(--accent); }
.info-card.sage a { color: var(--text-light); border-bottom-color: rgba(240,237,232,0.3); }

/* ================================================================
   CHI SIAMO PAGE
   ================================================================ */
.page-hero { padding-top: calc(var(--header-h) + 60px); padding-bottom: 80px; }
.page-hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.page-hero-inner--centered { grid-template-columns: 1fr; max-width: 700px; }
.page-hero-text--centered { text-align: center; }
.page-hero-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 20px; }
.page-hero-desc { font-size: 1.05rem; color: var(--text-muted); line-height: 1.7; max-width: 500px; }
.page-hero-text--centered .page-hero-desc { margin-inline: auto; }

.about-img-stack { position: relative; aspect-ratio: 4/5; }
.about-img-main { position: absolute; inset: 0 30px 30px 0; border-radius: var(--radius-lg); background: linear-gradient(135deg, #D4C9BA, #C0B5A4); }
.about-img-accent { position: absolute; bottom: 0; right: 0; width: 55%; height: 55%; border-radius: var(--radius-lg); background: var(--bg-dark); }

.mission-section { padding-block: clamp(60px, 10vw, 120px); border-top: var(--border); }
.mission-inner { display: grid; grid-template-columns: 200px 1fr; gap: 60px; }
.mission-title { font-size: clamp(1.8rem, 3.5vw, 3rem); margin-bottom: 20px; }
.mission-text { color: var(--text-muted); font-size: 1rem; line-height: 1.8; margin-bottom: 16px; }

.values-section { padding-block: clamp(60px, 10vw, 120px); }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.value-card { background: var(--bg-alt); border-radius: var(--radius); padding: 32px 24px; border: var(--border); transition: var(--transition); }
.value-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(26,26,26,0.06); }
.value-num { font-size: 1.8rem; font-weight: 200; color: var(--text-muted); display: block; margin-bottom: 12px; }
.value-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.value-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

.about-services-section { padding-block: clamp(60px, 10vw, 120px); border-top: var(--border); }
.about-services-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-services-list { margin-top: 20px; }
.about-service-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: var(--border); font-size: 0.95rem; }
.about-service-arrow { color: var(--text-muted); }
.about-services-cta { background: var(--bg-alt); border-radius: var(--radius-lg); padding: 40px; border: var(--border); }
.about-services-cta p { color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding-block: 80px 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-desc { color: rgba(240,237,232,0.5); font-size: 0.9rem; line-height: 1.7; margin-top: 16px; max-width: 300px; }
.footer-social { display: flex; gap: 20px; margin-top: 20px; }
.footer-social a { color: rgba(240,237,232,0.5); font-size: 0.85rem; }
.footer-social a:hover { color: var(--text-light); }
.site-footer h4 { margin-bottom: 16px; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer ul a { color: rgba(240,237,232,0.5); font-size: 0.9rem; }
.site-footer ul a:hover { color: var(--text-light); }
.site-footer p { color: rgba(240,237,232,0.5); font-size: 0.88rem; line-height: 1.7; }
.site-footer p a { border-bottom: 1px solid rgba(240,237,232,0.2); }
.site-footer p a:hover { color: var(--text-light); }
.footer-bottom { border-top: 1px solid rgba(240,237,232,0.1); padding-top: 24px; display: flex; justify-content: space-between; }
.footer-bottom p { font-size: 0.78rem; color: rgba(240,237,232,0.35); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
/* Nasconde i blocchi solo se il JS è attivo: senza JS (e per i crawler) il contenuto è sempre visibile. */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.active { opacity: 1; transform: translateY(0); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .hero-inner, .project-grid, .why-grid, .about-services-inner, .page-hero-inner { grid-template-columns: 1fr; }
    .services-grid, .values-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .services-grid, .values-grid, .stats-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; }
    .hero { min-height: auto; padding-top: calc(var(--header-h) + 40px); padding-bottom: 60px; }
    .mission-inner { grid-template-columns: 1fr; gap: 16px; }
}


/* ================================================================
   POSTS ARCHIVE GRID
   ================================================================ */
.posts-grid-wrap {
    padding-block: clamp(60px, 8vw, 120px);
}
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.post-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
}
.post-card:hover {
    transform: translateY(-4px);
}
.post-card-img-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: 0 10px 30px rgba(26,26,26,0.05);
    background: var(--bg-alt);
    border: var(--border);
}
.post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}
.post-card:hover .post-card-img {
    transform: scale(1.05);
}
.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-inline: 4px;
}
.post-card-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
}
.post-card-title a:hover {
    color: var(--accent);
}
.post-card-date {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}
@media (max-width: 640px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ================================================================
   UTILITIES
   ================================================================ */
.hhhome {
    display: none !important;
}

/* Stile per schermi grandi (Computer e Tablet) */
.footer-bottom {
    display: flex;
    justify-content: space-between; /* Spinge un blocco a sinistra e uno a destra */
    align-items: center;           /* Allinea i testi verticalmente al centro */
    flex-wrap: wrap;               /* Permette di andare a capo se lo spazio finisce */
    padding: 15px 0;               /* Un po' di respiro sopra e sotto */
}

.footer-bottom p {
    margin: 0;                     /* Rimuove i margini predefiniti dei paragrafi */
}

/* Stile per schermi piccoli (Smartphone) */
@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;    /* Incolonna gli elementi verticalmente */
        text-align: center;        /* Centra il testo per una resa estetica migliore */
        gap: 10px;                 /* Aggiunge spazio verticale tra i due blocchi */
    }
}


/* ================================================================
   v2 — PERFORMANCE, MOBILE, ACCESSIBILITÀ
   (stili prima sparsi in <style> nei template, ora qui e in cache)
   ================================================================ */

/* --- Accessibilità di base --- */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed !important;
    top: 12px; left: 12px;
    width: auto; height: auto;
    clip: auto; margin: 0;
    padding: 12px 20px;
    background: var(--text); color: var(--bg);
    border-radius: var(--radius-pill);
    z-index: 3000;
    font-size: 0.9rem;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.menu-overlay :focus-visible, .cta-section :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
button { font: inherit; }
address { font-style: normal; }
dl, dd { margin: 0; }
.hero-title a, .archive-post__title a { color: inherit; }
.hero-img-link { display: block; width: 100%; height: 100%; }

/* --- Header --- */
.site-header { padding-top: env(safe-area-inset-top); }
.menu-footer { display: flex; justify-content: space-between; align-items: flex-end; }

/* --- Hover solo su dispositivi con mouse (niente "salti" al tocco) --- */
@media (hover: none) {
    .service-card:hover, .value-card:hover, .post-card:hover, .btn-primary:hover { transform: none; box-shadow: none; }
    .post-card:hover .post-card-img { transform: none; }
}

/* --- Sezione libro (stili prima in linea nel template) --- */
.book-highlight {
    position: relative;
    margin-block: 40px;
    padding-block: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
    isolation: isolate;
}
.book-highlight__bg { position: absolute; inset: 0; z-index: -2; }
.book-highlight__bg img { width: 100%; height: 100%; object-fit: cover; }
.book-highlight__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: -1; }
.book-highlight__inner { position: relative; max-width: 800px; margin: 0 auto; padding-inline: 20px; }
.book-highlight__label {
    display: inline-block;
    font-size: 0.9rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 15px; padding-bottom: 5px;
    color: #e0e0e0; border-bottom: 2px solid #fff;
}
.book-highlight__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1; font-weight: 800;
    margin-bottom: 24px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.book-highlight__desc {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 40px; opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.book-highlight__actions { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.book-btn { padding: 14px 28px; font-weight: 600; border-radius: 4px; }
.book-btn--solid { background-color: #ffffff; color: #000000; border: none; }
.book-btn--solid:hover { transform: translateY(-2px); }
.book-btn--ghost { background-color: transparent; border: 2px solid #ffffff; color: #ffffff; padding: 12px 28px; }
.book-btn--ghost:hover { background: rgba(255,255,255,0.12); }

/* --- Video YouTube leggero --- */
.yt-lite { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.yt-lite__link { position: absolute; inset: 0; display: block; }
.yt-lite__link img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.3s; }
.yt-lite__link:hover img { opacity: 1; }
.yt-lite__play {
    position: absolute; top: 50%; left: 50%;
    width: 68px; height: 48px;
    transform: translate(-50%, -50%);
    background: rgba(26,26,26,0.85);
    border-radius: 12px;
    transition: background 0.3s;
}
.yt-lite__play::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-35%, -50%);
    border-style: solid; border-width: 10px 0 10px 17px;
    border-color: transparent transparent transparent #fff;
}
.yt-lite__link:hover .yt-lite__play { background: #FF0000; }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Servizi e valori come liste --- */
.services-grid, .values-grid { list-style: none; }

/* --- Contenuto WordPress in home --- */
.manual-content .entry-content > * + * { margin-top: 1.2em; }

/* --- Articoli e pagine (prima in <style> dentro single.php/page.php) --- */
.article-body { padding-bottom: 120px; padding-top: 20px; }
.single-article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    overflow-wrap: break-word;
}
.single-article-content > * { max-width: 100%; }
.single-article-content .wp-block-columns,
.single-article-content .wp-block-gallery,
.single-article-content .alignwide,
.single-article-content .alignfull {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.single-article-content p { margin-bottom: 1.8rem; }
.single-article-content h1,
.single-article-content h2,
.single-article-content h3,
.single-article-content h4,
.single-article-content h5,
.single-article-content h6 {
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--text);
    font-family: var(--font-display);
}
.single-article-content ul,
.single-article-content ol { margin-bottom: 1.8rem; padding-left: 1.5rem; }
.single-article-content ul { list-style: disc; }
.single-article-content ol { list-style: decimal; }
.single-article-content li { margin-bottom: 0.5rem; }
.single-article-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.single-article-content a:hover { color: var(--accent); }
.single-article-content .wp-block-button__link { text-decoration: none; }
.single-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-block: 1.5rem;
    display: block;
}
.single-article-content .wp-block-gallery img { margin-block: 0; }
.single-article-content figure { margin: 2rem 0; max-width: 100%; }
.single-article-content figure figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}
.single-article-content blockquote {
    margin: 2rem 0;
    padding: 1.2rem 1.6rem;
    border-left: 4px solid var(--accent);
    background-color: var(--bg-alt);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.single-article-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.8rem; display: block; overflow-x: auto; }
.single-article-content th, .single-article-content td { padding: 10px 12px; border-bottom: var(--border); text-align: left; }
.single-article-content iframe, .single-article-content video { max-width: 100%; }
.single-article-content .wp-block-embed__wrapper iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.single-article-content .page-links {
    margin-top: 40px;
    padding-top: 20px;
    border-top: var(--border);
    font-weight: 500;
}
.single-article-content hr { border: 0; border-top: var(--border); margin-block: 2.5rem; }

/* --- Modulo contatti --- */
.form-label { margin-bottom: 8px; }
.form-error { background: #fdecea; color: #b3261e; border-radius: 10px; padding: 16px; margin-bottom: 24px; font-size: 0.9rem; text-align: center; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.page-subtitle { font-family: var(--font-display); }

.contact-info-side .info-card__title,
.info-card .info-card__title { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; margin-bottom: 12px; line-height: 1.1; }

.whatsapp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background-color: #25D366;
    color: #ffffff;
    border-radius: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.whatsapp-card:hover { transform: translateY(-3px); background-color: #1ebe57; }
.whatsapp-card__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.whatsapp-card__number { font-size: 0.9rem; opacity: 0.9; margin-top: 4px; }

/* --- Footer --- */
.footer-logo-img { filter: invert(1); height: 40px; width: auto; }
.site-footer address p { margin-bottom: 4px; }

/* --- Archivio e blog --- */
.sticky-hero { margin-bottom: 80px; border-bottom: 2px solid var(--border-color); padding-bottom: 40px; }
.archive-post { margin-bottom: 60px; }
.archive-post__title { font-size: var(--hero-title-size, 3rem); margin-block: 10px 20px; }
.post-card-img-placeholder { width: 100%; height: 100%; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 2rem; opacity: 0.3; }
.pagination { margin-block: 60px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 14px;
    border: var(--border); border-radius: var(--radius-pill);
    font-size: 0.9rem;
}
.pagination .page-numbers.current { background: var(--text); color: var(--bg); border-color: var(--text); }
.no-posts-notice { text-align: center; padding-block: 80px; }
.no-posts-notice p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 24px; }

/* --- Pagina 404 --- */
.error-404 { padding-top: calc(var(--header-h) + 80px); padding-bottom: 120px; text-align: center; }
.error-code { font-family: var(--font-display); font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--accent); display: block; margin-bottom: 16px; }
.error-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
.error-desc { color: var(--text-muted); margin-bottom: 32px; }

/* --- Pagina Chi siamo: immagine hero --- */
.page-hero-visual .hero-img-main { max-width: 560px; margin-inline: auto; }


/* ================================================================
   RESPONSIVE v2
   ================================================================ */
@media (max-width: 1024px) {
    .hero { min-height: auto; }
    .hero-visual { max-width: 560px; }
    .section-header { flex-wrap: wrap; gap: 20px; }
    .why-grid { gap: 48px; }
    .contact-grid { gap: 32px; }
}

/* Pagine e articoli: su mobile prima l'immagine, poi il titolo */
@media (max-width: 768px) {
    .hero--content { padding-top: calc(var(--header-h) + 20px); padding-bottom: 40px; }
    .hero--content .hero-inner { display: flex; flex-direction: column; gap: 0; }
    .hero--content .hero-visual { order: -1; margin-bottom: 2rem; width: 100%; max-width: none; }
    .hero--content .hero-img-main { max-height: 380px; aspect-ratio: auto; }
    .hero--content .hero-badge { bottom: 12px; left: 12px; padding: 12px 16px; }
    .hero--content .hero-content { text-align: center; }
    .hero--content .hero-desc { margin-inline: auto; }
    .hero--content .hero-actions { justify-content: center; }
    .article-body { padding-bottom: 80px; }
    .single-article-content { font-size: 1.0625rem; }
}

@media (max-width: 640px) {
    :root { --header-h: 64px; }
    .hamburger-circle, .menu-close { width: 44px; height: 44px; }
    .hero-inner { gap: 40px; }
    .hero-badge { left: 12px; bottom: -16px; padding: 16px 20px; }
    .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
    .services-section, .values-section { padding-block: 64px; }
    .section-header { margin-bottom: 32px; }
    .service-card { padding: 28px 24px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-number { font-size: 2rem; }
    .book-highlight { padding-block: 80px; margin-block: 24px; }
    .contact-form-wrap { padding: 24px; }
    /* 16px evita lo zoom automatico di iPhone quando si tocca un campo */
    .form-input { font-size: 16px; }
    .archive-post__title { font-size: clamp(2rem, 9vw, 3rem); }
    .menu-nav a { padding: 16px 0; }
    .footer-grid { gap: 40px; }
}

/* Rispetta chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}

/* Stampa pulita */
@media print {
    .site-header, .menu-overlay, .marquee-wrap, .yt-lite, .hero-actions, .site-footer, .skip-link { display: none !important; }
    .js .reveal { opacity: 1 !important; transform: none !important; }
    body { background: #fff; }
}

/* ================================================================
   v2.1 — GDPR MODULO
   ================================================================ */
.req { color: var(--accent); }
.form-consent {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    margin: 4px 0 24px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.form-consent input {
    appearance: none; -webkit-appearance: none;
    width: 22px; height: 22px; margin-top: 1px;
    border: 1.5px solid var(--text-muted);
    border-radius: 6px;
    background: var(--bg);
    display: grid; place-content: center;
    cursor: pointer;
    transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.form-consent input::after {
    content: ''; width: 10px; height: 6px;
    border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg);
    transform: rotate(-45deg) scale(0); margin-top: -3px;
    transition: transform 0.25s var(--ease);
}
.form-consent input:checked { background: var(--text); border-color: var(--text); }
.form-consent input:checked::after { transform: rotate(-45deg) scale(1); }
.form-consent label { cursor: pointer; }
.form-consent a, .form-privacy-note a { text-decoration: underline; text-underline-offset: 2px; color: var(--text); }
.form-privacy-note { margin-top: 20px; font-size: 0.75rem; line-height: 1.6; color: var(--text-muted); }
.yt-lite__note {
    position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2;
    font-size: 0.7rem; color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    pointer-events: none;
}
.yt-lite__note a { pointer-events: auto; text-decoration: underline; }

/* ================================================================
   v2.1 — ANIMAZIONI
   ================================================================ */

/* Transizione morbida tra le pagine (browser compatibili) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ra-fade-out 0.25s var(--ease) both; }
::view-transition-new(root) { animation: ra-fade-in 0.45s var(--ease) both; }
@keyframes ra-fade-out { to { opacity: 0; } }
@keyframes ra-fade-in { from { opacity: 0; transform: translateY(8px); } }

/* Entrata della prima schermata: testo che sale, immagine che si assesta */
@keyframes ra-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes ra-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes ra-pop { from { opacity: 0; transform: translateY(16px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes ra-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero .hero-content > *,
.page-hero-text > *,
.contact-header > * {
    animation: ra-rise 0.9s var(--ease) both;
}
.hero .hero-content > *:nth-child(1), .page-hero-text > *:nth-child(1), .contact-header > *:nth-child(1) { animation-delay: 0.05s; }
.hero .hero-content > *:nth-child(2), .page-hero-text > *:nth-child(2), .contact-header > *:nth-child(2) { animation-delay: 0.12s; }
.hero .hero-content > *:nth-child(3), .page-hero-text > *:nth-child(3), .contact-header > *:nth-child(3) { animation-delay: 0.22s; }
.hero .hero-content > *:nth-child(4), .contact-header > *:nth-child(4) { animation-delay: 0.32s; }
.hero .hero-content > *:nth-child(n+5) { animation-delay: 0.4s; }
/* negli archivi solo il primo articolo anima all'avvio, gli altri con lo scroll */
.archive-post ~ .archive-post .hero-content > * { animation: none; }

.hero .hero-img-main,
.page-hero-visual .hero-img-main { overflow: hidden; }
.hero .hero-img-main img,
.page-hero-visual .hero-img-main img { animation: ra-settle 1.6s var(--ease) both; }
.hero .hero-badge { animation: ra-pop 0.8s var(--ease) 0.55s both; }

.hero-title em { display: inline-block; position: relative; }
.hero-title em::after {
    content: ''; position: absolute; left: 0; right: 0.12em; bottom: 0.06em;
    height: 2px; background: currentColor; opacity: 0.35;
    transform-origin: left; animation: ra-line 1.1s var(--ease) 0.75s both;
}

/* Immagini che si scoprono come una tendina */
.js .reveal--curtain { opacity: 1; transform: none; }
.js .reveal--curtain img { clip-path: inset(0 0 100% 0); transform: scale(1.18); transition: clip-path 1.2s var(--ease), transform 1.6s var(--ease); }
.js .reveal--curtain.active img { clip-path: inset(0 0 0 0); transform: scale(1); }

/* Header intelligente: si nasconde scendendo, ricompare risalendo */
.site-header { transition: transform 0.45s var(--ease), background-color 0.3s, box-shadow 0.3s; will-change: transform; }
.site-header.scrolled { background: rgba(240, 237, 232, 0.97); box-shadow: 0 6px 24px rgba(26,26,26,0.06); }
.site-header.header-hidden { transform: translateY(-100%); }
body.menu-open .site-header { transform: none; }

/* Hamburger: le linee si allargano al passaggio */
.hamburger-circle span { transform-origin: center; }
.hamburger-circle:hover span:first-child { transform: translateX(-2px) scaleX(1.15); }
.hamburger-circle:hover span:last-child  { transform: translateX(2px) scaleX(0.7); }

/* Menu che si apre a cerchio partendo dal pulsante */
.menu-overlay {
    clip-path: circle(0px at var(--mx, calc(100% - 64px)) var(--my, 40px));
    transition: clip-path 0.75s var(--ease), opacity 0.35s var(--ease);
}
.menu-overlay.open { clip-path: circle(150% at var(--mx, calc(100% - 64px)) var(--my, 40px)); }
.menu-close { transition: transform 0.5s var(--ease), background 0.3s, color 0.3s; }
.menu-close:hover { transform: rotate(90deg); }
.menu-footer { opacity: 0; transform: translateY(16px); transition: opacity 0.5s 0.5s, transform 0.6s var(--ease) 0.5s; }
.menu-overlay.open .menu-footer { opacity: 1; transform: none; }

/* Pulsanti: leggero sollevamento e "pressione" */
.btn { will-change: transform; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.1s; }

/* Card servizi e valori: icona che fluttua, linea d'accento che cresce */
.service-card, .value-card { position: relative; overflow: hidden; }
.service-card::after, .value-card::after {
    content: ''; position: absolute; left: 28px; right: 28px; bottom: 0; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform 0.6s var(--ease);
}
.service-icon { transition: transform 0.6s var(--ease); }
@media (hover: hover) {
    .service-card:hover::after, .value-card:hover::after { transform: scaleX(1); }
    .service-card:hover .service-icon { transform: translateY(-4px) rotate(-6deg) scale(1.08); }
}

/* Link con sottolineatura che si disegna */
.site-footer ul a, .footer-social a, .menu-footer a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
    transition: background-size 0.45s var(--ease), color 0.3s;
}
.site-footer ul a:hover, .footer-social a:hover, .menu-footer a:hover { background-size: 100% 1px; }

/* Marquee: si ferma al passaggio del mouse */
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* Sezione libro: sfondo con lieve parallasse (gestito via JS) */
.book-highlight__bg { inset: -12% 0; will-change: transform; }
.book-highlight__label { position: relative; }

/* WhatsApp: leggero respiro per attirare l'attenzione */
@keyframes ra-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.35); } 50% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); } }
.whatsapp-card { animation: ra-breathe 2.8s ease-in-out 1.5s 3; }

/* Barra di avanzamento della lettura negli articoli */
.read-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100;
    background: var(--accent); transform-origin: left; transform: scaleX(0);
    pointer-events: none;
}

/* Contatori: cifre a larghezza fissa per non "ballare" */
[data-count] { font-variant-numeric: tabular-nums; }

/* Card articoli: entrata scalata */
.posts-grid .post-card.reveal:nth-child(3n+2) { transition-delay: 0.08s; }
.posts-grid .post-card.reveal:nth-child(3n+3) { transition-delay: 0.16s; }

/* Meno animazioni per chi lo preferisce */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    .hero .hero-content > *, .page-hero-text > *, .contact-header > *,
    .hero .hero-img-main img, .page-hero-visual .hero-img-main img, .hero .hero-badge,
    .hero-title em::after, .whatsapp-card { animation: none !important; }
    .js .reveal--curtain img { clip-path: none; transform: none; }
    .menu-overlay { clip-path: none; }
    .site-header.header-hidden { transform: none; }
    .read-progress { display: none; }
}

/* ================================================================
   v2.2 — ARTICOLI, PAGINE, BLOG: LETTURA ELEGANTE
   ================================================================ */

/* Briciole di pane */
.breadcrumbs { margin-bottom: 18px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: 0.75rem; color: var(--text-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: '/'; opacity: 0.4; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] span { color: var(--text); opacity: 0.75; }
.hero--content .hero-content .breadcrumbs ol { justify-content: flex-start; }

.section-label a { color: inherit; border-bottom: 1px solid transparent; }
.section-label a:hover { border-bottom-color: currentColor; }

/* Riga meta (autore · data · tempo di lettura) */
.article-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.02em;
    margin-top: -12px;
}
.article-meta__author { color: var(--text); font-weight: 500; }

/* Intestazione solo testo (pagine senza immagine, legali, categorie) */
.text-hero { padding-top: calc(var(--header-h) + 64px); padding-bottom: 40px; border-bottom: var(--border); }
.text-hero__inner { max-width: 820px; }
.text-hero__inner > * { animation: ra-rise 0.9s var(--ease) both; }
.text-hero__inner > *:nth-child(2) { animation-delay: 0.08s; }
.text-hero__inner > *:nth-child(3) { animation-delay: 0.16s; }
.text-hero__inner > *:nth-child(n+4) { animation-delay: 0.26s; }
.text-hero__title { font-size: clamp(2.4rem, 5.5vw, 4.5rem); letter-spacing: -0.02em; margin-bottom: 24px; }
.text-hero .article-meta { margin-top: 0; }
.text-hero--doc .text-hero__title { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }

/* Corpo con indice laterale */
.article-layout { max-width: 800px; margin: 0 auto; }
.article-layout.has-toc { max-width: 1120px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; }
.article-layout.has-toc .single-article-content { margin: 0; max-width: 760px; }
.page-layout--text .article-body, .page-layout--doc .article-body { padding-top: 56px; }

/* Indice dei contenuti */
.toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: 0.85rem; }
.toc details { border-left: 1px solid var(--border-color); padding-left: 20px; }
.toc__title {
    list-style: none; cursor: pointer;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__count { font-size: 0.65rem; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg-alt); letter-spacing: 0; }
.toc__list { list-style: none; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--header-h) - 120px); overflow-y: auto; }
.toc__item a { color: var(--text-muted); line-height: 1.4; display: block; position: relative; transition: color 0.3s, transform 0.3s var(--ease); }
.toc__item a::before {
    content: ''; position: absolute; left: -21px; top: 0; bottom: 0; width: 2px;
    background: var(--accent); transform: scaleY(0); transition: transform 0.4s var(--ease);
}
.toc__item a:hover { color: var(--text); }
.toc__item a.is-active { color: var(--text); transform: translateX(2px); }
.toc__item a.is-active::before { transform: scaleY(1); }
.toc__item--h3 { padding-left: 14px; font-size: 0.8rem; }

/* Tipografia dell'articolo */
.single-post-article .single-article-content > p:first-of-type { font-size: 1.28rem; line-height: 1.7; color: var(--text); }
.single-post-article .single-article-content > p:first-of-type::first-letter {
    font-family: var(--font-display); float: left; font-size: 4.2em; line-height: 0.82;
    padding: 6px 10px 0 0; color: var(--accent);
}
.single-article-content h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); position: relative; padding-top: 18px; }
.single-article-content h2::before { content: ''; position: absolute; top: 0; left: 0; width: 40px; height: 2px; background: var(--accent); }
.single-article-content h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.single-article-content blockquote { position: relative; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.6; padding: 1.6rem 1.8rem 1.6rem 3.4rem; }
.single-article-content blockquote::before { content: '“'; position: absolute; left: 1rem; top: 0.4rem; font-size: 3.4rem; line-height: 1; color: var(--accent); opacity: 0.6; }
.single-article-content .wp-block-gallery { gap: 12px !important; }
.single-article-content .wp-block-gallery img { border-radius: 10px; transition: transform 0.6s var(--ease); }
.single-article-content .wp-block-gallery figure { overflow: hidden; border-radius: 10px; margin: 0; }
@media (hover: hover) { .single-article-content .wp-block-gallery figure:hover img { transform: scale(1.04); } }
.single-article-content .wp-block-image figure, .single-article-content figure.wp-block-image { margin-block: 2.2rem; }
.single-article-content strong.numbered-heading {
    display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem;
    letter-spacing: 0; text-transform: none; margin: 2.2rem 0 0.4rem; color: var(--text);
}
.single-article-content [id] { scroll-margin-top: calc(var(--header-h) + 24px); }
.page-layout--doc .single-article-content { font-size: 1rem; }
.page-layout--doc .single-article-content p, .page-layout--doc .single-article-content li { color: #3c3a37; }
.page-layout--doc .single-article-content .has-small-font-size { font-size: 1rem !important; }
.doc-contact { margin-top: 3rem; padding: 20px 24px; background: var(--bg-alt); border-radius: var(--radius); font-size: 0.95rem; }

/* Fine articolo: tag, condivisione, autore */
.article-footer { margin-top: 3.5rem; padding-top: 2rem; border-top: var(--border); display: flex; flex-direction: column; gap: 28px; }
.article-tags { list-style: none !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 !important; }
.article-tags a { text-decoration: none !important; font-size: 0.8rem; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--bg-alt); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); margin-right: 8px; }
.share a, .share__copy {
    text-decoration: none !important; font-size: 0.8rem; padding: 8px 16px; border-radius: var(--radius-pill);
    border: var(--border); background: transparent; color: var(--text); cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.share a:hover, .share__copy:hover { background: var(--text); color: var(--bg); border-color: var(--text); transform: translateY(-2px); }
.share__copy.is-copied { background: var(--accent); border-color: var(--accent); color: #fff; }
.author-box { display: flex; gap: 20px; align-items: center; padding: 24px; background: var(--bg-alt); border-radius: var(--radius-lg); }
.author-box__avatar {
    flex: 0 0 64px; height: 64px; border-radius: 50%; background: var(--text); color: var(--bg);
    display: grid; place-items: center; font-family: var(--font-display); font-size: 1.3rem;
}
.author-box p { margin: 0 !important; }
.author-box__label { font-size: 0.7rem !important; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.author-box__name { font-family: var(--font-display); font-size: 1.3rem !important; }
.author-box__name a { text-decoration: none !important; }
.author-box__bio { font-size: 0.9rem !important; color: var(--text-muted); line-height: 1.6; }

/* Articolo precedente / successivo */
.post-nav { max-width: 1120px; margin: 48px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.post-nav__link { display: flex; flex-direction: column; gap: 8px; padding: 24px 28px; border: var(--border); border-radius: var(--radius); transition: background-color 0.3s, transform 0.4s var(--ease); }
.post-nav__link:hover { background: var(--bg-alt); transform: translateY(-3px); }
.post-nav__link--next { text-align: right; grid-column: 2; }
.post-nav__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }
.post-nav__title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; }

/* Correlati */
.related { padding-block: clamp(64px, 9vw, 120px); border-top: var(--border); }
.related .section-title { margin-bottom: 40px; }

/* Card articoli */
.post-card { position: relative; }
.post-card-img-wrap { position: relative; }
.post-card-cat {
    position: absolute; left: 14px; top: 14px; z-index: 1;
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 6px 12px; border-radius: var(--radius-pill);
    background: rgba(240, 237, 232, 0.92); color: var(--text); backdrop-filter: blur(6px);
}
.post-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.03em; }
.post-card-title { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1.25; }
.post-card-title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.5s var(--ease), color 0.3s; }
.post-card:hover .post-card-title a { background-size: 100% 1px; }
.post-card-excerpt { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-more { font-size: 0.8rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.post-card-more span { transition: transform 0.4s var(--ease); }
.post-card:hover .post-card-more span { transform: translateX(5px); }

/* Filtri categorie */
.cat-filter { margin-bottom: 40px; }
.cat-filter ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.cat-filter a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--radius-pill); border: var(--border);
    font-size: 0.85rem; transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.cat-filter a span { font-size: 0.7rem; opacity: 0.55; }
.cat-filter a:hover { border-color: var(--text); }
.cat-filter a[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text); }
.posts-grid-wrap--archive { padding-top: 48px; }

/* Ricerca */
.search-form { display: flex; gap: 10px; margin-top: 24px; max-width: 520px; }
.search-form__input {
    flex: 1; min-width: 0; padding: 14px 20px; border-radius: var(--radius-pill);
    border: var(--border); background: var(--bg-alt); font: inherit; font-size: 16px; color: var(--text);
}
.search-form__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(130,143,112,0.15); }
.error-search .search-form { margin: 0 auto 28px; }
.error-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 32px; font-size: 0.9rem; }
.error-links a { border-bottom: var(--border); padding-bottom: 2px; }

/* Responsive v2.2 */
@media (max-width: 1024px) {
    .article-layout.has-toc { grid-template-columns: 1fr; gap: 32px; max-width: 800px; }
    .toc { position: static; }
    .toc details { border: var(--border); border-radius: var(--radius); padding: 18px 20px; background: var(--bg-alt); }
    .toc__title { margin-bottom: 0; }
    .toc details[open] .toc__title { margin-bottom: 14px; }
    .toc__item a::before { display: none; }
}
@media (max-width: 768px) {
    .hero--content .breadcrumbs ol, .hero--content .article-meta { justify-content: center; }
    .text-hero { padding-top: calc(var(--header-h) + 40px); }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav__link--next { grid-column: auto; text-align: left; }
    .author-box { flex-direction: column; text-align: center; }
    .single-post-article .single-article-content > p:first-of-type { font-size: 1.15rem; }
    .cat-filter ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
    .cat-filter ul::-webkit-scrollbar { display: none; }
    .cat-filter li { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .text-hero__inner > * { animation: none !important; }
}

/* Titoli lunghi */
.hero-title.hero-title--long { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.hero-title.hero-title--xlong { font-size: clamp(2.1rem, 4vw, 3.4rem); }
.text-hero__title.hero-title--long { font-size: clamp(2.2rem, 4.5vw, 3.8rem); }
.text-hero__title.hero-title--xlong { font-size: clamp(2rem, 3.6vw, 3.1rem); }
