/* ============================================================
   Aparto — pages.css
   Page composition: nav, hero, stats, collection, reviews,
   FAQ, contact, footer, property detail, lightbox.
   Built from design-system tokens and components.css.
   ============================================================ */

/* ---------------- Animated background layer ---------------- */

#vanta-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
}
#vanta-bg canvas {
  display: block;
}

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

.nav {
  --nav-ink: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  color: var(--nav-ink);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.nav.scrolled,
.nav.menu-open {
  --nav-ink: var(--ink);
  background: rgba(10, 9, 8, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--hairline);
}

/* Over the hero the nav has no fill of its own, and 14px links measured only
   3.80:1 against bright photography. This fades a little ground in behind the
   bar and retires once .scrolled supplies a real background. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(10, 9, 8, 0.42) 0%,
    rgba(10, 9, 8, 0) 100%
  );
  transition: opacity 0.3s ease;
}
.nav.scrolled::before,
.nav.menu-open::before {
  opacity: 0;
}

.nav-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  /* The mark is 34px tall; the tap target must not be. */
  min-height: 44px;
}
.brand img {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}
.nav-links a {
  position: relative;
  padding-block: var(--space-2);
  font-size: var(--step--1);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover {
  color: var(--white);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}
.nav-links a.active {
  color: var(--white);
  font-weight: 700;
}
.nav.scrolled .nav-links a {
  color: rgba(243, 239, 231, 0.7);
}
.nav.scrolled .nav-links a:hover,
.nav.scrolled .nav-links a.active {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  place-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--nav-ink);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.nav.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 859px) {
  .nav-toggle {
    display: flex;
  }
  .nav-cta {
    display: none;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    /* Opaque: drawer text must never sit over the moving background. */
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
    padding: var(--space-2) var(--space-5) var(--space-4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav.menu-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink);
  }
  .nav-links a:last-child {
    border-bottom: 0;
  }
  .nav-links a::after {
    display: none;
  }
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}
/* The <picture> wrapper must not become a layout box: the hero image is
   absolutely positioned and the card image fills a ratio-locked box. */
.hero picture,
.card-media picture {
  display: contents;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-zoom 22s var(--ease) both;
}
@keyframes hero-zoom {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Two layers, both load-bearing for legibility rather than mood. The radial
     sits behind the headline block, where the photography is at its brightest
     (a white wall) and white type measured only 2.53:1 without it. The linear
     darkens the top band so the nav clears 4.5:1, and the bottom so the scroll
     cue stays visible. Re-measure contrast if either is touched. */
  background:
    radial-gradient(
      ellipse 72% 50% at 50% 46%,
      rgba(10, 9, 8, 0.52) 0%,
      rgba(10, 9, 8, 0) 72%
    ),
    linear-gradient(
      to bottom,
      rgba(10, 9, 8, 0.52) 0%,
      rgba(10, 9, 8, 0.22) 24%,
      rgba(10, 9, 8, 0.16) 52%,
      rgba(10, 9, 8, 0.5) 84%,
      rgba(10, 9, 8, 0.82) 100%
    );
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-content h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 1.1rem + 7vw, 4.875rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
/* Gives the h1 real words for search engines and AI, under the wordmark. */
.hero-tagline {
  display: block;
  margin-top: var(--space-3);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55); /* smaller than the h1, so it needs more help than the scrim */
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.hero-animate .hero-content > * {
  opacity: 0;
  transform: translateY(26px);
  animation: hero-rise 0.9s var(--ease) forwards;
}
@keyframes hero-rise {
  to { opacity: 1; transform: none; }
}

/* ---------------- Collection ---------------- */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

/* ---------------- Reviews ---------------- */

.reviews {
  background: var(--veil-detail-b);
}
/* Carousel built on CSS scroll-snap: native touch swiping, trackpad and
   keyboard scrolling all work with no JavaScript. The buttons below are
   an enhancement, not the mechanism. There is deliberately no autoplay —
   content that moves on its own is the main reason carousels fail
   accessibility and annoy readers. */

.review-carousel {
  position: relative;
}

.review-track {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-block: var(--space-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.review-track::-webkit-scrollbar {
  display: none;
}
.review-track:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.review {
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-5);
  background: var(--veil-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
}
/* Exactly two per row above 640px: half the track minus half the gap. */
@media (min-width: 640px) {
  .review {
    flex-basis: calc(50% - (var(--space-5) / 2));
  }
}
.review-stars {
  color: var(--ink);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
}
.review p {
  color: var(--ink);
  line-height: var(--leading-loose);
}
.review cite {
  margin-top: auto;
  padding-top: var(--space-2);
  color: var(--muted);
  font-size: var(--step--1);
  font-style: normal;
}
.review-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.review-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.review-btn:hover:not([disabled]) {
  border-color: var(--ink);
  background: rgba(243, 239, 231, 0.06);
}
.review-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

.reviews-cta {
  margin-top: var(--space-7);
  text-align: center;
}

/* ---------------- FAQ ---------------- */

.faq {
  background: var(--veil-detail-a);
}
.accordion {
  max-width: 820px;
  margin-inline: auto;
}

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

.contact-inner {
  max-width: 900px;
  margin-inline: auto;
}

.contact-cta {
  margin-top: var(--space-8);
  text-align: center;
}

.contact-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 720px) {
  .contact-list {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--hairline);
}
.contact-label {
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--muted);
}
.contact-list strong {
  display: block;
  font-weight: 600;
}
.contact-list address {
  color: var(--muted);
  line-height: var(--leading-loose);
}

/* ---------------- About / hosts ---------------- */

.about {
  background: var(--veil-about);
  color: var(--ivory-text);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}
@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}
.about-text p + p {
  margin-top: var(--space-4);
}
.about-text p {
  color: rgba(245, 241, 234, 0.78);
  line-height: var(--leading-loose);
}
.about-text .btn {
  margin-top: var(--space-6);
}
.hosts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 559px) {
  .hosts { grid-template-columns: 1fr; }
}

