/**
 * Stepfox Hotel Booking — booking.css (handle `stepfox-hb-booking`)
 *
 * The picker side of the booking UI:
 *   .sfhb-dr / .sfhb-gs     the date-range and guests fields (variants: field | box)
 *   .sfhb-pk                 the popover / bottom sheet both of them open
 *   .sfhb-cg                 the month grid (popover + inline calendar share it)
 *   .sfhb-cal                the availability-calendar block
 *
 * Colour comes ONLY from the 16 palette presets (var(--wp--preset--color--<slug>)), so the
 * [data-sfhb-scheme="dark"] re-map of the presets flips everything. Availability is never
 * colour alone: booked = muted + strikethrough, check-out-only = half-shaded, no check-in =
 * dotted underline, selected range = tint, endpoints = solid ink.
 *   open        neon   (inline calendar tint)
 *   booked      muted + line-through
 *   range       accent-2 (tint) · endpoints ink on base
 *   price drop  accent
 * Logical properties throughout (RTL-safe). Reduced-motion safe. Mobile (<720px): bottom sheet.
 */

/* ==========================================================================
   1. Fields (date range + guests)
   ========================================================================== */

.sfhb-dr,
.sfhb-gs {
	position: relative;
	min-width: 0;
}

.sfhb-dr[hidden],
.sfhb-gs[hidden],
.sfhb-pk[hidden],
.sfhb-pk-backdrop[hidden],
.sfhb-dr__nights[hidden],
.sfhb-pk__clear[hidden],
.sfhb-cal__clear[hidden] {
	display: none !important;
}

.sfhb-dr__wrap,
.sfhb-gs__wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.sfhb-dr__wrap > .sfhb-i,
.sfhb-gs__wrap > .sfhb-i,
.sfhb-dr__wrap > svg,
.sfhb-gs__wrap > svg {
	flex: none;
	color: var(--wp--preset--color--accent);
}

.sfhb-dr__btn,
.sfhb-gs__btn {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	min-height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: 600 15px/1.3 var(--sfhb-font-ui, system-ui, sans-serif);
	text-align: start;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.sfhb-dr__btn:focus-visible,
.sfhb-gs__btn:focus-visible,
.sfhb-dr__cell:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2);
	outline-offset: 3px;
}

.sfhb-dr__val,
.sfhb-gs__val {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sfhb-dr__val.is-placeholder {
	color: var(--wp--preset--color--muted);
	font-weight: 500;
}

.sfhb-dr__nights {
	flex: none;
	color: var(--wp--preset--color--muted);
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.sfhb-dr__nights::before {
	content: "\00b7\00a0";
}

.sfhb-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- compact variant: a pill button for toolbars (map / filter bars) ------- */

.sfhb-dr--compact .sfhb-dr__btn,
.sfhb-gs--compact .sfhb-gs__btn {
	flex: 0 1 auto;
	width: auto;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 30%, transparent);
	border-radius: var(--sfhb-radius-chip, 999px);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
	font-size: 14px;
}

.sfhb-dr--compact.has-value .sfhb-dr__btn,
.sfhb-dr--compact .sfhb-dr__btn[aria-expanded="true"],
.sfhb-gs--compact .sfhb-gs__btn[aria-expanded="true"] {
	border-color: var(--wp--preset--color--ink);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--ink);
}

.sfhb-dr--compact .sfhb-dr__nights {
	display: none;
}

/* ---- box variant: a bordered input look for the booking widget ----------- */

.sfhb-dr--box,
.sfhb-gs--box {
	--sfhb-box-line: color-mix(in srgb, var(--wp--preset--color--ink) 38%, transparent);
}

