/*
Theme Name: Cerreto Vini
Theme URI: https://cerretolibri.com
Author: Gemini
Description: Custom theme for Fattoria Cerreto Libri inspired by Villa Matilde style.
Version: 1.0
Text Domain: cerreto-vini
*/

:root {
    /* Colors */
    --color-bg-primary: #ffffff;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-accent: #b5935a;
    --color-accent-hover: #9c7e4a;
    --color-white: #ffffff;
    --color-border: #e0e0e0;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    /* fallback */

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    /* Container */
    --container-width: 1200px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

img {
    max-width: 100%;
    height: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
}


/* Fixed Header */
.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    z-index: 1000;
    transition: all 0.3s ease;
}

body {
    padding-top: 0;
}

/* Header Container */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 16px;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.site-logo {
    height: 70px;
    width: auto;
    display: block;
}

.branding-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.site-tagline {
    font-size: 0.85rem;
    text-transform: lowercase;
    font-style: italic;
    color: #777;
    margin: 0;
    line-height: 1.2;
}

/* Header Right Side */
.header-right-side {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-left: auto;
}

/* Language Switcher */
.language-switcher {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 600;
    padding: 10px 0;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 80vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-family: var(--font-body);
}

/* Teaser Cards Premium */
.teaser-card-premium {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.teaser-card-premium:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.teaser-card-premium .btn {
    transition: all 0.3s ease;
}

.teaser-card-premium:hover .btn {
    background-color: #556b2f !important;
    color: #fff !important;
    transform: scale(1.05);
}


/* Home Testimonials */
.home-testimonials blockquote {
    border-left: none;
    padding: 0;
    margin: 0;
}

/* Teaser Grid */
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin: 60px 0;
}

.teaser-card {
    background: #fff;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease;
}

.teaser-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Forms (Contact) */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    font-family: var(--font-body);
}

button[type="submit"] {
    background-color: var(--color-accent);
    color: #fff;
    border: none;
    padding: 12px 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background-color: var(--color-accent-hover);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.left {
    transform: translateX(-50px);
}

.reveal.right {
    transform: translateX(50px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    transform: translateX(0);
}

/* Delay classes for staggered animations */
.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

/* Soft Zoom on Images */
.zoom-container img {
    transition: transform 0.6s ease;
}

.zoom-container:hover img {
    transform: scale(1.08);
}

/* ==========================================================================
   MOBILE MENU HAMBURGER
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    order: 3;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text-primary);
    margin: 3px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger animation quando aperto */
.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   RESPONSIVE - TABLET LANDSCAPE (1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }

    .main-navigation ul {
        gap: 25px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .teaser-grid {
        gap: 30px;
        margin: 40px 0;
    }
}

/* ==========================================================================
   RESPONSIVE - TABLET PORTRAIT (768px) + MOBILE MENU
   ========================================================================== */

@media (max-width: 768px) {
    /* Mobile Menu Toggle visibile */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Menu slide-in da destra */
    .header-right-side {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 30px 30px;
        gap: 0 !important;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .header-right-side.mobile-open {
        right: 0;
    }

    /* Menu verticale */
    .main-navigation {
        width: 100%;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-navigation a {
        display: block;
        padding: 15px 0;
        font-size: 1rem;
    }

    /* Header tools sotto il menu */
    .header-tools {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 1px solid #f0f0f0;
        width: 100%;
    }

    .language-switcher {
        justify-content: flex-start !important;
    }

    /* Overlay quando menu aperto */
    body.mobile-menu-active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    body.mobile-menu-active {
        overflow: hidden;
    }

    /* Hero responsive */
    .hero-section {
        height: 60vh;
        min-height: 400px;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .hero-content {
        padding: 15px;
    }

    /* Teaser 1 colonna */
    .teaser-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Scroll indicator nascosto su mobile */
    .scroll-down-indicator {
        display: none;
    }

    /* Site branding mobile */
    .site-logo {
        height: 50px !important;
    }

    .site-title {
        font-size: 1.2rem !important;
    }

    .site-tagline {
        font-size: 0.75rem !important;
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE (480px)
   ========================================================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-section {
        height: 50vh;
        min-height: 350px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    /* Nascondi branding text */
    .branding-text {
        display: none !important;
    }

    .site-logo {
        height: 45px !important;
    }

    .site-branding {
        gap: 0 !important;
    }
}

/* ==========================================================================
   RESPONSIVE - SMALL MOBILE (360px)
   ========================================================================== */

@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-section {
        min-height: 300px;
    }
}

/* ==========================================================================
   COLORI PER TIPOLOGIA VINO (Pagina Archivio Vini)
   ========================================================================== */

/* Rosso / Red — Bordeaux #8b1a2b */
.vino-card.tipo-vino-rosso .vino-type-badge,
.vino-card.tipo-vino-red .vino-type-badge {
    background: #8b1a2b;
}
.vino-card.tipo-vino-rosso .vino-vintage,
.vino-card.tipo-vino-red .vino-vintage {
    color: #8b1a2b;
}
.vino-card.tipo-vino-rosso .btn-scheda,
.vino-card.tipo-vino-red .btn-scheda {
    border-color: #8b1a2b;
    color: #8b1a2b;
}
.vino-card.tipo-vino-rosso:hover .btn-scheda,
.vino-card.tipo-vino-red:hover .btn-scheda {
    background: #8b1a2b;
    color: #fff;
}

/* Bianco / White — Oro/ambra #b8860b */
.vino-card.tipo-vino-bianco .vino-type-badge,
.vino-card.tipo-vino-white .vino-type-badge {
    background: #b8860b;
}
.vino-card.tipo-vino-bianco .vino-vintage,
.vino-card.tipo-vino-white .vino-vintage {
    color: #b8860b;
}
.vino-card.tipo-vino-bianco .btn-scheda,
.vino-card.tipo-vino-white .btn-scheda {
    border-color: #b8860b;
    color: #b8860b;
}
.vino-card.tipo-vino-bianco:hover .btn-scheda,
.vino-card.tipo-vino-white:hover .btn-scheda {
    background: #b8860b;
    color: #fff;
}

/* Dolce / Sweet — Rosa antico #c4717a */
.vino-card.tipo-vino-dolce .vino-type-badge,
.vino-card.tipo-vino-sweet .vino-type-badge {
    background: #c4717a;
}
.vino-card.tipo-vino-dolce .vino-vintage,
.vino-card.tipo-vino-sweet .vino-vintage {
    color: #c4717a;
}
.vino-card.tipo-vino-dolce .btn-scheda,
.vino-card.tipo-vino-sweet .btn-scheda {
    border-color: #c4717a;
    color: #c4717a;
}
.vino-card.tipo-vino-dolce:hover .btn-scheda,
.vino-card.tipo-vino-sweet:hover .btn-scheda {
    background: #c4717a;
    color: #fff;
}

/* ==========================================================================
   LIGHTBOX TESTIMONIANZE
   ========================================================================== */

.testimonial-product-img img {
    cursor: zoom-in;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.testimonial-product-img img:hover {
    transform: scale(1.04);
    opacity: 0.9;
}

#testimonial-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#testimonial-lightbox.active {
    display: flex;
    opacity: 1;
}

#testimonial-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
}

#testimonial-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#testimonial-lightbox-close:hover {
    opacity: 1;
}