/* ========================================================
   INDEX PAGE - Video Background
   ======================================================== */

/* Header container */
header {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
}

/* Video background responsive */
.videobg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    /* Increased scale to allow room for parallax movement */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: -1;
    will-change: transform;
    /* Hint for performance */
}

/* Overlay per migliorare la leggibilità del testo */
header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--overlay-hero-start) 0%, var(--overlay-hero-end) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 40;
    text-align: center;
    color: var(--color-text-inverse);
    padding: var(--space-xl);
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

/* Keep hero content constrained so header stays within 100vh */
.hero-content {
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 400;
    margin-bottom: var(--space-lg);
    color: var(--color-text-inverse);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--color-text-inverse);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* Animazione fade in staggered */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animazione per elementi CTA con delay maggiore */
.hero-cta {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        height: 60vh;
        min-height: 400px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    header {
        height: 50vh;
        min-height: 350px;
    }

    .hero-content {
        padding: var(--space-lg);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* ========================================================
   HOMEPAGE - STILI PERSONALIZZATI
   Tutte le variabili colore sono ora in styles.css globale
   ======================================================== */

/* ========================================================
   HERO SECTION - HOMEPAGE
   ======================================================== */

.homepage-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.homepage-hero .videobg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(74, 20, 13, 0.75) 0%,
            rgba(131, 50, 40, 0.65) 50%,
            rgba(192, 140, 59, 0.3) 100%);
    z-index: 1;
}

.homepage-hero .hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    color: white;
}

.homepage-hero .hero-title {
    font-family: 'Perandory', sans-serif;
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 3px 6px 16px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

.homepage-hero .hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.homepage-hero .hero-description {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

/* Unified Button Sizes for Homepage */
.hp-section .btn {
    min-width: 220px;
    padding: 0.875rem 2.5rem !important;
    /* Forza padding uniforme ovunque */
    font-weight: 600;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hp-section .btn {
        min-width: 100%;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

.hero-cta .btn {
    font-family: 'TeX Gyre Termes', serif;
    font-weight: 600;
    padding: 0.875rem 2.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.hero-cta .btn-primary {
    background: var(--color-gradient-primary);
    border: none;
    color: white;
}

.hero-cta .btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* ========================================================
   SECTIONS - HOMEPAGE
   ======================================================== */

.hp-section {
    position: relative;
    padding: 5rem 0;
    background: var(--color-background);
}

.hp-parco {
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

/* Sezione 'Il Parco' full-screen con logo di sfondo trasparente verso sinistra */
/* Background Design: Warmed Vellum + Subtle Vignette */
#il-parco.hp-parco {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    background:
        radial-gradient(circle at center, rgba(255, 255, 235, 0.4) 0%, rgba(74, 103, 65, 0.08) 100%),
        url('/static/assets/img/textures/paper-texture.webp');
    background-blend-mode: multiply;
    background-size: cover;
    overflow: hidden;
}

/* Internal refined frame */
#il-parco.hp-parco::after {
    content: '';
    position: absolute;
    top: 3rem;
    left: 3rem;
    right: 3rem;
    bottom: 3rem;
    border: 1px solid rgba(74, 103, 65, 0.12);
    pointer-events: none;
    z-index: 1;
}

/* Background Quotes Layer */
.hp-quotes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.bg-quote {
    position: absolute;
    color: var(--color-primary-dark);
    font-family: 'TeX Gyre Termes', serif;
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    line-height: 1.4;
    max-width: 280px;
    padding: 0.5rem 1rem;
    opacity: 0.45;
    /* Aumentata opacità per migliore leggibilità */
    background: rgba(255, 255, 255, 0.6);
    /* Sfondo più solido per contrasto */
    border-radius: 4px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s linear;
}

.bg-quote::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 4px;
    height: 60%;
    background: var(--color-primary);
    transform: translateY(-50%);
    opacity: 0.3;
}

.bg-quote-1 {
    top: 15%;
    left: 8%;
    transform: rotate(-2deg);
}

.bg-quote-2 {
    top: 18%;
    right: 10%;
    transform: rotate(1.5deg);
}

.bg-quote-3 {
    bottom: 20%;
    left: 12%;
    transform: rotate(1deg);
}

.bg-quote-4 {
    bottom: 15%;
    right: 8%;
    transform: rotate(-1.5deg);
}

@media (max-width: 991px) {
    .hp-quotes-layer {
        display: none;
    }

    #il-parco.hp-parco::after {
        top: 1.5rem;
        left: 1.5rem;
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

/* Subtle floating animation */
@keyframes microFloat {

    0%,
    100% {
        transform: translateY(0) rotate(var(--rot));
    }

    50% {
        transform: translateY(-15px) rotate(calc(var(--rot) + 0.5deg));
    }
}

.bg-quote-1 {
    --rot: -2deg;
    animation: microFloat 14s infinite ease-in-out;
}

.bg-quote-2 {
    --rot: 1.5deg;
    animation: microFloat 16s infinite ease-in-out;
}

.bg-quote-3 {
    --rot: 1deg;
    animation: microFloat 18s infinite ease-in-out;
}

.bg-quote-4 {
    --rot: -1.5deg;
    animation: microFloat 20s infinite ease-in-out;
}




/* Assicura che il contenuto resti sopra il logo di sfondo */
#il-parco .container-xl,
#il-parco .hp-content {
    position: relative;
    z-index: 2;
}

/* Constrain content inside #il-parco - Adjusted for centering */
#il-parco .hp-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.hp-section-separator {
    margin: 0.5rem 0 2rem;
    display: flex;
    align-items: center;
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 103, 65, 0.2), transparent);
    position: relative;
}

