/* Floor plans page: a brochure-style plan sheet (spec column, levels side by side, numbered key).
   Uses the site tokens from styles.css. */
.plans-page {
  background-color: var(--essentials); color: var(--upper);
}
.plans-page .site-nav { background: var(--essentials); padding-top: 22px; padding-bottom: 22px; }
.plans-page .site-nav .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.plans-page .explore-btn { --fill: var(--upper); }
.plans-page .explore-btn:hover, .plans-page .explore-btn[aria-expanded="true"] { color: var(--essentials); }

.fp {
  --hair: color-mix(in srgb, var(--upper) 30%, transparent);
  --muted: var(--muted-dark);
  --caps: 700 10px/1.2 var(--sans);
  max-width: 1440px; margin: 0 auto; padding: 160px var(--pad) 40px; font-size: 14px; font-variant-numeric: lining-nums;
}
.fp-tip { font-variant-numeric: lining-nums; }
.fp__caps { font: var(--caps); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fp__sheet { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 0 64px; align-items: start; }

/* ---- spec column ---- */
.fp__spec { display: flex; flex-direction: column; text-align: center; }
@media (min-height: 1020px) { .fp__spec { position: sticky; top: 128px; } }

.fp__picker { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 0 16px; }
.fp-key__lbl { position: absolute; font: var(--caps); font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; pointer-events: none; }
.fp-key__lbl--b2, .fp-key__lbl--b1 { left: -8px; transform: translate(-100%, -50%); }
.fp-key__lbl--b2 { top: 30%; }
.fp-key__lbl--b1 { top: 69.5%; }
.fp-key__lbl--drive { left: 44%; top: 49.5%; transform: translate(-50%, -50%); font: 400 11px/1 var(--serif); letter-spacing: .04em; text-transform: none; }
.fp-key__lbl--st { left: 93.5%; top: 50%; transform: translate(-50%, -50%) rotate(90deg); }

/* title with previous / next villa arrows */
.fp__titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fp-arrow { width: 40px; height: 32px; display: grid; place-items: center; color: var(--upper); opacity: .55; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.fp-arrow svg, .fp-step svg { width: 22px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.fp-arrow:hover { opacity: 1; }
.fp-arrow[data-unit-step="-1"]:hover { transform: translateX(-3px); }
.fp-arrow[data-unit-step="1"]:hover { transform: translateX(3px); }

.fp__rule { border-top: 1px solid var(--hair); padding: 14px 0; }
.fp__title { font: 500 clamp(26px, 2.1vw, 32px)/1.1 var(--serif); }
.fp__lines p { font: 400 17px/1.45 var(--serif); }

/* areas table with a solid total row */
.fp__areas { width: 100%; border-collapse: collapse; border-top: 1px solid var(--hair); font-size: 14px; }
.fp__areas td { padding: 11px 6px; border-bottom: 1px solid var(--hair); color: var(--upper); }
.fp__areas td:first-child { text-align: left; padding-left: 14px; }
.fp__areas td:nth-child(2) { text-align: center; color: var(--muted); }
.fp__areas td:last-child { text-align: right; padding-right: 14px; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.fp__areas tr.is-total td { background: var(--upper); color: var(--essentials); font-weight: 700; border-bottom: 0; }
.fp__areas tr[data-tip] { cursor: help; }
.fp__areas tr[data-tip]:hover td:not(.x) { background: color-mix(in srgb, var(--ocean) 40%, transparent); }
.fp__areas tr.is-total[data-tip]:hover td { background: var(--upper-deep); }
.fp__blurb { margin-top: 18px; font: 400 15px/1.55 var(--serif); color: var(--muted); }

/* ---- plans ---- */
.fp__plans { min-width: 0; }
.fp__levels { position: relative; margin-bottom: 18px; border: 1px solid var(--hair); }
.fp__levels-row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fp__levels-ind { position: absolute; left: 0; top: 0; width: 0; height: 100%; background: var(--upper); transition: transform .55s var(--ease), width .55s var(--ease), height .55s var(--ease); }
.fp-lv {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-align: left; color: var(--upper);
  transition: color .45s var(--ease), background .3s var(--ease);
}
.fp-lv + .fp-lv { border-left: 1px solid var(--hair); }
.fp-lv:hover:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--ocean) 35%, transparent); }
.fp-lv[aria-pressed="true"] { color: var(--essentials); }
.fp-lv:focus-visible { outline: 2px solid var(--ocean); outline-offset: -4px; }
.fp-lv__txt { display: grid; gap: 3px; min-width: 0; }
.fp-lv__name { font: 500 18px/1.05 var(--serif); white-space: nowrap; }
.fp-lv__sub { font-size: 11px; line-height: 1.2; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: lining-nums; }

.fp-stage { position: relative; overflow: hidden; height: clamp(300px, calc(100svh - 470px), 560px); touch-action: pan-y; user-select: none; }
.fp-stage.is-all { height: auto; overflow: visible; }
.fp-stage.is-zoomed { cursor: grab; touch-action: none; outline: 1px solid var(--hair); }
.fp-stage.is-panning { cursor: grabbing; }
.fp-stage__zoom { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3%; transform-origin: 0 0; }
.fp-stage.is-all .fp-stage__zoom { position: relative; align-items: flex-start; }
.fp-plan { position: relative; margin: 0; height: 100%; max-width: 100%; aspect-ratio: 8569 / 8939; container-type: inline-size; }
.fp-stage.is-all .fp-plan { height: auto; flex: 1 1 0; min-width: 0; cursor: zoom-in; }
.fp-plan > img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: transform .6s var(--ease); }
.fp-stage.is-all .fp-plan::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--upper); opacity: 0; transition: opacity .35s var(--ease), inset .45s var(--ease); pointer-events: none; }
.fp-stage.is-all .fp-plan:hover::after { opacity: .5; inset: -10px; }
.fp-plan__open {
  position: absolute; left: 50%; bottom: 10px; z-index: 3; padding: 7px 12px; background: var(--upper); color: var(--essentials);
  font: var(--caps); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .3s var(--ease), transform .4s var(--ease); pointer-events: none;
}
.fp-plan:hover .fp-plan__open { opacity: 1; transform: translate(-50%, 0); }