.sfhb-dr__label {
	color: var(--wp--preset--color--muted);
	font: 800 11px/1.2 var(--sfhb-font-ui, system-ui, sans-serif);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sfhb-dr--box > .sfhb-dr__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sfhb-dr__cells {
	display: grid;
	grid-template-columns: 1fr 1fr;
	overflow: hidden;
	border: 1px solid var(--sfhb-box-line, var(--wp--preset--color--line));
	border-radius: var(--sfhb-radius-input, 12px);
	background: var(--wp--preset--color--panel);
}

.sfhb-dr__cell {
	appearance: none;
	-webkit-appearance: none;
	display: grid;
	gap: 3px;
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	padding: 10px 14px 11px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--ink);
	font: 600 15px/1.3 var(--sfhb-font-ui, system-ui, sans-serif);
	text-align: start;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.sfhb-dr__cell + .sfhb-dr__cell {
	border-inline-start: 1px solid var(--sfhb-box-line, var(--wp--preset--color--line));
}

.sfhb-dr__cell[aria-expanded="true"] {
	background: var(--wp--preset--color--panel-2);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--ink);
}

.sfhb-dr__cell-label,
.sfhb-gs__cell-label {
	color: var(--wp--preset--color--ink);
	font: 800 10px/1.2 var(--sfhb-font-ui, system-ui, sans-serif);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sfhb-gs--box .sfhb-gs__btn {
	display: grid;
	gap: 3px;
	padding: 10px 14px 11px;
	border: 1px solid var(--sfhb-box-line, var(--wp--preset--color--line));
	border-radius: var(--sfhb-radius-input, 12px);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
}

.sfhb-gs--box .sfhb-gs__btn[aria-expanded="true"] {
	background: var(--wp--preset--color--panel-2);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--ink);
}

.sfhb-gs.is-over .sfhb-gs__btn {
	border-color: var(--wp--preset--color--accent);
}

.sfhb-gs.is-over .sfhb-gs__val {
	color: var(--wp--preset--color--accent);
}

/* ==========================================================================
   2. Popover / bottom sheet shell
   ========================================================================== */

.sfhb-pk {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 99990;
	box-sizing: border-box;
	max-width: calc(100vw - 16px);
	padding: 18px 20px 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--sfhb-radius-card, 16px);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
	box-shadow: 0 26px 60px -22px color-mix(in srgb, var(--wp--preset--color--ink) 46%, transparent), 0 6px 18px -8px color-mix(in srgb, var(--wp--preset--color--ink) 22%, transparent);
	font: 500 14px/1.4 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-pk--dates {
	width: max-content;
}

.sfhb-pk--guests {
	width: 340px;
}

.sfhb-pk__head {
	display: none;
}

.sfhb-pk__heading {
	font: 600 18px/1.2 var(--sfhb-font-display, Georgia, serif);
}

.sfhb-pk__x {
	appearance: none;
	-webkit-appearance: none;
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.sfhb-pk__x:focus-visible,
.sfhb-pk__clear:focus-visible,
.sfhb-pk__done:focus-visible,
.sfhb-cal__clear:focus-visible,
.sfhb-cg__nav:focus-visible,
.sfhb-cg__cell:focus-visible::after {
	outline: 2px solid var(--wp--preset--color--accent-2);
	outline-offset: 2px;
}

.sfhb-pk__status {
	min-height: 20px;
	margin: 0 0 10px;
	color: var(--wp--preset--color--muted);
	font: 600 13px/1.5 var(--sfhb-font-ui, system-ui, sans-serif);
	text-align: center;
}

.sfhb-pk__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-block-start: 10px;
	padding-block-start: 12px;
	border-block-start: 1px solid var(--wp--preset--color--line);
}

.sfhb-pk__sum {
	margin: 0;
	color: var(--wp--preset--color--ink);
	font: 700 13px/1.4 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-pk__actions {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-inline-start: auto;
}

.sfhb-pk__clear,
.sfhb-cal__clear {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 9px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--wp--preset--color--ink);
	font: 700 13px/1.2 var(--sfhb-font-ui, system-ui, sans-serif);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.sfhb-pk__done {
	appearance: none;
	-webkit-appearance: none;
	display: none;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: var(--sfhb-radius-btn, 12px);
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--base);
	font: 800 14px/1 var(--sfhb-font-ui, system-ui, sans-serif);
	cursor: pointer;
}

.sfhb-pk.is-sheet .sfhb-pk__done,
.sfhb-pk__done--always {
	display: inline-flex;
}

