/* Logo */
:root {
  --head: 96px;
}

.site-header .logo-wrap {
  width: 190px;
  height: 70px;
}

.logo-wrap.has-image .logo-fallback {
  display: none;
}

.hero-logo {
  width: min(420px, 78vw);
  height: auto;
  aspect-ratio: 2.1 / 1;
  margin-bottom: 2.5rem;
  filter: none;
}

.hero-logo img {
  object-fit: contain;
  object-position: left center;
}

/* Titoli fluidi */
.room-head h2 {
  max-width: 100%;
  font-size: clamp(3.5rem, 7vw, 7rem);
  overflow-wrap: anywhere;
}

/* Immagini apribili */
.photo.has-lightbox {
  cursor: zoom-in;
}

.photo.has-lightbox::after {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  content: "+";
  font: 700 1.35rem/1 Arial, sans-serif;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.photo.has-lightbox:hover::after,
.photo.has-lightbox:focus-visible::after {
  opacity: 1;
  transform: scale(1.04);
}

.photo:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

/* Lightbox: usa il file originale, senza ritagli */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(18, 18, 16, 0.94);
  backdrop-filter: blur(4px);
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 3rem);
  max-height: calc(100dvh - 5.5rem);
  object-fit: contain;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.36);
  font: 300 2rem/1 Arial, sans-serif;
  cursor: pointer;
}

.lightbox-caption {
  max-width: min(800px, calc(100vw - 3rem));
  margin: 0.7rem auto 0;
  color: #fff;
  font-family: "Raleway", Arial, sans-serif;
  font-size: 0.85rem;
  text-align: center;
}

.lightbox:not([open]) {
  display: none;
}

@media (max-width: 1100px) {
  :root {
    --head: 84px;
  }

  .site-header .logo-wrap {
    width: 160px;
    height: 64px;
  }

  .main-nav {
    inset: 0;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: calc(var(--head) + 1.5rem) 2rem 2.5rem;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .main-nav a {
    flex: 0 0 auto;
    padding: 0.48rem 0;
    font-size: clamp(1.25rem, 4.5vw, 2rem);
    line-height: 1.25;
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: auto;
    padding: calc(var(--head) + 2.25rem) 1.25rem 3.75rem;
    place-items: start;
  }

  .hero-inner {
    width: 100%;
  }

  .hero-logo {
    width: min(310px, 82vw);
    margin-bottom: 2rem;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 11.5vw, 4rem);
  }

  h2,
  .room-head h2 {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
    line-height: 1;
    letter-spacing: -0.035em;
  }

  #appartamento-title {
    font-size: clamp(1.85rem, 9vw, 3.15rem);
  }

  .hero-side {
    display: none;
  }

  .main-nav {
    padding-inline: 1.5rem;
  }

  .main-nav a {
    font-size: clamp(1.15rem, 5.5vw, 1.65rem);
  }

  .lightbox img {
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 5rem);
  }

  .lightbox-caption {
    max-width: calc(100vw - 1.5rem);
  }
}
