/* =========================================================
   AGRITENUTA SAN FRANCESCO — Global Styles
   File: wwwroot/css/site.css
   =========================================================
   Architettura:
     1. CSS Custom Properties (design tokens)
     2. Reset / Base
     3. Navbar
     4. Mobile menu
     5. Footer
     6. Utility
   ========================================================= */

/* ─────────────────────────────────────────────
   1. DESIGN TOKENS
───────────────────────────────────────────── */
:root {
    /* Palette */
    --olive:         #4a5240;
    --olive-light:   #7a8c6e;
    --cream:         #f5f0e8;
    --cream-60:      rgba(245, 240, 232, .60);
    --cream-45:      rgba(245, 240, 232, .45);
    --cream-35:      rgba(245, 240, 232, .35);
    --gold:          #c9a227;
    --gold-20:       rgba(201, 162, 39, .20);
    --gold-40:       rgba(201, 162, 39, .40);
    --dark:          #1a1c16;
    --dark-footer:   #141611;
    --white-05:      rgba(255, 255, 255, .05);
    --white-08:      rgba(255, 255, 255, .08);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-sans:    'Jost', system-ui, sans-serif;

    /* Spacing */
    --nav-h:        80px;   /* altezza navbar desktop */
    --nav-h-sm:     64px;   /* altezza navbar mobile  */

    /* Transitions */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --t-fast:   0.2s ease;
    --t-med:    0.35s ease;
    --t-slow:   0.5s var(--ease-out-quart);
}

/* ─────────────────────────────────────────────
   2. RESET / BASE
───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Ottimizzazione font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--dark);
    color: var(--cream);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    /* Compensa la navbar fixed */
    padding-top: var(--nav-h);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ─────────────────────────────────────────────
   3. NAVBAR
───────────────────────────────────────────── */
.navbar {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: var(--nav-h);
    z-index: 1000;
    /* Stato iniziale: trasparente sopra l'hero */
    background: transparent;
    border-bottom: 1px solid transparent;
    transition:
        background   var(--t-med),
        border-color var(--t-med),
        height       var(--t-med);
}

/* Glassmorphism attivato via JS allo scroll */
.navbar.is-scrolled {
    background:    rgba(10, 10, 8, .82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--white-05);
    height: calc(var(--nav-h) - 12px);
}

.nav-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Logo ── */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: opacity var(--t-fast);
}
.logo-wrap:hover { opacity: .85; }

.logo-emblem {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid var(--gold-40);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: box-shadow var(--t-med), border-color var(--t-med);
}
.logo-wrap:hover .logo-emblem {
    border-color: var(--gold);
    box-shadow: 0 0 14px 3px rgba(201, 162, 39, .18);
}

.logo-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--cream);
    line-height: 1.15;
}

.logo-sub {
    display: block;
    font-size: .62rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--cream-45);
    margin-top: 3px;
}

/* ── Desktop nav links ── */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.2rem;
    list-style: none;
}

.nav-link {
    position: relative;
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--cream-60);
    transition: color var(--t-fast);
    padding-bottom: 2px;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    inset-block-end: -4px;
    inset-inline-start: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--t-med);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--cream);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    width: 100%;
}

/* CTA "Prenota" */
.nav-cta {
    border: 1px solid var(--gold-40);
    border-radius: 999px;
    padding: .7rem 1.4rem;
    color: var(--gold) !important;
    transition: background var(--t-fast), border-color var(--t-fast) !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
    background: var(--gold-20);
    border-color: var(--gold) !important;
}

/* ─────────────────────────────────────────────
   4. MOBILE MENU
───────────────────────────────────────────── */

/* Hamburger */
.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    position: relative;
    background: transparent;
    border: 1px solid var(--white-08);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1200;
    transition: border-color var(--t-fast);
}
.mobile-toggle:hover { border-color: var(--gold-40); }

.mobile-toggle span {
    position: absolute;
    left: 10px;
    width: 22px;
    height: 1.5px;
    background: var(--cream);
    transition: transform var(--t-med), opacity var(--t-fast), top var(--t-med);
    transform-origin: center;
}
.mobile-toggle span:nth-child(1) { top: 14px; }
.mobile-toggle span:nth-child(2) { top: 21px; }
.mobile-toggle span:nth-child(3) { top: 28px; }

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg);  top: 21px; }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 21px; }