@media (prefers-reduced-motion: no-preference) {
	.sfhb-pk.is-open {
		animation: sfhb-pk-in 0.16s var(--sfhb-ease, ease-out);
	}

	.sfhb-pk.is-open.is-above {
		animation-name: sfhb-pk-in-up;
	}

	.sfhb-pk.is-open.is-sheet {
		animation: sfhb-pk-sheet 0.24s var(--sfhb-ease, ease-out);
	}
}

@keyframes sfhb-pk-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
}

@keyframes sfhb-pk-in-up {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

@keyframes sfhb-pk-sheet {
	from {
		transform: translateY(40px);
		opacity: 0;
	}
}

/* ---- bottom sheet (< 720px) ---------------------------------------------- */

.sfhb-pk.is-sheet {
	inset: auto 0 0 0;
	width: auto;
	max-width: none;
	max-height: 92vh;
	max-height: 92dvh;
	padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	overscroll-behavior: contain;
	border-width: 1px 0 0;
	border-radius: 22px 22px 0 0;
}

.sfhb-pk.is-sheet .sfhb-pk__head {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-inline: -16px;
	margin-block-end: 8px;
	padding: 10px 8px 6px 20px;
	border-block-end: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--panel);
}

.sfhb-pk.is-sheet .sfhb-pk__foot {
	position: sticky;
	bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
	margin-inline: -16px;
	margin-block-end: calc(-16px - env(safe-area-inset-bottom, 0px));
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	background: var(--wp--preset--color--panel);
}

.sfhb-pk-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99989;
	background: color-mix(in srgb, var(--wp--preset--color--ink) 48%, transparent);
}

html.sfhb-pk-lock {
	overflow: hidden;
}

/* ==========================================================================
   3. Guests stepper rows
   ========================================================================== */

.sfhb-gs__rows {
	display: grid;
}

.sfhb-gs__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 14px;
	border-block-end: 1px solid var(--wp--preset--color--line);
}

.sfhb-gs__row:last-child {
	border-block-end: 0;
}

.sfhb-gs__name {
	display: block;
	font: 700 15px/1.3 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-gs__desc {
	display: block;
	color: var(--wp--preset--color--muted);
	font: 400 13px/1.4 var(--sfhb-font-body, system-ui, sans-serif);
}

.sfhb-gs__step {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.sfhb-gs__b {
	appearance: none;
	-webkit-appearance: none;
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 38%, transparent);
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--ink);
	font: 500 22px/1 var(--sfhb-font-ui, system-ui, sans-serif);
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
	-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
	.sfhb-gs__b:not(.is-disabled):hover {
		border-color: var(--wp--preset--color--ink);
		background: var(--wp--preset--color--panel-2);
	}
}

.sfhb-gs__b.is-disabled {
	opacity: 0.32;
	cursor: not-allowed;
}

.sfhb-gs__b:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2);
	outline-offset: 2px;
}

