/* ==========================================================================
   COMPONENTS
   Reusable pieces: buttons, links, nav, forms, calendar, lightbox, status,
   summary, tables. Every interactive control satisfies 44x44 touch, a visible
   focus ring, and a 150-300ms transition.
   ========================================================================== */

/* --------------------------------------------------------------------------
   BUTTON
   Three intents only: solid (primary), outline (secondary), quiet (tertiary).
   Square-ish, uppercase, wide-tracked. Never a pill, never a gradient.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: 0 var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--c-ink);
  color: var(--c-text-invert);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition:
    background-color var(--d-fast) var(--e-out),
    color var(--d-fast) var(--e-out),
    border-color var(--d-fast) var(--e-out),
    opacity var(--d-fast) var(--e-out);
}
.btn:hover { background: var(--c-ink-2); }

.btn--outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-ink);
}
.btn--outline:hover { background: var(--c-ink); color: var(--c-text-invert); }

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn--ghost:hover { border-color: var(--c-ink); }

/* On dark backgrounds and over media. */
.btn--invert { background: var(--c-bg); color: var(--c-ink); }
.btn--invert:hover { background: var(--c-white); }
.btn--invert-outline {
  background: transparent;
  color: var(--c-text-invert);
  border-color: rgba(240, 237, 230, 0.45);
}
.btn--invert-outline:hover {
  background: rgba(240, 237, 230, 0.10);
  border-color: var(--c-text-invert);
}

.btn--wide { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 var(--s-4); }
.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* The underlined text link. The rule grows from the left on hover. */
.link {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-block: var(--s-2);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  border: 0;
}
.link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform var(--d-base) var(--e-out);
}
.link:hover::after { transform: scaleX(0); transform-origin: right; }

/* --------------------------------------------------------------------------
   HEADER / NAV
   Transparent over the hero, warm and solid after scroll.
   -------------------------------------------------------------------------- */
/* SOLID IS THE DEFAULT.
   Deciding this in JS meant every page without a media hero painted cream
   navigation on a cream background until the script booted — about a second of
   invisible links on a slow connection. The page now declares its own case:
   `<body class="has-hero">` opts into the transparent treatment, and JS only
   toggles `.is-pinned` on scroll. Nothing about the first paint waits on JS. */
.header {
  position: fixed;
  top: var(--demo-h); left: 0; right: 0;
  z-index: 100;
  height: calc(var(--nav-h) - var(--demo-h));
  display: flex;
  align-items: center;
  background: rgba(245, 242, 236, 0.94);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  transition:
    background-color var(--d-base) var(--e-out),
    color var(--d-base) var(--e-out),
    border-color var(--d-base) var(--e-out);
}

/* Over a media hero, and only until the page scrolls. */
.has-hero .header:not(.is-pinned) {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--c-text-invert);
  border-bottom-color: transparent;
}

/* A wash belonging to the header itself, rather than more darkness across the
   whole top of the photograph. The hero's own gradient is deliberately light
   up here so the image reads; this keeps the navigation legible over any
   footage without paying for it in the composition. It fades out below the
   header, so it is felt rather than seen. */
.has-hero .header:not(.is-pinned)::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--nav-h) + 48px);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(18,18,16,0.50) 0%,
    rgba(18,18,16,0.46) 58%,
    rgba(18,18,16,0.20) 84%,
    rgba(18,18,16,0.00) 100%);
  transition: opacity var(--d-base) var(--e-out);
}
.header__inner {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--s-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  line-height: 1;
}
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand__mark {
  flex: none;
  height: 36px;
  width: auto;
  overflow: visible;
}
.brand__mark .acc { fill: var(--c-accent-mark); }
.has-hero .header:not(.is-pinned) .brand__mark .acc { fill: var(--c-brass-bright); }
@media (max-width: 860px) {
  .brand__mark { height: 30px; }
  .brand { gap: 9px; }
}

/* ── DEMO STRIP ────────────────────────────────────────────────────────────
   Fixed above the header while the site is a preview. Removed by setting
   property.demoNotice to null in content.js and rebuilding. */
