/* ==========================================================================
   Sovana — AVAILABILITY (results) page. Layered on styles-alt.css.
   STRUCTURE after the earlier build (~/Sovana/availability.html): an editable
   search bar on top, the heading, one meta line, then one HORIZONTAL row per
   residence — photo | name, specs and copy | rate column behind a hairline.
   STYLE is the home page's: square, Source Serif 4 over Lato via .t-* only,
   hairlines instead of cards, outline buttons that fill on hover.
   Brief ② (brief-desain.md §5): every row carries the same fields in the
   same place, so the eye runs down one column — the rate column is fixed
   width for exactly that reason.
   ========================================================================== */

/* The nav is solid from the first paint here: there is no hero under it.
   The top padding clears the fixed nav (~93px) plus a section's breath. */
.avail { padding-top: max(calc(var(--section-y) + 20px), 132px); }


/* ── The search bar, in the page's flow ───────────────────────────────────
   The home bar's markup and picker script (picker.js), but not floating:
   it sits at the top of the results as the thing you edit. White, so it
   has to be lifted — hairline ring plus the card shadow. It is always in
   its expanded state, which is what the phone rules key on. */
.book.book--inline {
  position: relative; z-index: 5;
  left: auto; bottom: auto; transform: none;
  width: 100%;
  margin-bottom: clamp(48px, 6vw, 80px);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--hairline-color), var(--shadow-card);
}
.book.book--inline::before { content: none; }   /* solid white: no frost */
/* The action is the home bar's own outline button (styles-alt.css). */
/* Panels DROP here — the bar is at the top of the page, not the foot. */
.book--inline .pick__panel {
  top: 100%; bottom: auto; transform: translateY(-4px); max-height: none;
}
.book--inline .pick.is-open .pick__panel { transform: none; }


/* ── Head + meta ───────────────────────────────────────────────────────── */
.avail__head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  margin-bottom: var(--head-gap);
}
.avail__head h1 { margin: 0; color: var(--green); }



/* ── Toolbar · after wyejunction.com/floor-plans ────────────────────────
   Their three controls — Filter with the count beside it, Sort by, View —
   on a hairline band instead of their dark bar: a green band is already
   spoken for on this page by the 30-night line. */
.tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding: 14px 0;
  border-block: var(--hairline);
}
.tools__left, .tools__right { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.tools__count { margin: 0; color: var(--muted); }
.tools__count b { font-weight: var(--weight-regular); color: var(--green); }
.tools__label { color: var(--muted); }

/* Sort: the site's own picker (picker.js enhances select[data-pick]),
   boxed here so it reads as a control inside a toolbar. */
.tools__sort { display: flex; align-items: center; gap: 12px; }
.tools__sort .pick { min-width: 190px; }
.tools__sort .pick__btn {
  min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(14, 43, 33, .28); color: var(--green);
}
.tools__sort .pick__panel { top: calc(100% + 6px); z-index: 6; }
.tools__sort .pick__btn:focus-visible { outline: 2px solid var(--gold-700); outline-offset: 3px; }

/* View: a segmented pair, one square box split by a hairline. */
.tools__view { display: flex; align-items: center; gap: 12px; }
.seg { display: inline-flex; border: 1px solid rgba(14, 43, 33, .28); }
.seg button {
  min-height: 42px; padding: 0 16px;
  background: none; border: 0; color: var(--green); cursor: pointer;
  transition: background-color var(--dur-quick) var(--ease-out), color var(--dur-quick) var(--ease-out);
}
.seg button + button { border-left: 1px solid rgba(14, 43, 33, .28); }
.seg button:hover { background: rgba(14, 43, 33, .06); }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--ivory); }
.seg button:focus-visible { outline: 2px solid var(--gold-700); outline-offset: -4px; }



/* ── FLOOR PLANS view · Wye's card, this site's material ────────────────
   Name and tags on top, the plan as the picture, three figures on one
   line, the action at the foot. Plan paper as the card ground, a hairline
   box — no shadow, it is not lifted. */
.plans-grid {
  list-style: none; margin: 0; padding: clamp(28px, 3vw, 40px) 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;   /* 20 between cards, every page (2026-09-28) */
}
.plans-grid > .empty { grid-column: 1 / -1; }
.pcard {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(20px, 2vw, 28px);
  background: var(--ivory); border: 1px solid rgba(14, 43, 33, .16);
}
.pcard__head { display: flex; flex-direction: column; gap: 12px; }
.pcard__name { margin: 0; color: var(--green); }
.pcard__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pcard__tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border: 1px solid rgba(14, 43, 33, .28); color: var(--green);
}
.pcard__tag--no { background: var(--green); color: var(--ivory); border-color: var(--green); }
/* the plan is a button: it opens the viewer */
.pcard__plan {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0;
  background: none; border: 0; cursor: zoom-in;
}
/* absolute, not height: 100% — a percentage height does not resolve inside
   a <button>, and the tall Grande plan set its own height instead */
