/*
 * Guested — Hospitable booking widget
 *
 * Deliberately unbranded. Everything visual hangs off the custom properties
 * below, so the client's theme can restyle the card by redeclaring them —
 * no need to fight specificity or edit this file.
 */

.guested-booking,
.guested-availability,
.guested-enquiry-standalone {
	--guested-accent: #1f513f;
	--guested-accent-text: #fff;
	--guested-text: #1c1c1c;
	--guested-muted: #6b6b6b;
	--guested-border: #ddd;
	--guested-surface: #fff;
	--guested-radius: 12px;
	--guested-unavailable: #bdbdbd;

	box-sizing: border-box;
	color: var(--guested-text);
	font-size: 15px;
	line-height: 1.45;
}

.guested-booking *,
.guested-availability *,
.guested-enquiry-standalone * {
	box-sizing: inherit;
}

.guested-booking {
	background: var(--guested-surface);
	border: 1px solid var(--guested-border);
	border-radius: var(--guested-radius);
	padding: 20px;
	max-width: 420px;
	box-shadow: 0 2px 16px rgba( 0, 0, 0, .06 );
}

/* ── Headline price ───────────────────────────────────────────── */

.guested-from-price {
	margin: 0 0 14px;
	font-size: 15px;
}
.guested-from-price strong { font-size: 22px; }
.guested-from-label,
.guested-from-price small { color: var(--guested-muted); }

/* ── Date bar ─────────────────────────────────────────────────── */

.guested-datebar {
	display: flex;
	align-items: stretch;
	position: relative;
	border: 1px solid var(--guested-border);
	border-radius: 8px;
	overflow: hidden;
}

.guested-datebar-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	background: none;
	border: 0;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.guested-datebar-btn.is-active { background: rgba( 0, 0, 0, .04 ); }
.guested-datebar-btn:focus-visible { outline: 2px solid var(--guested-accent); outline-offset: -2px; }

.guested-date-label {
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--guested-muted);
}

.guested-datebar-sep { width: 1px; background: var(--guested-border); }

.guested-dates-clear {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY( -50% );
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 50%;
	background: rgba( 0, 0, 0, .06 );
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: var(--guested-muted);
}

/* ── Calendar ─────────────────────────────────────────────────── */

.guested-cal-wrap { margin-top: 16px; }

.guested-cal-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}
.guested-cal-nav button {
	width: 32px;
	height: 32px;
	border: 1px solid var(--guested-border);
	border-radius: 50%;
	background: none;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	color: inherit;
}
.guested-cal-nav button:disabled { opacity: .35; cursor: default; }
.guested-cal-month-label { font-weight: 600; }

.guested-cal-grid {
	display: grid;
	grid-template-columns: repeat( 7, 1fr );
	gap: 2px;
}

.guested-cal-dow {
	text-align: center;
	font-size: 11px;
	color: var(--guested-muted);
	padding-bottom: 6px;
}

.guested-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	aspect-ratio: 1 / 1;
	min-height: 40px;
	padding: 2px;
	border: 0;
	border-radius: 6px;
	background: none;
	font: inherit;
	font-size: 13px;
	color: inherit;
	cursor: pointer;
}
.guested-day.is-empty { visibility: hidden; cursor: default; }

.guested-day-price {
	font-size: 9px;
	line-height: 1;
	color: var(--guested-muted);
}

.guested-day.is-available:hover { background: rgba( 0, 0, 0, .06 ); }
.guested-day.is-today { font-weight: 700; }

/* Past, booked and rule-blocked days all read as unpickable. Booked days
   get the strike-through because "someone has this" is worth showing;
   a day blocked only by a min-stay or checkout rule is merely dimmed. */
.guested-day.is-past,
.guested-day.is-unavailable,
.guested-day.is-blocked {
	color: var(--guested-unavailable);
	cursor: default;
}
.guested-day.is-unavailable .guested-day-num { text-decoration: line-through; }
.guested-day.is-past .guested-day-price,
.guested-day.is-unavailable .guested-day-price,
.guested-day.is-blocked .guested-day-price { display: none; }

