:root{
  --bg:#F4F6F8;
  --line:#D8DEE6;
  --card:#FFFFFF;
  --text:#1E242B;
  --blu:#1F3A56;
  --bluDeep:#122536;
  --wa:#25D366;

  /* Toni sezione */
  --tone-1:#EDEFF3;
  --tone-2:#CCD6E0;
  --tone-3:#EDEFF3;
  --tone-4:#CCD6E0;
  --tone-5:#EDEFF3;

  /* Accenti “luxury” per Esperienze */
  --lux-gold-1: rgba(213,186,128,.22);
  --lux-gold-2: rgba(213,186,128,.10);
  --lux-sage-1: rgba(142,178,169,.22);
  --lux-sage-2: rgba(142,178,169,.10);
  --lux-sky-1:  rgba(159,197,232,.22);
  --lux-sky-2:  rgba(159,197,232,.10);
}

*{ box-sizing:border-box }
html{ scroll-behavior:smooth }
html, body { overflow-x: hidden; }

body.theme-mid{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:#0f2a40; /* scuro: maschera micro-gap tra sfondi */
}

/* >>> OVERRIDE SOLO PAGINA LEGALE: sfondo chiaro, testo scuro */
body.theme-mid.legal-page{
  background: var(--bg);
  color: var(--text);
}

/* Contenuto legale consigliato (card chiara centrale) */
.legal-page main{
  max-width: 900px;
  margin: 80px auto 100px;
  padding: 0 24px;
  line-height: 1.75;
  color: #2a3139;
}

/* Header chiaro per pagine testuali */
.topbar.plain-top{
  background:#fff;
  border-bottom:1px solid var(--line);
}
.topbar.plain-top .brand{ color: var(--bluDeep); }
.topbar.plain-top .brand span{ opacity:.9; }

.container{ max-width:1180px; margin:0 auto; padding:0 24px }
.small{ font-size:.9rem }
a{ color:var(--blu); text-decoration:none }

/* Offset ancore per topbar sticky */
section[id]{ scroll-margin-top:140px; }

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:10;
  height:128px; display:flex; align-items:center;
  border-bottom:0;                    /* niente riga chiara */
  background-color:#2b1b12;           /* fallback coerente col legno */
}
.wood-top{ position:relative; background:url('../img/wood.jpg') center/cover no-repeat }
.wood-top .overlay-dark{ position:absolute; inset:0; background:rgba(0,0,0,.35) }
.head.head--center{
  position:relative; z-index:1;
  display:grid; grid-template-columns: 1fr auto 1fr;
  column-gap:64px; align-items:end;
}
@media (max-width:980px){ .head.head--center{ column-gap:32px; align-items:center; } }
@media (max-width:640px){ .head.head--center{ column-gap:16px; } }
.actions{ margin-right:8px; display:flex; align-items:center; justify-self:end; gap:12px; flex-wrap:nowrap; white-space:nowrap; }
.brand{ line-height:1.05; }
.actions .pill, .lang-btn{ padding-top:9px; padding-bottom:9px; }

