/* ============================================================
   SNS Valley View — Reserve modal

   A CSS-only dialog built on <details>, opened by the header's Reserve
   button. See web/templates/reserve.templ for why <details> and not
   <dialog>, and why the <summary> doubles as the backdrop.

   No new design vocabulary: --c-bg-card ground, --c-hair rules, the gold
   accent on the label and the × only, radius 0, no shadow, --dur/--ease
   on every transition.
   ============================================================ */

.reserve {
  position: relative;
}

/* The trigger. list-style/::-webkit-details-marker strip the disclosure
   triangle so the existing .btn--ghost inside is the entire visual — the
   header's Reserve button is unchanged to look at. */
.reserve__toggle {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
}
.reserve__toggle::-webkit-details-marker { display: none; }

/* Focus lands on the summary, so the ring has to be drawn on the label
   inside it — a ring on the element that becomes a full-viewport backdrop
   would outline the whole screen once open. */
.reserve__toggle:focus-visible { outline: none; }
.reserve__toggle:focus-visible .reserve__toggle-label { outline: 2px solid var(--c-gold); outline-offset: 3px; }

.reserve__close { display: none; }

/* ------------------------------------------------------------
   Open state

   The summary becomes the backdrop: fixed, full viewport, dimmed. Its
   "Reserve" label is hidden and a × takes its place in the top-right, so
   the one native toggle serves as backdrop-dismiss and close button at
   once. The panel sits above it on z-index.
   ------------------------------------------------------------ */
details.reserve[open] .reserve__toggle {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: block;
  background: rgba(9, 9, 9, 0.82);
  animation: reserveFade var(--dur) var(--ease) both;
}
details.reserve[open] .reserve__toggle-label { display: none; }

details.reserve[open] .reserve__close {
  display: block;
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 22px;
  color: var(--c-cream-55);
  transition: color var(--dur) var(--ease);
}
details.reserve[open] .reserve__toggle:hover .reserve__close { color: var(--c-cream); }

.reserve__panel {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 40px;
  text-align: center;
  background: var(--c-bg-card);
  border: 1px solid var(--c-hair);
  animation: reserveRise var(--dur-slow) var(--ease) both;
}

.reserve__title {
  margin: 12px 0 0;
  font-family: var(--f-display);
  font-size: 34px;
  font-weight: 300;
  line-height: 1.05;
  color: var(--c-cream);
}

.reserve__lede {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-cream-55);
}

/* The QR is dark-on-cream (scanners are unreliable on inverted symbols —
   see scripts/qr/main.go), so it arrives as a light tile on a dark panel.
   The cream ground is part of the SVG itself; the padding here is extra
   quiet zone, not decoration. */
.reserve__qr {
  display: block;
  width: 132px;
  height: 132px;
  margin: 32px auto 0;
  padding: 8px;
  background: var(--c-cream);
  border: 1px solid var(--c-gold-line);
}

.reserve__qr-caption {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-cream-30);
}

.reserve__rows {
  margin-top: 28px;
  border-top: 1px solid var(--c-hair);
}

/* 44px minimum height: these are the real tap targets on a phone, where
   the QR is hidden and these three rows are the entire panel. */
.reserve__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 8px 0;
  text-align: left;
  border-bottom: 1px solid var(--c-hair);
  color: var(--c-cream);
  transition: color var(--dur) var(--ease);
}
.reserve__row:hover .reserve__row-value { color: var(--c-gold); }

.reserve__row-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-cream-40);
}

.reserve__row-value {
  font-size: 14px;
  color: var(--c-cream);
  transition: color var(--dur) var(--ease);
}

/* The address is real, actionable information — it opens Google Maps — so
   it sits at the cream-40 "secondary" tier, not the cream-20 legal tier the
   line here used to use. CLAUDE.md reserves 20% cream for legal text, and
   an address a guest has to read to find the property in the hills at dusk
   is not legal text. */
.reserve__address {
  display: block;
  margin: 24px 0 0;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--c-cream-40);
  transition: color var(--dur) var(--ease);
}
.reserve__address:hover { color: var(--c-gold); }

.reserve__address-lines { display: block; }

/* The affordance. Gold at rest, because this is the one line in the block
   that has to read as "this does something" — the address above it stays at
   the quiet tier it was composed at. Hover takes it to cream, which is the
   global link behaviour (base.css) rather than a new rule of its own, and
   matches the footer's identical line. */
.reserve__address-cta {
  display: inline-block;
  margin-top: 10px;
  color: var(--c-gold);
  transition: color var(--dur) var(--ease);
}
.reserve__address:hover .reserve__address-cta { color: var(--c-cream); }

@keyframes reserveFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 16px, not a large slide: the panel is already centred, and the design's
   long --dur-slow does the work. A bigger travel at 760ms reads as slow
   rather than unhurried. */
@keyframes reserveRise {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ------------------------------------------------------------
   Mobile — the QR goes away entirely.

   Nobody scans a QR with the phone that is displaying it. On a phone the
   three rows ARE the panel: tel: opens the dialer, wa.me opens WhatsApp,
   mailto: opens the mail app, all with one tap.
   ------------------------------------------------------------ */
@media (max-width: 680px) {
  .reserve__qr,
  .reserve__qr-caption { display: none; }

  .reserve__panel {
    width: calc(100vw - 32px);
    padding: 32px 24px;
  }

  /* The maps line is a real destination on the device most likely to use
     it, so it gets the 44px target the contact rows already have. */
  .reserve__address-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .reserve__title { font-size: 28px; }
  .reserve__rows { margin-top: 24px; }
}

/* The dissolve is decorative; the panel must still appear. */
@media (prefers-reduced-motion: reduce) {
  details.reserve[open] .reserve__toggle,
  .reserve__panel {
    animation: none;
  }
  .reserve__panel { transform: translate(-50%, -50%); }
  .reserve__row,
  .reserve__row-value,
  .reserve__address,
  .reserve__address-cta,
  .reserve__close { transition-duration: 0.01ms; }
}