.sfhb-gs__n {
	min-width: 1.6em;
	font: 700 16px/1 var(--sfhb-font-num, var(--sfhb-font-ui, system-ui, sans-serif));
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.sfhb-gs__hint {
	min-height: 18px;
	margin: 10px 0 0;
	color: var(--wp--preset--color--muted);
	font: 500 13px/1.45 var(--sfhb-font-body, system-ui, sans-serif);
}

.sfhb-gs__hint.is-over {
	color: var(--wp--preset--color--accent);
	font-weight: 700;
}

/* ==========================================================================
   4. Month grid (.sfhb-cg) — shared by the popover and the inline calendar
   ========================================================================== */

.sfhb-cg {
	--sfhb-cg-h: 50px;
	position: relative;
	color: var(--wp--preset--color--ink);
	font-family: var(--sfhb-font-num, var(--sfhb-font-ui, system-ui, sans-serif));
}

.sfhb-cg__months {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px 36px;
}

.sfhb-cg__month {
	flex: 1 1 270px;
	min-width: 0;
}

.sfhb-pk--dates .sfhb-cg__month {
	flex: 0 0 308px;
}

.sfhb-pk.is-sheet .sfhb-cg__month {
	flex: 1 1 100%;
}

.sfhb-cg__title {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	margin-block-end: 6px;
	font: 600 17px/1.2 var(--sfhb-font-display, Georgia, serif);
	text-transform: capitalize;
}

.sfhb-cg__nav {
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	top: 0;
	z-index: 2;
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.sfhb-cg__nav--prev {
	inset-inline-start: 0;
}

.sfhb-cg__nav--next {
	inset-inline-end: 0;
}

@media (hover: hover) {
	.sfhb-cg__nav:not([aria-disabled="true"]):hover {
		background: var(--wp--preset--color--panel-2);
	}
}

.sfhb-cg__nav[aria-disabled="true"] {
	opacity: 0.28;
	cursor: default;
}

[dir="rtl"] .sfhb-cg__nav svg {
	transform: scaleX(-1);
}

/* 2+ months: the inner arrows would sit on a middle title — keep them on the outer corners only */
.sfhb-cg__grid {
	display: block;
}

.sfhb-cg__row {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.sfhb-cg__dow {
	padding-block: 4px 6px;
	color: var(--wp--preset--color--muted);
	font: 700 11px/1.2 var(--sfhb-font-ui, system-ui, sans-serif);
	letter-spacing: 0.04em;
	text-align: center;
	text-transform: capitalize;
}

/* ---- day cell ------------------------------------------------------------- */

.sfhb-cg__cell,
.sfhb-cg__pad {
	box-sizing: border-box;
	min-height: var(--sfhb-cg-h);
}

.sfhb-cg__cell {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 3px 0;
	outline: none;
	cursor: pointer;
	font-variant-numeric: tabular-nums;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* ::before = the range band, ::after = the rounded chip (hover, today ring, endpoints) */
.sfhb-cg__cell::before,
.sfhb-cg__cell::after {
	content: "";
	position: absolute;
	pointer-events: none;
}

.sfhb-cg__cell::before {
	inset-block: 4px;
	inset-inline: 0;
	z-index: -2;
	background: transparent;
}

.sfhb-cg__cell::after {
	inset: 4px 2px;
	z-index: -1;
	border-radius: 12px;
	background: transparent;
	transition: background-color 0.12s ease;
}

.sfhb-cg__d {
	font: 600 15px/1.1 var(--sfhb-font-num, var(--sfhb-font-ui, system-ui, sans-serif));
}

.sfhb-cg__p {
	color: var(--wp--preset--color--muted);
	font: 600 10px/1 var(--sfhb-font-num, var(--sfhb-font-ui, system-ui, sans-serif));
	letter-spacing: -0.01em;
	white-space: nowrap;
}

@media (hover: hover) {
	.sfhb-cg__cell:not(.is-disabled):not(.is-static):not(.is-in):not(.is-out):hover::after {
		background: var(--wp--preset--color--panel-2);
	}
}

.sfhb-cg__cell:focus-visible::after {
	outline-offset: -2px;
}

.sfhb-cg__cell.is-today::after {
	box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--wp--preset--color--ink) 52%, transparent);
}

/* unavailable family */
.sfhb-cg__cell.is-past,
.sfhb-cg__cell.is-far {
	cursor: default;
	opacity: 0.4;
}

.sfhb-cg__cell.is-booked {
	cursor: not-allowed;
}

.sfhb-cg__cell.is-booked .sfhb-cg__d {
	color: var(--wp--preset--color--muted);
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
	opacity: 0.75;
}

.sfhb-cg__cell.is-checkout::after {
	background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--wp--preset--color--muted) 24%, transparent) 50%);
}

.sfhb-cg__cell.is-cta .sfhb-cg__d,
.sfhb-cg__cell.is-short .sfhb-cg__d {
	color: var(--wp--preset--color--muted);
	text-decoration: underline dotted;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
}

.sfhb-cg__cell.is-minstay {
	opacity: 0.74;
}

.sfhb-cg__cell.is-disabled:not(.is-past):not(.is-far):not(.is-booked) {
	cursor: not-allowed;
}

/* Today after the same-day cut-off: looks as unavailable as it is (no ring, struck through, dimmed). */
.sfhb-cg__cell.is-today.is-disabled {
	opacity: 0.45;
}