.demo-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
  height: var(--demo-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-inline: var(--s-gutter);
  background: var(--c-indigo-deep);
  color: var(--c-text-invert);
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid rgba(216, 185, 120, 0.28);
}
.demo-bar__tag {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--c-brass-bright);
  border-radius: var(--radius);
  color: var(--c-brass-bright);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.demo-bar__long, .demo-bar__short { overflow: hidden; text-overflow: ellipsis; }
.demo-bar__short { display: none; }
@media (max-width: 720px) {
  .demo-bar__long { display: none; }
  .demo-bar__short { display: inline; }
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.brand__meta {
  font-size: 0.5625rem;
  letter-spacing: var(--ls-label-wide);
  text-transform: uppercase;
  opacity: 0.7;
  /* One line or nothing. Allowed to wrap, this line drops below the header
     bar and sits on top of the hero, which is what it did on every phone. */
  white-space: nowrap;
}
/* On a phone the place line is what has to fit, so it gives up a little of its
   letter-spacing rather than a whole second line. */
@media (max-width: 600px) {
  .brand__meta { font-size: 0.5rem; letter-spacing: 0.09em; }
}

.nav { display: flex; align-items: center; gap: var(--s-7); }
.nav__list { display: flex; align-items: center; gap: var(--s-6); }
.nav__link {
  position: relative;
  display: inline-block;
  padding-block: var(--s-2);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  opacity: 0.82;
  transition: opacity var(--d-fast) var(--e-out);
}
.nav__link:hover { opacity: 1; }
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--d-base) var(--e-out);
}
.nav__link:hover::after,
.nav__link[aria-current='page']::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current='page'] { opacity: 1; }

/* Header CTA: outlined so it never shouts over the hero. */
.nav__cta {
  min-height: 42px;
  padding: 0 var(--s-5);
  border: 1px solid currentColor;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  transition: background-color var(--d-fast) var(--e-out),
              color var(--d-fast) var(--e-out);
}
.nav__cta:hover { background: var(--c-ink); color: var(--c-text-invert); }
.has-hero .header:not(.is-pinned) .nav__cta:hover {
  background: var(--c-text-invert);
  color: var(--c-ink);
}

/* Menu toggle — two rules, not a hamburger icon set. */
.menu-toggle {
  display: none;
  width: 48px; height: 48px;
  margin-right: -12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-toggle__bars { display: block; width: 22px; height: 9px; position: relative; }
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0; width: 100%; height: 1px;
  background: currentColor;
  transition: transform var(--d-base) var(--e-out), opacity var(--d-fast) var(--e-out);
}
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { bottom: 0; }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars::before { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle__bars::after  { transform: translateY(-4px) rotate(-45deg); }

/* Full-screen mobile menu. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--c-bg);
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + var(--s-7)) var(--s-gutter) var(--s-7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity var(--d-base) var(--e-out),
    transform var(--d-base) var(--e-out),
    visibility var(--d-base) step-end;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--d-base) var(--e-out),
              transform var(--d-base) var(--e-out),
              visibility 0s;
}
.menu__list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-4); }
.menu__link {
  display: block;
  padding-block: var(--s-3);
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: var(--ls-display);
}
.menu__foot {
  margin-top: auto;
  padding-top: var(--s-7);
  display: grid;
  gap: var(--s-4);
  /* Grid items stretch by default, which would drag an inline link's underline
     across the full width. The button is widened explicitly instead. */
  justify-items: start;
}
.menu__foot .btn { width: 100%; }

@media (max-width: 1080px) {
  .nav__list { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav { gap: var(--s-4); }
}
@media (max-width: 560px) {
  .nav__cta { display: none; }
}

/* Sticky mobile booking bar — appears once the hero has passed. */
.book-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  display: none;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4)
           calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 242, 236, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--c-border);
  transform: translateY(100%);
  transition: transform var(--d-base) var(--e-out);
}
.book-bar.is-shown { transform: none; }
.book-bar__price { display: grid; align-content: center; line-height: 1.25; }
.book-bar .btn { flex: 1; }
@media (max-width: 720px) { .book-bar { display: flex; } body { padding-bottom: 0; } }

/* --------------------------------------------------------------------------
   FORMS
   Visible labels always. Errors inline, tied by aria-describedby.
   -------------------------------------------------------------------------- */
