@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

/* 
    SERVIZI GRANDINE SRL - Official Stylesheet v4.2
    Changelog: 
    - Migliorato contrasto accessibilità footer
    - Ottimizzazione CLS per immagini hero
    - Transizioni fluide per menu mobile
    - Correzione specificità link
*/

:root {
    /* Brand Colors */
    --primary: #064e3b;
    --primary-dark: #022c22;
    --primary-light: #10b981; 
    --accent: #10b981;
    --bg-color: #f8fafc;
    --stone: #e4e4e7;
    --text-main: #27272a;
    --text-muted: #52525b;
    --white: #ffffff;
    
    /* UI Colors */
    --footer-bg: #09090b;
    --footer-text: #d4d4d8; /* Incrementato contrasto per accessibilità */
    --footer-heading: #ffffff;
    --border: rgba(9, 9, 11, 0.1);
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    
    /* Spacings */
    --container-pad: 1.5rem;
    --section-gap: 3.5rem;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; 
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* --- BUTTONS & CTA --- */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    background-color: var(--primary);
    color: var(--white);
    border: 1px solid transparent;
    box-shadow: 0 4px 14px rgba(6, 78, 59, 0.2);
    min-height: 3.25rem; /* Ottimizzato per il touch */
}

.btn-cta:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 78, 59, 0.3);
    color: var(--white);
}

.btn-cta.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
}

/* --- TOP BAR --- */
.top-bar {
    background-color: var(--primary-dark);
    color: var(--white);
    font-size: 0.8125rem;
    padding: 0.75rem 0;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.top-bar .container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.top-bar a {
    color: var(--white);
    opacity: 0.85;
}

.top-bar a:hover {
    opacity: 1;
    text-decoration: underline;
}

.top-bar-right {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

/* --- NAVIGATION & HEADER --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

.nav-links {
    display: none; 
}

/* Stile menu mobile con transizione */
.nav-links.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 1rem 2rem rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HERO SECTION --- */
.hero {
    padding: var(--section-gap) 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

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

.hero-content h1 {
    font-size: clamp(2.25rem, 8vw, 3.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.15;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.hero-image {
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.15);
    background-color: var(--stone); /* Placeholder CLS */
    aspect-ratio: 16 / 10;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- FOOTER --- */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 4rem 0 0 0;
    margin-top: 4rem;
    font-size: 0.875rem;
}

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

.footer-col h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--footer-heading);
    margin-bottom: 1.5rem;
}

.footer-col a {
    color: var(--footer-text);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.footer-col a:hover {
    color: var(--white);
    transform: translateX(4px);
}

.footer-bottom {
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 3rem;
    font-size: 0.75rem;
    text-align: center;
}

.legal-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
}

.legal-links a {
    color: var(--footer-text);
    font-size: 0.75rem;
    text-decoration: underline;
    opacity: 0.9;
}

.legal-links a:hover {
    color: var(--white);
    opacity: 1;
}
.legal-links a:hover { opacity: 1; }

/* --- MEDIA QUERIES --- */



/* TABLET */
@media (min-width: 768px) {
    .top-bar .container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .hero-btns {
        flex-direction: row;
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* DESKTOP */
@media (min-width: 1024px) {
    nav { height: 90px; }

    .menu-toggle { display: none; }

    .nav-links {
        display: flex;
        gap: 2.5rem;
        align-items: center;
    }

    .nav-links a:not(.btn-cta) {
        font-size: 0.875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
    }

    .nav-links a:not(.btn-cta):hover,
    .nav-links a.active {
        color: var(--primary);
    }

    .hero {
        flex-direction: row;
        align-items: center;
        padding: 8rem 0;
        text-align: left;
        gap: 4rem;
    }

    .hero-content {
        flex: 1.2;
        text-align: left;
    }

    .hero-content p {
        margin-left: 0;
    }

    .hero-btns {
        justify-content: flex-start;
    }

    .hero-image {
        flex: 1;
    }

    .footer-grid {
        grid-template-columns: 2fr repeat(3, 1fr);
    }

    .footer-bottom .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .legal-links { margin-top: 0; }
}

/* --- ACCESSIBILITY & UTILS --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}