.brand-wrap{ display:flex; flex-direction:column; align-items:center; gap:6px }
.logo-mountain{ width:132px; height:auto }
.logo-mountain.fine{ filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)) }
.brand{ font-weight:800; letter-spacing:.2px; color:#fff; font-size:1.7rem; font-family:"Playfair Display",serif }
.brand span{ color:#fff; opacity:.95 }
.lang{ position:relative; flex:0 0 auto; }

/* Lingue */
.lang-btn{
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.28);
  color:#fff; border-radius:12px; padding:10px 12px; cursor:pointer; font-weight:800;
}
.pill{
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.28);
  color:#fff !important; border-radius:12px; padding:10px 12px;
  text-decoration:none; font-weight:800; white-space:nowrap;
}
.pill:hover{ background:rgba(255,255,255,.24); }
.lang-code{ font-weight:800 }
.flag-svg{ display:inline-grid; place-items:center; width:20px; height:14px; border-radius:3px; overflow:hidden; box-shadow:0 0 0 1px rgba(0,0,0,.18) inset; background:#fff }
.flag-svg svg{ width:100%; height:100%; display:block }
.lang-menu{
  position:absolute; right:0; top:115%; background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:8px; display:none; min-width:220px; box-shadow:0 10px 28px rgba(0,0,0,.12)
}
.lang-menu.show{ display:block }
.lang-menu a{ display:flex; align-items:center; gap:10px; color:#1E242B; padding:10px 12px; border-radius:10px; font-weight:600 }
.lang-menu a:hover{ background:#F4F6F9 }

/* Headings */
h1,h2,h3{ font-family:"Playfair Display", serif; color:#111 }
.section h2{ font-size:clamp(26px,3.8vw,38px); margin:0 0 18px }
.center{ text-align:center }

/* Segni grafici */
.with-mark{ position:relative; z-index:0; display:inline-block; padding-top:26px; }
.with-mark::before{
  content:""; position:absolute; z-index:-1; top:-14px; left:50%; transform:translateX(-50%);
  width:170px; height:58px; opacity:.10; filter:grayscale(1);
  background:center/contain no-repeat;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 60'><path d='M5 48 L40 22 L55 34 L72 20 L90 32 L112 18 L155 48' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.with-house::before{
  width:170px; height:64px; opacity:.10; filter:grayscale(1);
  background:center/contain no-repeat;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 64'><g fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'><path d='M20 42 L90 14 L160 42' stroke-width='3'/><path d='M50 28 L90 14 L130 28' stroke-width='2' opacity='.6'/><path d='M118 22 L118 12 L130 12 L130 26' stroke-width='2' opacity='.6'/><rect x='38' y='28' width='104' height='26' rx='3' stroke-width='2.4'/><rect x='84' y='38' width='20' height='16' rx='2' stroke-width='2.4'/><rect x='50' y='36' width='16' height='12' rx='2'/><rect x='114' y='36' width='16' height='12' rx='2'/></g></svg>");
}

/* Hero */
.hero{
  position:relative; aspect-ratio:16/9; width:100%;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; background:#000;
  border:0;                 /* niente riga */
  margin-top:-1px;          /* sovrappone di 1px all'header per eliminare seam */
}
.hero-img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; display:block;
}
.overlay-hero.soft{
  position:absolute; inset:0;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(0,0,0,.24) 0%, rgba(0,0,0,.44) 65%, rgba(0,0,0,.6) 100%),
    linear-gradient(180deg, rgba(0,0,0,.26) 0%, rgba(0,0,0,.5) 100%);
}
.hero-inner{ position:relative; text-align:center; color:#fff; padding:20px; line-height:1.2 }
.hero h1{ color:#fff; font-size:clamp(30px,5vw,50px); margin:.2em 0 }
.hero-sub{ opacity:.98; font-size:clamp(17px,2.2vw,21px); margin:.5em 0 1.2em }
.cta{ display:inline-block; background:#fff; color:#0f2a40; padding:12px 22px; border-radius:12px; font-weight:800 }

/* Sezioni */
.section{ padding:88px 0; border-top:1px solid rgba(0,0,0,.04) }
.tone-1{ background:var(--tone-1) }
.tone-2{ background:var(--tone-2) }
.tone-3{ background:var(--tone-3) }
.tone-4{ background:var(--tone-4) }
.tone-5{ background:var(--tone-5) }

/* Lead */
.lead.wide{ max-width:1000px; margin-left:auto; margin-right:auto; font-size:1.2rem; line-height:1.78; color:#2a3139 }

/* Galleria casa */
.casa-gallery{
  display:grid; gap:14px; grid-template-columns: 1fr;
}
@media (min-width:520px){ .casa-gallery{ grid-template-columns: repeat(2,1fr); } }
@media (min-width:980px){ .casa-gallery{ grid-template-columns: repeat(3,1fr); } }
@media (min-width:1280px){ .casa-gallery{ grid-template-columns: repeat(4,1fr); } }

.casa-gallery figure{
  display:flex; flex-direction:column;
  border:1px solid var(--line); border-radius:16px;
  background:#fff; overflow:hidden;
}
.casa-gallery figure img{
  width:100%; height:auto; display:block;
  aspect-ratio:4/3; object-fit:cover;
  border-bottom:1px solid var(--line);
  transition: transform .25s ease;
}
.casa-gallery figure img:hover{ transform:scale(1.03); }
.casa-gallery figcaption{
  min-height:40px; display:flex; align-items:center; justify-content:center;
  padding:6px 10px; margin:6px 8px 10px;
  font-size:0.95rem; font-weight:700; color:#1F3A56;
}
.casa-gallery .video video{ width:100%; height:auto; border-radius:14px; display:block }

/* Where */
.where-text{ max-width:980px; color:#2a3139; margin:0 auto }
.where-gallery{ margin-top:16px; display:grid; gap:14px; grid-template-columns:repeat(3,1fr) }
.where-gallery figure{ margin:0; border-radius:16px; overflow:hidden; border:1px solid var(--line); background:#fff }
.where-gallery img{ width:100%; height:100%; object-fit:cover; aspect-ratio:4/3 }

/* Cards (base) */
.cards{
  list-style:none; padding:0; margin:22px 0;
  display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px;
}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px; color:#2a3139;
  display:flex; flex-direction:column; gap:8px;
}
.card h3{ margin:0; font-size:1.08rem; color:#111 }
.card p{ margin:0 0 8px }
.card-actions{ margin-top:auto }
.link.btnlink{
  display:inline-block; padding:8px 12px; border-radius:10px;
  border:1px solid var(--line); background:#fff; font-weight:700;
}

/* Tabs */
.tabs{ display:flex; gap:10px; margin:12px 0 8px; justify-content:center }
.tab{ background:#fff; border:1px solid var(--line); color:#242b31; padding:10px 14px; border-radius:999px; cursor:pointer; font-weight:700 }
.tab.active{ background:#e8edf4 }
.tabpanes{ margin-top:14px }
.tabpane{ display:none }
.tabpane.show{ display:block }

/* Servizi */
.services{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px; margin-top:14px;
}
.srv{
  display:flex; align-items:center; gap:12px;
  background:var(--card); border:1px solid var(--line);
  border-radius:16px; padding:14px; color:#2a3139;
}
.srv .ico{
  width:28px; height:28px; flex:0 0 28px;
  background:linear-gradient(135deg, rgba(159,197,232,.22), rgba(31,58,86,.18));
  border:1px solid #d7dee7; border-radius:10px; display:grid; place-items:center; color:#1F3A56;
}
.srv .ico svg{ width:18px; height:18px }
.srv .label{ font-weight:700 }

/* Disponibilità */
.avail{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px; margin-top:14px;
}
.a-card{
  background:var(--card); border:1px solid var(--line);
  border-radius:16px; padding:16px; display:flex; align-items:center; gap:12px;
}
.a-ico{
  width:36px; height:36px; border-radius:10px; border:1px solid #d7dee7;
  display:grid; place-items:center; color:#1F3A56;
  background:linear-gradient(135deg, rgba(159,197,232,.18), rgba(31,58,86,.12));
}
.a-ico svg{ width:22px; height:22px }
.a-title{ font-weight:800 }
.avail-note{ margin:12px 0 10px; color:#2a3139; text-align:center }

/* CTA prenotazioni */
.contact-slim{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center }
.btn.wa{
  display:inline-flex; align-items:center; gap:8px; background:var(--wa);
  color:#fff; padding:12px 18px; border-radius:12px; font-weight:800; border:0;
}
.btn.wa svg{ width:18px; height:18px }
.btn.ghost{
  background:#fff; color:#1f242b; border:1px solid var(--line);
  padding:10px 18px; border-radius:12px; font-weight:700;
}

/* Lightbox */
.lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.9);
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transition:.2s ease; z-index:1000;
}
.lightbox.show{ opacity:1; pointer-events:all }
.lightbox img{ max-width:92vw; max-height:90vh; border-radius:12px }
.lightbox-close{
  position:absolute; top:18px; right:18px; background:rgba(255,255,255,.12);
  color:#fff; border:1px solid rgba(255,255,255,.2); border-radius:10px;
  width:36px; height:36px; font-size:22px; line-height:34px; text-align:center; cursor:pointer;
}
.lightbox .nav{
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(255,255,255,.12); color:#fff; border:1px solid rgba(255,255,255,.2);
  width:44px; height:44px; border-radius:12px; font-size:28px; line-height:40px; text-align:center; cursor:pointer;
}
.lightbox .prev{ left:18px }
.lightbox .next{ right:18px }

/* Footer */
.footer{
  border-top:1px solid var(--line); background:#fff; color:#5b6672;
  padding:30px 0; text-align:center;
}
.footer .legal{ margin-bottom:6px }
.footer .f-link{ color:#55606e }
.footer .dot{ margin:0 6px; color:#9aa6b4 }
.footer .disclaimer{ margin:8px 0 10px; color:#7b8796 }

/* Testi descrittivi (Playfair) in alcune sezioni */
.section .lead,
.section > .container > p,
.where-text,
.card p{
  font-family:"Playfair Display", serif;
  font-weight:400; letter-spacing:.1px;
}

/* Sezioni specifiche */
#casa.section{ padding-top:60px; }
#casa h2{ margin-top:0; margin-bottom:10px; }
#casa .lead{ margin-top:6px; }

.title-inline{ display:inline-flex; align-items:center; gap:12px; }
.title-inline .icon-house,
.icon-location,
.icon-services,
.icon-experiences,
.icon-booking{
  display:inline-grid; place-items:center;
  width:46px; height:46px; border-radius:12px;
  background:#fff; border:1px solid var(--line);
  color:var(--bluDeep); box-shadow:0 1px 0 rgba(0,0,0,.04);
}
.title-inline .icon-house svg{ width:28px; height:28px; display:block; }
.icon-location svg{ width:28px; height:26px; display:block; }
.icon-services svg{ width:28px; height:28px; display:block; }
.icon-experiences svg{ width:33px; height:33px; display:block; }
.icon-booking svg{ width:28px; height:28px; display:block; }

.section .section-title{
  display:flex; justify-content:center; align-items:center; gap:12px; margin:0;
}

#dove.section{ padding-top:60px; }
#dove h2{ margin-top:0; margin-bottom:10px; }
#dove .where-text{ margin-top:6px; }

#servizi.section{ padding-top:60px; }
#servizi h2{ margin-top:0; margin-bottom:30px; }
#servizi .services{ margin-top:18px; }

#esperienze.section{ padding-top:60px; }
#esperienze h2{ margin-top:0; margin-bottom:18px; }
#esperienze .tabs{ margin-top:8px; margin-bottom:10px; }

#disponibilita.section{ padding-top:60px; }
#disponibilita h2{ margin-top:0; margin-bottom:16px; }
#disponibilita .avail{ margin-top:14px; margin-bottom:20px; }
#disponibilita .contact-slim{ margin-top:8px; gap:12px; justify-content:center; }

/* Cards look elegante/lux */
.cards .card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.88)),
    radial-gradient(120% 100% at 0% 0%, rgba(31,58,86,.06), transparent 60%);
  border: 1px solid rgba(31,58,86,.12);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(18,37,54,.08), inset 0 1px 0 rgba(255,255,255,.6);
  backdrop-filter: blur(2px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cards .card:hover,
.cards .card:focus-within{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(18,37,54,.12);
  border-color: rgba(31,58,86,.18);
}
.cards .card h3{ color: var(--bluDeep); }
.cards .card .btnlink{ border-color: rgba(31,58,86,.22); }
.cards .card .btnlink:hover{ background: rgba(31,58,86,.06); }

/* Tab attivo curato */
#esperienze .tab.active{
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.9));
  border-color: rgba(31,58,86,.25);
  box-shadow: 0 4px 10px rgba(18,37,54,.08);
}

/* Esperienze: accenti colore */
#esperienze .cards .card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.94)), #fff;
  border: 1px solid rgba(30,36,43,.10);
  box-shadow: 0 6px 18px rgba(0,0,0,.06), 0 1px 0 rgba(255,255,255,.8) inset;
  backdrop-filter: saturate(1.02);
}
#esperienze .cards .card.card--gold{
  background:
    linear-gradient(180deg, var(--lux-gold-1), var(--lux-gold-2)),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.96)), #fff;
  border-color: rgba(120,98,52,.22);
}
#esperienze .cards .card.card--sage{
  background:
    linear-gradient(180deg, var(--lux-sage-1), var(--lux-sage-2)),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.96)), #fff;
  border-color: rgba(40,84,74,.18);
}
#esperienze .cards .card.card--sky{
  background:
    linear-gradient(180deg, var(--lux-sky-1), var(--lux-sky-2)),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.96)), #fff;
  border-color: rgba(31,58,86,.18);
}
#esperienze .cards .card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.85) inset;
}
#esperienze .cards .card .btnlink{ border-color: rgba(30,36,43,.16); }
#esperienze .cards .card .btnlink:hover{ background: rgba(255,255,255,.85); }

