/* One listing's details: js/room-sheet.js. The same shape and motion as the roommate
   profile sheet (.rm-sheet in css/roommates.css), taller because a listing says more:
   the details scroll, and the price and button stay put.

   The homepage has the --hm- colours and the city pages only those in css/index.css,
   so each colour names both. */
html.rooms-modal-open { overflow: hidden; }

.room-sheet { --sheet-card: var(--hm-card, var(--bg-card)); --sheet-ink: var(--hm-ink, var(--text)); --sheet-soft: var(--hm-soft, var(--text-2)); --sheet-line: var(--hm-line, var(--border)); position: fixed; inset: 0; width: min(calc(100vw - 32px), 1240px); height: min(calc(100dvh - 32px), 760px); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; overscroll-behavior: contain; border: 0; border-radius: 24px; background: var(--sheet-card); color: var(--sheet-ink); box-shadow: var(--hm-shadow, 0 10px 30px rgba(52, 28, 10, .14)); font-family: Manrope, sans-serif; }
.room-sheet[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); }
.room-sheet::backdrop { background: var(--hm-scrim, rgba(36, 22, 12, .5)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.room-sheet__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-sheet__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 24px; scrollbar-width: thin; scrollbar-color: var(--sheet-line) transparent; }
.room-slider__track { scrollbar-width: none; -ms-overflow-style: none; }
.room-slider__track::-webkit-scrollbar { display: none; }
.room-sheet__eyebrow, .room-sheet__intro h2 { padding-right: 44px; }
#room-dialog-sections > .room-section:first-child { margin-top: 24px; }

.room-sheet__close { position: absolute; z-index: 3; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1.5px solid var(--orange); border-radius: 50%; background: var(--sheet-card); color: var(--sheet-ink); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.room-sheet__close:focus-visible, .room-sheet__nav:focus-visible, .room-slider__dot:focus-visible, .room-sheet__cta:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* Left: the photo slider, full height */
.room-slider { position: relative; min-height: 0; overflow: hidden; background: var(--hm-peach, var(--bg-3)); }
.room-slider__track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.room-slider__slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.room-slider__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.room-slider::after { content: ""; position: absolute; inset: auto 0 0; height: 6rem; background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent); pointer-events: none; }
.room-sheet__nav { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #16140f; cursor: pointer; box-shadow: var(--shadow-md); transition: transform var(--t-fast); }
.room-sheet__nav:hover { transform: scale(1.06); }
.room-sheet__nav svg { width: 18px; height: 18px; }
.room-sheet__nav--left { left: .9rem; }
.room-sheet__nav--right { right: .9rem; }
.room-sheet__counter { position: absolute; z-index: 2; top: .9rem; left: .9rem; padding: .22rem .6rem; border-radius: var(--radius-full); background: rgba(20, 18, 15, .65); color: #fff; font-size: .72rem; font-weight: 700; }
.room-slider__dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 1rem; display: flex; justify-content: center; gap: .4rem; }
.room-slider__dot { width: .5rem; height: .5rem; padding: 0; border: 0; border-radius: var(--radius-full); background: rgba(255, 255, 255, .55); cursor: pointer; transition: width var(--t-fast), background var(--t-fast); }
.room-slider__dot.is-active { width: 1.4rem; background: #fff; }
.room-slider .room-photo-note { position: absolute; left: 1rem; bottom: 1rem; z-index: 1; padding: .25rem .6rem; border-radius: var(--radius-full); background: rgba(20, 18, 15, .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: .72rem; font-weight: 700; }

.room-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: var(--radius-full); background: rgba(20, 18, 15, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.room-badge svg { width: 13px; height: 13px; }
.room-badge--verified { background: rgba(22, 163, 74, .9); }

/* Right: the details */
.room-sheet__eyebrow { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; color: var(--orange); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.room-sheet__eyebrow .room-badge { text-transform: none; letter-spacing: 0; }
.room-sheet__intro h2 { margin: 0; color: var(--sheet-ink); font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.2; letter-spacing: -.015em; font-weight: 700; outline: none; }
.room-sheet__where { display: flex; align-items: flex-start; gap: .35rem; margin: .45rem 0 0; color: var(--sheet-soft); font-size: .95rem; line-height: 1.45; }
.room-sheet__where svg { flex: none; width: 17px; height: 17px; margin-top: .1rem; color: var(--orange); }

.room-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: .5rem; margin: 1.1rem 0 0; }
.room-stat { min-width: 0; padding: .65rem .75rem; border: 1px solid var(--sheet-line); border-radius: 12px; }
.room-stat dt { color: var(--sheet-soft); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.room-stat dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 0; }
.room-stat strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.room-stat dd span { color: var(--sheet-soft); font-size: .72rem; font-weight: 600; }
.room-stat--ok strong { color: var(--green); }
.room-stat--muted strong { color: var(--sheet-soft); }

.room-section { margin: 1.5rem 0 0; padding: 0; }
.room-section h3 { margin: 0 0 .7rem; color: var(--sheet-ink); font-size: .95rem; font-weight: 800; letter-spacing: -.01em; }

.room-options { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--sheet-line); border-radius: 12px; overflow: hidden; }
.room-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; }
.room-option + .room-option { border-top: 1px solid var(--sheet-line); }
.room-option__info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.room-option__name { display: flex; align-items: center; gap: .45rem; font-weight: 800; font-size: .95rem; }
.room-option__name svg { flex: none; width: 18px; height: 18px; color: var(--orange); }
.room-option__meta { padding-left: 1.6rem; color: var(--sheet-soft); font-size: .8rem; }
.room-option__price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.room-option__price strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.room-option__price span { color: var(--sheet-soft); font-size: .74rem; font-weight: 600; }
.room-option.is-full .room-option__name, .room-option.is-full strong, .room-option.is-full .room-option__name svg { color: var(--sheet-soft); }

.room-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.room-facts dt { color: var(--sheet-soft); font-size: .74rem; font-weight: 700; }
.room-facts dd { margin: .15rem 0 0; font-weight: 700; font-size: .92rem; }

.room-amenities { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.room-amenities li { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border: 1px solid var(--sheet-line); border-radius: var(--radius-full); font-size: .82rem; font-weight: 600; }
.room-amenities svg { width: 15px; height: 15px; color: var(--green); }

.room-about { margin: 0; color: var(--sheet-soft); line-height: 1.6; }
.room-sheet__fineprint { margin: 1.5rem 0 0; color: var(--sheet-soft); font-size: .75rem; line-height: 1.55; }

.room-sheet__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; padding: 14px 28px; border-top: 1px solid var(--sheet-line); background: var(--sheet-card); }
.room-sheet__price { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1 1 12rem; }
.room-price { display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: .1rem; line-height: 1.2; }
.room-price strong { color: var(--hm-ink, var(--text)); font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.room-price-lead { margin-right: .3rem; color: var(--text-3); font-size: .75rem; font-weight: 700; }
.room-price-unit { margin-left: .25rem; color: var(--text-3); font-size: .78rem; font-weight: 600; }
.room-sheet__hint { color: var(--sheet-soft); font-size: .74rem; line-height: 1.35; }
.room-sheet__cta { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 12px; background: var(--grad-brand); color: #fff; font-size: 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.room-sheet__cta:hover { color: #fff; filter: brightness(1.05); }

/* Opening: drifts in from the card that was tapped (--sheet-from-x/y, set in
   js/room-sheet.js), the photo settles, then the details rise in order. */
.room-sheet[open] { animation: room-sheet-in .5s cubic-bezier(.3, 0, .15, 1) both; }
.room-sheet[open]::backdrop { animation: room-sheet-fade-in .4s ease both; }
.room-sheet[open] .room-slider__slide img { animation: room-sheet-photo-in .75s cubic-bezier(.3, 0, .15, 1) both; }
.room-sheet[open] .room-sheet__intro, .room-sheet[open] #room-dialog-sections, .room-sheet[open] .room-sheet__fineprint, .room-sheet[open] .room-sheet__foot { animation: room-sheet-rise-in .42s cubic-bezier(.3, 0, .15, 1) both; animation-delay: calc(140ms + var(--sheet-step, 0) * 60ms); }
.room-sheet #room-dialog-sections { --sheet-step: 1; }
.room-sheet .room-sheet__fineprint { --sheet-step: 2; }
.room-sheet .room-sheet__foot { --sheet-step: 2; }
.room-sheet[open].is-closing { animation: room-sheet-out .24s ease-in both; }
.room-sheet[open].is-closing::backdrop { animation: room-sheet-fade-out .24s ease-in both; }
@keyframes room-sheet-in { from { opacity: 0; transform: translate(var(--sheet-from-x, 0), var(--sheet-from-y, 16px)) scale(.93); } }
@keyframes room-sheet-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes room-sheet-fade-in { from { opacity: 0; } }
@keyframes room-sheet-fade-out { to { opacity: 0; } }
@keyframes room-sheet-photo-in { from { transform: scale(1.06); } }
@keyframes room-sheet-rise-in { from { opacity: 0; transform: translateY(10px); } }

/* Narrow screens: one column, photos on top, the whole sheet scrolls, the button stays */
@media (max-width: 760px) {
  .room-sheet { width: min(460px, calc(100vw - 32px)); height: auto; max-height: calc(100dvh - 32px); overflow-y: auto; }
  .room-sheet[open] { display: block; }
  .room-slider { aspect-ratio: 8 / 5; }
  .room-sheet__main { display: contents; }
  .room-sheet__scroll { overflow: visible; padding: 16px 18px 18px; }
  .room-sheet__eyebrow, .room-sheet__intro h2 { padding-right: 0; }
  .room-sheet__foot { position: sticky; z-index: 2; bottom: 0; padding: 12px 18px; }
  .room-sheet__hint { display: none; }
  .room-sheet__cta { flex: 1 1 auto; }
  .room-sheet__counter { top: auto; bottom: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .room-sheet[open], .room-sheet[open].is-closing, .room-sheet[open]::backdrop, .room-sheet[open].is-closing::backdrop,
  .room-sheet[open] .room-slider__slide img, .room-sheet[open] .room-sheet__intro, .room-sheet[open] #room-dialog-sections,
  .room-sheet[open] .room-sheet__fineprint, .room-sheet[open] .room-sheet__foot { animation: none; }
  .room-slider__dot, .room-sheet__nav { transition: none; }
}

/* The contact request for one listing (js/listing-enquiry.js), in place of the details */
.room-enquiry { margin-top: 20px; }
.room-enquiry__back { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--sheet-ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.room-enquiry__title { margin: 8px 0 6px; color: var(--sheet-ink); font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.room-enquiry__title:focus { outline: none; }
.room-enquiry__lede { margin: 0 0 14px; color: var(--sheet-soft); font-size: .92rem; line-height: 1.5; }
.room-enquiry__form { display: grid; gap: 12px; }
.room-enquiry__field { display: grid; gap: 4px; }
.room-enquiry__label { color: var(--sheet-ink); font-size: .88rem; font-weight: 700; }
.room-enquiry__hint, .room-enquiry__note { margin: 0; color: var(--sheet-soft); font-size: .8rem; line-height: 1.45; }
.room-enquiry__note a { color: inherit; text-decoration: underline; }
.room-enquiry__form input, .room-enquiry__form select, .room-enquiry__form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--sheet-line); border-radius: 10px; background: var(--sheet-card); color: var(--sheet-ink); font: inherit; font-size: 1rem; }
.room-enquiry__form textarea { resize: vertical; min-height: 84px; }
.room-enquiry__form input:focus-visible, .room-enquiry__form select:focus-visible, .room-enquiry__form textarea:focus-visible, .room-enquiry__back:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.room-enquiry__form [aria-invalid="true"] { border-color: #b42318; }
.room-enquiry__error, .room-enquiry__alert { margin: 0; color: #b42318; font-size: .85rem; font-weight: 600; }
[data-theme="dark"] .room-enquiry__error, [data-theme="dark"] .room-enquiry__alert { color: #ff8a80; }
[data-theme="dark"] .room-enquiry__form [aria-invalid="true"] { border-color: #ff8a80; }
.room-enquiry__submit { width: 100%; border: 0; cursor: pointer; font-family: inherit; }
.room-enquiry__submit[disabled] { opacity: .7; cursor: progress; }
.room-enquiry__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.room-enquiry__apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.room-enquiry__app { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--sheet-line); border-radius: 10px; color: var(--sheet-ink); font-weight: 700; text-decoration: none; }
.room-sheet__cta[hidden] { display: none; }
button.room-sheet__cta { border: 0; cursor: pointer; font-family: inherit; }
/* The display rules above must not beat the hidden attribute */
.room-enquiry[hidden], .room-enquiry [hidden] { display: none !important; }
