/* =============================================================================
   Via ai Monti 31 — listing landing page
   Mobile-first, bilingual, no build step
   ============================================================================= */

:root {
  --ink: #1c1917;
  --ink-soft: #575248;
  --ink-faint: #8a8378;
  --paper: #fffdf9;
  --bg: #f3efe8;
  --bg-deep: #ebe4d8;
  --line: #e0d8cc;
  --lake: #1d5a6e;
  --lake-deep: #154554;
  --lake-hover: #16485a;
  --lake-soft: #e6eef1;
  --sand: #d4c2a6;
  --terracotta: #b07d52;
  --whatsapp: #127a6c;
  --whatsapp-hover: #0e655a;
  --header-h: 4.25rem;
  --cta-bar-h: 4.25rem;
  --max: 70rem;
  --narrow: 42rem;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: 0 0.75rem 2rem rgba(28, 25, 23, 0.08);
  --shadow-soft: 0 0.35rem 1.25rem rgba(28, 25, 23, 0.06);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --space: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html,
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--lake);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--lake-deep);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.65rem, 3.8vw, 2.45rem); margin: 0 0 0.65rem; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

address { font-style: normal; }

button, input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--lake);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 1000;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

/* Language visibility: Italian default; German when #lang-de is checked */
.t-de { display: none !important; }
body:has(#lang-de:checked) .t-de { display: revert !important; }
body:has(#lang-de:checked) .t-it { display: none !important; }

/* When a .t-de / .t-it is a block-level standalone element */
p.t-de, h1.t-de, h2.t-de, h3.t-de, li.t-de, dt.t-de, dd.t-de, span.t-de.block,
p.t-it, h1.t-it, h2.t-it, h3.t-it, li.t-it, dt.t-it, dd.t-it {
  /* display handled by rules above */
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 2rem, var(--narrow));
  margin-inline: auto;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  min-height: 2.85rem;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--lake);
  color: #fff;
  border-color: var(--lake);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--lake-hover);
  border-color: var(--lake-hover);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--lake-deep);
  border-color: var(--line);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--lake);
  color: var(--lake-deep);
  background: var(--lake-soft);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  border-color: var(--whatsapp);
}
.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
  background: var(--whatsapp-hover);
  border-color: var(--whatsapp-hover);
  color: #fff;
}

.btn-lg {
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
}

/* ----- Header ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(28, 25, 23, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.logo-link:hover { color: var(--ink); }
.logo-link img {
  height: 2.15rem;
  width: auto;
}

.logo-meta {
  display: none;
  flex-direction: column;
  line-height: 1.25;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.logo-meta strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header-cta { display: none; }

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  min-height: 2.5rem;
}
.lang-switch legend { padding: 0; }
.lang-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lang-switch label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--ink-soft);
}
.lang-switch input:checked + label {
  background: var(--lake);
  color: #fff;
}
.lang-switch input:focus-visible + label {
  outline: 2px solid var(--lake);
  outline-offset: 2px;
}

/* ----- Hero ----- */
.hero {
  position: relative;
}
.hero-figure {
  margin: 0;
  background: var(--bg-deep);
}
.hero-figure img {
  width: 100%;
  height: min(56vw, 22rem);
  object-fit: cover;
  object-position: center 58%;
}
@media (min-width: 48rem) {
  .hero-figure img {
    height: min(48vh, 26.5rem);
    object-position: center 52%;
  }
}

.hero-panel-wrap {
  width: min(100% - 2rem, var(--max));
  margin: -3rem auto 0;
  position: relative;
  z-index: 2;
}
.hero-panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.2rem 1.3rem;
  border: 1px solid rgba(224, 216, 204, 0.7);
}
.kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lake);
  margin: 0 0 0.65rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  max-width: 44rem;
}
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.price {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  margin: 0;
}
.price-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ----- Sections ----- */
.section {
  padding: 3.25rem 0 0;
}
.section-head {
  margin-bottom: 1.5rem;
}
.section-head p {
  color: var(--ink-soft);
  max-width: 40rem;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lake);
  margin: 0 0 0.4rem;
}

/* ----- Key facts ----- */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.fact {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  min-height: 100%;
}
.fact-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.fact-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* ----- Walking distances ----- */
.distances {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.distance {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
}
.distance-m {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--lake);
  letter-spacing: -0.02em;
  min-width: 6.5rem;
  flex-shrink: 0;
}
.distance-label {
  color: var(--ink);
  font-weight: 500;
}
.distance-note {
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-weight: 400;
}

/* ----- Gallery ----- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  aspect-ratio: 4 / 3;
  text-decoration: none;
}
.gallery-item:focus-visible {
  outline-offset: 2px;
  z-index: 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.03);
}
.gallery-item.wide {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 8;
}
.gallery-item.panorama {
  aspect-ratio: 16 / 7;
}

/* ----- Details ----- */
.details-grid {
  display: grid;
  gap: 2rem;
}
.description p {
  color: var(--ink);
}
.honest-line {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--lake-soft);
  border-left: 3px solid var(--lake);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 500;
  color: var(--lake-deep);
}