.guested-day.is-in-range { background: rgba( 31, 81, 63, .10 ); border-radius: 0; }

.guested-day.is-selected {
	background: var(--guested-accent);
	color: var(--guested-accent-text);
}
.guested-day.is-selected .guested-day-price { color: rgba( 255, 255, 255, .8 ); }
.guested-day.is-checkin  { border-radius: 6px 0 0 6px; }
.guested-day.is-checkout { border-radius: 0 6px 6px 0; }

.guested-cal-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--guested-muted);
	min-height: 1.2em;
}

.guested-cal-key {
	display: flex;
	gap: 16px;
	font-size: 12px;
	color: var(--guested-muted);
	margin-top: 10px;
}
.guested-cal-key span::before {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	border-radius: 2px;
	vertical-align: -1px;
}
.guested-key-available::before   { background: var(--guested-accent); }
.guested-key-unavailable::before { background: var(--guested-unavailable); }

/* ── Guests ───────────────────────────────────────────────────── */

.guested-guest-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--guested-border);
}

.guested-guest-counter { display: flex; align-items: center; gap: 12px; }
.guested-guest-counter button {
	width: 30px;
	height: 30px;
	border: 1px solid var(--guested-border);
	border-radius: 50%;
	background: none;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: inherit;
}
.guested-guest-counter button:disabled { opacity: .3; cursor: default; }
.guested-guest-count { min-width: 1.5em; text-align: center; }

/* ── hidden must mean hidden ──────────────────────────────────── */
/*
 * The browser's own `[hidden] { display: none }` is an author-beatable
 * default: any rule of ours that sets `display` wins over it. `.guested-btn`
 * sets `display: block`, so every button we hid with the `hidden` attribute
 * stayed on screen — the JS was correct and the CSS quietly undid it.
 *
 * Scoped to our own components so it cannot affect the surrounding theme.
 */
.guested-booking [hidden],
.guested-availability [hidden],
.guested-enquiry-standalone [hidden] {
	display: none !important;
}

/* ── Buttons ──────────────────────────────────────────────────── */

.guested-btn {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 13px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--guested-accent);
	color: var(--guested-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.guested-btn:hover { filter: brightness( 1.08 ); }
.guested-btn:disabled { opacity: .6; cursor: default; }

.guested-link {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: var(--guested-accent);
	text-decoration: underline;
	cursor: pointer;
}

/* ── Price panel ──────────────────────────────────────────────── */

.guested-price-panel {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--guested-border);
}

.guested-price-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0;
}
.guested-price-total {
	margin-top: 6px;
	padding-top: 10px;
	border-top: 1px solid var(--guested-border);
	font-weight: 700;
}

.guested-price-indicative,
.guested-no-charge-note,
.guested-booking-note {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--guested-muted);
	text-align: center;
}

.guested-price-loading { margin: 0; color: var(--guested-muted); }

.guested-quote-error {
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba( 180, 40, 40, .07 );
	color: #9b2626;
	font-size: 14px;
}

/* ── Hand-off panels ──────────────────────────────────────────── */

.guested-widget-panel,
.guested-enquiry-panel {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--guested-border);
}

.guested-panel-back {
	border: 0;
	background: none;
	padding: 0 0 10px;
	font: inherit;
	font-size: 13px;
	color: var(--guested-muted);
	cursor: pointer;
}

.guested-widget-frame {
	display: block;
	width: 100%;
	min-height: 720px;
	border: 0;
	border-radius: 8px;
}

/* ── Enquiry form ─────────────────────────────────────────────── */

.guested-field { display: block; margin-bottom: 12px; }
.guested-field > span {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	color: var(--guested-muted);
}
.guested-field input,
.guested-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--guested-border);
	border-radius: 8px;
	font: inherit;
	color: inherit;
	background: var(--guested-surface);
}
.guested-field input:focus,
.guested-field textarea:focus {
	outline: 2px solid var(--guested-accent);
	outline-offset: -1px;
}