/* numbered room markers */
.fp-pin {
  position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: clamp(14px, 5.4cqw, 26px); aspect-ratio: 1; border-radius: 50%;
  background: var(--upper); color: var(--essentials); box-shadow: 0 0 0 2px var(--floor);
  font: 700 clamp(7px, 2.5cqw, 12px)/1 var(--sans); font-variant-numeric: lining-nums; cursor: help;
  transition: background .25s var(--ease), color .25s var(--ease), scale .25s var(--ease);
}
.fp-pin:hover, .fp-pin.is-hot { background: var(--ocean); color: var(--upper); scale: 1.2; z-index: 2; }

/* captions + keys under each level */
.fp__keys { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0 3%; margin-top: 12px; }
.fp-keycol h3 { font: 500 19px/1.2 var(--serif); text-align: center; padding-bottom: 10px; }
.fp-keycol h3 button { font: inherit; color: inherit; border-bottom: 1px solid transparent; transition: border-color .3s; }
.fp-keycol h3 button:hover { border-color: currentColor; }
.fp-keycol h3 small { display: block; margin-top: 3px; font: 400 11.5px/1.2 var(--sans); font-style: normal; color: var(--muted); }
.fp-keycol ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.fp-keycol li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid color-mix(in srgb, var(--upper) 12%, transparent); font-size: 13px; cursor: default; transition: background .25s; }
.fp-keycol li:hover, .fp-keycol li.is-hot { background: color-mix(in srgb, var(--ocean) 40%, transparent); }
.fp-keycol li i { flex: none; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--upper); color: var(--essentials); font: 700 9.5px/1 var(--sans); font-style: normal; font-variant-numeric: lining-nums; }
.fp-k__size { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: lining-nums; }
.fp__keys.is-single { --cols: 1; max-width: 520px; margin-left: auto; margin-right: auto; }
.fp__keys.is-single ol { columns: 2; column-gap: 24px; }
.fp__keys.is-single li { break-inside: avoid; }

/* zoom buttons (single-level view only) */
.fp-tools { position: absolute; right: 0; bottom: 0; z-index: 4; display: flex; background: var(--essentials); }
.fp-tools[hidden] { display: none; }
.fp-tools button {
  position: relative; width: 34px; height: 32px; display: grid; place-items: center; overflow: hidden; isolation: isolate;
  border: 1px solid var(--upper); margin-left: -1px; font-size: 16px; line-height: 1; transition: color .4s var(--ease);
}
.fp-tools button.is-text { width: 48px; font: var(--caps); letter-spacing: .14em; text-transform: uppercase; }
.fp-tools button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--upper); transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease); }
.fp-tools button:hover { color: var(--essentials); }
.fp-tools button:hover::before { transform: scaleY(1); }