.field { display: grid; gap: var(--s-2); }
.field__label {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.field__req { color: var(--c-accent); }
.field__hint { font-size: var(--t-caption); color: var(--c-text-faint); }

.input, .select, .textarea {
  width: 100%;
  min-height: 52px;
  padding: var(--s-3) var(--s-4);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: var(--t-body);
  color: var(--c-text);
  transition: border-color var(--d-fast) var(--e-out),
              background-color var(--d-fast) var(--e-out);
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 132px; padding-top: var(--s-4); resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--c-text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: #BDB7AA; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--c-ink);
  outline: 1px solid var(--c-ink);
  outline-offset: 0;
}
.select {
  /* Chevron drawn in CSS — no icon font, no SVG sprite. */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--c-text-muted) 50%),
    linear-gradient(135deg, var(--c-text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: var(--s-8);
  cursor: pointer;
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--c-fail); }

.field__error {
  display: none;
  font-size: var(--t-caption);
  color: var(--c-fail);
}
.field.has-error .field__error { display: block; }

/* Error summary at the top of a form — focus lands here after a failed submit. */
.error-summary {
  display: none;
  padding: var(--s-5);
  border: 1px solid var(--c-fail);
  background: var(--c-fail-bg);
  border-radius: var(--radius);
}
.error-summary.is-shown { display: block; }
.error-summary h3 {
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-fail);
  margin-bottom: var(--s-3);
}
.error-summary ul { display: grid; gap: var(--s-2); }
.error-summary a { font-size: var(--t-body-s); text-decoration: underline; text-underline-offset: 3px; }

.form-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}

/* Stepper — number of guests. */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
}
.stepper__btn {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.125rem;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color var(--d-fast) var(--e-out), background-color var(--d-fast) var(--e-out);
}
.stepper__btn:hover:not([disabled]) { color: var(--c-ink); background: var(--c-surface-sunk); }
.stepper__btn[disabled] { opacity: 0.3; cursor: not-allowed; }
.stepper__value {
  min-width: 56px;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: var(--t-body-l);
}

/* Radio cards — payment method, accommodation choice. */
.choice { display: grid; gap: var(--s-3); }
.choice__item { position: relative; }
.choice__item input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}
.choice__body {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-5);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  transition: border-color var(--d-fast) var(--e-out),
              box-shadow var(--d-fast) var(--e-out);
}
.choice__item:hover .choice__body { border-color: #BDB7AA; }
.choice__item input:checked + .choice__body {
  border-color: var(--c-ink);
  box-shadow: inset 0 0 0 1px var(--c-ink);
}
.choice__item input:focus-visible + .choice__body {
  outline: 2px solid var(--c-ink);
  outline-offset: 3px;
}
.choice__title { font-size: var(--t-body); font-weight: 500; }
.choice__meta { font-size: var(--t-caption); color: var(--c-text-muted); }

/* Checkbox — square, hairline, no custom SVG. */
.check { display: flex; gap: var(--s-3); align-items: flex-start; cursor: pointer; }
.check input {
  flex: none;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  accent-color: var(--c-ink);
  cursor: pointer;
}
.check span { font-size: var(--t-body-s); color: var(--c-text-muted); }

/* --------------------------------------------------------------------------
   STATUS
   Muted, typographic. A small square mark carries the colour, not a pill.
   -------------------------------------------------------------------------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  white-space: nowrap;
}
.status::before {
  content: '';
  width: 6px; height: 6px;
  flex: none;
  background: currentColor;
}
.status--ok      { color: var(--c-ok); }
.status--pending { color: var(--c-pending); }
.status--fail    { color: var(--c-fail); }
.status--neutral { color: var(--c-text-faint); }

/* Notices — inline, never a floating toast. */
.notice {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-left: 2px solid var(--c-border);
  background: var(--c-surface-sunk);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--t-body-s);
  color: var(--c-text-muted);
}
.notice strong { color: var(--c-text); font-weight: 500; }
.notice--error   { border-left-color: var(--c-fail); background: var(--c-fail-bg); }
.notice--ok      { border-left-color: var(--c-ok); background: var(--c-ok-bg); }
.notice--pending { border-left-color: var(--c-pending); background: var(--c-pending-bg); }