/* Menu overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(14, 15, 11, .97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;

    /* Animazione: scivola dall'alto */
    opacity: 0;
    transform: translateY(-12px);
    visibility: hidden;
    transition:
        opacity     var(--t-slow),
        transform   var(--t-slow),
        visibility  0s var(--t-slow);
}

.mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition:
        opacity     var(--t-slow),
        transform   var(--t-slow);
}

.mobile-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--cream-60);
    font-size: 1.2rem;
    cursor: pointer;
    padding: .5rem;
    line-height: 1;
    transition: color var(--t-fast);
}
.mobile-close:hover { color: var(--cream); }

.mobile-menu a {
    font-size: .85rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--cream-60);
    text-decoration: none;
    transition: color var(--t-fast);
    /* Stagger animation (definito inline con JS se necessario, o via nth-child) */
}
.mobile-menu a:hover  { color: var(--cream); }
.mobile-menu .mobile-cta {
    margin-top: .5rem;
    border: 1px solid var(--gold-40);
    padding: .9rem 2.2rem;
    border-radius: 999px;
    color: var(--gold) !important;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.mobile-menu .mobile-cta:hover {
    background: var(--gold-20);
    border-color: var(--gold);
}

/* ─────────────────────────────────────────────
   5. FOOTER
───────────────────────────────────────────── */
.site-footer {
    background: var(--dark-footer);
    border-top: 1px solid var(--white-05);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 5rem 2rem 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--cream);
}

.footer-heading {
    font-family: var(--font-sans);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.4rem;
}

.footer-text {
    color: var(--cream-60);
    line-height: 1.85;
    font-size: .92rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.footer-links a {
    font-size: .9rem;
    color: var(--cream-60);
    transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--gold); }

/* Social icons */
.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.4rem;
}
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--white-08);
    border-radius: 8px;
    color: var(--cream-60);
    transition: color var(--t-fast), border-color var(--t-fast);
}
.footer-social a:hover {
    color: var(--gold);
    border-color: var(--gold-40);
}

/* Newsletter form */
.footer-newsletter {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--white-08);
    border-radius: 6px;
    transition: border-color var(--t-fast);
}
.footer-newsletter:focus-within { border-color: var(--gold-40); }

.footer-newsletter input {
    flex: 1;
    background: transparent;
    border: none;
    padding: .65rem 1rem;
    font-family: var(--font-sans);
    font-size: .85rem;
    color: var(--cream);
    outline: none;
}
.footer-newsletter input::placeholder { color: var(--cream-35); }

.footer-newsletter button {
    padding: .65rem 1rem;
    background: var(--gold-20);
    border: none;
    border-left: 1px solid var(--white-08);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--t-fast);
}
.footer-newsletter button:hover { background: rgba(201, 162, 39, .30); }

/* Bottom bar */
.footer-bottom {
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--white-05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    color: var(--cream-35);
    font-size: .78rem;
    letter-spacing: .06em;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--cream-35);
    transition: color var(--t-fast);
}
.footer-bottom-links a:hover { color: var(--gold); }

/* ─────────────────────────────────────────────
   6. UTILITY
───────────────────────────────────────────── */

/* Contenuto pagina */
.page-content { min-height: 80vh; }

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.sr-only.focus\:not-sr-only:focus {
    position: static;
    width: auto; height: auto;
    clip: auto;
    white-space: normal;
}

/* ─────────────────────────────────────────────
   7. RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 900px) {
    body { padding-top: var(--nav-h-sm); }

    .navbar { height: var(--nav-h-sm); }
    .navbar.is-scrolled { height: var(--nav-h-sm); }

    .nav-container { padding: 0 1.25rem; }

    .nav-menu    { display: none; }
    .mobile-toggle { display: flex; align-items: center; justify-content: center; }

    .logo-name { font-size: .95rem; }
    .logo-sub  { display: none; }   /* troppo stretto su mobile piccolo */

    .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-name { font-size: .88rem; }
}