.separator-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(74, 103, 65, 0.2);
}

#il-parco .hp-section-title {
    font-size: clamp(2rem, 5.5vw, 3rem);
    margin-bottom: 0.5rem;
    color: var(--color-primary-dark);
}

#il-parco .lead {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--color-text-secondary);
}

/* Elegant Drop-cap rimosso per pulizia */

/* Pulsanti nella sezione Il Parco: riga e centrati */
#il-parco.hp-parco .hp-cta-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Mobile: impilare verticalmente per spazio ridotto */
@media (max-width: 480px) {
    #il-parco.hp-parco .hp-cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
}

/* Mobile: logo più piccolo e meno invadente */
@media (max-width: 768px) {
    /* Mobile video: remove scale to minimize cropping */
    .videobg {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    #il-parco.hp-parco::before {
        width: 80vw;
        height: 80vw;
        background-size: contain;
        opacity: 0.03;
    }

    #il-parco.hp-parco {
        min-height: auto;
        /* Permette alla sezione di crescere col contenuto */
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
}

.hp-luoghi {
    background: linear-gradient(to bottom,
            color-mix(in srgb, var(--color-primary-pale) 30%, var(--color-background)) 0%,
            var(--color-background) 100%);
}

.hp-biblioteca {
    background: linear-gradient(to bottom,
            var(--color-background) 0%,
            color-mix(in srgb, var(--color-secondary-light) 15%, var(--color-background)) 100%);
    border-bottom: 1px solid var(--color-border);
}

.hp-eventi {
    background: linear-gradient(to bottom,
            color-mix(in srgb, var(--color-secondary-light) 15%, var(--color-background)) 0%,
            var(--color-background) 100%);
}

.hp-archivi {
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

.hp-cta-final {
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--color-primary-pale) 50%, var(--color-background)) 0%,
            color-mix(in srgb, var(--color-secondary-light) 20%, var(--color-background)) 100%);
}

/* ========================================================
   ALTERNATE SECTION BACKGROUNDS
   Use two alternating colors instead of gradients for hp sections
   ======================================================== */

/* Default fallback for sections */
.hp-section {
    background: var(--color-background) !important;
}

/* Odd sections: primary pale, Even sections: background (alternating) */
/* We target section elements in sequence to alternate colors */
section.hp-section:nth-of-type(odd) {
    background: var(--color-primary-pale) !important;
}

section.hp-section:nth-of-type(even) {
    background: var(--color-background) !important;
}


/* Slight border contrast preserved */
section.hp-section {
    border-bottom: 1px solid var(--color-border);
}

@media (prefers-reduced-motion: reduce) {
    section.hp-section {
        transition: none !important;
    }
}