/* Empty state. */
.empty {
  display: grid;
  gap: var(--s-3);
  justify-items: start;
  padding: var(--s-8) 0;
  border-top: 1px solid var(--c-border);
}
.empty[hidden] { display: none; }

/* --------------------------------------------------------------------------
   CALENDAR
   Custom, typographic. Range selection, blocked dates, min-stay.
   -------------------------------------------------------------------------- */
/* Reserve the calendar's height before JS builds it.
   Without this the whole page below jumps down when the calendar appears —
   it was the largest remaining layout shift on both the booking flow and the
   accommodation pages. Values are the measured rendered heights
   (`node tools/perf.mjs`), rounded up. Too small and it still shifts; too
   large and it leaves a gap, so re-measure if the calendar's structure
   changes. */
[data-calendar] { min-height: 560px; }
@media (max-width: 860px) { [data-calendar] { min-height: 500px; } }
@media (max-width: 400px) { [data-calendar] { min-height: 470px; } }

.calendar { display: grid; gap: var(--s-6); }
.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
}
/* Month navigation: labelled buttons either side of a month menu, so moving
   past the first two months is obvious (the old bare chevrons were missed). */
.calendar__nav { display: flex; align-items: center; gap: var(--s-2); }
.calendar__navbtn {
  height: 48px;
  min-width: 48px;
  padding: 0 var(--s-5);
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  border: 1px solid var(--c-ink);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-ink);
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.calendar__navbtn:hover:not([disabled]) { background: var(--c-ink); color: var(--c-white); }
.calendar__navbtn[disabled] { opacity: 0.3; cursor: not-allowed; }
/* Chevron from a rotated square — no icon dependency. */
.calendar__navbtn i {
  width: 9px; height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 3px;
  flex: none;
}
.calendar__navbtn--next i { transform: rotate(-135deg); margin-left: 0; margin-right: 3px; }
.calendar__nav .cselect, .calendar__jump { min-width: 11.5rem; }
.calendar__nav .cselect__button, .calendar__jump { height: 48px; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 560px) {
  .calendar__head { display: grid; }
  .calendar__nav { width: 100%; }
  .calendar__nav .cselect, .calendar__jump { flex: 1; min-width: 0; }
  .calendar__navtext { display: none; }
  .calendar__navbtn { padding: 0; width: 48px; }
}

.calendar__months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-8);
}
@media (max-width: 860px) { .calendar__months { grid-template-columns: 1fr; gap: var(--s-7); } }

.calendar__month { display: grid; gap: var(--s-4); }
.calendar__caption {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  text-align: center;
}
/* The month is a real table so row/column semantics reach screen readers;
   table-layout:fixed gives the seven equal columns a grid would have. */
.calendar__table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.calendar__table td { padding: 0; text-align: center; }
.calendar__caption { caption-side: top; }
.calendar__dow {
  padding-bottom: var(--s-3);
  text-align: center;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-faint);
}

.day {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 44px;
  display: grid;
  place-items: center;
  font-size: var(--t-body-s);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--c-text);
  cursor: pointer;
  background: none;
  border: 0;
  transition: background-color var(--d-fast) var(--e-out),
              color var(--d-fast) var(--e-out);
}
/* Leading/trailing blanks. Not days, so they don't carry the .day class. */
.calendar__pad { visibility: hidden; pointer-events: none; }
.day:hover:not(:disabled) { background: var(--c-sand); }