.specs {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 1.25rem;
}
.specs div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.specs div:last-child { border-bottom: 0; }
.specs dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.specs dd {
  margin: 0;
  color: var(--ink);
}

/* ----- Booking / about ----- */
.booking {
  margin-top: 3.25rem;
  padding: 3rem 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.booking-card {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}
.agent-photo {
  width: 10.5rem;
  max-width: 42%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  background: var(--bg-deep);
}
.booking-copy .role {
  margin: 0 0 0.35rem;
  color: var(--lake);
  font-size: 0.85rem;
  font-weight: 600;
}
.booking-copy h2 { margin-bottom: 0.75rem; }
.booking-copy p { color: var(--ink-soft); }
.booking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.booking-note {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

/* ----- Documentation ----- */
.docs {
  padding: 3rem 0 0;
}
.docs-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem;
  display: grid;
  gap: 1rem;
}
.docs-box p { color: var(--ink-soft); }

/* ----- Map ----- */
.map-section { padding-top: 3.25rem; }
.map-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  aspect-ratio: 16 / 11;
}
.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.map-caption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ----- Footer ----- */
.site-footer {
  margin-top: 3.5rem;
  padding: 2.5rem 0 calc(var(--cta-bar-h) + 2.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--lake-deep);
  color: #e7eef1;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  gap: 1.75rem;
}
.footer-logo {
  height: 2.1rem;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  margin-bottom: 0.85rem;
}
.footer-brand p { margin: 0; color: #c5d5dc; font-size: 0.92rem; }
.footer-contact {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
}
.footer-contact a { text-decoration: none; }
.footer-contact a:hover { text-decoration: underline; }
.footer-legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  color: #b7c8d0;
  display: grid;
  gap: 0.65rem;
}
.privacy-note { max-width: 42rem; }

/* ----- Sticky mobile CTA bar ----- */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(28, 25, 23, 0.06);
}
.cta-bar .btn {
  padding: 0.65rem 0.4rem;
  font-size: 0.78rem;
  min-height: 2.75rem;
  border-radius: 0.6rem;
  flex-direction: column;
  gap: 0.1rem;
}
.cta-bar .btn svg { width: 16px; height: 16px; }
.cta-bar .btn-primary { font-size: 0.78rem; }

@media (min-width: 28rem) {
  .cta-bar .btn {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.82rem;
  }
}

/* ----- Lightbox ----- */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}
.lightbox::backdrop {
  background: rgba(16, 18, 20, 0.92);
}
.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  padding: 3.5rem 0.75rem 4.5rem;
}
.lightbox-inner img {
  max-width: 100%;
  max-height: calc(100vh - 8.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  background: #111;
}
.lightbox-caption {
  margin-top: 0.75rem;
  color: #e8e4dc;
  font-size: 0.9rem;
  text-align: center;
  max-width: 40rem;
  padding: 0 2.5rem;
}
.lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close { top: 0.75rem; right: 0.75rem; }
.lightbox-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* =============================================================================
   Wider screens
   ============================================================================= */
@media (min-width: 48rem) {
  .logo-meta { display: flex; }
  .header-cta { display: inline-flex; }
  .hero-panel {
    padding: 1.55rem 2.15rem 1.65rem;
  }
  .hero-panel-wrap { margin-top: -5.75rem; }
  .facts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .fact:nth-child(5),
  .fact:nth-child(6) {
    /* still 4-col; last two span naturally in next row — or 6 equal */
  }
  .facts-grid { grid-template-columns: repeat(3, 1fr); }
  .distances {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
  }
  .distance {
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1rem 1.2rem;
    min-height: 100%;
  }
  .distance-m { min-width: 0; font-size: 1.5rem; }
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
  }
  .gallery-item.wide {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 7;
  }
  .gallery-item.span2 {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
  }
  .details-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 2.5rem;
    align-items: start;
  }
  .specs div {
    grid-template-columns: 11.5rem 1fr;
    gap: 1rem;
    align-items: baseline;
  }
  .booking-card {
    grid-template-columns: 13.5rem 1fr;
    gap: 2.5rem;
    width: min(100% - 2rem, var(--max));
    margin-inline: auto;
  }
  .agent-photo {
    width: 100%;
    max-width: none;
  }
  .docs-box {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 1.85rem 2rem;
    gap: 2rem;
  }
  .map-frame { aspect-ratio: 16 / 8; }
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 2rem;
  }
  .cta-bar { display: none; }
  .site-footer {
    padding-bottom: 2.5rem;
  }
}

@media (min-width: 64rem) {
  .facts-grid { grid-template-columns: repeat(6, 1fr); }
  .hero-panel { padding: 1.7rem 2.35rem 1.8rem; }
}

@media (min-width: 48rem) {
  .section { padding-top: 4rem; }
  .booking { margin-top: 4rem; padding: 4rem 0; }
}
