/* ==========================================================================
   Palazzo Nay — Stradella (Oltrepò Pavese)
   Foglio di stile unico per tutte le pagine del sito
   ========================================================================== */

:root {
  --wine: #782A3C;
  --wine-dark: #521C29;
  --cream: #f6f1e7;
  --cream-deep: #ede4d3;
  --ink: #2a2622;
  --ink-soft: #5c564c;
  --green: #40502f;
  --gold: #a9822f;
  --border: #ddd0b8;
  --radius: 2px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Source Sans 3", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--wine-dark);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

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

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.6em;
}

/* ---------- Header / Nav ---------- */

header.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  color: var(--wine-dark);
  letter-spacing: 0.02em;
}
.brand span { color: var(--gold); }

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav.main-nav a {
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--wine);
  border-bottom-color: var(--gold);
  text-decoration: none;
}

/* ---------- Nav mobile (hamburger) ---------- */

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 42px;
  height: 40px;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; order: 2; }
  .nav-bar { position: relative; }
  nav.main-nav { display: none; width: 100%; order: 3; }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 0; padding-top: 8px; }
  nav.main-nav li { border-top: 1px solid var(--border); }
  nav.main-nav a { display: block; padding: 14px 2px; }
}

/* ---------- Hero: banda cartellone + fotogramma video ---------- */

.hero-band {
  background: var(--wine-dark);
  color: #fff;
  padding: 56px 0 44px;
}
.hero-band .eyebrow { color: var(--gold); }
.hero-band h1 {
  color: #fff;
  font-size: clamp(2.6rem, 9vw, 6rem);
  line-height: 1.02;
  margin: 0 0 0.35em;
}
.hero-band p.lead { color: var(--cream); max-width: 620px; font-size: 1.15rem; }

.video-frame {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #e7ded0, #e7ded0 14px, #ded2bb 14px, #ded2bb 28px);
}
.video-frame img { width: 100%; height: 100%; object-fit: cover; }
.video-frame .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 26px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}
.video-frame .play-btn::after {
  content: '';
  border-style: solid;
  border-width: 12px 0 12px 19px;
  border-color: transparent transparent transparent var(--wine-dark);
  margin-left: 4px;
}
.video-frame:hover .play-btn { transform: translate(-50%, -50%) scale(1.06); }

/* ---------- Hero Home: immagine a sinistra + cartellone testo a destra ---------- */

.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 78vh;
}
.hero-split .hero-image {
  position: relative;
  overflow: hidden;
  background: var(--wine-dark);
}
.hero-split .hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-split .hero-text {
  background: var(--wine-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
}
.hero-split .hero-text .eyebrow { color: var(--gold); }
.hero-split .hero-text h1 {
  color: #fff;
  font-size: clamp(2.8rem, 6.2vw, 5.4rem);
  line-height: 0.96;
  margin: 0 0 0.22em;
  letter-spacing: 0.01em;
}
.hero-split .hero-text .subtitle {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  color: var(--gold);
  margin: 0 0 0.85em;
}
.hero-split .hero-text p.lead { color: var(--cream); max-width: 480px; }
.hero-split .hero-image { cursor: pointer; }
.hero-split .hero-image .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 26px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
  z-index: 2;
}
.hero-split .hero-image .play-btn::after {
  content: '';
  border-style: solid;
  border-width: 12px 0 12px 19px;
  border-color: transparent transparent transparent var(--wine-dark);
  margin-left: 4px;
}
.hero-split .hero-image:hover .play-btn { transform: translate(-50%, -50%) scale(1.06); }

.hero-video-frame iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.hero-video-frame .mute-btn {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20,18,15,0.55);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 3;
}
.hero-video-cta {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 32px;
}
.hero-video-cta span {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  background: rgba(20,18,15,0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hero-video-cta:hover span,
.hero-video-cta:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}
@media (hover: none) {
  .hero-video-cta span { opacity: 0.85; transform: translateY(0); }
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; min-height: auto; }
  .hero-split .hero-image { aspect-ratio: 3/4; }
  .hero-split .hero-text { padding: 36px 24px 44px; }
}

/* ---------- Page header (non-home pages) ---------- */

.page-header {
  background: var(--cream-deep);
  border-bottom: 1px solid var(--border);
  padding: 46px 0 36px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--wine);
  color: #fff;
}
.btn-primary:hover { background: var(--wine-dark); text-decoration: none; }

.btn-outline {
  border-color: currentColor;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.12); text-decoration: none; }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section.tight { padding: 40px 0; }
section.alt { background: var(--cream-deep); }

