/* ============================================================
   Bed and Breakfast Marie — sito vetrina in PHP puro
   Palette naturale: verde salvia, terracotta, crema.
   ============================================================ */

:root {
    --green-900: #2f4530;
    --green-700: #4a6b4d;
    --green-500: #6f9070;
    --terracotta: #c1714f;
    --terracotta-dark: #a65a3c;
    --cream: #f7f3ea;
    --cream-dark: #efe8d8;
    --ink: #2c2a26;
    --muted: #6c685f;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(47, 69, 48, 0.12);
    --radius: 14px;
    --maxw: 1120px;
    --font-head: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.65;
    font-size: 17px;
}

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

a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.text-center { text-align: center; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--green-900); }

/* ---------------- Header / Nav ---------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(247, 243, 234, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--cream-dark);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-head); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--green-700); color: var(--cream);
    font-size: 20px; font-weight: 700;
}
.brand-name { font-size: 22px; color: var(--green-900); font-weight: 600; }
.brand--footer .brand-name { color: var(--cream); }
.brand--footer .brand-mark { background: var(--terracotta); }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: 16px; }
.nav-links a.is-active { color: var(--terracotta-dark); }
.nav-links a:hover { text-decoration: none; color: var(--terracotta-dark); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--green-900); transition: .3s; }

.lang-switch { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.lang-switch a { color: var(--muted); font-weight: 600; }
.lang-switch a.is-active { color: var(--green-900); text-decoration: underline; }
.lang-switch span { color: var(--cream-dark); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block; padding: 13px 26px; border-radius: 999px;
    font-weight: 600; font-size: 16px; cursor: pointer; border: 2px solid transparent;
    transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.15); color: var(--white); }
.btn-nav { background: #c0392b; color: var(--white) !important; padding: 9px 20px; }
.btn-nav:hover { background: #a02d22; }

/* ---------------- Hero ---------------- */
.hero {
    position: relative; min-height: 78vh; display: grid; align-items: center;
    background: linear-gradient(120deg, #3a5740, #6f9070);
    color: var(--white); overflow: hidden;
}
.hero--photo { background-size: cover; background-position: center; }
.hero-overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(193,113,79,.30), transparent 45%),
        linear-gradient(180deg, rgba(20,30,20,.35), rgba(20,30,20,.70));
}
.hero-content { position: relative; max-width: 760px; padding-top: 40px; padding-bottom: 40px; }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 13px; font-weight: 600; opacity: .9; margin: 0 0 14px; }
.hero h1 { color: var(--white); font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 0 0 18px; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 0 0 28px; opacity: .95; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 16px; font-size: 14px; opacity: .85; }