.sfhb-cg__cell.is-today.is-disabled::after {
	box-shadow: none;
}

.sfhb-cg__cell.is-today.is-disabled .sfhb-cg__d {
	color: var(--wp--preset--color--muted);
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
}

.sfhb-cg__cell.is-static {
	cursor: default;
}

.sfhb-cg__cell.is-deal .sfhb-cg__p {
	color: var(--wp--preset--color--accent);
	font-weight: 800;
}

/* open-night tint (inline calendar only) — before the endpoint rules so those win */
:where(.sfhb-cal) .sfhb-cg__cell.is-free::after {
	background: color-mix(in srgb, var(--wp--preset--color--neon) 10%, transparent);
}

@media (hover: hover) {
	:where(.sfhb-cal) .sfhb-cg__cell.is-free:not(.is-disabled):not(.is-static):not(.is-in):not(.is-out):hover::after {
		background: color-mix(in srgb, var(--wp--preset--color--neon) 24%, transparent);
	}
}

/* range band + endpoints */
.sfhb-cg .sfhb-cg__cell.is-range::before,
.sfhb-cg .sfhb-cg__cell.is-preview::before {
	background: var(--wp--preset--color--turf);
	background: color-mix(in srgb, var(--wp--preset--color--accent-2) 17%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-preview::before {
	background: color-mix(in srgb, var(--wp--preset--color--accent-2) 9%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-in.has-band::before {
	inset-inline-start: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--accent-2) 17%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-out::before {
	inset-inline-end: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--accent-2) 17%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-hover-out::before {
	inset-inline-end: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--accent-2) 9%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-range::after,
.sfhb-cg .sfhb-cg__cell.is-preview::after {
	background: transparent;
	border-radius: 0;
}

.sfhb-cg .sfhb-cg__cell.is-in::after,
.sfhb-cg .sfhb-cg__cell.is-out::after {
	background: var(--wp--preset--color--ink);
}

.sfhb-cg .sfhb-cg__cell.is-hover-out::after {
	background: color-mix(in srgb, var(--wp--preset--color--ink) 60%, transparent);
}

.sfhb-cg .sfhb-cg__cell.is-in,
.sfhb-cg .sfhb-cg__cell.is-out,
.sfhb-cg .sfhb-cg__cell.is-hover-out {
	color: var(--wp--preset--color--base);
}

.sfhb-cg .sfhb-cg__cell.is-in .sfhb-cg__p,
.sfhb-cg .sfhb-cg__cell.is-out .sfhb-cg__p,
.sfhb-cg .sfhb-cg__cell.is-hover-out .sfhb-cg__p {
	color: inherit;
	opacity: 0.85;
}

.sfhb-cg .sfhb-cg__cell.is-in .sfhb-cg__d,
.sfhb-cg .sfhb-cg__cell.is-out .sfhb-cg__d {
	color: var(--wp--preset--color--base);
	text-decoration: none;
}

/* loading shimmer */
.sfhb-cg.is-loading .sfhb-cg__cell .sfhb-cg__d {
	opacity: 0.5;
}

@media (prefers-reduced-motion: no-preference) {
	.sfhb-cg.is-loading .sfhb-cg__cell.is-pending::after {
		animation: sfhb-cg-pulse 1.1s ease-in-out infinite alternate;
	}
}

@keyframes sfhb-cg-pulse {
	from {
		background: color-mix(in srgb, var(--wp--preset--color--muted) 6%, transparent);
	}

	to {
		background: color-mix(in srgb, var(--wp--preset--color--muted) 18%, transparent);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sfhb-cg__cell::after,
	.sfhb-gs__b {
		transition: none;
	}
}

@media (forced-colors: active) {
	.sfhb-cg .sfhb-cg__cell.is-in::after,
	.sfhb-cg .sfhb-cg__cell.is-out::after {
		background: Highlight;
	}

	.sfhb-cg .sfhb-cg__cell.is-in,
	.sfhb-cg .sfhb-cg__cell.is-out {
		color: HighlightText;
	}

	.sfhb-cg__cell.is-booked .sfhb-cg__d {
		color: GrayText;
	}
}

/* ==========================================================================
   5. availability-calendar block (.sfhb-cal)
   ========================================================================== */

.sfhb-cal {
	display: grid;
	gap: 18px;
	box-sizing: border-box;
	padding: 22px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--sfhb-radius-card, 16px);
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
}

.sfhb-cal__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 20px;
}

.sfhb-cal__title {
	margin: 0;
	font: 600 clamp(20px, 2.4vw, 26px) / 1.15 var(--sfhb-font-display, Georgia, serif);
	letter-spacing: -0.01em;
}

.sfhb-cal__sub {
	margin: 4px 0 0;
	color: var(--wp--preset--color--muted);
	font: 400 14px/1.45 var(--sfhb-font-body, system-ui, sans-serif);
}

.sfhb-cal__room {
	display: grid;
	gap: 5px;
	min-width: min(100%, 260px);
}

.sfhb-cal__room-label {
	color: var(--wp--preset--color--muted);
	font: 800 11px/1.2 var(--sfhb-font-ui, system-ui, sans-serif);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sfhb-cal__select {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink) 38%, transparent);
	border-radius: var(--sfhb-radius-input, 12px);
	background-color: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
	font: 600 14px/1.3 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-cal__select:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2);
	outline-offset: 2px;
}

.sfhb-cal__body {
	min-height: 120px;
}

.sfhb-cal .sfhb-cg {
	--sfhb-cg-h: 54px;
}

.sfhb-cal__status {
	min-height: 20px;
	margin: 0;
	color: var(--wp--preset--color--muted);
	font: 600 13px/1.5 var(--sfhb-font-ui, system-ui, sans-serif);
	text-align: center;
}

.sfhb-cal__skel {
	display: grid;
	place-items: center;
	min-height: 220px;
	margin: 0;
	border-radius: var(--sfhb-radius-card, 16px);
	background: var(--wp--preset--color--panel-2);
	color: var(--wp--preset--color--muted);
	font: 600 14px/1.4 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-cal__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 24px;
	padding-block-start: 14px;
	border-block-start: 1px solid var(--wp--preset--color--line);
}

.sfhb-cal__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--wp--preset--color--muted);
	font: 500 12.5px/1.3 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-cal__legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;
}

