:root {
    /* Color Palette */
    --color-beige: #e6dfd3;
    /* Pietra beige */
    --color-wood: #5b3a29;
    /* Legno marrone scuro */
    --color-olive: #8a8f7a;
    /* Oliva grigia */
    --color-sand: #d8c9a3;
    /* Sabbia calda */
    --color-white: #ffffff;
    --color-black: #1a1a1a;

    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 80px 20px;

    /* Transitions */
    --transition-speed: 0.3s;
}

/* Reset & Base */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Offset for sticky header */
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-beige);
    color: var(--color-wood);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--color-wood);
}

h3 {
    font-size: 1.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

.bg-light {
    background-color: #f7f3ed;
}

/* Lighter beige */
.bg-dark {
    background-color: var(--color-wood);
    color: var(--color-beige);
}

.section-padding {
    padding: var(--section-padding);
}

/* Buttons */
.btn-primary {
    background-color: var(--color-olive);
    color: var(--color-white);
    padding: 10px 25px;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--color-wood);
}

.btn-outline {
    border: 2px solid var(--color-white);
    color: var(--color-white);
    padding: 10px 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.btn-outline:hover {
    background-color: var(--color-white);
    color: var(--color-wood);
}

.btn-text {
    color: var(--color-olive);
    border-bottom: 1px solid transparent;
}

.btn-text:hover {
    border-color: var(--color-olive);
}

/* Header */
#main-header {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(230, 223, 211, 0.95);
    /* Semi-transparent beige */
    backdrop-filter: blur(5px);
    transition: box-shadow 0.3s ease;
}

#main-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
}

#main-nav ul {
    display: flex;
    gap: 30px;
    align-items: center;
}

#main-nav ul li a {
    position: relative;
    padding-bottom: 5px;
}

#main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-olive);
    transition: width 0.3s;
}

#main-nav ul li a:hover::after,
#main-nav ul li a.active::after {
    width: 100%;
}

#main-nav ul li a.active {
    color: var(--color-olive);
}

/* Language Switcher */
.lang-switcher-desktop {
    display: flex;
    gap: 5px;
    margin-left: 20px;
    align-items: center;
    color: var(--color-wood);
}

.lang-link {
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0 2px;
    text-transform: uppercase;
}

.lang-link:hover,
.lang-link.active {
    color: var(--color-olive);
    font-weight: 700;
}

/* Mobile Lang Switcher */
.lang-switcher-mobile {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.lang-switcher-mobile .lang-link {
    font-size: 1.2rem;
}

#mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

#mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--color-wood);
}

/* Mobile Menu */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--color-beige);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: right 0.4s ease;
}

#mobile-menu.active {
    right: 0;
}

#mobile-menu ul {
    text-align: center;
    gap: 40px;
    display: flex;
    flex-direction: column;
}

/* Hero */
#hero {
    height: 90vh;
    background-color: var(--color-olive);
    /* Fallback */
    background-image: url('img/esterno1.jpg');
    /* User photo */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.lead {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 20px;
    color: var(--color-olive);
}

.about-img-desktop {
    height: 400px;
    object-fit: cover;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Menu */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.menu-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card-content h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-wood);
}

.menu-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.price {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-olive);
}

.badge {
    background-color: var(--color-sand);
    color: var(--color-wood);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.menu-desc {
    font-size: 0.9rem;
    color: #666;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.img-box {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.img-box:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

#load-more-card {
    cursor: pointer;
}

.more-card-content {
    background-color: var(--color-olive);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.more-card-content-strong {
    font-size: 2rem;
    font-weight: 500;
}

.more-card-content span {
    pointer-events: none;
}

.hidden-gallery-item {
    display: none;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.6s;
    border-radius: 12px;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

/* Contact */
.contact-layout {
    display: flex;
    justify-content: center;
    text-align: center;
}

.contact-info a {
    color: var(--color-sand);
}

.contact-form-wrapper input,
.contact-form-wrapper textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--font-sans);
}

.contact-form-wrapper input::placeholder,
.contact-form-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.contact-form-wrapper input:focus,
.contact-form-wrapper textarea:focus {
    outline: none;
    border-color: var(--color-sand);
}

/* Footer */
footer {
    padding: 30px 0;
    background-color: #f7f3ed;
    color: #888;
    font-size: 0.8rem;
}

.map-container {
    margin-top: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.map-container iframe {
    display: block;
    width: 100%;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    #main-nav {
        display: none;
    }

    #mobile-menu-btn {
        display: flex;
    }

    .about-grid,
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-image {
        order: -1;
    }

    /* Image first on mobile */
    .menu-grid {
        grid-template-columns: 1fr 1fr;
        /* Two columns on mobile */
        gap: 15px;
    }

    .card-img {
        height: 140px;
        /* Smaller image height */
    }

    .card-content {
        padding: 15px;
    }

    .card-content h3 {
        font-size: 1rem;
    }

    /* Gallery & About Mobile */
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .img-box {
        height: 140px;
        /* Smaller gallery images */
    }

    .about-img-desktop {
        height: 250px;
        /* Smaller about image */
    }
}