/* KAYATEA v11.20 (30 Nov 2026)
   1. Compose your box (gifting pop-up): every box size now shows its photo, so people can see what they
      are choosing without leaving the pop-up. The selected box gets a small check. "See the Petite Box" /
      "See the Wooden Box" / "See the Tin Tall" open the large photo viewer on top of the pop-up
      (assets/js/v11-20.js); before, they pointed at the page behind the pop-up and seemed to do nothing.
   2. Phones (up to 900 px): the five chapter cards on the home page enter like the rest of the site.
      The whole row rises 34 px while the cards fade in one after another. No photo zoom or "opening"
      any more (that is what showed the coloured square behind the photo), and the photos are fetched
      and decoded before the row arrives, so nothing pops in. Replaces v11-17.css / v11-17.js. */

/* ---------- 1. compose your box: photos on the choices ---------- */
.boxopt span{overflow:hidden}
.boxopt__img{display:block;width:calc(100% + 32px);max-width:none;height:auto;aspect-ratio:4/3;object-fit:cover;margin:-16px -16px 12px;background:var(--paper-2);transition:transform .9s var(--ease)}
@media (hover:hover){.boxopt span:hover .boxopt__img{transform:scale(1.03)}}
.boxopt--wide span{display:grid;grid-template-columns:clamp(104px,32%,168px) 1fr;grid-template-rows:auto auto;column-gap:20px;row-gap:2px;align-content:center}
.boxopt--wide b{align-self:end}
.boxopt--wide small{align-self:start}
.boxopt--wide .boxopt__img{grid-row:1 / span 2;width:calc(100% + 16px);aspect-ratio:1/1;margin:-16px 0 -16px -16px}
/* the chosen box: a small dark check in the photo's corner */
.boxopt input:checked + span::after{content:"";position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;
  background:var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.4l3.2 3.1L17 8.8' fill='none' stroke='%23f5f1ea' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
  box-shadow:0 0 0 2px rgba(245,241,234,.9)}
@media (max-width:760px){.boxopt b{font-size:18px}.boxopt small{font-size:11.5px}}
/* Tin Tall in the photo viewer: keep the tin in the square frame */
dialog.viewer.viewer--tin .viewer__fig img{object-position:50% 66%}
dialog.viewer.viewer--tin .viewer__step{display:none}

/* ---------- 2. phones: the five chapter cards ---------- */
@media (max-width:900px){
  html.js-rooms2 .rooms-wrap{transform:translate3d(0,34px,0)}
  html.js-rooms2 .rooms-wrap .room{opacity:0}
  html.js-rooms2 .rooms-wrap.is-in{transform:none;transition:transform 1.3s var(--apple)}
  html.js-rooms2 .rooms-wrap.is-in .room{opacity:1;transition:opacity 1.1s var(--apple) var(--d,0ms)}
  html.js-rooms2 .rooms-wrap.is-done,html.js-rooms2 .rooms-wrap.is-done .room{transition:none}
  /* a photo that was still on its way when the row arrived fades in over its colour instead of popping */
  html.js-rooms2 .rooms .room__img img{transition:opacity .7s var(--apple)}
  html.js-rooms2 .rooms .room__img img.is-late{opacity:0}
}
