/* --- VARIABILI --- */
:root {
    --ink: #2b211a;
    --wine: #6e1f24;
    --wine-deep: #4d1519;
    --tufo: #b97d43;
    --tufo-light: #d3a066;
    --parchment: #f2e8d5;
    --paper: #faf5ea;
    --moss: #5f6b45;
    --stone-line: #d8c7a4;
    --font-display: 'Fraunces', serif;
    --font-body: 'Work Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    line-height: 1.65;
}

a {
    color: inherit;
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--paper);
    padding: 0.8rem 6%;
    border-bottom: 1px solid var(--stone-line);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-wrap {
    display: block;
    text-decoration: none;
}

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

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

nav a:not(.btn-nav):hover {
    border-color: var(--tufo);
}

.btn-nav {
    background-color: var(--wine);
    color: #ffffff !important;
    padding: 9px 22px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.btn-nav:hover {
    background-color: var(--wine-deep);
}

/* --- HERO --- */
/* --- HERO CON SFONDO BORGO.JPG --- */
.hero {
    position: relative;
    background-color: var(--ink);
    min-height: 78vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Immagine di sfondo con overlay scuro sfumato per far risaltare il testo */
    background-image: 
        linear-gradient(160deg, rgba(26, 19, 16, 0.85) 0%, rgba(43, 33, 26, 0.75) 55%, rgba(26, 19, 16, 0.90) 100%),
        url('img/borgo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Rimuoviamo il vecchio pattern a mattoni */
.hero-stone {
    display: none;
}


.hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 8%;
    color: #f5ecdb;
}

.kicker {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--tufo-light);
    margin-bottom: 1rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 3.4rem;
    line-height: 1.12;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-text {
    font-size: 1.05rem;
    color: #d8cbb4;
    max-width: 480px;
    margin-bottom: 2.2rem;
}

.hero-buttons {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 13px 26px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
    background-color: var(--tufo);
    color: #221a12;
}

.btn-secondary {
    background: transparent;
    color: #f5ecdb;
    border: 1px solid rgba(245,236,219,0.4);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- STORIA / STRIP NARRATIVA --- */
.storia {
    background-color: var(--wine);
    padding: 3.5rem 1.5rem;
}

.storia-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    color: var(--parchment);
}

.storia-mark {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--tufo-light);
    display: block;
    margin-bottom: 0.8rem;
}

.storia-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.05rem, 1.7vw, 1.3rem);
    line-height: 1.6;
    font-weight: 400;
    text-wrap: pretty;
}

.storia-text p + p {
    margin-top: 1.1rem;
}

/* --- SEZIONI --- */
.section-container {
    max-width: 880px;
    margin: 5rem auto;
    padding: 0 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 2.1rem;
    color: var(--wine);
    margin-bottom: 0.4rem;
}

.section-title.text-center {
    text-align: center;
}

.section-subtitle {
    color: #6b5e4d;
    margin-bottom: 2.2rem;
    font-size: 1rem;
}

/* --- LAPIDE ORARI E CONTATTI CENTRALIZZATI --- */
.plaque {
    border-top: 2px solid var(--wine);
    border-bottom: 2px solid var(--wine);
    padding: 0.4rem 0;
}

.plaque-centered .plaque-row {
    text-align: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.plaque-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.1rem 0.2rem;
    flex-wrap: wrap;
}

.plaque-row + .plaque-row {
    border-top: 1px solid var(--stone-line);
}

.plaque-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--wine);
}

.plaque-value {
    font-size: 1rem;
    color: #4a3f32;
    text-align: center;
}

.plaque-value a {
    color: var(--wine);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

.plaque-value.closed {
    color: var(--wine-deep);
    font-weight: 600;
}

.plaque-main-contact {
    background-color: rgba(185, 125, 67, 0.08);
    padding: 1.5rem 1rem !important;
}

.plaque-numbers {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 1.15rem;
}

.phone-big a, .wa-big a {
    font-weight: 600;
}

.plaque-link {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.plaque-divider {
    height: 1px;
    background: var(--stone-line);
    margin: 0.5rem 0;
}

/* --- CAROSELLO GALLERIA --- */
.carousel-container {
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.carousel-track::-webkit-scrollbar {
    height: 6px;
}

.carousel-track::-webkit-scrollbar-track {
    background: var(--parchment);
    border-radius: 4px;
}

.carousel-track::-webkit-scrollbar-thumb {
    background: var(--tufo);
    border-radius: 4px;
}

.carousel-card {
    flex: 0 0 290px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    background-color: #e3d5b8;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--stone-line);
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    backface-visibility: hidden;
    transition: transform 0.4s ease;
}

.carousel-card:hover img {
    transform: scale(1.04);
}

.card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.9rem 1rem;
    background: linear-gradient(transparent, rgba(43, 33, 26, 0.85));
    color: #f5ecdb;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-display);
}

/* --- FOOTER --- */
footer {
    background-color: var(--ink);
    color: #cbbfa9;
    text-align: center;
    padding: 3rem 1rem 2.5rem;
}

.footer-logo {
    height: 50px;
    width: auto;
    margin: 0 auto 1rem;
    display: block;
    border-radius: 4px; /* Opzionale: smussa gli angoli se lo sfondo del logo è chiaro */
}

footer p {
    font-size: 0.95rem;
}

.footer-sub {
    color: #8a7d69;
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 720px) {
    .navbar {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    nav {
        gap: 1.2rem;
        flex-wrap: wrap;
    }
    .hero h1 {
        font-size: 2.3rem;
    }
    .hero-content {
        margin: 0 6%;
    }
    .plaque-numbers {
        flex-direction: column;
        gap: 0.5rem;
    }
    .carousel-card {
        flex: 0 0 80%;
    }
}

/* --- ACCESSIBILITÀ --- */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--tufo);
    outline-offset: 2px;
}

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

/* --- OTTIMIZZAZIONE USER EXPERIENCE MOBILE --- */
@media (max-width: 720px) {
    /* Navbar compatta */
    .navbar {
        padding: 0.6rem 4%;
    }
    
    .logo-img {
        height: 38px;
    }

    nav {
        gap: 0.8rem;
    }

    nav {
        width: 100%;
        justify-content: center;
        gap: 0.7rem;
    }

    nav a:not(.btn-nav) {
        display: block;
        font-size: 0.78rem;
    }

    .btn-nav {
        padding: 7px 14px;
        font-size: 0.85rem;
    }

    /* Hero adattata ai pollici */
    .hero {
        min-height: 85vh; /* Sfrutta meglio l'altezza dello schermo mobile */
        padding: 4rem 0;
    }

    .hero-content {
        margin: 0 5%;
    }

    .hero h1 {
        font-size: 2.1rem; /* Dimensione ideale per non andare a capo male */
        line-height: 1.2;
    }

    .hero-text {
        font-size: 0.95rem;
    }

    .storia {
        padding: 2.8rem 1.1rem;
    }

    .storia-inner {
        max-width: 34rem;
    }

    .storia-text {
        font-size: 1.05rem;
        line-height: 1.55;
    }

    .storia-text p + p {
        margin-top: 0.95rem;
    }

    /* Bottoni a larghezza piena facilissimi da cliccare */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .btn-primary, .btn-secondary {
        text-align: center;
        width: 100%;
        padding: 14px 16px; /* Area di tocco più grande per le dita */
    }

    /* Carosello piatti fluido */
    .carousel-card {
        flex: 0 0 82vw; /* Ogni scheda occupa l'82% della larghezza dello schermo */
    }
}