/**
 * [hh_program_rooms]: accommodation cards and the room photo gallery.
 *
 * Colours come from Impreza's custom properties (content-faded is Hollyhock's
 * navy, content-primary their teal), with the current values as fallbacks.
 * The sale red matches the early bird notice in the 2027 template.
 */

.hh-rooms {
	--hh-room-navy: var(--color-content-faded, #233c4d);
	--hh-room-teal: var(--color-content-primary, #427c7d);
	--hh-room-line: var(--color-alt-content-bg, #e2e5d6);
	--hh-room-card: var(--color-content-bg-alt, #fff);
	--hh-room-sale: #b32a00;
	--hh-room-gap: 1.25rem;
	--hh-room-per: 4;
	margin: 1.5rem 0 0;
}

/* ----------------------------------------------------------- the row */

.hh-rooms-viewport {
	position: relative;
}

.hh-rooms-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--hh-room-per) - 1) * var(--hh-room-gap)) / var(--hh-room-per));
	gap: var(--hh-room-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 2px 2px 6px;
	/* Snap to the padding edge, so the first card sits at scrollLeft 0. */
	scroll-padding-inline: 2px;
}

.hh-rooms-track::-webkit-scrollbar {
	display: none;
}

@media (max-width: 1024px) {
	.hh-rooms { --hh-room-per: 2.15; }
}

@media (max-width: 600px) {
	.hh-rooms { --hh-room-per: 1.15; --hh-room-gap: 1rem; }
}

.hh-rooms-nav {
	position: absolute;
	top: 30%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hh-room-teal);
	color: #fff;
	font-size: 1rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	cursor: pointer;
	transition: opacity .2s;
}

.hh-rooms-prev { left: -1.1rem; }
.hh-rooms-next { right: -1.1rem; }

.hh-rooms-nav[disabled] {
	opacity: 0;
	pointer-events: none;
}

/* Every card fits, so there is nothing to scroll to. */
.hh-rooms.is-static .hh-rooms-nav {
	display: none;
}

/* Phones swipe; the arrows would sit on top of the cards. */
@media (max-width: 600px) {
	.hh-rooms-nav { display: none; }
}

/* ---------------------------------------------------------- one card */

/* position:relative keeps the absolutely positioned screen-reader labels inside
   the scrolling track. Without it they anchor to .hh-rooms-viewport, escape the
   track's clipping and make the whole page 6,000px wide. */
.hh-room {
	position: relative;
	display: flex;
	flex-direction: column;
	scroll-snap-align: start;
	overflow: hidden;
	border: 1px solid var(--hh-room-line);
	border-radius: 12px;
	background: var(--hh-room-card);
	text-align: center;
}

.hh-room-photo {
	position: relative;
	display: block;
	width: 100%;
	/* RetreatGuru's recommended lodging photo size, 920 x 756. Hollyhock's
	   new photos carry the building name, so the frame matches them exactly
	   (Sachia, 5 Nov 2026). Was 4 / 3. */
	aspect-ratio: 920 / 756;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--hh-room-line);
	cursor: zoom-in;
	overflow: hidden;
}

.hh-room-photo.is-empty {
	cursor: default;
}

/* Absolute, so a portrait photo cannot stretch the frame (aspect-ratio
   gives way to content height). */
.hh-room-photo img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.hh-room-photo:hover img,
.hh-room-photo:focus-visible img {
	transform: scale(1.04);
}

/* Top right (Sachia, 3 Nov 2026): the bottom of the photo is kept clear for
   the building name Hollyhock is adding to the featured images. */
.hh-room-count {
	position: absolute;
	top: .6rem;
	right: .6rem;
	padding: .3em .7em;
	border-radius: 100px;
	background: rgba(35, 60, 77, .85);
	color: #fff;
	font-size: .75rem;
	line-height: 1.3;
}

