:root {
  --cream: #f7f2ea;
  --stone: #ebe3d6;
  --ink: #2e2a25;
  --muted: #6f675d;
  --olive: #56623a;
  --olive-dark: #3d4629;
  --terra: #a55a31;
  --line: #d9cfbf;
  --busy: #cfc6b8;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Mulish", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.6 var(--sans); }
img { display: block; max-width: 100%; }
a { color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: 1.5rem; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
section.wrap { padding-top: 80px; padding-bottom: 80px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--terra); margin: 0 0 .6em; }
.lead { font-size: 1.1rem; max-width: 46em; }
.small { font-size: .85rem; color: var(--muted); margin: .6em 0 0; }

.btn { display: inline-block; background: var(--terra); color: #fff; border: 0; border-radius: 999px; padding: 14px 28px;
  font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background .2s; }
.btn:hover { background: #8c4a26; }
.btn:disabled { background: #b9ab98; cursor: not-allowed; }
.btn-small { padding: 8px 18px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-full { width: 100%; }

/* Testata */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(247, 242, 234, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font: 600 1.35rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--terra); font-style: italic; }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .95rem; }
.top nav a:not(.btn):hover { color: var(--terra); }
.top nav { margin-left: auto; }
.lingua { display: flex; flex: none; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.lingua button { border: 0; background: transparent; padding: 6px 11px; font: 700 .8rem var(--sans); color: var(--muted); cursor: pointer; }
.lingua button.on { background: var(--ink); color: #fff; }

/* Copertina */
.hero { position: relative; height: min(88vh, 760px); min-height: 480px; overflow: hidden; color: #fff; }
.hero picture { display: block; height: 100%; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
@media (min-width: 901px) { .hero img { object-position: center 55%; } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.55)); }
.hero-text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; max-width: 1140px; margin: 0 auto; padding: 0 20px 64px; }
.hero-text .eyebrow { color: #f3d9b8; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 500; }
.hero-text p { max-width: 34em; font-size: 1.15rem; }

/* Introduzione */
.intro { display: grid; grid-template-columns: 1.6fr 1fr; gap: 60px; align-items: start; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.pills li { background: var(--stone); color: var(--olive-dark); border-radius: 999px; padding: 6px 14px; font-size: .88rem; font-weight: 600; }
.facts { list-style: none; margin: 0; padding: 28px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.facts li { padding: 10px 0; border-bottom: 1px solid var(--stone); }
.facts li:last-child { border: 0; }
.facts strong { font-family: var(--serif); font-size: 1.35rem; margin-right: 4px; }

/* Mosaico foto */
#foto { padding-top: 0; }
.mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 230px 230px; gap: 8px; border-radius: var(--radius); overflow: hidden; }
.mosaic button { padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: var(--stone); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.mosaic button:hover img { transform: scale(1.04); }
.m-big { grid-row: span 2; }
#tutte-foto { margin-top: 18px; }

/* Fasce colorate */
.band { background: var(--stone); padding: 80px 0; }
.band-dark { background: var(--olive-dark); color: #f4efe6; }
.band-dark .eyebrow { color: #e7b98f; }

/* Esperienze */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; align-items: start; }
.cards article { background: #fff; border-radius: var(--radius); overflow: hidden; }
.cards img { width: 100%; height: auto; } /* foto intere, senza tagli */
.esperienze-btn { margin-top: 26px; }
.cards h3, .cards p { padding: 0 18px; }
.cards h3 { margin-top: 16px; }
.cards p { font-size: .95rem; color: var(--muted); }
.cards .incluso { margin: -4px 0 0; color: var(--olive); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }

/* Servizi */
.servizi { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.list-cols { columns: 2; gap: 30px; margin: 0; padding: 0; list-style: none; }
.list-cols li { padding: 8px 0 8px 22px; position: relative; break-inside: avoid; }
.list-cols li::before { content: ""; position: absolute; left: 0; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--olive); }

/* Prenotazione */
.demo-note { display: inline-block; background: #e7b98f; color: var(--ink); padding: 6px 14px; border-radius: 8px; font-size: .9rem; }
.booking { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; margin-top: 28px; align-items: start; }
.cal-box, .form, .grazie { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 24px; }
.cal-box { position: relative; }
.cal-nav { position: absolute; top: 20px; left: 16px; right: 16px; display: flex; justify-content: space-between; pointer-events: none; }
.cal-nav button { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); }
.cal-nav button:disabled { opacity: .3; cursor: default; }
.cal { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; min-height: 330px; }
.cal-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding-top: 120px; }
.month h4 { text-align: center; font: 600 1.3rem var(--serif); margin: 6px 0 14px; text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.day { aspect-ratio: 1 / 1.05; border: 0; border-radius: 8px; background: #fff; color: var(--ink); font: 600 .95rem var(--sans);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; padding: 0; }
.day small { font-size: .66rem; font-weight: 600; color: var(--olive); }
.day:hover:not(:disabled) { outline: 2px solid var(--ink); }
.day:disabled { cursor: default; }
.day.past { background: transparent; color: #bdb3a5; }
.day.busy { background: transparent; color: #a99f91; text-decoration: line-through; }
.day.checkout-only { background: #fff; color: var(--ink); text-decoration: none; }
.day.checkout-only small { color: var(--muted); }
.day.out { background: transparent; color: #cbc2b5; }
.day.in-range { background: #e9d3bf; border-radius: 0; }
.day.start, .day.end { background: var(--terra); color: #fff; }
.day.start small, .day.end small, .day.in-range small { color: inherit; }
.day.start { border-radius: 8px 0 0 8px; }
.day.end { border-radius: 0 8px 8px 0; }
.day.start.end { border-radius: 8px; }
.empty { aspect-ratio: 1 / 1.05; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 20px 0 0; font-size: .85rem; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.sw-free { background: #fff; border: 1px solid var(--line); }
.sw-busy { background: var(--busy); }
.sw-sel { background: var(--terra); }

.summary { background: #fff; border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; border: 1px solid var(--line); }
.summary .hint { margin: 0; color: var(--muted); }
.summary .dates { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.summary .dates span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.summary .total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.summary .lines { font-size: .9rem; color: var(--muted); margin: 0 0 8px; }
.summary .warn { color: var(--terra); font-weight: 600; margin: 8px 0 0; font-size: .92rem; }
.summary .pay { font-size: .85rem; color: var(--olive); margin: 6px 0 0; }

.form .row { margin: 0 0 14px; border: 0; padding: 0; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.form label { display: block; font-size: .88rem; font-weight: 600; }
.form input:not([type=checkbox]), .form select, .form textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 1rem var(--sans); color: var(--ink); }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--olive); border-color: transparent; }
.form legend { font-size: .88rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.form small { font-weight: 400; color: var(--muted); }
.form .check { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; margin: 0 14px 6px 0; }
.form .check.inline { padding-bottom: 12px; }
.form .privacy { display: flex; align-items: flex-start; font-size: .85rem; margin: 6px 0 16px; }
.form .privacy input { margin-top: 4px; }
.form input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--terra); flex: none; }
.hp { position: absolute; left: -9999px; }
.errore { background: #f6dfd3; color: #7b2f12; border-radius: 8px; padding: 10px 14px; font-size: .92rem; }
.grazie { text-align: center; padding: 50px 30px; }
.grazie h3 { font-size: 2rem; color: var(--olive-dark); }

/* Host e mappa */
.host { display: grid; grid-template-columns: 1fr 1.4fr; gap: 50px; align-items: center; }
.host img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; width: 100%; }
.contatti a { margin-right: 18px; font-weight: 600; }
.dove { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; }
.regole { list-style: none; padding: 0; margin: 20px 0 0; }
.regole li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mappa { display: block; width: 100%; height: 380px; border: 0; border-radius: var(--radius); }
.indirizzo { margin: 12px 0 0; font-weight: 600; }
.apri-mappa { margin-top: 10px; }
.foot { background: var(--ink); color: #cfc6b8; padding: 30px 0; font-size: .9rem; }
.foot a { color: #e7b98f; }
.foot p { margin: 4px 0; }

/* Galleria */
.gallery { position: fixed; inset: 0; z-index: 50; background: var(--cream); overflow-y: auto; }
.gallery-head { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 14px 20px; background: var(--cream); border-bottom: 1px solid var(--line); }
.gallery-title { margin: 0; font: 600 1.4rem var(--serif); }
/* Righe allineate della stessa altezza; ogni foto tiene la sua forma (verticale o orizzontale).
   --r è il rapporto larghezza/altezza della foto, impostato da app.js. */
.gallery-grid { --h: 220px; display: flex; flex-wrap: wrap; gap: 10px; padding: 20px; max-width: 1200px; margin: 0 auto; }
.gallery-grid::after { content: ""; flex: 100 1 0; } /* l'ultima riga non si allarga troppo */
.gallery-grid button { flex: var(--r, 1.33) 1 calc(var(--r, 1.33) * var(--h)); height: var(--h); padding: 0; border: 0;
  cursor: zoom-in; border-radius: 8px; overflow: hidden; background: var(--stone); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
.close { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(18, 16, 14, .96); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.viewer .close { position: absolute; top: 16px; right: 16px; }
.v-prev, .v-next { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 2rem; cursor: pointer; }
.v-prev { left: 16px; } .v-next { right: 16px; }
.v-count { position: absolute; bottom: 12px; color: #cfc6b8; font-size: .9rem; margin: 0; }
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

/* Barra prenotazione in basso (solo telefono) */
.mbar { display: none; }
.contatti a { display: inline-block; margin: 6px 10px 0 0; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--terra); text-decoration: none; }

/* Tablet e telefono */
@media (max-width: 900px) {
  .top nav a:not(.btn) { display: none; }
  .intro, .servizi, .booking, .host, .dove { grid-template-columns: 1fr; gap: 30px; }
  .cal { grid-template-columns: 1fr; }
  .cal .month + .month { display: none; }
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 140px 140px; }
  .m-big { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 900px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .top .btn { display: none; }
  .mbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(0,0,0,.06); transition: transform .25s; }
  .mbar.off { transform: translateY(110%); }
  /* Badge "Powered by Netlify" (in basso a destra, alto circa 60px): la barra lascia il posto sotto
     al pulsante, così il badge non lo copre. La classe la mette app.js solo se il badge c'è. */
  body.con-badge { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body.con-badge .mbar { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .mbar-text { line-height: 1.25; min-width: 0; }
  .mbar-text strong { display: block; font-size: 1.05rem; }
  .mbar-text span { font-size: .8rem; color: var(--muted); }
  .mbar .btn { flex: none; padding: 12px 20px; }
  .v-prev, .v-next { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top { padding: 10px 16px; }
  .logo { font-size: 1.15rem; }
  .wrap { padding: 0 16px; }
  section.wrap, .band { padding-top: 52px; padding-bottom: 52px; }
  .hero { height: 82svh; min-height: 460px; }
  .hero-text { padding-bottom: 36px; }
  .intro { gap: 24px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 14px 18px; font-size: .92rem; }
  .facts li { padding: 8px 0; }
  .facts strong { font-size: 1.15rem; }
  .mosaic { grid-template-rows: 220px 130px 130px; gap: 6px; }
  #tutte-foto { width: 100%; }
  .cards { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 24px -16px 0; padding: 0 16px 6px;
    scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .cards article { flex: 0 0 80%; scroll-snap-align: center; }
  .servizi { gap: 10px; }
  .list-cols { columns: 2; gap: 14px; font-size: .9rem; }
  .list-cols li { padding: 6px 0 6px 16px; }
  .list-cols li::before { top: 14px; width: 6px; height: 6px; }
  .booking { margin-top: 20px; gap: 16px; }
  .form .two { grid-template-columns: 1fr; }
  .cal-box, .form { padding: 16px 12px; }
  .cal-nav { top: 12px; left: 10px; right: 10px; }
  .grid { gap: 2px; }
  .legend { gap: 6px 14px; }
  .host { gap: 24px; }
  .host img { aspect-ratio: 4 / 3; }
  .mappa { height: 260px; }
  .regole li { font-size: .95rem; }
  .gallery-head { padding: 10px 12px; }
  .gallery-grid { --h: 140px; gap: 6px; padding: 8px; }
}