/* previous / next level, beside a single plan */
.fp-step {
  position: absolute; top: 50%; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 0;
  font: var(--caps); letter-spacing: .16em; text-transform: uppercase; color: var(--upper); opacity: .6;
  transform: translateY(-50%); transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.fp-step[hidden] { display: none; }
.fp-step--prev { left: 0; }
.fp-step--next { right: 0; }
.fp-step:hover { opacity: 1; }
.fp-step--prev:hover { transform: translate(-3px, -50%); }
.fp-step--next:hover { transform: translate(3px, -50%); }

/* ---- foot: scale, disclaimer ---- */
.fp__foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--hair); }
.fp__keys-hint kbd { display: inline-block; min-width: 16px; padding: 1px 4px; border: 1px solid var(--hair); font: inherit; text-align: center; }
/* the site plan is drawn north-right; it's turned to north-up here */
.fp-key { --kw: var(--kw-pick, 260px); position: relative; margin: 0; width: var(--kw); height: calc(var(--kw) * 27100 / 39275); }
.fp-key__rot { position: absolute; left: 50%; top: 50%; width: calc(var(--kw) * 27100 / 39275); height: var(--kw); transform: translate(-50%, -50%) rotate(-90deg); }
.fp-key__rot > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fp-site__unit { position: absolute; display: grid; place-items: center; color: var(--upper); transition: background .3s var(--ease), color .3s var(--ease); }
.fp-site__unit span { transform: rotate(90deg); font: 500 17px/1 var(--serif); font-variant-numeric: lining-nums; }
.fp-site__unit:hover, .fp-site__unit:focus-visible { background: color-mix(in srgb, var(--ocean) 65%, transparent); outline: none; }
.fp-site__unit.is-active { background: var(--upper); color: var(--essentials); }
.fp-site__unit.is-twin:not(.is-active) { box-shadow: inset 0 0 0 1.5px var(--upper); }
.fp-site__unit:focus-visible { outline: 2px solid var(--upper); outline-offset: -2px; }
.fp__annot { display: grid; gap: 10px; justify-items: start; }
.fp-scale { display: grid; gap: 4px; width: 80px; transition: width .4s var(--ease); }
.fp-scale__bar { display: grid; grid-template-columns: repeat(4, 1fr); height: 5px; border: 1px solid var(--upper); }
.fp-scale__bar i:nth-child(odd) { background: var(--upper); }
.fp-scale__labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.fp__note { font-size: 10.5px; line-height: 1.5; color: var(--muted); max-width: 70ch; }

/* ---- hover tooltip ---- */
.fp-tip {
  position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none;
  padding: 8px 11px 9px; background: var(--upper); color: var(--essentials); white-space: nowrap;
  font-size: 12px; line-height: 1.35; box-shadow: 0 10px 30px -14px rgba(40, 14, 6, .6);
  opacity: 0; transform: translate(-50%, calc(-100% - 14px)) translateY(4px); transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.fp-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 14px)); }
.fp-tip strong { display: block; font: var(--caps); letter-spacing: .14em; text-transform: uppercase; color: var(--ocean); margin-bottom: 3px; }
.fp-tip span { display: block; }
.fp-tip em { font-style: normal; font-family: var(--serif); font-weight: 500; font-size: 20px; line-height: 1.1; }

@media (max-width: 1100px) {
  .fp__sheet { grid-template-columns: 1fr; gap: 32px; }
  .fp__spec { position: static; max-width: 520px; margin: 0 auto; width: 100%; }
}

/* the font shorthand resets numeral style, so restore lining figures (Cormorant defaults to old-style) */
.fp__title, .fp__lines p, .fp__blurb, .fp-keycol h3, .fp-keycol h3 small, .fp-keycol li i,
.fp-pin, .fp-site__unit span, .fp-tip em, .fp-tools button { font-variant-numeric: lining-nums; }

/* ---------- phones ---------- */
@media (hover: none) { .fp__keys-hint { display: none; } .fp-plan__open { display: none; } }
@media (max-width: 700px) {
  .fp { padding-top: 96px; }
  .fp__levels-row { grid-template-columns: 1fr 1fr; }
  .fp-lv { padding: 10px 12px; gap: 8px; }
  .fp-lv + .fp-lv { border-left: 0; }
  .fp-lv:nth-child(even) { border-left: 1px solid var(--hair); }
  .fp-lv:nth-child(n+3) { border-top: 1px solid var(--hair); }
  .fp-lv__name { font-size: 17px; }
  .fp-lv__sub { font-size: 11px; }
  .fp-step { display: none !important; }            /* swipe the plan or use the level buttons */
  .fp-stage { height: auto; aspect-ratio: 8569 / 8939; max-height: 70svh; }
  .fp-stage.is-all { aspect-ratio: auto; max-height: none; }
  .fp-stage.is-all .fp-stage__zoom { flex-direction: column; align-items: stretch; gap: 28px; }
  .fp-stage.is-all .fp-plan { width: 100%; flex: none; }
  .fp__keys { grid-template-columns: 1fr !important; gap: 18px; }
  .fp-keycol li { font-size: 14px; padding: 8px 4px; }
  .fp__foot { grid-template-columns: 1fr; gap: 14px; }
  .fp-key { --kw-pick: min(260px, 70vw); }
}