.section-head { max-width: 680px; margin-bottom: 36px; }

.grid {
  display: grid;
  gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .hero { min-height: 50vh; }
}

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
a.card { transition: border-color 0.15s ease, transform 0.15s ease; }
a.card:hover, a.card:hover * { text-decoration: none; }
a.card:hover { border-color: var(--wine); transform: translateY(-2px); }

.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  background: #e7ebe1;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  font-weight: 700;
}

.card .tag.gold { color: var(--wine-dark); background: #f1e3c6; }

.tag.stato-disponibile { color: #3a5a2c; background: #e3ecd9; }
.tag.stato-trattativa  { color: #8a5a12; background: #f3e6cc; }
.tag.stato-venduto     { color: #7a2a2a; background: #f0dcdc; }
.tag.stato-riservato   { color: #2a4a6a; background: #dde6f0; }

.photo-box {
  aspect-ratio: 4/3;
  background: repeating-linear-gradient(135deg, #e7ded0, #e7ded0 14px, #ded2bb 14px, #ded2bb 28px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
  padding: 12px;
}

.photo-box.wide { aspect-ratio: 16/9; }

.photo-box.has-img {
  background: none;
  padding: 0;
  overflow: hidden;
}
.photo-box.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.card .photo-box.has-img img { cursor: pointer; }

/* Planimetrie: vanno mostrate intere (object-fit: contain), mai ritagliate come le foto.
   Sfondo trasparente: i PNG delle piante sono già puliti (senza sfondo), niente riquadro pieno dietro. */
.photo-box.plan.has-img {
  aspect-ratio: 4/3;
  background: none;
  border: none;
}
.photo-box.plan.has-img img {
  object-fit: contain;
  padding: 16px;
}

.img-caption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: right;
}

/* ---------- Ambienti (dettaglio unità) ---------- */

.ambiente {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.ambiente:last-child { border-bottom: none; }
.ambiente h3 { font-size: 1.05rem; margin-bottom: 6px; }
.ambiente p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.avviso-dati {
  background: #f3e6cc;
  border: 1px solid #d9bd82;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.86rem;
  color: #6b4b12;
  margin-top: 20px;
}

/* ---------- Stanze del giardino ---------- */

.stanza-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stanza-card .photo-box { aspect-ratio: 4/3; }
.stanza-card .stanza-body { padding: 20px; }
.stanza-card h3 { margin-bottom: 8px; }
.stanza-card p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ---------- Gallery: scroll orizzontale (dettaglio unità) ---------- */

.gallery-scroll {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.gallery-scroll::-webkit-scrollbar { height: 8px; }
.gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.gallery-scroll > div {
  flex: 0 0 auto;
  width: 320px;
  scroll-snap-align: start;
}
.gallery-scroll .photo-box { aspect-ratio: 4/3; }
@media (max-width: 560px) {
  .gallery-scroll > div { width: 78vw; }
}

/* ---------- Quote / positioning strip ---------- */

.quote-strip {
  background: var(--wine-dark);
  color: var(--cream);
  padding: 54px 0;
  text-align: center;
}
.quote-strip p {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  max-width: 780px;
  margin: 0 auto;
  font-style: italic;
}

/* ---------- Lists ---------- */

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.checklist li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
ul.checklist li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: var(--radius);
}
.contact-card + .contact-card { margin-top: 20px; }

form.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 14px 0 6px;
}
form.contact-form input,
form.contact-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
}
form.contact-form textarea { min-height: 140px; resize: vertical; }
form.contact-form button {
  margin-top: 20px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--ink);
  color: #cfc7ba;
  padding: 44px 0 26px;
  font-size: 0.88rem;
}
footer.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 26px;
}
@media (max-width: 700px) { footer.site-footer .footer-grid { grid-template-columns: 1fr; } }

footer.site-footer h4 {
  color: #fff;
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
footer.site-footer a { color: #cfc7ba; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer .fine-print {
  border-top: 1px solid #45403a;
  padding-top: 18px;
  font-size: 0.78rem;
  color: #948c7e;
}

/* Lightbox — zoom immagini a schermo intero */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
}
@media (max-width: 560px) {
  .lightbox { padding: 16px; }
  .lightbox-close { top: 6px; right: 10px; }
}

/* Video lightbox — video hero a schermo intero con audio, aperto dal pulsante sul video in Home */
.video-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.video-lightbox[hidden] { display: none; }
.video-lightbox-frame {
  position: relative;
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.video-lightbox-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 560px) {
  .video-lightbox { padding: 16px; }
}