/* Unavailable: struck through, not merely greyed, so it reads without colour. */
.day:disabled { color: var(--c-text-faint); cursor: not-allowed; opacity: 0.55; }
.day--blocked::after {
  content: '';
  position: absolute;
  left: 26%; right: 26%;
  top: 50%;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.day--past { opacity: 0.28; }

.day--in-range { background: var(--c-sand); }
.day--start, .day--end {
  background: var(--c-ink);
  color: var(--c-text-invert);
  font-weight: 500;
}
/* The `:not(:disabled)` in the hover rule above contributes its argument's
   specificity, making it (0,3,0). These have to match it or a hovered
   selected day reverts to the sand hover fill and its pale text becomes
   unreadable. Do not simplify to `.day--start:hover`. */
.day--start:hover:not(:disabled),
.day--end:hover:not(:disabled) {
  background: var(--c-ink);
  color: var(--c-text-invert);
}
.day--preview { background: var(--c-surface-sunk); }
.day--today::before {
  content: '';
  position: absolute;
  bottom: 18%;
  width: 3px; height: 3px;
  /* A mark, not text: the lighter bronze is fine here. */
  background: var(--c-accent-mark);
}
.day--start.day--today::before, .day--end.day--today::before { background: var(--c-bg); }

.calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--c-border);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-caption);
  color: var(--c-text-muted);
}
.legend-swatch { width: 14px; height: 14px; border: 1px solid var(--c-border); }
.legend-swatch--sel { background: var(--c-ink); border-color: var(--c-ink); }
.legend-swatch--free { background: var(--c-white); }
.legend-swatch--busy { background: var(--c-surface-sunk); position: relative; }
.legend-swatch--busy::after {
  content: '';
  position: absolute;
  left: 2px; right: 2px; top: 50%;
  height: 1px;
  background: var(--c-text-faint);
}

/* --------------------------------------------------------------------------
   BOOKING SUMMARY — the price ledger. Nothing is hidden.
   -------------------------------------------------------------------------- */
