/* MANACA v3: rooms, the category fan. Tokens come from site.css. */

/* ================= rooms: every category as one fan of cards =================
   Without JS or with reduced motion .r7-rail is a flat native scroller of links with snap. js/rooms.js turns it into a looping
   fan (.r7.live): the slots are stacked on the stage centre and placed with transform and opacity only, and nothing runs
   while the fan is still. The card is sized from the viewport height so heading, fan and index fit one screen. */
#rooms { position: relative; overflow: hidden; --rw: min(84vw, 42vh); --rw: min(84vw, 42svh); --rh: calc(var(--rw) / .7); --rpad: clamp(12px, 2vh, 22px);
  padding: calc(var(--hdr) + 10px) 0 0; }
@media (min-width: 900px) { #rooms { --rh: clamp(340px, 63vh, 700px); --rw: calc(var(--rh) * .75); } }
#rooms .rooms-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; max-width: none; padding: 0 var(--gut); }
#rooms .rooms-head h2 { margin: 0; font: 820 clamp(26px, 2.5vw, 36px)/1 var(--display); font-stretch: 62%; letter-spacing: -.02em; text-transform: none; }
.r7-btns { display: none; gap: 10px; }
.r7-on .r7-btns { display: flex; }
@media (hover: none) { #rooms .arrow:hover:not(:active) { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent); } }   /* no stuck hover after a tap */
/* the stage (it carries .flow only so tools/overflow.cjs skips the off-screen cards) */
.rooms .r7 { position: relative; display: block; }

.r7-rail { position: relative; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: var(--rpad) calc(50% - var(--rw) / 2);
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; outline-offset: -4px; }
.r7-rail::-webkit-scrollbar { display: none; }
.r7-rail:focus-visible { outline: 2px solid var(--ink); }
.r7-slot { flex: 0 0 var(--rw); scroll-snap-align: center; }
.r7-link { display: block; height: var(--rh); border-radius: 5px; color: #f6f7f1; text-decoration: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent; }
.r7-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.r7-card { position: relative; display: block; width: var(--rw); height: var(--rh); overflow: hidden; border-radius: 5px;
  background: var(--bg, var(--well)); color: #f6f7f1; box-shadow: 0 34px 44px -30px rgb(0 0 0 / .5), 0 0 0 1px rgb(14 14 13 / .1); }
/* the photo is as tall as the card and wider than it: the card is a window onto it, and the fan slides it for parallax */
.r7-img { position: absolute; top: 0; left: 50%; height: 100%; width: auto; max-width: none; translate: -50% 0; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.r7-card::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 50%, rgb(0 0 0 / .34) 72%, rgb(0 0 0 / .72)); }
.r7-shade { position: absolute; inset: 0; z-index: 1; background: #0e0e0d; opacity: 0; pointer-events: none; }
.r7-name { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 78px; font: 820 clamp(36px, 3.6vw, 56px)/.88 var(--display); font-stretch: 62%; letter-spacing: -.02em; text-wrap: balance; }
.r7-go { position: absolute; z-index: 2; left: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  background: #f4f5ef; color: var(--ink); font: 650 14px/1 var(--body); transition: background-color .25s var(--ease); }
.r7-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .r7-link:hover .r7-go { background: rgb(var(--led)); } }

/* the fan */
.r7.live .r7-rail { display: block; height: calc(var(--rh) + 2 * var(--rpad)); padding: 0; overflow: visible; scroll-snap-type: none; perspective: 1400px; perspective-origin: 50% 50%;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.r7.live .r7-slot { position: absolute; left: 50%; top: var(--rpad); width: var(--rw); margin-left: calc(var(--rw) / -2); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.r7.live .r7-name, .r7.live .r7-go { transition: opacity .35s var(--ease), background-color .25s var(--ease); }
.r7.live .r7-slot:not(.on) :is(.r7-name, .r7-go) { opacity: 0; }
.r7.live .r7-card::after { transition: opacity .35s var(--ease); }
.r7.live .r7-slot:not(.on) .r7-card::after { opacity: 0; }
.r7.live .r7-slot.on .r7-card { box-shadow: 0 44px 56px -30px rgb(0 0 0 / .6), 0 0 0 1px rgb(14 14 13 / .14); }
@media (hover: hover) and (pointer: fine) { .r7.live .r7-rail { cursor: grab; } .r7.live .r7-link { cursor: pointer; } .r7.live.dragging :is(.r7-rail, .r7-link) { cursor: grabbing; } }

/* the index: every category by name, one tap away; the current one is inked and underlined */
.r7-idx { display: none; }
.r7-idx:not(:empty) { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 calc(var(--gut) - 10px); }
.r7-idx::-webkit-scrollbar { display: none; }
.r7-idx button { position: relative; flex: 0 0 auto; min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--mute); cursor: pointer; white-space: nowrap;
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; -webkit-tap-highlight-color: transparent; }
.r7-idx button:first-child { margin-left: auto; } .r7-idx button:last-child { margin-right: auto; }
.r7-idx button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 9px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease); }
.r7-idx button[aria-current="true"] { color: var(--ink); }
.r7-idx button[aria-current="true"]::after { transform: scaleX(1); }
.r7-idx button:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) { .r7-idx button:hover { color: var(--ink); } }

@media (prefers-reduced-motion: reduce) {
  .r7-go, .r7-idx button::after { transition: none; }
}