/* ---------------- Property detail ---------------- */

.detail-a { background: var(--veil-detail-a); }
.detail-b { background: var(--veil-detail-b); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: calc(var(--nav-h) + var(--space-3));
  color: var(--muted);
  font-size: var(--step--1);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--dot);
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.breadcrumb a:hover {
  color: var(--ink);
}

.detail-head {
  padding-block: var(--space-6) var(--space-7);
}
.detail-head h1 {
  font-size: var(--step-4);
  max-width: 22ch;
}
.detail-head .chips {
  margin-top: var(--space-5);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
}
@media (min-width: 860px) {
  .detail-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 150px;
  gap: var(--space-3);
}
.g-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
}
.g-item picture {
  display: contents;
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.g-item:hover img {
  transform: scale(1.05);
}
.g-main {
  grid-column: 1 / -1;
  grid-row: span 2;
}
.g-item:last-child {
  grid-column: 1 / -1;
}
@media (min-width: 720px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
  }
  .g-main { grid-column: span 2; }
  .g-item:last-child { grid-column: auto; }
}
@media (min-width: 1024px) {
  .gallery { grid-auto-rows: 200px; }
}

.detail-body .lede {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
}
.detail-body p + p {
  margin-top: var(--space-4);
  color: var(--muted);
  line-height: var(--leading-loose);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.fine {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: var(--step--1);
}

/* Quick facts: plain label/value pairs that search engines and AI
   assistants can lift straight out of the HTML. */
.facts {
  display: grid;
  grid-template-columns: minmax(7.5rem, max-content) 1fr;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
  font-size: var(--step--1);
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  color: var(--ink);
}

/* 404 page clears the fixed nav (was an inline style; CSP blocks those). */
.section.page-404 {
  padding-top: calc(var(--nav-h) + var(--space-10));
}

.more-stays {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 720px) {
  .more-stays { grid-template-columns: repeat(3, 1fr); }
}
.more-stay {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.more-stay:hover {
  border-color: var(--dot);
  background: rgba(255, 255, 255, 0.04);
}
.more-stay span {
  color: var(--muted);
  font-size: var(--step--1);
}

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

.footer {
  background: var(--veil-footer);
  border-top: 1px solid var(--hairline);
  color: rgba(245, 241, 234, 0.72);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  padding-block: var(--space-9) var(--space-8);
}
@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}
.footer-brand img {
  height: 30px;
  width: auto;
}
.footer-brand p {
  margin-top: var(--space-4);
}
.footer-entities {
  margin-top: var(--space-4);
  color: var(--muted);
  font-size: var(--step--1);
  line-height: var(--leading-loose);
}
.footer-col h2 {
  margin-bottom: var(--space-4);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-overline);
  color: var(--ivory-text);
}
.footer-col {
  display: flex;
  flex-direction: column;
}
.footer-col a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--step--1);
  transition: color 0.2s ease;
}
.footer-col a:hover {
  color: var(--ivory-text);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-5);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------------- Lightbox ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 8, 0.94);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.lb-visible { opacity: 1; }
.lightbox[hidden] { display: none; }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
  max-width: 100%;
  opacity: 0;
  transform: scale(0.94) translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}
.lightbox.lb-visible .lb-figure {
  opacity: 1;
  transform: none;
}
#lbImg {
  max-width: min(88vw, 1200px);
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.25s ease;
}
.lb-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--step--1);
  letter-spacing: 0.02em;
}
.lb-close,
.lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lb-close:hover,
.lb-nav:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}
.lb-close {
  top: var(--space-5);
  right: var(--space-5);
  font-size: var(--step-2);
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--step-1);
}
.lb-prev { left: var(--space-5); }
.lb-next { right: var(--space-5); }
@media (max-width: 719px) {
  .lb-prev { left: var(--space-2); }
  .lb-next { right: var(--space-2); }
  .lb-close { top: var(--space-3); right: var(--space-3); }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  .review-track { scroll-behavior: auto; }
  .review-btn { transition: none; }
  .hero-bg { animation: none; }
  .hero-animate .hero-content > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .g-item:hover img { transform: none; }
  .lightbox,
  .lb-figure,
  #lbImg,
  .nav-links { transition: none; }
}