.guested-field-row { display: flex; gap: 10px; }
.guested-field-row .guested-field { flex: 1; }

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.guested-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.guested-enquiry-msg {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba( 31, 81, 63, .08 );
	font-size: 14px;
}
.guested-enquiry-msg.is-error {
	background: rgba( 180, 40, 40, .07 );
	color: #9b2626;
}

/* ── Fallback ─────────────────────────────────────────────────── */

.guested-booking-fallback {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--guested-border);
	font-size: 13px;
	color: var(--guested-muted);
	text-align: center;
}
.guested-booking-fallback p { margin: 0 0 4px; }
.guested-fallback-or { display: block; margin-top: 4px; }

.guested-error {
	padding: 10px 12px;
	border-left: 3px solid #b33;
	background: rgba( 180, 40, 40, .06 );
	font-size: 14px;
}

/* ── Mobile bar ───────────────────────────────────────────────── */

.guested-mobile-bar { display: none; }

@media ( max-width: 781px ) {
	.guested-booking { max-width: none; padding: 16px; }

	.guested-mobile-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 14px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 60;
		padding: 10px 16px;
		padding-bottom: calc( 10px + env( safe-area-inset-bottom ) );
		background: var(--guested-surface, #fff);
		border-top: 1px solid var(--guested-border, #ddd);
		box-shadow: 0 -2px 14px rgba( 0, 0, 0, .08 );
	}

	.guested-mobile-bar-price strong { font-size: 17px; }
	.guested-mobile-bar-price span { color: var(--guested-muted, #6b6b6b); font-size: 13px; }
	.guested-mobile-bar .guested-btn { width: auto; margin: 0; padding: 11px 20px; }

	.guested-widget-frame { min-height: 620px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.guested-booking * { scroll-behavior: auto !important; }
}

/* ── Property content shortcodes ──────────────────────────────── */

.guested-prop-field p { margin: 0 0 1em; }
.guested-prop-field p:last-child { margin-bottom: 0; }

/* Gallery */
.guested-gallery {
	display: grid;
	grid-template-columns: repeat( var( --guested-gallery-cols, 3 ), 1fr );
	gap: 10px;
	margin: 0 0 20px;
}

.guested-gallery-item { margin: 0; }

.guested-gallery-open {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	border-radius: 8px;
	overflow: hidden;
}

.guested-gallery-open img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform .3s ease;
}

.guested-gallery-open:hover img { transform: scale( 1.03 ); }
.guested-gallery-open:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.guested-gallery figcaption {
	margin-top: 5px;
	font-size: .82rem;
	opacity: .75;
}

/* Lightbox */
body.guested-lb-open { overflow: hidden; }

.guested-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	background: rgba( 0, 0, 0, .9 );
}

.guested-lightbox[hidden] { display: none; }

.guested-lb-figure {
	margin: 0;
	max-width: min( 1100px, 100% );
	max-height: 100%;
	text-align: center;
}

.guested-lb-figure img {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 6px;
}

.guested-lb-figure figcaption {
	margin-top: 10px;
	color: #fff;
	font-size: .9rem;
}

.guested-lightbox button {
	border: 0;
	background: rgba( 255, 255, 255, .12 );
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
	line-height: 1;
	flex: 0 0 auto;
}

.guested-lightbox button:hover { background: rgba( 255, 255, 255, .25 ); }
.guested-lb-close { position: absolute; top: 16px; right: 16px; }

/* Amenities */
.guested-amenities {
	display: grid;
	grid-template-columns: repeat( var( --guested-amenity-cols, 2 ), 1fr );
	gap: 8px 20px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.guested-amenities li {
	position: relative;
	padding-left: 22px;
}

.guested-amenities li::before {
	content: "✓";
	position: absolute;
	left: 0;
	opacity: .55;
}

.guested-amenities-more { font-size: .88rem; opacity: .7; margin: 0 0 16px; }

/* Capacity */
.guested-capacity {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
}

.guested-capacity li { display: flex; align-items: baseline; gap: 5px; }
.guested-capacity strong { font-size: 1.15rem; }
.guested-capacity span { opacity: .75; }

/* Rooms */
.guested-rooms { margin: 0 0 18px; padding: 0; list-style: none; }

.guested-rooms li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px solid var( --guested-border, #e5e5e5 );
}

.guested-rooms li:last-child { border-bottom: 0; }
.guested-rooms span { opacity: .75; text-align: right; }

/* Location */
.guested-location-line { margin: 0 0 12px; font-weight: 600; }

.guested-location-map iframe {
	display: block;
	width: 100%;
	min-height: 320px;
	border: 0;
	border-radius: 8px;
}

/* Rules */
.guested-rules { margin: 0 0 18px; padding: 0; list-style: none; }

.guested-rules li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px solid var( --guested-border, #e5e5e5 );
}

.guested-rules li:last-child { border-bottom: 0; }
.guested-rule-value { opacity: .75; }

@media ( max-width: 640px ) {
	.guested-gallery { grid-template-columns: repeat( 2, 1fr ); }
	.guested-amenities { grid-template-columns: 1fr; }
	.guested-lightbox { padding: 12px; gap: 4px; }
	.guested-lightbox button { width: 38px; height: 38px; }
}

/* ── Property page layout ─────────────────────────────────────── */
/*
 * Two columns with the booking card pinned as you scroll the content,
 * collapsing to one column with the fixed mobile bar on small screens.
 *
 * Two things this depends on:
 *   - align-items: start. Without it the grid stretches the aside to full
 *     row height, and a sticky element inside a full-height box has nowhere
 *     to travel, so it silently never sticks.
 *   - No ancestor with overflow other than visible. `overflow: hidden` on any
 *     wrapper up the tree disables sticky just as silently. If the card stops
 *     pinning after a theme change, that is the first thing to check.
 */

.guested-layout {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 400px;
	gap: 56px;
	align-items: start;
	margin: 0 0 40px;
}

/*
 * Block themes constrain every child of the post content to `content-size`
 * (645px in Twenty Twenty-Five), which squeezes the two columns to about
 * 190px + 400px. The markup carries `alignwide` so block themes widen it
 * natively; this rule pins the same width with enough specificity to win
 * regardless of stylesheet order, and gives non-block themes a sane value.
 */
.guested-layout.alignwide {
	max-width: var( --wp--style--global--wide-size, 1340px );
	width: 100%;
}

.guested-layout-main { min-width: 0; }

.guested-layout-side {
	position: sticky;
	top: var( --guested-sticky-top, 24px );
	/* A 12-month card can outgrow a short viewport; let it scroll inside
	   itself rather than pinning its top and hiding the button. */
	max-height: calc( 100vh - ( var( --guested-sticky-top, 24px ) * 2 ) );
	overflow-y: auto;
	overscroll-behavior: contain;
}

.guested-layout-side .guested-booking { max-width: none; }

/* The admin bar is fixed over the top of the page for logged-in users. */
.admin-bar .guested-layout-side { --guested-sticky-top: 56px; }

.guested-section-title {
	margin: 36px 0 14px;
	font-size: 1.35rem;
	line-height: 1.25;
}

.guested-layout-main > *:first-child,
.guested-layout-main > .guested-section-title:first-child { margin-top: 0; }

@media ( max-width: 1024px ) {
	.guested-layout {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	/* Single column: pinning it would just cover the content. */
	.guested-layout-side {
		position: static;
		max-height: none;
		overflow: visible;
	}

	.guested-layout-side .guested-booking { max-width: 420px; }
}

@media ( max-width: 781px ) {
	.guested-layout-side .guested-booking { max-width: none; }
	/* Clear the fixed mobile bar at the foot of the page. */
	.guested-layout { padding-bottom: 76px; }
}

/* ── Widget-mode card ─────────────────────────────────────────── */
/*
 * The slim card shown when Hospitable's widget takes the booking. It has no
 * calendar, guest picker or price of its own — the widget draws all three —
 * so it is mostly whitespace and one button, and needs a little breathing
 * room to not look unfinished.
 */

.guested-widget-intro {
	margin: 0 0 16px;
	color: var( --guested-muted, #6b6b6b );
	font-size: 14px;
	line-height: 1.5;
}

.guested-booking[data-layout="widget"] .guested-from-price { margin-bottom: 10px; }

.guested-booking[data-layout="widget"] .guested-widget-panel {
	margin-top: 14px;
	padding-top: 12px;
}

/* ── Card payment ─────────────────────────────────────────────── */

.guested-payment-panel {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var( --guested-border, #e5e5e5 );
}

.guested-pay-heading {
	margin: 12px 0 12px;
	font-size: 1.05rem;
}

.guested-pay-summary {
	margin-bottom: 12px;
	padding: 10px 12px;
	background: var( --guested-surface-alt, #f7f7f7 );
	border-radius: 8px;
	font-weight: 600;
}

/* Stripe mounts its own iframe here; give it room so the form does not
   jump as the Payment Element finishes loading. */
.guested-card-element {
	min-height: 220px;
	margin-bottom: 14px;
}

.guested-pay-note {
	margin: 10px 0 0;
	font-size: .82rem;
	color: var( --guested-muted, #6b6b6b );
	text-align: center;
}

.guested-pay-error {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fdeaea;
	color: #97231f;
	font-size: .9rem;
}

.guested-pay-done {
	padding: 6px 0 4px;
}

.guested-pay-done-body {
	margin: 0;
	line-height: 1.55;
}

.guested-pay-continue,
.guested-pay-submit {
	width: 100%;
	margin-top: 6px;
}

.guested-pay-details .guested-field { margin-bottom: 10px; }

.guested-test-banner {
	margin: 12px 0 4px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fff4e5;
	border: 1px solid #f0c98a;
	color: #7a4b00;
	font-size: .85rem;
	line-height: 1.45;
}

/* ── Property grid ────────────────────────────────────────────── */

.guested-properties {
	display: grid;
	grid-template-columns: repeat( var( --guested-properties-cols, 3 ), 1fr );
	gap: 28px 24px;
	margin: 0 0 32px;
}

.guested-property-card {
	border: 1px solid var( --guested-border, #e5e5e5 );
	border-radius: 12px;
	overflow: hidden;
	background: var( --guested-surface, #fff );
	transition: box-shadow .2s ease, transform .2s ease;
}

.guested-property-card:hover {
	box-shadow: 0 6px 22px rgba( 0, 0, 0, .09 );
	transform: translateY( -2px );
}

.guested-property-card.is-unavailable { opacity: .62; }

.guested-property-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.guested-property-image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.guested-property-body { padding: 14px 16px 16px; }

.guested-property-name {
	margin: 0 0 4px;
	font-size: 1.02rem;
	line-height: 1.35;
}

.guested-property-place,
.guested-property-facts {
	margin: 0 0 4px;
	font-size: .86rem;
	color: var( --guested-muted, #6b6b6b );
}

.guested-property-price {
	margin: 10px 0 0;
	font-weight: 600;
	font-size: .92rem;
}

.guested-property-price.is-loading { opacity: .6; font-weight: 400; }
.guested-property-price.is-unavailable { color: var( --guested-muted, #6b6b6b ); font-weight: 400; }

@media ( max-width: 900px ) {
	.guested-properties { grid-template-columns: repeat( 2, 1fr ); }
}

@media ( max-width: 560px ) {
	.guested-properties { grid-template-columns: 1fr; }
}

/* ── Discount code ────────────────────────────────────────────── */

.guested-code { margin-top: 10px; }

.guested-code-toggle { font-size: .88rem; }

.guested-code-entry {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}

.guested-code-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 11px;
	border: 1px solid var( --guested-border, #ddd );
	border-radius: 8px;
	font: inherit;
	text-transform: uppercase;
}

.guested-code-apply {
	flex: 0 0 auto;
	padding: 9px 16px;
	border: 1px solid var( --guested-border, #ddd );
	border-radius: 8px;
	background: none;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.guested-code-apply:hover { background: var( --guested-surface-alt, #f5f5f5 ); }

.guested-code-msg {
	margin: 7px 0 0;
	font-size: .84rem;
	color: var( --guested-muted, #6b6b6b );
}

.guested-code-msg.is-error { color: #97231f; }

.guested-price-discount { color: #1c7c40; }
.guested-price-discount-amount { white-space: nowrap; }