.pcard__plan img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pcard__plan:focus-visible { outline: 2px solid var(--gold-700); outline-offset: 4px; }
.pcard__facts {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; margin: 0;
  padding-top: 16px; border-top: var(--hairline);
}
.pcard__facts div { min-width: 0; }
.pcard__facts dt { color: var(--muted); }
.pcard__facts dd { margin: 4px 0 0; color: var(--green); font-variant-numeric: tabular-nums; }
.pcard__sub { margin: -10px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcard__act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: auto; }
.pcard__act .btn { flex: 1 1 auto; }

.pcard.is-skeleton .sk { display: block; background: rgba(14, 43, 33, .07); height: 14px; }
.pcard.is-skeleton .sk--title { height: 28px; width: 60%; }
.pcard.is-skeleton .sk--short { width: 35%; }
.pcard.is-skeleton .sk--plan { height: auto; aspect-ratio: 4 / 3; }
.pcard.is-skeleton .sk--line { width: 80%; }
.pcard.is-skeleton .sk--btn { height: 48px; }
@media (prefers-reduced-motion: no-preference) {
  .pcard.is-skeleton .sk { animation: sk-pulse 1.6s var(--ease-out) infinite alternate; }
}


/* ── 30 nights or more — one prominent line, not a banner ──────────────
   Brief §5 / §7: the daily results stay; above them sits ONE line saying a
   monthly rate exists and WhatsApp is the way to it. It cannot be closed
   and it is not a modal. Green band: structure, not alert. */
.longstay {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px; align-items: center;
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 40px);
  margin-bottom: clamp(28px, 3vw, 40px);
  background: var(--green); color: var(--ivory);
}
.longstay__copy { display: flex; flex-direction: column; gap: 8px; }
.longstay__copy h2 { margin: 0; }
.longstay__copy p { margin: 0; color: rgba(252, 251, 248, .82); max-width: 62ch; }


/* ── The rows ────────────────────────────────────────────────────────────
   Photo | body | rate. The rate column is a FIXED width so its price and
   its button line up down the whole list. Rows are split by a hairline
   above and below; there is no vertical rule before the rate (both
   2026-09-23, by request). */
.rows {
  list-style: none; margin: 0; padding: 0;
  border-bottom: var(--hairline);
}
/* the toolbar's own bottom rule is the first row's top edge */
.row:first-child { border-top: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr) 300px;
  align-items: stretch;
  padding-block: clamp(28px, 3vw, 40px);
  border-top: var(--hairline);
}

.row__media {
  margin: 0; aspect-ratio: 4 / 3; overflow: hidden; align-self: center;
  background: var(--ivory);
}
.row__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  outline: 1px solid oklch(0 0 0 / .1); outline-offset: -1px;
}
/* Two and Grande have no photograph of their own (brief §6): the plan is
   the only honest picture, so it leads, on its own paper. */
.row__media--plan img { object-fit: contain; padding: 10px; outline: 0; }

.row__body {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 14px; padding: 28px clamp(24px, 3vw, 48px); min-width: 0;
}
.row__name { margin: 0; color: var(--green); }
/* the collection card's spec list, laid in a line */
.row__specs {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 22px;
}
.row__specs li { display: flex; align-items: center; gap: 8px; color: var(--green); white-space: nowrap; }
.row__desc { margin: 0; color: var(--muted); max-width: 52ch; }
.row__flag {
  display: inline-flex; padding: 4px 10px;
  border: 1px solid rgba(14, 43, 33, .28); color: var(--green);
}

/* "Floor plan" is an underline action, like "Discover more" on the cards */
.row__plan {
  position: relative; padding: 5px 0;
  background: none; border: 0; cursor: pointer; color: var(--green);
}
.row__plan::after, .empty__wa::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform var(--duration) var(--ease-out);
}
.row__plan:hover::after, .empty__wa:hover::after { transform: scaleX(1); }
.row__plan:focus-visible, .empty__wa:focus-visible { outline: 2px solid var(--gold-700); outline-offset: 4px; }

/* The rate column: label, figure, the line under it, then the action. */
.row__rate {
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 4px;
  padding: 28px 0 28px clamp(24px, 2.6vw, 40px);
}
.row__label { color: var(--muted); }
.row__amount { margin: 0; color: var(--green); font-variant-numeric: tabular-nums; }
.row__sub { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.row__rate .btn { margin-top: 18px; width: 100%; white-space: nowrap; }
.row__none { margin: 0; color: var(--muted); }

/* LOADING — skeleton, not spinner: the layout is already known. */
.row.is-skeleton .sk { display: block; background: rgba(14, 43, 33, .07); height: 14px; }
.row.is-skeleton .row__media { background: rgba(14, 43, 33, .07); }
.row.is-skeleton .sk--title { height: 32px; width: 55%; }
.row.is-skeleton .sk--line { width: 80%; }
.row.is-skeleton .sk--short { width: 40%; }
.row.is-skeleton .sk--btn { height: 50px; margin-top: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .row.is-skeleton .sk, .row.is-skeleton .row__media {
    animation: sk-pulse 1.6s var(--ease-out) infinite alternate;
  }
}
@keyframes sk-pulse { from { opacity: 1; } to { opacity: .45; } }

/* NOTHING AVAILABLE */
.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: clamp(40px, 6vw, 80px) 0; border-block: var(--hairline);
}
.empty h2 { margin: 0; color: var(--green); }
.empty p  { margin: 0; color: var(--muted); max-width: 56ch; }
.empty__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 8px; }
.empty__wa { position: relative; padding-block: 5px; color: var(--green); }