.hh-room-flag {
	position: absolute;
	top: .75rem;
	left: .75rem;
	padding: .35em .8em;
	border-radius: 4px;
	background: var(--hh-room-navy);
	color: #fff;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.hh-room-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: .75rem;
	padding: 1.25rem 1rem 1.25rem;
}

/* Plain text on the white card, no navy band: the building name now lives in
   the photo itself (Sachia, 3 Nov 2026). */
.hh-room-title {
	margin: 0;
	color: var(--hh-room-navy);
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.3;
}

.hh-room-price {
	display: flex;
	flex-direction: column;
	margin: auto 0 0;
	line-height: 1.3;
}

.hh-room-was {
	color: var(--hh-room-navy);
	font-size: .9rem;
	opacity: .75;
}

.hh-room-now {
	font-size: 1.15rem;
	font-weight: 600;
}

.hh-room-was + .hh-room-now {
	color: var(--hh-room-sale);
}

.hh-room-btn.w-btn {
	font-size: .9rem;
}

.hh-room-soldout {
	display: inline-block;
	padding: .6em 1.4em;
	border: 1px solid var(--hh-room-navy);
	border-radius: 4px;
	color: var(--hh-room-navy);
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Sold out reads at a glance: greyed photo, muted price, flag on the photo. */
.hh-room.is-sold-out .hh-room-photo img {
	filter: grayscale(1);
	opacity: .6;
}

.hh-room.is-sold-out .hh-room-price {
	opacity: .55;
}

.hh-room.is-sold-out .hh-room-was + .hh-room-now {
	color: inherit;
}

.hh-rooms-note {
	margin: 1.25rem auto 0;
	max-width: 46rem;
	font-size: .9rem;
	font-style: italic;
	text-align: center;
}

/* ------------------------------------------------------- the gallery */

html.hh-room-open {
	overflow: hidden;
}

.hh-room-dialog {
	width: min(960px, calc(100% - 32px));
	max-height: calc(100% - 32px);
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--color-content-bg-alt, #fff);
	color: var(--color-content-text, #000);
	overflow: hidden auto;
}

.hh-room-dialog::backdrop {
	background: rgba(20, 30, 38, .8);
}

.hh-room-dialog-media {
	position: relative;
	background: #111;
}

.hh-room-dialog-strip {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.hh-room-dialog-strip::-webkit-scrollbar {
	display: none;
}

.hh-room-dialog-strip img {
	flex: 0 0 100%;
	width: 100%;
	height: min(62vh, 600px);
	object-fit: contain;
	scroll-snap-align: center;
}

.hh-room-dialog-nav,
.hh-room-dialog-close {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #233c4d;
	font-size: 1rem;
	cursor: pointer;
}

.hh-room-dialog-nav {
	top: 50%;
	transform: translateY(-50%);
}

.hh-room-dialog-prev { left: .75rem; }
.hh-room-dialog-next { right: .75rem; }

.hh-room-dialog-nav[disabled] {
	opacity: .35;
	cursor: default;
}

.hh-room-dialog-close {
	top: .75rem;
	right: .75rem;
	font-size: 1.4rem;
	line-height: 1;
}

.hh-room-dialog-count {
	position: absolute;
	bottom: .75rem;
	left: 50%;
	transform: translateX(-50%);
	padding: .25em .8em;
	border-radius: 100px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: .8rem;
}

.hh-room-dialog-text {
	padding: 1.25rem 1.5rem 1.5rem;
}

.hh-room-dialog-text h3 {
	margin: 0 0 .5rem;
	font-size: 1.3rem;
}

.hh-room-dialog-text p:last-child {
	margin-bottom: 0;
}

@media (max-width: 600px) {
	.hh-room-dialog-strip img { height: 45vh; }
	.hh-room-dialog-nav { display: none; }
	.hh-room-dialog-text { padding: 1rem 1.1rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
	.hh-rooms-track,
	.hh-room-dialog-strip { scroll-behavior: auto; }
	.hh-room-photo img { transition: none; }
}