.sfhb-cal__key {
	display: inline-block;
	flex: none;
	box-sizing: border-box;
	width: 16px;
	height: 16px;
	border-radius: 5px;
}

.sfhb-cal__key--open {
	border: 1px solid var(--wp--preset--color--neon);
	background: color-mix(in srgb, var(--wp--preset--color--neon) 14%, transparent);
}

.sfhb-cal__key--booked {
	border: 1px solid var(--wp--preset--color--line);
	background: linear-gradient(to top right, transparent calc(50% - 1px), var(--wp--preset--color--muted) calc(50% - 1px), var(--wp--preset--color--muted) calc(50% + 1px), transparent calc(50% + 1px));
}

.sfhb-cal__key--selected {
	background: var(--wp--preset--color--ink);
}

.sfhb-cal__key--deal {
	display: inline-grid;
	place-items: center;
	width: auto;
	min-width: 16px;
	color: var(--wp--preset--color--accent);
	font: 800 11px/1 var(--sfhb-font-num, var(--sfhb-font-ui, system-ui, sans-serif));
}

.sfhb-cal__sum {
	margin: 0;
	font: 700 14px/1.4 var(--sfhb-font-ui, system-ui, sans-serif);
}

.sfhb-cal__actions {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-inline-start: auto;
}

.sfhb-cal.is-empty {
	place-items: center;
	color: var(--wp--preset--color--muted);
	text-align: center;
}

@media (max-width: 560px) {
	.sfhb-cal {
		padding: 14px;
	}

	.sfhb-cal .sfhb-cg {
		--sfhb-cg-h: 50px;
	}

	.sfhb-cal .sfhb-cg__month {
		flex-basis: 100%;
	}

	.sfhb-cal__room {
		width: 100%;
	}
}
