/* Il Geco — design system */
:root {
  --surface-100: #faf6ef;
  --surface-200: #f1e9da;
  --surface-300: #e4d8c0;
  --ink: #2f2a1f;
  --ink-muted: #6b5f4a;
  --line: #e6dac0;
  --border: #9c8450;
  --brand: #2f4d3a;
  --brand-strong: #22392b;
  --brand-tint: #e3ebe1;
  --accent: #a84e2c;
  --accent-strong: #8a3f22;
  --accent-tint: #f3e3d8;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(47, 42, 31, .06);
  --shadow-md: 0 12px 32px rgba(47, 42, 31, .14);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--surface-100);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Transizione fluida tra le pagine */
body.js-fade {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .28s ease, transform .28s ease;
}
body.js-fade.is-ready { opacity: 1; transform: translateY(0); }
body.js-fade.is-leaving { opacity: 0; transform: translateY(-6px); transition-duration: .22s; }
@media (prefers-reduced-motion: reduce) {
  body.js-fade { transition: none; }
}

h1, h2, h3 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  margin: 0;
}

p { margin: 0; }

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  cursor: pointer;
  border: none;
  transition: background-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-200); }
.btn-onhero { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.7); }
.btn-onhero:hover { background: rgba(255,255,255,0.18); }
.btn-onbrand { background: #fff; color: var(--brand); }
.btn-onbrand:hover { background: var(--surface-200); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header / nav */
.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 64px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.logo {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--brand);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.navpill-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
}
.navpill {
  position: relative;
  z-index: 1;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color .15s ease;
}
.navpill:hover { color: var(--brand); }
.navpill-active { color: var(--brand); background: #fff; }
.navpill-active::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}
.navpill-active::after {
  content: "";
  position: absolute;
  top: -15px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 18px;
  background: var(--brand);
  filter: blur(9px);
  opacity: .32;
  border-radius: var(--radius-full);
  pointer-events: none;
}

/* Indicatore animato: sostituisce la barra statica quando JS è disponibile */
.navpill-wrap.has-indicator .navpill-active { background: transparent; }
.navpill-wrap.has-indicator .navpill-active::before,
.navpill-wrap.has-indicator .navpill-active::after { display: none; }
.nav-indicator {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  border-radius: var(--radius-full);
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: transform .35s cubic-bezier(.65,0,.35,1), width .35s cubic-bezier(.65,0,.35,1), opacity .2s ease;
}
.nav-indicator.is-visible { opacity: 1; }
.nav-indicator::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}
.nav-indicator::after {
  content: "";
  position: absolute;
  top: -15px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 18px;
  background: var(--brand);
  filter: blur(9px);
  opacity: .32;
  border-radius: var(--radius-full);
  pointer-events: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero {
  min-height: 620px;
  display: flex;
  align-items: center;
  padding: 0 64px;
  background-size: cover;
  background-position: center 40%;
}
.hero-inner {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 48px 0;
}
.hero-title { font-size: 56px; line-height: 60px; color: #fff; }
.hero-sub { font-size: 18px; line-height: 29px; color: var(--surface-200); max-width: 54ch; }
.btn-row { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.btn-row .btn { padding: 0 28px; min-height: 52px; }

/* Services badges */
.services {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 64px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--brand-tint);
  font-size: 13px;
  font-weight: 600;
}
.badge-neutral { background: var(--surface-300); color: var(--ink-muted); }

/* Apartments */
.apartments { padding: 48px 64px; display: flex; flex-direction: column; gap: 40px; }
.section-heading { display: flex; flex-direction: column; gap: 8px; }
.section-heading h2 { font-size: 40px; line-height: 44px; }
.section-heading p { color: var(--ink-muted); font-size: 16px; max-width: 70ch; }
.placeholder-tag {
  background: var(--surface-100);
  color: var(--ink-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

/* Location teaser (home) */
.location-teaser {
  min-height: 380px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 48px 64px;
  gap: 64px;
}
.location-teaser-text { max-width: 520px; display: flex; flex-direction: column; gap: 16px; }
.location-teaser-text h2 { font-size: 40px; line-height: 44px; }
.location-teaser-text p { font-size: 16px; line-height: 26px; color: var(--brand-tint); }
.map-frame {
  flex-grow: 1;
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--surface-300);
}
.map-canvas { width: 100%; height: 100%; }
.map-canvas .leaflet-tile-pane { filter: saturate(.55) brightness(1.03); }
.map-canvas .leaflet-control-zoom { border: none; box-shadow: var(--shadow-md); margin: 12px; }
.map-canvas .leaflet-control-zoom a {
  font-family: "Inter", sans-serif;
  color: var(--ink);
  width: 32px;
  height: 32px;
  line-height: 32px;
}
.map-canvas .leaflet-control-attribution {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  background: rgba(255,255,255,.8);
  border-radius: var(--radius-sm) 0 0 0;
}
.map-open-link {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: background-color .15s ease;
}
.map-open-link:hover { background: var(--surface-200); }
.map-open-link::after { content: "↗"; font-size: 13px; }

.map-pin-wrap { background: none; border: none; }
.map-pin {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(47,42,31,.35);
}
.map-pin::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .3;
  animation: map-pulse 2.4s ease-out infinite;
}
@keyframes map-pulse {
  0% { transform: scale(.35); opacity: .5; }
  100% { transform: scale(1.8); opacity: 0; }
}
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.leaflet-popup-content {
  margin: 12px 14px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink);
}
.leaflet-popup-tip-container { display: none; }
@media (prefers-reduced-motion: reduce) {
  .map-pin::after { animation: none; opacity: 0; }
}

/* Footer */
.site-footer {
  padding: 48px 64px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--surface-200);
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .logo { font-size: 22px; }
.footer-brand span { color: var(--ink-muted); font-size: 14px; max-width: 36ch; }
.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-col-title {
  font-weight: 600;
  color: var(--ink-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Credits row (full width, bottom of footer) */
.footer-credit {
  flex-basis: 100%;
  align-self: stretch;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-300);
  font-size: 13px;
  color: var(--ink-muted);
}
.credit-forvea {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .2s ease;
}
.credit-forvea img { border-radius: 4px; display: block; transition: transform .2s ease; }
.credit-forvea strong { font-weight: 600; color: var(--ink); }
.credit-forvea:hover strong { color: #d3530a; }
.credit-forvea:hover img { transform: rotate(-6deg); }

/* Intro sections (inner pages) */
.intro {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 64px;
  gap: 12px;
}
.intro h1 { font-size: 40px; line-height: 44px; }
.intro p { color: var(--ink-muted); font-size: 16px; max-width: 70ch; }

/* Booking card (contatti) */
.booking-card { justify-content: center; gap: 16px; }
.booking-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.form-card.booking-card h2 { font-size: 32px; line-height: 36px; }
.booking-card > p { color: var(--ink-muted); font-size: 16px; line-height: 1.6; max-width: 46ch; }
.btn-booking { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; font-size: 16px; margin-top: 8px; }
.btn-booking svg { flex-shrink: 0; transition: transform .2s ease; }
.btn-booking:hover svg { transform: translate(2px, -2px); }
.booking-alt { font-size: 14px !important; border-top: 1px solid var(--surface-300); padding-top: 16px; margin-top: 8px; }
.booking-alt a { color: var(--brand); text-decoration: underline; white-space: nowrap; }

/* Legal pages (privacy) */
.legal { padding: 0 64px 56px; max-width: calc(75ch + 128px); display: flex; flex-direction: column; gap: 12px; }
.legal h2 { font-size: 22px; line-height: 28px; margin-top: 20px; }
.legal p { color: var(--ink); font-size: 15px; line-height: 1.65; }
.legal a { text-decoration: underline; }
.legal-updated { margin-top: 16px; font-size: 13px !important; color: var(--ink-muted) !important; }

/* Apartments detail page */
.apt-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0;
  min-height: 560px;
}
.apt-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  min-height: 320px;
}
.apt-photo.placeholder-1 { background: repeating-linear-gradient(45deg, var(--brand-tint), var(--brand-tint) 12px, var(--surface-300) 12px, var(--surface-300) 24px); }
.apt-photo.placeholder-2 { background: repeating-linear-gradient(45deg, var(--accent-tint), var(--accent-tint) 12px, var(--surface-300) 12px, var(--surface-300) 24px); }
.apt-text {
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.apt-text h2 { font-size: 32px; }
.apt-text p { color: var(--ink-muted); font-size: 15px; line-height: 24px; max-width: 48ch; }
.amenity-row { display: flex; gap: 8px; flex-wrap: wrap; }
.amenity { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-full); background: var(--brand-tint); font-size: 13px; font-weight: 600; }

/* Location page */
.location-split {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 40px;
  padding: 0 64px 48px;
  align-items: center;
}
.location-split p { font-size: 16px; line-height: 27px; margin-bottom: 12px; }
.location-split p:last-child { font-size: 14px; line-height: 22px; color: var(--ink-muted); margin-bottom: 0; }
.location-split .map-frame { height: 420px; width: 100%; border-radius: var(--radius-lg); }

.distances {
  padding: 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface-200);
}
.distances h2 { font-size: 24px; }
.distances-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.dist-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dist-card strong { font-size: 26px; font-weight: 700; color: var(--brand); font-family: "Fraunces", serif; }
.dist-card .dist-title { font-size: 13px; font-weight: 600; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
.dist-card p { font-size: 14px; line-height: 21px; color: var(--ink-muted); }

/* Contact page */
.contact-grid {
  padding: 0 64px 48px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.3fr);
  gap: 48px;
  align-items: start;
}
.info-card {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.info-card-top { display: flex; flex-direction: column; gap: 24px; }
.info-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-tint);
  margin-bottom: 6px;
}
.info-value { font-family: "Fraunces", serif; font-size: 22px; display: block; }
.info-card-note { font-size: 13px; line-height: 20px; color: var(--brand-tint); }

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-card h2 { font-size: 22px; margin-bottom: 4px; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
label { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
input, textarea {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 96px; }
.form-status { font-size: 13px; color: var(--brand); min-height: 18px; }
.form-status.is-error { color: var(--accent-strong); }

.faq { padding: 8px 64px 32px; display: flex; flex-direction: column; gap: 20px; }
.faq h2 { font-size: 24px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.faq-item h3 { font-size: 15px; font-family: "Inter", sans-serif; font-weight: 600; }
.faq-item p { font-size: 14px; line-height: 21px; color: var(--ink-muted); }

.note { padding: 24px 64px 48px; }
.note p { font-size: 13px; color: var(--ink-muted); max-width: 90ch; }

/* Responsive */
@media (max-width: 900px) {
  .site-header { padding: 12px 20px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: var(--surface-100);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px 20px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .navpill-wrap {
    flex-direction: column;
    align-items: stretch;
    background: transparent;
    border: none;
    backdrop-filter: none;
    padding: 0;
    gap: 4px;
  }
  .navpill { text-align: center; padding: 12px 16px; }
  .navpill-active::before, .navpill-active::after { display: none; }
  .navpill-active,
  .navpill-wrap.has-indicator .navpill-active { background: var(--brand-tint); }
  .nav-indicator { display: none; }
  .site-nav .btn-primary { width: 100%; }

  .hero { padding: 40px 20px; background-position: center 75%; min-height: 520px; }
  .hero-inner { max-width: 100%; padding: 24px 0; }
  .hero-title { font-size: 32px; line-height: 37px; }
  .hero-sub { font-size: 15px; line-height: 23px; max-width: 100%; }
  .btn-row { flex-direction: column; align-items: stretch; }

  .services { padding: 20px; justify-content: flex-start; }
  .apartments { padding: 32px 20px; }
  .section-heading h2 { font-size: 30px; line-height: 34px; }

  .location-teaser { flex-direction: column; padding: 32px 20px; gap: 24px; text-align: left; }
  .location-teaser .map-frame { width: 100%; height: 220px; }
  .location-teaser-text { max-width: 100%; }
  .location-teaser-text h2 { font-size: 28px; line-height: 32px; }

  .site-footer { flex-direction: column; gap: 24px; padding: 32px 20px; }

  .intro { padding: 28px 20px; }
  .intro h1 { font-size: 28px; line-height: 32px; }

  .apt-split { grid-template-columns: 1fr; min-height: 0; }
  .apt-split .apt-text { padding: 28px 20px; }
  .apt-split .apt-photo { order: -1; min-height: 240px; }

  .location-split { grid-template-columns: 1fr; padding: 0 20px 32px; gap: 24px; }
  .location-split .map-frame { min-height: 220px; height: 220px; }
  .distances { padding: 28px 20px; }
  .distances-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }

  .contact-grid { grid-template-columns: 1fr; padding: 0 20px 32px; gap: 24px; }
  .info-card, .form-card { padding: 28px; min-height: 0; }
  .form-row-2 { grid-template-columns: 1fr; }
  .faq { padding: 8px 20px 24px; }
  .faq-list { grid-template-columns: 1fr; }
  .note { padding: 0 20px 32px; }
  .btn-booking { align-self: stretch; justify-content: center; text-align: center; }
  .form-card.booking-card h2 { font-size: 26px; line-height: 30px; }
  .legal { padding: 0 20px 40px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 27px; line-height: 31px; }
  .distances-grid { grid-template-columns: 1fr; }
  .intro h1 { font-size: 26px; line-height: 30px; }
}