/* Page heros (galleria / contatto) */
.page-hero { position: relative; padding: 96px 0; color: var(--white); text-align: center; overflow: hidden; }
.page-hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 14px; position: relative; }
.page-hero .hero-sub { position: relative; max-width: 640px; margin: 0 auto; }
.page-hero--gallery { background: linear-gradient(120deg, #4a6b4d, #c1714f); }
.page-hero--contact { background: linear-gradient(120deg, #2f4530, #4a6b4d); }

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section--alt { background: var(--cream-dark); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 16px; }
.section-intro { color: var(--muted); max-width: 720px; margin: 0 auto 36px; }
.lead { font-size: 1.2rem; color: var(--green-700); }

/* ---------------- Home: intro con immagine ---------------- */
.intro-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: center; }
.intro-media img { width: 100%; aspect-ratio: 4 / 3; max-height: 440px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------------- Home: anteprima galleria ---------------- */
.home-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.home-gallery img { width: 100%; height: 210px; object-fit: cover; border-radius: var(--radius); }
.home-gallery-cta { margin-top: 30px; }

/* ---------------- Feature list ---------------- */
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li {
    position: relative; padding: 16px 0 16px 34px;
    border-bottom: 1px solid var(--cream-dark);
}
.feature-list li::before {
    content: ""; position: absolute; left: 4px; top: 22px;
    width: 12px; height: 12px; border-radius: 50%; background: var(--terracotta);
}

/* ---------------- Galleria ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease; }
.gallery-card:hover { transform: translateY(-5px); }
.gallery-photo { display: block; width: 100%; height: 240px; object-fit: cover; cursor: zoom-in; }

/* Lightbox (ingrandimento immagini) */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,.88); padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; box-shadow: 0 12px 44px rgba(0,0,0,.5); }
.lightbox-close {
    position: absolute; top: 14px; right: 20px;
    width: 44px; height: 44px; border: 0; cursor: pointer;
    background: none; color: #fff; font-size: 34px; line-height: 1;
}
.lightbox-close:hover { color: #ddd; }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
@media (max-width: 520px) {
    .lightbox-nav { width: 44px; height: 44px; font-size: 22px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

/* ---------------- Contatto ---------------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.contact-info h2, .contact-form-wrap h2 { font-size: 1.8rem; margin: 0 0 22px; }
.contact-list { list-style: none; margin: 0 0 26px; padding: 0; }
.contact-list li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--cream-dark); }
.contact-list strong { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--green-700); margin-bottom: 2px; }
.contact-hours { background: var(--cream-dark); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
.contact-hours p { margin: 4px 0; }
.contact-hours .hours-title { font-weight: 700; color: var(--green-900); margin-top: 12px; }
.contact-hours .hours-title:first-child { margin-top: 0; }

.contact-form-wrap { background: var(--white); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; color: var(--green-900); }
.field--consent label.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.field--consent input[type="checkbox"] { width: auto; margin-top: 3px; flex: 0 0 auto; }
.field--consent .consent span { font-size: 14px; color: var(--muted); }
.field input, .field textarea {
    width: 100%; padding: 13px 15px; border: 1.5px solid var(--cream-dark);
    border-radius: 10px; font-family: inherit; font-size: 16px; background: var(--cream);
    transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green-500); background: var(--white); }
.field textarea { resize: vertical; }
.field-error { display: block; margin-top: 6px; color: #b3261e; font-size: 14px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 15px 18px; border-radius: 10px; margin-bottom: 22px; font-weight: 500; }
.alert--success { background: #e4f0e1; color: #2f5d2f; border: 1px solid #b9d8b2; }
.alert--error { background: #fbe6e4; color: #8f2018; border: 1px solid #f0bcb6; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--green-900); color: var(--cream); margin-top: 0; padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-tag { font-family: var(--font-head); font-size: 1.3rem; margin: 14px 0 0; color: var(--cream-dark); }
.footer-info p { margin: 6px 0; color: var(--cream-dark); }
.footer-hours { margin-top: 14px; }
.footer-hours-title { margin: 10px 0 2px !important; color: var(--cream) !important; font-weight: 600; }
.footer-info a { color: var(--cream); }
.footer-bottom { border-top: 1px solid rgba(247,243,234,.15); padding: 20px 0; text-align: center; }
.footer-bottom p { margin: 0; font-size: 14px; color: var(--cream-dark); }
.footer-codes { margin-bottom: 12px !important; letter-spacing: .5px; }
.footer-bottom a { color: var(--cream); text-decoration: underline; }

/* ---------------- Pagina legale ---------------- */
.legal h2 { font-size: 1.3rem; margin: 30px 0 10px; }
.legal p { color: var(--muted); }
.legal a { color: var(--terracotta-dark); text-decoration: underline; }
.legal-back { margin-top: 34px; }

/* ---------------- WhatsApp floating ---------------- */
.whatsapp-float {
    position: fixed; right: 22px; bottom: 22px; z-index: 999;
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #25d366; color: #fff !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    transition: transform .2s ease, box-shadow .2s ease;
}
.whatsapp-float:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.3); text-decoration: none; }
.whatsapp-float svg { display: block; }

/* ---------------- Servizi (home) ---------------- */
.service-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.service-item {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 20px 18px; text-align: center; font-weight: 600; color: var(--green-900);
    position: relative; padding-top: 42px;
}
.service-item::before {
    content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    width: 14px; height: 14px; border-radius: 50%; background: var(--terracotta);
}

/* ---------------- Card servizi (galleria) ---------------- */
.feature-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 28px 26px; border-top: 4px solid var(--terracotta);
}
.feature-card-title { font-size: 1.5rem; margin: 0 0 4px; }
.feature-card-subtitle { font-weight: 600; color: var(--green-700); margin: 0 0 12px; }
.feature-card p:last-child { color: var(--muted); margin: 0; }

/* ---------------- Cosa vedere ---------------- */
.seewhat-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.seewhat-subtitle { font-size: 1.4rem; margin: 0 0 6px; color: var(--terracotta-dark); }

/* ---------------- Social (contatto) ---------------- */
.contact-social { margin-top: 8px; }
.contact-social .hours-title { font-weight: 700; color: var(--green-900); margin-bottom: 10px; }
.social-links { display: flex; gap: 14px; }
.social-links a {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--green-700); color: var(--cream);
    transition: transform .2s ease, background .2s ease;
}
.social-links a:hover { background: var(--terracotta); transform: translateY(-2px); text-decoration: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-cards { grid-template-columns: repeat(2, 1fr); }
    .seewhat-split { grid-template-columns: 1fr; gap: 24px; }
    .services-grid, .gallery-grid, .home-gallery { grid-template-columns: repeat(2, 1fr); }
    .intro-split { grid-template-columns: 1fr; gap: 28px; }
    .contact-layout { grid-template-columns: 1fr; gap: 36px; }
    .footer-grid { grid-template-columns: 1fr; }

    .nav-toggle { display: flex; }
    .nav-links {
        position: absolute; top: 72px; left: 0; right: 0;
        flex-direction: column; align-items: flex-start; gap: 0;
        background: var(--cream); border-bottom: 1px solid var(--cream-dark);
        padding: 8px 24px; max-height: 0; overflow: hidden; transition: max-height .3s ease;
    }
    .nav-links.is-open { max-height: 360px; padding: 16px 24px; }
    .nav-links li { width: 100%; }
    .nav-links a { display: block; padding: 12px 0; width: 100%; }
    .btn-nav { margin-top: 6px; }
}

@media (max-width: 520px) {
    .services-grid, .gallery-grid, .service-grid, .feature-cards { grid-template-columns: 1fr; }
    .home-gallery { grid-template-columns: repeat(2, 1fr); }
    .contact-form-wrap { padding: 24px; }
}
