/* ==========================================================================
   Villa Sarda — shared stylesheet
   Palette ispirata alla Sardegna: sabbia, mare profondo, crema, inchiostro
   ========================================================================== */

:root {
  --gold:  #B8945F;
  --gold-dark: #9A7A48;
  --deep:  #163B47;   /* mare profondo / teal */
  --deep-2:#0F2A33;
  --ink:   #2A2A28;
  --muted: #6b6b64;
  --cream: #F7F2E9;
  --cream-2:#EFE7D8;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(22, 59, 71, .18);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --maxw: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, .display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .01em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .35em;
  font-size: .72rem;
  font-weight: 400;
  color: var(--gold);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.25rem, 5vw, 3rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .78rem;
  padding: 1rem 2.2rem;
  border: 1px solid currentColor;
  transition: all .35s ease;
  cursor: pointer;
  background: transparent;
}
.btn-solid { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-solid:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-light { color: #fff; }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-dark { color: var(--ink); }
.btn-dark:hover { background: var(--ink); color: #fff; }

/* ---------- Top nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 5vw, 3rem);
  transition: background .4s ease, padding .4s ease;
}
.nav.solid { background: rgba(247,242,233,.96); box-shadow: 0 2px 20px rgba(0,0,0,.06); padding-top: 1rem; padding-bottom: 1rem; }
/* ---- Logo lockup: "Villa Sarda" + "CALA GINEPRO" ---- */
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-weight: 700; font-size: 1.7rem; letter-spacing: .01em;
  color: #fff; transition: color .4s ease;
}
.nav.solid .brand-name { color: var(--deep); }
.brand-sub {
  font-family: var(--sans); text-transform: uppercase;
  font-size: .58rem; letter-spacing: .42em; font-weight: 400;
  color: var(--gold); margin-top: .34rem; padding-left: .12em;
}
.nav-right { display: flex; align-items: center; gap: 1.6rem; }
.nav a.navlink { font-size: .8rem; text-transform: uppercase; letter-spacing: .18em; color: #fff; transition: color .4s ease; }
.nav.solid a.navlink { color: var(--ink); }
.nav a.navlink:hover { color: var(--gold); }

/* language switch */
.lang { display: flex; gap: .1rem; align-items: center; font-size: .78rem; letter-spacing: .12em; }
.lang button {
  background: none; border: none; cursor: pointer; color: inherit;
  font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; padding: .2rem .35rem; opacity: .55;
}
.nav .lang button { color: #fff; }
.nav.solid .lang button { color: var(--ink); }
.lang button.active { opacity: 1; font-weight: 500; border-bottom: 1px solid var(--gold); }
.lang span.sep { opacity: .4; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; color: #fff; overflow: hidden;
}
.hero .bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; transform: scale(1.05); animation: slowzoom 18s ease-out forwards; }
@keyframes slowzoom { to { transform: scale(1); } }
.hero-video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.hero-video.ready { opacity: 1; }
/* Due strati sovrapposti:
   1) un'ellisse molto diffusa dietro al testo, per il contrasto (nessun bordo visibile)
   2) la velatura verticale che lega nav e fondo pagina                                 */
.hero::after {
  content:""; position:absolute; inset:0; z-index: 1;
  background:
    radial-gradient(ellipse 62% 48% at 50% 46%,
      rgba(8,24,30,.58) 0%,
      rgba(8,24,30,.34) 42%,
      rgba(8,24,30,.10) 68%,
      rgba(8,24,30,0)   82%),
    linear-gradient(180deg, rgba(15,42,51,.34) 0%, rgba(15,42,51,.10) 40%, rgba(15,42,51,.52) 100%);
}
.hero .hero-inner { position: relative; z-index: 2; padding: 6rem 1.5rem; max-width: 900px; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 6rem); font-weight: 500; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.hero .sub { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 300; letter-spacing: .04em; margin-top: 1.2rem; opacity: .95; }
.hero .scroll-cue { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; color:#fff; font-size: .7rem; letter-spacing:.3em; text-transform:uppercase; opacity:.8; }
.hero .scroll-cue::after { content:""; display:block; width:1px; height:44px; margin: .8rem auto 0; background: rgba(255,255,255,.6); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0%,100%{ opacity:.3; transform: scaleY(.6);} 50%{opacity:1; transform: scaleY(1);} }

/* ---------- Image with graceful placeholder ---------- */
.ph { position: relative; background: linear-gradient(135deg, var(--deep) 0%, var(--gold) 130%); overflow: hidden; }
.ph > img { width: 100%; height: 100%; object-fit: cover; }
.ph.is-empty::before {
  content: attr(data-label);
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.85); font-family: var(--sans); text-transform: uppercase;
  letter-spacing: .25em; font-size: .7rem; text-align: center; padding: 1rem;
}

/* ---------- Sections ---------- */
section { position: relative; }
.pad { padding: clamp(4rem, 10vw, 8rem) 0; }
.center { text-align: center; }
.lead { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-family: var(--serif); color: var(--deep); font-weight: 400; }

.section-head { max-width: 720px; margin: 0 auto 3.5rem; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin: .6rem 0 1rem; }
.section-head p { color: var(--muted); }

/* ---------- Villa chooser (landing) ---------- */
.villas { display: grid; grid-template-columns: 1fr 1fr; min-height: 78vh; }
.villa-card { position: relative; display: flex; align-items: flex-end; overflow: hidden; color: #fff; min-height: 60vh; }
.villa-card .ph { position: absolute; inset: 0; }
.villa-card .ph > img { transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.villa-card:hover .ph > img { transform: scale(1.06); }
.villa-card::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(15,42,51,.05) 0%, rgba(15,42,51,.75) 100%); z-index:1; }
.villa-card .content { position: relative; z-index: 2; padding: clamp(2rem, 5vw, 4rem); width: 100%; }
.villa-card h3 { font-size: clamp(2rem, 4vw, 3rem); }
.villa-card .meta { font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; opacity: .9; margin: .6rem 0 1.4rem; }
.villa-card .enter { display: inline-flex; align-items: center; gap: .6rem; font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,.5); padding-bottom: .3rem; transition: gap .3s ease; }
.villa-card:hover .enter { gap: 1.1rem; }

/* ---------- Split feature rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.split.reverse .split-media { order: 2; }
.split-media .ph { aspect-ratio: 4/3; box-shadow: var(--shadow); }
.split-text h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1.2rem; }
.split-text p { color: var(--muted); margin: 0 0 1rem; }

/* ---------- Facts row ---------- */
.facts { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 4rem); margin-top: 2rem; }
.fact .n { font-family: var(--serif); font-size: 2.4rem; color: var(--deep); line-height: 1; }
.fact .l { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: .4rem; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.gallery .ph { aspect-ratio: 1; cursor: pointer; }
.gallery .ph:nth-child(1) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.gallery .ph > img { transition: transform .8s ease; }
.gallery .ph:hover > img { transform: scale(1.05); }

/* ---------- Amenities ---------- */
.amenities { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.2rem 2rem; margin-top: 2rem; }
.amenity { display: flex; align-items: center; gap: .8rem; font-size: .95rem; color: var(--ink); padding: .4rem 0; border-bottom: 1px solid var(--cream-2); }
.amenity .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }

/* ---------- Reviews ---------- */
.reviews-band { background: var(--deep); color: #fff; }
.reviews-band .eyebrow { color: var(--gold); }
.reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; }
.review { padding: 2.2rem; border: 1px solid rgba(255,255,255,.15); }
.review .stars { color: var(--gold); letter-spacing: .2em; margin-bottom: 1rem; }
.review blockquote { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; line-height: 1.4; margin: 0 0 1.2rem; }
.review .who { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-top: 2.5rem; }
.price-card { background: #fff; border: 1px solid var(--cream-2); padding: 2rem 1.6rem; text-align: center; }
.price-card .season { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.price-card .amount { font-family: var(--serif); font-size: 2.4rem; color: var(--deep); margin: .6rem 0 .2rem; }
.price-card .per { font-size: .8rem; color: var(--muted); }
.price-note { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 1.6rem; }

/* ---------- Calendario disponibilita' ---------- */
.calendar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem 2.5rem; margin-top: 2.5rem; }
.cal-month h3 { font-family: var(--serif); font-size: 1.35rem; color: var(--deep); text-align: center; margin-bottom: .9rem; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); text-align: center; padding-bottom: .4rem; }
.cal-day, .cal-void { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: .82rem; border-radius: 2px; }
.cal-free { color: var(--ink); background: #fff; border: 1px solid var(--cream-2); }
.cal-busy { color: #b9b2a4; background: var(--cream-2); text-decoration: line-through; }
.cal-past { color: #cfc9bd; background: transparent; }
.cal-legend { display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap; margin-top: 2.2rem; font-size: .85rem; color: var(--muted); }
.cal-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 2px; margin-right: .5rem; vertical-align: -2px; }
.cal-legend .l-free { background: #fff; border: 1px solid var(--cream-2); }
.cal-legend .l-busy { background: var(--cream-2); }
.cal-loading { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ---------- Booking / contact ---------- */
.booking { background: var(--cream-2); }
.form-wrap { max-width: 720px; margin: 2.5rem auto 0; }
form.enquiry { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
form.enquiry .full { grid-column: 1 / -1; }
form.enquiry .trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
form.enquiry .consent { display: flex; align-items: flex-start; gap: .7rem; font-size: .85rem; color: var(--muted); line-height: 1.5; }
form.enquiry .consent input { width: auto; flex: none; margin-top: .2rem; accent-color: var(--gold); }
form.enquiry .consent a { color: var(--deep); text-decoration: underline; }
form.enquiry .consent a:hover { color: var(--gold-dark); }
@media (max-width: 620px) { form.enquiry .trio { grid-template-columns: 1fr; } }
form.enquiry label { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
form.enquiry input, form.enquiry select, form.enquiry textarea {
  width: 100%; padding: .9rem 1rem; border: 1px solid #d8cfbe; background: #fff; font-family: var(--sans);
  font-size: 1rem; color: var(--ink); border-radius: 0;
}
form.enquiry input:focus, form.enquiry select:focus, form.enquiry textarea:focus { outline: none; border-color: var(--gold); }
form.enquiry textarea { min-height: 120px; resize: vertical; }
.form-actions { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.maillink { display: inline-flex; align-items: center; gap: .6rem; font-size: .85rem; letter-spacing: .04em; color: var(--deep); transition: color .3s ease; }
.maillink:hover { color: var(--gold-dark); }
.maillink svg { width: 22px; height: 22px; fill: var(--gold); }

/* ---------- Footer ---------- */
.footer { background: var(--deep-2); color: rgba(255,255,255,.8); }
.footer .container { padding-top: 4rem; padding-bottom: 2.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--serif); color: #fff; font-size: 1.6rem; margin-bottom: .8rem; }
.footer .footer-logo { font-family: 'Playfair Display', 'Cormorant Garamond', serif; font-weight: 700; margin-bottom: .1rem; }
.footer a:hover { color: var(--gold); }
.footer .fine { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; opacity: .6; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ---------- Back link ---------- */
.back { display: inline-flex; align-items: center; gap: .6rem; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- i18n visibility ---------- */
[data-lang-hide="en"] { }
html[lang="it"] .only-en { display: none !important; }
html[lang="en"] .only-it { display: none !important; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(10,20,24,.94); display: none; align-items: center; justify-content: center; z-index: 100; padding: 2rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox .close { position: absolute; top: 1.5rem; right: 2rem; color: #fff; font-size: 2rem; cursor: pointer; opacity: .8; }
.lightbox .close:hover { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .villas { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  form.enquiry { grid-template-columns: 1fr; }
  .nav .navlink.hide-sm { display: none; }
  .gallery .ph:nth-child(1) { grid-column: span 2; }
}