.summary {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.summary__nights {
  font-family: var(--font-display);
  font-size: var(--t-display-s);
  font-weight: 300;
  line-height: 1;
}
.ledger { display: grid; gap: var(--s-3); }
.ledger__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  font-size: var(--t-body-s);
}
.ledger__row span:first-child { color: var(--c-text-muted); min-width: 0; }
/* The amount is the thing being read; it must never break across lines. */
.ledger__row span:last-child {
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.ledger__row--total {
  padding-top: var(--s-4);
  margin-top: var(--s-2);
  border-top: 1px solid var(--c-border);
  font-size: var(--t-body-l);
}
.ledger__row--total span:first-child {
  color: var(--c-text);
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.ledger__row--total span:last-child { font-family: var(--font-display); font-size: 1.5rem; }
.ledger__note { font-size: var(--t-caption); color: var(--c-text-faint); }

/* --------------------------------------------------------------------------
   LIGHTBOX
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(18, 18, 16, 0.97);
  color: var(--c-text-invert);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--d-base) var(--e-out), visibility var(--d-base) step-end;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity var(--d-base) var(--e-out), visibility 0s; }
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-gutter);
}
.lightbox__stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 var(--s-4);
  min-height: 0;
  touch-action: pan-y;
}
.lightbox__img {
  max-width: min(96vw, 1400px);
  max-height: 100%;
  width: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--d-base) var(--e-out);
}
.lightbox__img.is-ready { opacity: 1; }
.lightbox__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-gutter) var(--s-6);
}
.lightbox__caption { font-family: var(--font-display); font-size: 1.25rem; font-weight: 300; }
.lightbox__count { font-size: var(--t-label); letter-spacing: var(--ls-label); opacity: 0.6; font-variant-numeric: lining-nums tabular-nums; }
.lightbox__ctrl {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.72;
  cursor: pointer;
  transition: opacity var(--d-fast) var(--e-out);
}
.lightbox__ctrl:hover:not([disabled]) { opacity: 1; }
.lightbox__ctrl[disabled] { opacity: 0.22; cursor: default; }
.lightbox__arrows { display: flex; gap: var(--s-2); }
.lightbox__ctrl i {
  width: 9px; height: 9px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  margin-left: 4px;
}
.lightbox__ctrl--next i { transform: rotate(-135deg); margin-left: -4px; }
/* Close: two crossed rules. */
.lightbox__ctrl--close i {
  width: 16px; height: 16px;
  border: 0;
  position: relative;
  margin: 0;
  transform: none;
}
.lightbox__ctrl--close i::before,
.lightbox__ctrl--close i::after {
  content: '';
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 1px;
  background: currentColor;
}
.lightbox__ctrl--close i::before { transform: rotate(45deg); }
.lightbox__ctrl--close i::after  { transform: rotate(-45deg); }

@media (max-width: 720px) {
  .lightbox__foot { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
}

/* --------------------------------------------------------------------------
   TABLE (admin + booking lists)
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-body-s); }
.table th, .table td {
  padding: var(--s-4) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
  white-space: nowrap;
}
.table th {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
  border-bottom-color: var(--c-ink);
}
.table tbody tr { transition: background-color var(--d-fast) var(--e-out); }
.table tbody tr:hover { background: var(--c-surface-sunk); }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child,  .table th:last-child  { padding-right: 0; }

/* Definition pairs — used for guest details, sleeping, rules. */
.pairs { display: grid; gap: 0; }
.pair {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr);
  gap: var(--s-4);
  padding-block: var(--s-4);
  border-bottom: 1px solid var(--c-border);
  align-items: baseline;
}
.pair:first-child { border-top: 1px solid var(--c-border); }
.pair dt {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.pair dd { font-size: var(--t-body-s); }
@media (max-width: 560px) {
  .pair { grid-template-columns: 1fr; gap: var(--s-1); }
}

/* The header's account link. Its text is swapped once the session is known
   ("Sign in" → a first name), so a minimum width is reserved for it: without
   one, the swap reflows the nav row and shows up as cumulative layout shift.
   Declared here rather than in account.css because the header is on every
   page and account.css is not. */
.nav__account {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 7ch;
  justify-content: flex-end;
  font-size: var(--t-caption);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding: var(--s-2) 0;
  min-height: 44px;
  white-space: nowrap;
}
/* Hidden when there is no backend to sign in to — but with its box kept.
   `display: none` here reflows the whole nav row and puts cumulative layout
   shift back on every page; `visibility: hidden` reserves the space, and
   still takes the link out of the tab order. */
.nav__account--off { visibility: hidden; }
.nav__account::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-accent-mark);
  flex: none;
}
/* Below 560px the wordmark and the menu button are all that fit across the
   header. The account link moves into the menu itself, where renderHeader()
   puts a second copy of it — declared here, after the base rule above, so it
   actually wins. */
@media (max-width: 560px) {
  .nav__account { display: none; }
}

/* Filter toolbar (gallery). The admin has its own copy in admin.css; the public
   pages never loaded it, so the gallery filters rendered as bare text. */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.toolbar .tabtn {
  padding: var(--s-2) var(--s-4);
  min-height: 42px;
  font-size: var(--t-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--d-fast) var(--e-out), background-color var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out);
}
.toolbar .tabtn:hover { border-color: var(--c-ink); color: var(--c-ink); }
.toolbar .tabtn[aria-pressed='true'] { background: var(--c-ink); color: var(--c-text-invert); border-color: var(--c-ink); }
.toolbar .tabtn:active { transform: translateY(1px); }
/* On a phone eight filters wrapped to four rows and pushed every photograph
   below the fold. One row that swipes instead, fading out at the edge so it
   reads as "there is more". */
@media (max-width: 860px) {
  .toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin-inline: calc(var(--s-gutter) * -1);
    padding-inline: var(--s-gutter);
    scroll-padding-inline: var(--s-gutter);
    /* Without this the row's full width is its min-content, and the grid
       column around it stretches past the screen, taking the lede with it. */
    contain: inline-size;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .tabtn { flex: none; }
}

/* Booking: rooms grouped, and a room already taken for the chosen dates. */
.choice__group { margin-top: var(--s-4); }
.choice__group:first-child { margin-top: 0; }
.choice__item.is-taken .choice__body { opacity: 0.55; cursor: not-allowed; }
.choice__item.is-taken:hover .choice__body { border-color: var(--c-line); }

/* Booking: several rooms can be ticked. A visible square says so, since the
   real checkbox is invisible over the card. */