/* Eventi - lista: più spazio e divisori tra gli elementi nella sezione Eventi & Notizie */
.hp-eventi-notizie .hp-card ul.list-unstyled {
    margin: 0;
    padding: 0;
}

.hp-eventi-notizie .hp-card ul.list-unstyled li {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--color-border);
}

.hp-eventi-notizie .hp-card ul.list-unstyled li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hp-eventi-notizie .hp-card ul.list-unstyled li a {
    display: block;
    padding: 0.15rem 0;
}

.hp-eventi-notizie .hp-card ul.list-unstyled li .text-muted {
    display: block;
    margin-top: 0.25rem;
}

.hp-section-title {
    font-family: 'TeX Gyre Termes', serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hp-accent {
    background: var(--color-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================================
   CONTENT - HOMEPAGE
   ======================================================== */

.hp-content {
    padding: 1rem;
}

.hp-content .lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.hp-features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    display: grid;
    gap: 1rem;
}

.hp-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--color-text-primary);
    line-height: 1.6;
}

.hp-features i {
    color: var(--color-accent);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.hp-cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hp-cta-buttons .btn {
    font-family: 'TeX Gyre Termes', serif;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hp-cta-buttons .btn-primary {
    background: var(--color-gradient-primary);
    border: none;
    color: white;
}

.hp-cta-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.hp-cta-buttons .btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.hp-cta-buttons .btn-outline-primary:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ========================================================
   CARDS - HOMEPAGE
   ======================================================== */

.hp-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

/* Gradient border effect on hover */
.hp-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary-dark);
}

.hp-card:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.hp-card-primary {
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--color-primary-pale) 70%, var(--color-surface)) 0%,
            color-mix(in srgb, var(--color-primary-light) 8%, var(--color-surface)) 50%,
            var(--color-surface) 100%);
    border-color: color-mix(in srgb, var(--color-primary) 15%, var(--color-border));
}

.hp-card-primary:hover {
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--color-primary-pale) 90%, var(--color-surface)) 0%,
            color-mix(in srgb, var(--color-primary-light) 20%, var(--color-surface)) 50%,
            color-mix(in srgb, var(--color-primary-pale) 40%, var(--color-surface)) 100%);
}

.hp-card-secondary {
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--color-neutral-100) 80%, var(--color-surface)) 0%,
            color-mix(in srgb, var(--color-primary-pale) 15%, var(--color-surface)) 50%,
            var(--color-surface) 100%);
    border-color: color-mix(in srgb, var(--color-primary) 12%, var(--color-border));
}

.hp-card-secondary:hover {
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--color-primary-pale) 60%, var(--color-surface)) 0%,
            color-mix(in srgb, var(--color-primary-light) 15%, var(--color-surface)) 50%,
            color-mix(in srgb, var(--color-neutral-100) 30%, var(--color-surface)) 100%);
}

.hp-card-icon {
    width: 85px;
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--color-primary) 15%, transparent) 0%,
            color-mix(in srgb, var(--color-primary-light) 20%, transparent) 100%);
    border-radius: 50%;
    margin: 0 auto;
    color: var(--color-primary);
    font-size: 2.5rem;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    border: 2px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
}

/* Icon animation on hover */
.hp-card:hover .hp-card-icon {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 10px 25px color-mix(in srgb, var(--color-primary) 35%, transparent);
    border-color: transparent;
}

/* Subtle bounce for icon */
.hp-card:hover .hp-card-icon i {
    animation: iconPulse 0.8s ease;
}

