/* THE DRAWING — the second signature interaction.

   One composition, never seven popups: an editorial column, the plan itself,
   and a preview that changes inside the same frame. Choosing a room dims the
   rest of the house, draws a perimeter around the room you chose and runs a
   hairline from that room across to the photograph of it.

   The plan image carries burnt-in labels. They belong to the drawing; the
   site's room names, descriptions and accessible labels come from
   assets/js/property.js and never from the picture. */
.plan { padding-block: clamp(4.5rem, 11vh, 8rem); }
.plan__grid {
  display: grid;
  grid-template-columns: minmax(12rem, 18%) minmax(0, 1fr) minmax(15rem, 24%);
  gap: clamp(1.6rem, 3.4vw, 3.6rem);
  align-items: start;
  position: relative;
}
.plan__intro { display: grid; gap: clamp(1rem, 2vw, 1.6rem); align-content: start; }
.plan__intro .rule { margin-block: .4rem; }

/* --- the plan ----------------------------------------------------------- */
.plan__figure { position: relative; overflow: hidden; background: rgba(23,32,42,.06); }
.plan__zoom { transition: transform 1s var(--slow); transform-origin: 50% 50%; }
.plan__figure img { width: 100%; height: auto; }
.plan__spots { position: absolute; inset: 0; }
.spot {
  position: absolute;
  left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  display: block;
}
.spot__ring {
  position: absolute; inset: 0;
  border: 1px solid transparent;
  transition: border-color .5s var(--ease), background-color .5s var(--ease);
}
.spot:hover .spot__ring, .spot:focus-visible .spot__ring { border-color: rgba(251,249,244,.55); }
.spot__dot {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px;
  border-radius: 50%; background: rgba(251,249,244,.9);
  box-shadow: 0 0 0 1px rgba(23,32,42,.25);
  opacity: .55; transition: opacity .5s var(--ease), transform .6s var(--slow);
}
.spot:hover .spot__dot, .spot:focus-visible .spot__dot { opacity: 1; transform: scale(1.5); }
.spot.is-on .spot__dot { opacity: 0; }

/* the chosen room: everything else steps back behind a veil, and one drawn
   rectangle stays lit */
.plan__hi {
  position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  pointer-events: none; opacity: 0;
  border: 1px solid rgba(251,249,244,.92);
  background: rgba(251,249,244,.10);
  box-shadow: 0 0 0 100vmax rgba(30,38,44,.42);
  transition: opacity .5s var(--ease), left .8s var(--slow), top .8s var(--slow),
              width .8s var(--slow), height .8s var(--slow);
}
.plan__figure.is-active .plan__hi { opacity: 1; }
.plan__hi::after {
  content: ""; position: absolute; inset: -4px;
  border: 1px solid rgba(251,249,244,.42);
  stroke-dasharray: 3 5;
  animation: breathe 4.5s var(--ease) infinite;
}
@keyframes breathe { 0%,100% { opacity: .25; transform: scale(1); } 50% { opacity: .7; transform: scale(1.012); } }
.plan__hi-name {
  position: absolute; left: 0; top: -1.55rem;
  font-size: .55rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--warm-white); white-space: nowrap;
}

/* the hairline that ties the room to its photograph (desktop only, placed by
   assets/js/plan.js because it spans two grid columns) */
.plan__link {
  position: absolute; height: 1px; background: var(--rule-2);
  opacity: 0; transform-origin: 0 50%; transform: scaleX(0);
  transition: opacity .4s var(--ease), transform .7s var(--slow);
  pointer-events: none;
}
.plan__figure.is-active ~ .plan__link, .plan__grid.is-active .plan__link { opacity: 1; transform: scaleX(1); }

/* --- room list + preview ------------------------------------------------ */
.plan__side { display: grid; gap: clamp(1rem, 2vw, 1.6rem); align-content: start; }
.plan__rooms { display: grid; }
.plan__rooms li + li { border-top: 1px solid var(--rule); }
.plan__rooms button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .72em 0;
  font-size: var(--label); font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-2);
  transition: color .4s var(--ease), padding-left .5s var(--slow);
}
.plan__rooms button i {
  width: 1.4rem; height: 1px; background: currentColor; opacity: .35;
  transition: opacity .4s var(--ease), width .5s var(--slow);
}
.plan__rooms button:hover { color: var(--ink); }
.plan__rooms button[aria-pressed="true"] { color: var(--ink); padding-left: .5rem; }
.plan__rooms button[aria-pressed="true"] i { opacity: 1; width: 2.4rem; }

.plan__preview { display: grid; gap: .85rem; }
.plan__shot { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: rgba(23,32,42,.08); }
/* the stack inside it is .pshot — see assets/css/grid.css */
.plan__tag { font-family: var(--serif); font-weight: 400; font-size: 1.34rem; line-height: 1.16; }
.plan__desc { font-size: .92rem; }

/* --- phones: no hover anywhere, and the plan is never shrunk to unreadable */
.plan__pager { display: none; }
@media (max-width: 1024px) {
  .plan__grid { grid-template-columns: 1fr; }
  .plan__intro { max-width: 40rem; }
}
@media (max-width: 720px) {
  .plan__figure { touch-action: pan-y; }
  .plan__rooms {
    display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(var(--gut) * -1); padding-inline: var(--gut);
  }
  .plan__rooms::-webkit-scrollbar { display: none; }
  .plan__rooms li + li { border-top: 0; }
  .plan__rooms button {
    white-space: nowrap; border: 1px solid var(--rule); padding: .95em 1.1em;
    justify-content: center;
  }
  .plan__rooms button i { display: none; }
  .plan__rooms button[aria-pressed="true"] { padding-left: 1.1em; border-color: var(--ink); }
  .plan__hi-name { display: none; }
  .plan__pager {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2);
  }
  .plan__pager button { display: flex; gap: .5rem; align-items: center; padding: .75rem 0; }
}