.avail__note { margin: 20px 0 0; color: var(--muted); max-width: 72ch; }


/* ── Floor-plan viewer ─────────────────────────────────────────────────
   Brief §6: plans open in a viewer rather than a carousel, and the viewer
   steps between layouts — the cheapest honest way to compare two plans.
   Native <dialog>: focus held inside, Escape closes, focus returns. */
.planbox {
  width: min(1100px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100svh - 48px);
  padding: 0; border: 0; color: var(--ink);
  background: var(--ivory);
  box-shadow: var(--shadow-soft);
}
.planbox::backdrop { background: rgba(0, 0, 0, .62); }
.planbox__in { display: flex; flex-direction: column; max-height: inherit; }
.planbox__head, .planbox__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 24px;
}
.planbox__head { border-bottom: var(--hairline); }
.planbox__foot { border-top: var(--hairline); }
.planbox__title { margin: 0; color: var(--green); }
.planbox__cap   { margin: 0; color: var(--muted); }
.planbox__fig { margin: 0; flex: 1; min-height: 0; display: grid; place-items: center; padding: 24px; }
.planbox__fig { position: relative; }   /* anchors .plans__label once the plan is inlined */
.planbox__fig img { max-width: 100%; max-height: calc(100svh - 260px); object-fit: contain; }
.planbox__fig svg { display: block; width: 100%; height: auto; max-height: calc(100svh - 260px); }
.planbox__close, .planbox__step {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
  color: var(--green);
  transition: opacity var(--dur-quick) var(--ease-out), scale var(--dur-quick) var(--ease-out);
}
.planbox__close:hover, .planbox__step:hover { opacity: .7; }
.planbox__close:active, .planbox__step:active { scale: .96; }
.planbox__close:focus-visible, .planbox__step:focus-visible { outline: 2px solid var(--gold-700); outline-offset: 2px; }
.planbox__step svg, .planbox__close svg { width: 17px; height: 17px; }
.planbox__step--prev svg { transform: scaleX(-1); }


/* ── Narrow ──────────────────────────────────────────────────────────── */
/* the last field's panel opens from the right edge, so it cannot run off it */
@media (max-width: 1080px) {
  .book--inline .pick--guests .pick__panel { left: auto; right: 0; }
}
@media (max-width: 1080px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .plans-grid { grid-template-columns: 1fr; }
  /* VERTICAL on phones (2026-09-29, by request): each label over its
     control, the two groups stacked; the controls keep their own width
     (full width was tried and turned back) */
  .tools__right { width: 100%; flex-direction: column; align-items: flex-start; gap: 20px; }
  .tools__sort, .tools__view { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 1180px) {
  .row { grid-template-columns: minmax(0, 380px) minmax(0, 1fr) 260px; }
}
/* Below 900 a row stacks: photo, body, then the rate as its own band under
   a hairline — figure left, action right, so the price never squeezes. */
@media (max-width: 900px) {
  /* the title sits closer to the toolbar under it (2026-09-29, by request) */
  .avail__head { margin-bottom: 24px; }
  /* stacked: more air between residences, and the rate a step down
     (2026-09-29, by request — 28 / 40 before) */
  .row { grid-template-columns: 1fr; padding-block: 56px; }
  .row__amount { font-size: var(--size-20); }
  .row__media { aspect-ratio: 16 / 10; }
  .row__body { padding: 20px 0 18px; }
  .row__rate {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px; row-gap: 2px; align-items: end;
    padding: 18px 0 0; border-top: var(--hairline);
  }
  .row__rate > :not(.btn) { grid-column: 1; }
  .row__rate .btn { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; width: auto; }
  .longstay { grid-template-columns: 1fr; }
  .longstay .btn { width: 100%; }
  .planbox__head, .planbox__foot { padding: 14px 16px; }
  .planbox__fig { padding: 12px; }
}
@media (max-width: 480px) {
  .row__rate { grid-template-columns: 1fr; }
  .row__rate .btn { grid-column: 1; grid-row: auto; width: 100%; margin-top: 14px; }
}


/* the residence name opens its page — the underline wipe on hover */
.row__name a, .pcard__name a { color: inherit; background: linear-gradient(var(--gold), var(--gold)) left bottom / 0 1px no-repeat; transition: background-size var(--duration) var(--ease-out); }
.row__name a:hover, .pcard__name a:hover { background-size: 100% 1px; }
.row__name a:focus-visible, .pcard__name a:focus-visible { outline: 2px solid var(--gold-700); outline-offset: 4px; }

/* one-line notice above the toolbar — a released hold */
.notice {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 20px; padding: 14px 18px;
  background: var(--ivory); color: var(--green);
  border-left: 2px solid var(--gold);
}