.choice__item--multi .choice__tick {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  width: 22px;
  height: 22px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-white);
  pointer-events: none;
  transition: background var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out);
}
.choice__item--multi input:checked + .choice__body .choice__tick {
  background: var(--c-ink);
  border-color: var(--c-ink);
}
.choice__item--multi input:checked + .choice__body .choice__tick::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--c-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.choice__item--multi .choice__title { padding-right: var(--s-7); }
.choice__note { font-size: var(--t-caption); margin-top: calc(-1 * var(--s-2)); }
.choice__status { display: grid; gap: var(--s-3); }
.choice__status:empty { display: none; }
.choice__summary {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: var(--t-body-s);
  font-variant-numeric: lining-nums tabular-nums;
}
.choice__summary.is-short { border-color: var(--c-fail); background: var(--c-fail-bg); }
.choice__deal { margin-top: 0; }
.choice__deal .btn { justify-self: start; margin-top: var(--s-3); }

/* ── In-page dropdown (ui/select.js) ──────────────────────────────────────
   Replaces the operating system's picker. The real <select> stays in the DOM,
   hidden, so forms and validation still work. */
.cselect { position: relative; width: 100%; align-self: start; }
.cselect[hidden], .cselect__list[hidden] { display: none; }
.cselect__native {
  position: absolute; inset: 0 auto auto 0;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
  overflow: hidden; clip-path: inset(50%);
}
.cselect__button { text-align: left; display: flex; align-items: center; }
.cselect__button:disabled { opacity: 0.55; cursor: not-allowed; }
.cselect__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect__value.is-empty { color: var(--c-text-faint); }
.cselect.is-open .cselect__button { border-color: var(--c-ink); }
.cselect.is-invalid .cselect__button { border-color: var(--c-fail); }
.cselect__list {
  position: absolute; z-index: 60; inset: calc(100% + 4px) 0 auto 0;
  max-height: min(18rem, 46svh); overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: var(--s-1) 0; list-style: none;
  background: var(--c-white); color: var(--c-text);
  border: 1px solid var(--c-ink); border-radius: var(--radius);
  box-shadow: 0 18px 40px -18px rgba(23, 23, 21, 0.35);
  animation: cselect-in var(--d-fast) var(--e-out);
}
.cselect.is-up .cselect__list { inset: auto 0 calc(100% + 4px) 0; }
.cselect__option {
  min-height: 44px; padding: var(--s-3) var(--s-4);
  display: flex; align-items: center; cursor: pointer; font-size: var(--t-body);
}
.cselect__option.is-active { background: var(--c-surface-sunk); }
.cselect__option[aria-selected="true"] { font-weight: 500; box-shadow: inset 3px 0 0 var(--c-accent); }
@keyframes cselect-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cselect__list { animation: none; } }
/* On dark grounds (sign-in gate, royal sections) */
.authgate .cselect__list, .section--royal .cselect__list { background: var(--c-indigo-raised); color: var(--c-text-invert); border-color: var(--c-brass); }
.authgate .cselect__option.is-active, .section--royal .cselect__option.is-active { background: rgba(240, 237, 230, 0.1); }
/* Admin toolbars size selects to their content. */
.toolbar .cselect, .toolbar--tight .cselect { width: auto; min-width: 180px; }

/* Room cards with a photograph (booking page, room step). */
.choice__item.has-photo .choice__body {
  padding: 0; overflow: hidden;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 0; align-items: stretch;
}
.choice__photo { display: block; aspect-ratio: 3 / 2; background: var(--c-surface-sunk); overflow: hidden; }
/* Beside the text the photo takes the card's height, never wider than its
   column (a fixed 3:2 grew past 240px on cards with longer text). */
.choice__item.has-photo .choice__photo { aspect-ratio: auto; min-height: 160px; }
.choice__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--d-slow) var(--e-out); }
.choice__item:hover .choice__photo img { transform: scale(1.03); }
.choice__text { display: grid; gap: var(--s-1); padding: var(--s-5); align-content: center; }
.choice__blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.choice__item.is-taken .choice__photo img { filter: grayscale(1); opacity: 0.6; }
@media (max-width: 640px) {
  .choice__item.has-photo .choice__body { grid-template-columns: 1fr; }
  .choice__item.has-photo .choice__photo { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) { .choice__item:hover .choice__photo img { transform: none; } }

/* Sign-up "About you" block (data/onboarding.js). */
.onboarding__title { margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--c-border-invert); }
.auth .onboarding__title { border-top-color: var(--c-border); }
.field__opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--c-text-faint); }
.authgate .field__opt { color: var(--c-on-royal-muted); }
