/* Homestays: card grid + Airbnb-style detail overlay. Layered on top of site.css's
   tokens (--surface, --ink, --accent, etc.) so the palette stays consistent. */

.stay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px 22px;
}

.stay-card {
  cursor: pointer; border: none; background: none; text-align: left; font: inherit;
  color: inherit; padding: 0; display: flex; flex-direction: column; gap: 8px;
}
.stay-card .cover {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: var(--accent-wash);
}
.stay-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.stay-card:hover .cover img { transform: scale(1.04); }
.stay-card .cover .count {
  position: absolute; right: 8px; bottom: 8px; background: rgba(20,20,18,0.66);
  color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px;
}
.stay-card h3 { font-family: 'Public Sans', sans-serif; font-size: 15.5px; font-weight: 700; }
.stay-card .loc { color: var(--muted); font-size: 13.5px; }
.stay-card .stats { color: var(--muted); font-size: 13px; }
.stay-card .price { font-size: 14.5px; margin-top: 2px; }
.stay-card .price b { font-weight: 700; }

/* ── Overlay ── */
.stay-overlay {
  position: fixed; inset: 0; background: rgba(12, 16, 14, 0.88); z-index: 50;
  display: flex; justify-content: center; align-items: flex-start;
  overflow-y: auto; padding: 28px 16px;
}
/* align-items:flex-start above matters more than it looks: flex's default
   (stretch) forces .stay-sheet to the FULL viewport height regardless of its
   own content, and that -- combined with .stay-sheet's overflow:hidden below
   -- silently clipped anything taller than one screen instead of letting it
   scroll. With flex-start, the sheet is exactly as tall as its content, and
   this element's own overflow-y:auto reveals the rest by scrolling normally. */
.stay-overlay.hidden { display: none; }
.stay-sheet {
  background: var(--surface); border-radius: 16px; max-width: 980px; width: 100%;
  position: relative; overflow: hidden; padding-bottom: 30px;
  box-shadow: 0 30px 70px rgba(10,16,12,0.35);
}
.stay-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 34px; height: 34px;
  border-radius: 50%; border: none; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.stay-gallery {
  display: grid; grid-template-columns: 2fr 1fr; gap: 4px; height: 340px;
  border-radius: 16px 16px 0 0; overflow: hidden; position: relative;
}
.stay-gallery img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; border: none; padding: 0; }
.stay-gallery .side { display: grid; grid-template-rows: 1fr 1fr; gap: 4px; }
.stay-gallery .show-all {
  position: absolute; right: 14px; bottom: 14px; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
@media (max-width: 680px) {
  .stay-gallery { grid-template-columns: 1fr; height: 220px; }
  .stay-gallery .side { display: none; }
}

.stay-content { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 28px 32px 0; }
@media (max-width: 780px) {
  .stay-content { grid-template-columns: 1fr; padding: 22px 20px 0; }
  /* Larger tap targets on touch-sized screens -- 26px is below the ~44px
     comfortable minimum for a finger, not just a cursor. */
  .stepper button { width: 36px; height: 36px; font-size: 18px; }
  .stay-close { width: 40px; height: 40px; font-size: 16px; }
}

.stay-main h2 { font-size: 24px; }
.stay-loc { color: var(--muted); margin-top: 4px; }
.stay-stats { margin-top: 14px; color: var(--ink-soft); font-size: 14.5px; }
.stay-rule { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.stay-sub { font-family: 'Fraunces', serif; font-size: 18px; margin-bottom: 12px; }
.stay-desc { color: var(--ink-soft); }

.stay-book { position: relative; }
.stay-book-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow); background: var(--surface);
}
.stay-price-row { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.stay-price-row span { font-weight: 400; font-size: 14px; color: var(--muted); }
/* min-width:0 on the grid items: a date input's intrinsic content width can
   exceed its track, and a grid item won't shrink below that by default --
   the classic cause of a booking card that quietly overflows its own box. */
.book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.book-grid label, .guests-row {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); display: grid; gap: 4px; min-width: 0;
}
.book-grid input {
  font: inherit; font-size: 14px; padding: 8px; border: 1px solid var(--line);
  border-radius: 8px; width: 100%; min-width: 0;
}
.guests-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink);
}
.stepper span { font-size: 14px; font-weight: 600; color: var(--ink); min-width: 14px; text-align: center; }
.stay-total {
  display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 14px;
}
.stay-total b { color: var(--ink); }

.stay-contact-form { padding: 24px 32px 0; max-width: none; }
.stay-contact-form.hidden { display: none; }

/* ── Photo lightbox: every uploaded photo, one at a time, with its caption ── */
.lightbox {
  position: fixed; inset: 0; background: rgba(8, 10, 9, 0.95); z-index: 60;
  display: flex; align-items: center; justify-content: center;
}
.lightbox.hidden { display: none; }
.lightbox-frame { max-width: min(88vw, 1100px); max-height: 82vh; display: flex; flex-direction: column; gap: 12px; }
.lightbox-frame img { max-width: 100%; max-height: 74vh; width: auto; height: auto; margin: 0 auto; border-radius: 6px; }
.lightbox-caption { color: #F1EFE6; text-align: center; font-size: 15px; min-height: 1.4em; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: none;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-close { top: 20px; right: 20px; width: 40px; height: 40px; font-size: 16px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 26px; }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #cfcbbd; font-size: 13px; }
@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 22px; }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
}