@keyframes iconPulse {
    0% {
        transform: scale(1) translateY(0);
    }

    20% {
        transform: scale(1.2) translateY(-3px);
    }

    40% {
        transform: scale(0.95) translateY(1px);
    }

    60% {
        transform: scale(1.08) translateY(-1px);
    }

    80% {
        transform: scale(0.98) translateY(0);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

.hp-card h3 {
    font-family: 'TeX Gyre Termes', serif;
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1.3rem;
    margin: 0;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.hp-card:hover h3 {
    color: var(--color-primary-dark);
}

.hp-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    margin: 0;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.hp-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.hp-card-link:hover {
    color: var(--color-primary-dark);
    gap: 0.75rem;
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.hp-card-link i {
    transition: transform 0.3s ease;
}

.hp-card-link:hover i {
    transform: translateX(4px);
}

.hp-card-link:hover {
    color: var(--color-primary-dark);
    gap: 1rem;
}

/* ========================================================
   IMAGES & ILLUSTRATIONS - HOMEPAGE
   ======================================================== */

.hp-image-wrapper {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hp-illustration {
    width: 100%;
    height: auto;
    display: block;
    /* Animation removed as requested: "le card con dentro gli svg fanno su e giu ed è brutto" */
}

/* ========================================================
   CTA CARD - HOMEPAGE
   ======================================================== */

.hp-cta-card {
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--color-primary-pale) 70%, var(--color-surface)) 0%,
            color-mix(in srgb, var(--color-secondary-light) 20%, var(--color-surface)) 100%);
    border: 2px solid var(--color-primary-light);
    border-radius: 2rem;
    padding: 4rem 2rem;
    box-shadow: var(--color-shadow-lg);
}

.hp-cta-card h2 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.hp-cta-card .lead {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ========================================================
   RESPONSIVE - HOMEPAGE
   ======================================================== */

@media (max-width: 991.98px) {
    .hp-section-title {
        font-size: 2rem;
    }

    .hp-hero-content {
        text-align: center;
    }

    .homepage-hero .hero-title {
        font-size: 2rem;
    }

    .homepage-hero .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hp-cta-buttons {
        justify-content: center;
    }

    .hp-cta-card {
        padding: 3rem 1.5rem;
    }

    .hp-section {
        padding: 3rem 0 !important;
        /* Ridotto da 5rem per mobile */
    }
}

@media (max-width: 767.98px) {
    .hp-section-title {
        font-size: 1.75rem;
    }

    .homepage-hero .hero-title {
        font-size: 1.75rem;
    }

    .hp-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .hp-card {
        padding: 1.5rem;
        transform: none !important;
        transition: opacity 0.4s ease, background 0.4s ease !important;
        /* Solo opacità e sfondo */
        animation: none !important;
        width: 100% !important;
        /* Forza layout verticale stabile */
        margin-bottom: 1.5rem;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .hp-card::before,
    .hp-card::after {
        display: none !important;
    }

    .hp-cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hp-cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .hp-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
}

/* ========================================================
   ACCESSIBILITY & PRINT - HOMEPAGE
   ======================================================== */

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

    .hp-illustration,
    .hp-card,
    .hp-card-icon {
        animation: none !important;
        transition: none !important;
    }
}

@media print {
    .homepage-hero {
        min-height: auto;
        background: var(--color-surface);
    }
}

/* ====================
   Overflow fixes
   - Ensure predictable box-sizing
   - Prevent horizontal scrollbar caused by wide pseudo-elements
   ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Defensive: if any element still overflows, hide horizontal overflow globally */
html,
body {
    overflow-x: hidden;
}

/* ========================================================
   CONTACT / FORM - hp-contact-split
   ======================================================== */
/* removed legacy .hp-contact-split (was duplicate) */

.hp-contact-center {
    display: grid;
    grid-template-columns: 1fr;
    /* single column: form centered */
    gap: 2rem;
    align-items: start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

.hp-contact-column {
    min-width: 0;
    /* prevents grid children from forcing overflow */
    width: 100%;
}

/* ========================================================
   CONTACT FORM - HOMEPAGE (Premium Styles)
   ======================================================== */

.hp-contact-card {
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface-elevated) 60%, var(--color-surface)) 0%, var(--color-surface) 100%);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 1000px;
}

.hp-contact-form .form-group {
    margin-bottom: 1.5rem;
}

.hp-contact-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.hp-contact-form .form-label .required {
    color: var(--color-error);
    font-weight: 700;
}

.hp-contact-form .form-label .optional {
    color: var(--color-text-tertiary);
    font-weight: 400;
    font-size: 0.875rem;
}

.hp-contact-form .form-control {
    display: block;
    width: 100%;
    min-height: 56px;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-contact-form .form-control:hover {
    border-color: var(--color-primary-light);
}

.hp-contact-form .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(130, 50, 40, 0.08);
    background: var(--color-surface-elevated);
}

.hp-contact-form .form-control::placeholder {
    color: var(--color-text-tertiary);
    opacity: 0.8;
}

.hp-contact-form textarea.form-control {
    resize: vertical;
    min-height: 140px;
    height: auto;
}

/* Validazione visiva */
.hp-contact-form .form-control.is-invalid {
    border-color: var(--color-error);
    background-image: none;
}

.hp-contact-form .invalid-feedback {
    font-size: 0.875rem;
    color: var(--color-error);
    margin-top: 0.5rem;
}

/* Button override for contact form - Unified with homepage buttons */
.hp-contact-form .btn-lg {
    min-width: 220px;
    /* padding ereditato da .hp-section .btn con !important */
    font-size: 1.125rem;
    letter-spacing: 0.02em;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

.hp-contact-form .form-note {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hp-contact-card {
        padding: 1.5rem;
    }

    .hp-contact-form .btn-lg {
        width: 100%;
    }
}



.hp-contact-form .form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.hp-contact-form .form-control {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Form group margin (custom) */
.hp-contact-form .form-group {
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .hp-contact-form .form-group {
        margin-bottom: 0.85rem !important;
        /* Spazio ridotto tra i campi su mobile */
    }

    .hp-contact-form .form-control {
        height: 48px !important;
        min-height: 48px !important;
        font-size: 15px !important;
    }

    .hp-contact-form textarea.form-control {
        min-height: 100px !important;
    }

    .hp-contact-form .form-label {
        margin-bottom: 0.2rem !important;
        font-size: 0.9rem !important;
    }
}

/* right-column styles removed (column deleted from template) */

.hp-contact-form .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 6px 18px rgba(130, 50, 40, 0.06);
}

/* ========================================================
   MOBILE/TABLET FIX - RESPONSIVE IMPROVEMENTS
   ======================================================== */

/* Hide decorative SVG illustrations on mobile - they cause visual noise */
@media (max-width: 991.98px) {
    .hp-illustration {
        display: none !important;
    }

    .hp-image-wrapper {
        display: none !important;
    }

    /* Make columns full width when illustration is hidden */
    .hp-section .col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Center content when illustration is hidden */
    .hp-content {
        text-align: center;
    }

    .hp-features {
        text-align: left;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Further mobile-specific fixes */
@media (max-width: 767.98px) {

    /* Ensure no horizontal overflow */
    .container,
    .container-xl,
    .container-fluid {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Reduce hero height for better mobile experience */
    header {
        height: 70vh !important;
        min-height: 350px !important;
    }

    /* Smaller hero title on mobile */
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    /* Section padding reduction */
    .hp-section {
        padding: 2.5rem 0 !important;
    }

    /* Smaller section titles */
    .hp-section-title {
        font-size: 1.5rem !important;
    }

    /* Hide background pseudo-elements that cause overflow */
    #il-parco.hp-parco::before {
        display: none !important;
    }

    /* Cards full width on mobile */
    .hp-card {
        margin-bottom: 1rem;
    }

    /* Remove max-height restrictions that may clip content */
    #il-parco.hp-parco {
        max-height: none !important;
        min-height: auto !important;
        padding-top: 0 !important;
        /* Rimuove spazio residuo sotto il video */
    }

    #il-parco .hp-content {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Form improvements for touch */
    .hp-contact-form .form-control {
        height: 50px;
        font-size: 16px;
        /* Prevents iOS zoom on input focus */
    }

    .hp-contact-card {
        padding: 1rem !important;
    }
}

/* Very small screens (< 400px) */
@media (max-width: 399px) {
    .hero-title {
        font-size: 1.5rem !important;
    }

    .hero-content {
        padding: 1rem !important;
    }

    .hp-section-title {
        font-size: 1.25rem !important;
    }

    .hp-cta-buttons .btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
    }
}

/* Eliminate gap before footer on mobile */
@media (max-width: 991px) {

    .hp-section.hp-cta-final,
    .hp-section:last-of-type {
        padding-bottom: 2.5rem !important;
        /* Ripristinata simmetria (uguale al padding-top) */
        margin-bottom: 0 !important;
    }

    .hp-cta-final .container,
    .hp-cta-final .container-xl {
        margin-bottom: 0 !important;
    }
}