/* --- FIX RESPONSIVE HEADER MOBILE --- */
@media (max-width:640px){
  .topbar{
    height: auto;
    padding: 16px 0;
  }

  .head.head--center{
    grid-template-columns: 1fr;
    row-gap: 12px;
    justify-items: center;
    align-items: center;
    text-align: center;
  }

  .brand-wrap{ order: 1; }

  .actions{
    order: 2;
    flex-direction: column;
    gap: 8px;
    margin: 0;

    /* centratura perfetta del blocco */
    justify-self: center;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  /* centra visivamente i due pulsanti anche se hanno larghezze diverse */
  .actions > *{
    margin-left: auto;
    margin-right: auto;
  }

  /* pulsanti un filo più compatti su mobile */
  .lang-btn,
  .pill{
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  /* evita che il menu lingue esca dallo schermo */
  .lang-menu{
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}
/* ===== LEGAL PAGE OVERRIDES (deve stare IN FONDO al file) ===== */
body.theme-mid.legal-page{
  /* forza sfondo chiaro e testo scuro anche se altre regole provano a sovrascrivere */
  background: #F4F6F8 !important;
  color: var(--text) !important;
}

/* Header chiaro in Legal */
body.theme-mid.legal-page .topbar{
  background: #fff !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}

/* Contenuto su card bianca (così anche se il body fosse scuro intorno, il testo è su bianco) */
body.theme-mid.legal-page main{
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

/* Link e titoli coerenti */
body.theme-mid.legal-page h1,
body.theme-mid.legal-page h2,
body.theme-mid.legal-page h3{
  color: var(--bluDeep) !important;
}
body.theme-mid.legal-page a{
  color: var(--blu) !important;
}
.casa-gallery figure figcaption {
    display: none;
}
/* ===== Gallery Hero (foto grande + thumbs) ===== */
/* ===== Gallery Hero (foto grande + thumbs) ===== */
.gallery-hero{ max-width: 1100px; margin: 26px auto 0; }

.gh-stage{
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 10px;
}

.gh-viewport{
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 5;          /* desktop: più verticale -> niente (o quasi) bande */
  background: var(--tone-1);   /* grigio chiaro della sezione */
  outline: none;
  max-height: 72vh;             /* evita “gigante” su schermi alti */
  margin: 0 auto;
}


.gh-main{
  width: 100%;
  height: 100%;
  object-fit: contain;           /* niente tagli */
  display: block;
  background: transparent;     /* lascia gestire lo sfondo al viewport */
}

/* Mobile: foto verticali senza bande */
@media (max-width: 768px){
  .gh-viewport{
    aspect-ratio: 9 / 16;
  }
}

.gh-nav{
  height: 46px;
  width: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}
.gh-nav:hover{ background: rgba(0,0,0,.5); }
.gh-nav:active{ transform: translateY(1px); }

.gh-thumbs{
  margin-top: 10px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88px;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
}
.gh-thumb{
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  outline: none;
  scroll-snap-align: start;
  position: relative;
}
.gh-thumb img{
  width: 88px;
  height: 56px;
  object-fit: cover;
  display: block;
  opacity: .85;
  transform: scale(1.001);
}
.gh-thumb.is-active img{ opacity: 1; }
.gh-thumb.is-active::after{
  content:"";
  position:absolute; inset:0;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 12px;
  pointer-events:none;
}

/* Mobile: frecce sopra l'immagine */
@media (max-width: 640px){
  .gh-stage{ grid-template-columns: 1fr; }
  .gh-nav{ position:absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
  .gh-prev{ left: 10px; }
  .gh-next{ right: 10px; }
}

