:root {
    --primary: #a5432a;
    --primary-dark: #83341f;
    --accent: #5b7052;
    --dark: #2b2320;
    --text: #3a322d;
    --light: #fbf7f1;
    --white: #ffffff;
    --shadow: 0 6px 18px rgba(0,0,0,0.08);
    --border-radius: 10px;
    --font-family: 'Georgia', 'Times New Roman', serif;
}

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

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

.container { width: 90%; max-width: 1100px; margin: 0 auto; }
a { color: var(--primary); }

/* Utility: contenuto solo per screen reader */
.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;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -60px;
    left: 0;
    background: var(--dark);
    color: var(--white);
    padding: 0.9rem 1.4rem;
    z-index: 1000;
    text-decoration: none;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    border-radius: 0 0 8px 0;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Header */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-menu { display: flex; list-style: none; gap: 1.8rem; }
.nav-menu a { text-decoration: none; color: var(--dark); font-weight: 600; }
.nav-menu a:hover, .nav-menu a.active { color: var(--primary); }

.hamburger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 4px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    padding: 0;
}
.hamburger span { width: 25px; height: 3px; background: var(--dark); border-radius: 2px; }

@media (max-width: 760px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 66px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1.5rem 0;
        box-shadow: var(--shadow);
    }
    .nav-menu.active { display: flex; }
    .hamburger { display: flex; }
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #a5432a 0%, #5b7052 100%);
    color: var(--white);
    text-align: center;
    padding: 5rem 1.5rem;
}
.hero h1 { font-size: clamp(1.9rem, 4vw + 1rem, 3rem); margin-bottom: 1rem; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.hero p { font-size: 1.15rem; max-width: 600px; margin: 0 auto 2rem; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary { background: var(--white); color: var(--primary); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

section { padding: 4rem 0; }
section h2 { text-align: center; font-size: 2rem; margin-bottom: 0.5rem; color: var(--dark); }
.section-sub { text-align: center; color: #6b5f57; margin-bottom: 2.5rem; }

/* Tile "foto" generate via gradiente + emoji (fallback per un piatto/evento senza foto ancora caricata) */
.photo-tile {
    aspect-ratio: 4 / 3;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.6rem;
    box-shadow: var(--shadow);
    text-align: center;
    gap: 0.4rem;
    transition: transform 0.25s;
    overflow: hidden;
}
.photo-tile span.tile-label { font-size: 0.85rem; font-family: system-ui, sans-serif; opacity: 0.9; }
.photo-tile:hover { transform: translateY(-4px); }

.photo-tile.has-photo { padding: 0; justify-content: flex-end; }
.photo-tile.has-photo img {
    flex: 1;
    width: 100%;
    object-fit: cover;
    display: block;
}
.photo-tile.has-photo .tile-label {
    width: 100%;
    background: var(--dark);
    color: var(--white);
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
    font-family: system-ui, sans-serif;
}

/* Variante senza didascalia (es. griglia social): la foto riempie tutto il tile */
.photo-tile.has-photo.no-caption { justify-content: center; }
.photo-tile.has-photo.no-caption img { flex: none; height: 100%; }

.tile-1 { background: linear-gradient(135deg,#a5432a,#c9714f); }
.tile-2 { background: linear-gradient(135deg,#5b7052,#83a06f); }
.tile-3 { background: linear-gradient(135deg,#8a5a2f,#c99a5b); }
.tile-4 { background: linear-gradient(135deg,#a5432a,#5b7052); }
.tile-5 { background: linear-gradient(135deg,#6b3f2a,#a5432a); }
.tile-6 { background: linear-gradient(135deg,#3f5b38,#5b7052); }

@media (prefers-reduced-motion: reduce) {
    .photo-tile, .btn-primary { transition: none; }
    .photo-tile:hover, .btn-primary:hover { transform: none; }
}

/* Galleria anteprima in home */
.gallery-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
}

/* Pagina galleria completa */
.gallery-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* Eventi / blog */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}
.event-card {
    display: block;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.event-card .photo-tile { aspect-ratio: 16/9; border-radius: 0; }
.event-card-body { padding: 1.3rem; }
.event-date { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.event-card-body h3 { margin: 0.4rem 0 0.6rem; color: var(--dark); }
.event-card-body p { color: #6b5f57; font-size: 0.95rem; }

/* Social mockup */
.social-mockup {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}
.social-mockup h3 { margin-bottom: 0.3rem; }
.social-mockup .handle { color: var(--accent); font-weight: 600; margin-bottom: 1.5rem; display: block; }
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.social-grid .photo-tile { aspect-ratio: 1/1; font-size: 1.6rem; }

/* Menu con categorie */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; max-width: 900px; margin: 0 auto; }
.menu-category h3 {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    margin-bottom: 1rem;
    padding-bottom: 0.2rem;
}
.menu-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dashed #ddd; }
.menu-item .price { font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Contatti */
.contact-section { background: var(--white); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; max-width: 900px; margin: 0 auto; }
.contact-info p { margin-bottom: 0.8rem; }
.contact-form input, .contact-form select, .contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: system-ui, sans-serif;
    min-height: 44px;
}
.contact-form textarea { min-height: 80px; }
.form-note {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: #eaf1e7;
    color: #2f4a29;
    display: none;
}
.form-note.visible { display: block; }

@media (max-width: 760px) {
    .contact-grid { grid-template-columns: 1fr; }
    .social-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Footer */
footer { background: var(--dark); color: #d8cfc7; text-align: center; padding: 2rem 0; font-size: 0.9rem; }
footer a { color: #e8b596; }

/* Banner demo */
.demo-banner {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}
.demo-banner a { color: #e8b596; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}
