/*
Theme Name: The House
Theme URI: https://bananabees.co.uk/the-house/
Author: Barnaby
Description: Minimal classic theme for a single holiday-let property. Hand-coded layout, core blocks for page content, native Gallery block lightbox.
Version: 1.0.0
Requires at least: 7.0
Requires PHP: 8.0
License: All Rights Reserved
Text Domain: the-house
*/

/* =========================================================================
   RESET
   ========================================================================= */
*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
	font-family: inherit;
}

p,
h1,
h2,
h3,
h4 {
	overflow-wrap: break-word;
}

p {
	text-wrap: pretty;
}

/* =========================================================================
   TOKENS
   ========================================================================= */
:root {
	--paper: #faf8f4;
	--paper-warm: #f3efe7;
	--ink: #2b2a26;
	--ink-soft: #5f5c54;
	--brick: #9c5a3c;
	--sage: #6f7a63;
	--line: rgb(43 42 38 / 0.14);

	--font-display: "EB Garamond", Georgia, "Times New Roman", serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--wrap: 68rem;
	--measure: 42rem;

	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 2rem;
	--space-lg: 3.5rem;
	--space-xl: 5.5rem;

	--nav-h: 3.75rem;
}

/* =========================================================================
   BASE
   ========================================================================= */
html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-h);
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	/* Display face site-wide; --font-body stays defined in case anything
	   needs to opt back into the sans stack later. */
	font-family: var(--font-display);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.4rem, 6vw, 4rem);
}

h2 {
	font-size: clamp(1.9rem, 4vw, 2.75rem);
}

h3 {
	font-size: clamp(1.35rem, 2.4vw, 1.7rem);
}

a {
	color: var(--brick);
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--ink);
}

:where(h1, h2, h3, h4, p, ul, ol, figure):where(:not(:last-child)) {
	margin-bottom: 1em;
}

/* Visible focus for keyboard users. */
:focus-visible {
	outline: 2px solid var(--brick);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999;
	padding: 0.75rem 1rem;
	background: var(--ink);
	color: var(--paper);
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
}

/* =========================================================================
   LAYOUT HELPERS
   ========================================================================= */
.wrap {
	width: min(100% - 2.5rem, var(--wrap));
	margin-inline: auto;
}

.wrap--narrow {
	width: min(100% - 2.5rem, var(--measure));
	margin-inline: auto;
}

.section {
	padding-block: var(--space-lg);
}

@media (min-width: 48rem) {
	.section {
		padding-block: var(--space-xl);
	}
}

.section--warm {
	background: var(--paper-warm);
}

.section__title {
	margin-bottom: var(--space-md);
}

.txt-center {
	text-align: center;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
	display: inline-block;
	padding: 0.85em 1.8em;
	border: 1px solid var(--ink);
	border-radius: 2px;
	background: var(--ink);
	color: var(--paper);
	font-size: 0.95rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
	background: transparent;
	color: var(--ink);
}

.btn--light {
	border-color: #fff;
	background: #fff;
	color: var(--ink);
}

.btn--light:hover,
.btn--light:focus-visible {
	background: transparent;
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	.btn {
		transition: none;
	}
}

/* =========================================================================
   HEADER / NAV
   ========================================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgb(250 248 244 / 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	min-height: var(--nav-h);
}

/*
 * Wordmark and links are different sizes, so matching line-height alone
 * doesn't align them. Both are flex children centred on the cross axis,
 * with line-height normalised so the serif's ascenders don't shift them.
 */
.site-header__inner > * {
	display: flex;
	align-items: center;
	line-height: 1;
}

.site-title {
	display: flex;
	align-items: center;
	font-family: var(--font-display);
	font-size: 1.35rem;
	line-height: 1;
	letter-spacing: 0.01em;
}

.site-title a {
	color: var(--ink);
	text-decoration: none;
}

.nav__list {
	display: flex;
	align-items: center;
	line-height: 1;
	gap: 1.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav__list li {
	margin: 0;
}

.nav__list a {
	display: flex;
	align-items: center;
	color: var(--ink);
	font-size: 1.05rem;
	letter-spacing: 0.02em;
	line-height: 1;
	text-decoration: none;
}

.nav__list a:hover,
.nav__list a:focus-visible {
	color: var(--brick);
}

@media (max-width: 30rem) {
	.site-title {
		font-size: 1.1rem;
	}

	.nav__list {
		gap: 1rem;
	}

	.nav__list a {
		font-size: 0.875rem;
	}
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
	position: relative;
	display: grid;
	place-items: end center;
	min-height: min(78vh, 44rem);
	overflow: hidden;
	background: var(--ink);
}

.hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgb(0 0 0 / 0.25) 0%,
		rgb(0 0 0 / 0.05) 35%,
		rgb(0 0 0 / 0.55) 100%
	);
}

.hero__content {
	position: relative;
	padding-block: var(--space-lg);
	color: #fff;
	text-align: center;
	text-shadow: 0 1px 20px rgb(0 0 0 / 0.35);
}

.hero__title {
	color: #fff;
}

.hero__sub {
	margin-top: 0.4em;
	font-family: var(--font-display);
	font-size: clamp(1.1rem, 2.2vw, 1.5rem);
	font-style: italic;
}

.hero__cta {
	margin-top: var(--space-md);
}

/* =========================================================================
   INTRO
   ========================================================================= */
.intro {
	text-align: center;
	/* Paper-on-paper, so the bottom padding just adds dead space. Restore
	   this if the intro or the section below it ever gets its own colour. */
	padding-bottom: 0;
}

.intro p {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
	line-height: 1.5;
	color: var(--ink-soft);
}

/* =========================================================================
   PAGE CONTENT (block editor output)
   ========================================================================= */
.entry-content > * {
	width: min(100% - 2.5rem, var(--measure));
	margin-inline: auto;
}

.entry-content > .alignwide {
	width: min(100% - 2.5rem, var(--wrap));
}

.entry-content > .alignfull {
	width: 100%;
	max-width: none;
}

.entry-content > * + * {
	margin-top: 1.5rem;
}

.entry-content h2 {
	margin-top: 2.5rem;
}

.entry-content h3 {
	margin-top: 2rem;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.3em;
}

.entry-content li + li {
	margin-top: 0.35em;
}

/* =========================================================================
   GALLERY (core Gallery block)

   Deliberately light-touch. The block supplies its own layout and the
   lightbox (with prev/next since WP 7.0); this only tidies the grid and
   makes images a consistent shape.
   ========================================================================= */
.wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: 0.5rem;
	gap: 0.5rem;
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
	border-radius: 2px;
	overflow: hidden;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.4s ease, filter 0.4s ease;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	transform: scale(1.02);
	filter: brightness(1.04);
}

/* Cursor hint that an image opens the lightbox. */
.wp-block-image .wp-lightbox-container button {
	cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.has-nested-images figure.wp-block-image img {
		transition: none;
	}

	.wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
		transform: none;
	}
}

/* Caption styling for gallery and standalone images. */
.wp-block-image figcaption,
.wp-block-gallery figcaption {
	margin-top: 0.5em;
	color: var(--ink-soft);
	font-size: 0.85rem;
	text-align: center;
}

/* Lightbox overlay: warm paper background rather than stark white. */
.wp-lightbox-overlay .scrim {
	background: var(--ink);
	opacity: 0.94;
}

.wp-lightbox-overlay button {
	color: #fff;
}

/* =========================================================================
   BOOKING
   ========================================================================= */
.booking {
	scroll-margin-top: var(--nav-h);
}

.booking__intro {
	margin-bottom: var(--space-md);
	color: var(--ink-soft);
}

.booking__widget {
	margin-inline: auto;
}

/* Give plugin-rendered forms a little breathing room without fighting them. */
.booking__widget form {
	margin-inline: auto;
}

.booking__placeholder {
	padding: var(--space-md);
	border: 1px dashed var(--line);
	border-radius: 3px;
	background: var(--paper);
	color: var(--ink-soft);
	font-size: 0.95rem;
}

/* =========================================================================
   PAGE HEADER (interior pages)
   ========================================================================= */
.page-header {
	padding-block: var(--space-lg) var(--space-md);
	text-align: center;
}

.page-header__title {
	margin: 0;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer {
	padding-block: var(--space-lg);
	border-top: 1px solid var(--line);
	background: var(--paper-warm);
	color: var(--ink-soft);
	font-size: 0.9rem;
	text-align: center;
}

.site-footer p {
	margin-bottom: 0.35em;
}

.site-footer__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.25rem;
	margin-bottom: 0.75rem;
}

.site-footer a {
	color: var(--ink-soft);
}

.site-footer a:hover {
	color: var(--ink);
}

/* =========================================================================
   404
   ========================================================================= */
.error-404 {
	padding-block: var(--space-xl);
	text-align: center;
}

/* =========================================================================
   BOOKING — calendar
   ========================================================================= */
.booking__cal {
	margin-bottom: var(--space-md);
}

.booking__callabel {
	margin-bottom: 0.75rem;
	font-family: var(--font-display);
	font-size: 1.25rem;
}

.cal {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--space-md);
	max-height: 26rem;
	overflow-y: auto;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--paper);
	text-align: left;
	overscroll-behavior: contain;
}

.cal__name {
	margin-bottom: 0.5rem;
	font-size: 1.05rem;
	font-weight: 500;
	text-align: center;
}

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

.cal__dow {
	padding-bottom: 0.25rem;
	color: var(--ink-soft);
	font-size: 0.7rem;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.cal__pad {
	aspect-ratio: 1;
}

.cal__day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: transparent;
	color: var(--ink);
	font-size: 0.8rem;
	font-family: inherit;
	line-height: 1;
}

button.cal__day.is-free {
	cursor: pointer;
	background: rgb(111 122 99 / 0.12);
	transition: background-color 0.12s ease;
}

button.cal__day.is-free:hover,
button.cal__day.is-free:focus-visible {
	background: rgb(111 122 99 / 0.35);
}

.cal__day.is-past {
	color: rgb(43 42 38 / 0.25);
}

.cal__day.is-taken {
	background: rgb(43 42 38 / 0.07);
	color: rgb(43 42 38 / 0.3);
	text-decoration: line-through;
}

button.cal__day.is-start,
button.cal__day.is-end {
	background: var(--ink);
	color: var(--paper);
	font-weight: 600;
}

button.cal__day.is-within {
	background: rgb(43 42 38 / 0.18);
}

.cal__key {
	display: flex;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 0.75rem;
	color: var(--ink-soft);
	font-size: 0.85rem;
}

.cal__keyitem {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.cal__swatch {
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 2px;
}

.cal__swatch.is-free {
	background: rgb(111 122 99 / 0.35);
}

.cal__swatch.is-taken {
	background: rgb(43 42 38 / 0.12);
}

@media (prefers-reduced-motion: reduce) {
	button.cal__day.is-free {
		transition: none;
	}
}

/* =========================================================================
   BOOKING — form
   ========================================================================= */
.booking__form {
	text-align: left;
}

.booking__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
}

.booking__field {
	flex: 1 1 10rem;
	margin-bottom: var(--space-sm);
}

.booking__field--wide {
	flex-basis: 100%;
}

.booking__field label {
	display: block;
	margin-bottom: 0.3rem;
	color: var(--ink-soft);
	font-size: 0.85rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.booking__field input,
.booking__field select,
.booking__field textarea {
	width: 100%;
	padding: 0.65em 0.75em;
	border: 1px solid var(--line);
	border-radius: 2px;
	background: var(--paper);
	color: var(--ink);
}

.booking__field input:focus-visible,
.booking__field select:focus-visible,
.booking__field textarea:focus-visible {
	outline: 2px solid var(--brick);
	outline-offset: 1px;
}

/* Honeypot: present for bots, gone for everyone else. */
.booking__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.booking__extras {
	margin-bottom: var(--space-sm);
	padding: 0.9rem 1rem;
	border: 1px solid var(--line);
	border-radius: 2px;
}

.booking__extras legend {
	padding: 0 0.4rem;
	color: var(--ink-soft);
	font-size: 0.85rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.booking__extra {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.25rem 0;
	cursor: pointer;
}

.booking__extraprice {
	margin-left: auto;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.booking__submit {
	margin-top: var(--space-sm);
}

.booking__reassure {
	margin-top: 0.75rem;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.booking__errors {
	margin-bottom: var(--space-sm);
	padding: 0.9rem 1rem;
	border-left: 3px solid var(--brick);
	background: rgb(156 90 60 / 0.08);
	text-align: left;
}

.booking__errors p:last-child {
	margin-bottom: 0;
}

.booking__done {
	padding: var(--space-md);
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--paper);
}

/* =========================================================================
   BOOKING — quote
   ========================================================================= */
.booking__quote {
	margin-bottom: var(--space-sm);
}

.quote {
	padding: 1rem 1.15rem;
	border: 1px solid var(--line);
	border-radius: 3px;
	background: var(--paper);
	text-align: left;
}

.quote__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.3rem 0;
}

.quote__total {
	margin-top: 0.4rem;
	padding-top: 0.7rem;
	border-top: 1px solid var(--line);
	font-family: var(--font-display);
	font-size: 1.3rem;
}

.quote__sub {
	color: var(--ink-soft);
	font-size: 0.9rem;
}

.quote__note {
	margin: 0.6rem 0 0;
	color: var(--ink-soft);
	font-size: 0.85rem;
	line-height: 1.4;
}

.quote__error {
	padding: 0.9rem 1rem;
	border-left: 3px solid var(--brick);
	background: rgb(156 90 60 / 0.08);
	text-align: left;
}

.quote__loading {
	padding: 0.9rem 0;
	color: var(--ink-soft);
	font-size: 0.9rem;
}

/* Required-field marker. */
.booking__field .req {
	color: var(--brick);
}

/* The submit control is a <button>; make that obvious. */
.booking__submit .btn,
button.btn {
	cursor: pointer;
}

/*
 * Refreshing the estimate fades it rather than replacing it, so the page
 * doesn't jump every time the guest count or an extra changes.
 */
.booking__quote {
	transition: opacity 0.15s ease;
}

.booking__quote.is-loading {
	opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
	.booking__quote {
		transition: none;
	}
}

/* =========================================================================
   LAYOUT — footer fills the viewport, no gap underneath

   The sticky-footer pattern: body is a column, main grows, footer sits at
   the bottom. Guarantees no dead space below the footer on a short page,
   whatever is appended to <body> afterwards (the lightbox markup, plugin
   output, anything else).

   100dvh rather than 100vh: on iOS, 100vh is the viewport with the browser
   chrome *hidden*, which is why content ends up behind the address bar and
   leaves a strip when it reappears. dvh tracks the real height.
   ========================================================================= */
html {
	/* Shows through the iOS address-bar area and any rubber-band overscroll,
	   so there is never a bare white strip at the bottom. */
	background: var(--paper-warm);
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;      /* fallback for older browsers */
	min-height: 100dvh;
}

body > main {
	flex: 1 0 auto;
}

.site-footer {
	flex-shrink: 0;
}

/* =========================================================================
   GALLERY LIGHTBOX (core Gallery block)

   Core supplies the behaviour; this only restyles it. Selectors follow
   WordPress's own markup, so if core renames something the page still works,
   it just reverts to core's default look.
   ========================================================================= */

/*
 * iOS: double-tapping a button zooms the page. Because the overlay is
 * position: fixed, the zoomed page cannot be scrolled back and the viewer is
 * stuck until they reload. touch-action: manipulation disables double-tap
 * zoom on these elements while leaving scrolling and pinch alone.
 */
.wp-lightbox-overlay,
.wp-lightbox-overlay * {
	touch-action: manipulation;
}

.wp-lightbox-overlay {
	-webkit-tap-highlight-color: transparent;
}

/* Backdrop: black at 50%, lightly blurred. */
.wp-lightbox-overlay .scrim {
	background-color: rgb(0 0 0 / 0.5);
	opacity: 1;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* Controls: white pills, large enough to hit on a phone. */
.wp-lightbox-overlay button,
.wp-lightbox-overlay .close-button,
.wp-lightbox-overlay .previous-button,
.wp-lightbox-overlay .next-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50px;
	background: #fff;
	color: var(--ink);
	box-shadow: 0 2px 10px rgb(0 0 0 / 0.25);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
}

.wp-lightbox-overlay button:hover,
.wp-lightbox-overlay button:focus-visible {
	background: #fff;
	color: var(--brick);
}

.wp-lightbox-overlay button svg {
	width: 1.5rem;
	height: 1.5rem;
	fill: currentColor;
}

/* Bigger targets on touch screens — 3.5rem clears the 44px minimum
   comfortably, and the arrows sit further from the screen edge. */
@media (max-width: 48rem) {
	.wp-lightbox-overlay button,
	.wp-lightbox-overlay .close-button,
	.wp-lightbox-overlay .previous-button,
	.wp-lightbox-overlay .next-button {
		width: 3.5rem;
		height: 3.5rem;
	}

	.wp-lightbox-overlay button svg {
		width: 1.75rem;
		height: 1.75rem;
	}

	.wp-lightbox-overlay .previous-button {
		left: 0.75rem;
	}

	.wp-lightbox-overlay .next-button {
		right: 0.75rem;
	}
}

/*
 * Root cause of the gap below the footer: the lightbox overlay markup sits
 * after the footer and, if core's own positioning doesn't apply, contributes
 * its full height to the document.
 *
 * Forcing it out of normal flow fixes it at source. These are core's own
 * values, restated — if core's CSS is working, this changes nothing.
 */
.wp-lightbox-overlay {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	z-index: 100000;
}

/* Closed overlay must not intercept clicks or be reachable by keyboard. */
.wp-lightbox-overlay:not(.active) {
	visibility: hidden;
	pointer-events: none;
}

/*
 * Fallback for the overlay, matched by attribute rather than class name.
 * The Interactivity API attribute has been stable since WP 6.4, so this
 * holds even if the class is renamed in a future release.
 */
body > div[data-wp-interactive],
body > div[class*="lightbox"],
body > div[class*="light-box"] {
	position: fixed;
	inset: 0;
	pointer-events: none;
}

body > div[data-wp-interactive].active,
body > div[class*="lightbox"].active {
	pointer-events: auto;
}

/*
 * iOS: double-tapping a gallery image zooms the page instead of opening the
 * lightbox, and the zoom then traps the viewer. Opening on tap is what people
 * expect, so double-tap zoom is simply switched off on gallery images and on
 * the buttons core wraps them in.
 */
.wp-block-gallery figure.wp-block-image,
.wp-block-gallery figure.wp-block-image img,
.wp-block-image img,
.wp-lightbox-container,
.wp-lightbox-container button {
	touch-action: manipulation;
}

/* Hero text over a photo: a tighter dark shadow so it stays readable
   against bright sky as well as dark foliage. */
.hero__content {
	text-shadow:
		0 1px 3px rgb(0 0 0 / 0.55),
		0 2px 12px rgb(0 0 0 / 0.5),
		0 1px 24px rgb(0 0 0 / 0.35);
}

/* =========================================================================
   CALENDAR — stop it contributing height to the page

   The calendar is 12 months of grid inside a 26rem scroll container. If the
   clipping is defeated for any reason, all ~120rem of it counts toward the
   document height while painting as blank space, which is the dead area
   below the footer.

   Three belts:
   - min-height: 0 — a grid/flex item defaults to min-height:auto, which
     refuses to shrink below its content. That alone makes a scroll container
     grow to full content height instead of scrolling.
   - contain: layout paint — descendants cannot affect layout outside this
     element, nor paint beyond it. Designed for exactly this.
   - overflow: hidden on the wrapper — catches anything that still escapes.
   ========================================================================= */
.booking__cal {
	overflow: hidden;
	min-width: 0;
}

.cal {
	max-height: min(26rem, 60vh);
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	contain: layout paint;
}

.cal__month,
.cal__grid {
	min-width: 0;
}

/* =========================================================================
   TWEAKS
   ========================================================================= */

/* Hero button is black on white — it inherits the hero's text shadow, which
   just makes it look smudged. */
.hero__cta .btn,
.hero__content .btn {
	text-shadow: none;
}

/* ---- Header: identical boxes, so the wordmark and links line up ----
   Centring two different font sizes in a flex row centres their boxes, which
   still reads as misaligned. Giving both children the same min-height and
   centring their own contents makes them genuinely level. */
.site-title,
.nav,
.nav__list {
	display: flex;
	align-items: center;
	min-height: var(--nav-h);
}

.site-title a {
	display: flex;
	align-items: center;
	min-height: var(--nav-h);
}

/* Links fill the full bar height, so the tap target is the whole strip
   rather than the glyphs. */
.nav__list a {
	min-height: var(--nav-h);
	padding: 0 0.6rem;
}

@media (max-width: 30rem) {
	/* Padding provides the spacing, so the gap shrinks to compensate. */
	.nav__list {
		gap: 0;
	}

	.nav__list a {
		padding: 0 0.7rem;
		font-size: 1rem;
	}

	/* Keep the last link flush with the page edge. */
	.nav__list li:last-child a {
		padding-right: 0;
	}
}

/* ---- Form fields: stop date inputs overflowing on iOS ----
   Date inputs have a large intrinsic width on iOS, and a flex item defaults
   to min-width:auto, so it refuses to shrink below that and overflows. */
.booking__row {
	min-width: 0;
}

.booking__field {
	min-width: 0;
}

.booking__field input,
.booking__field select,
.booking__field textarea {
	min-width: 0;
	max-width: 100%;
}

.booking__field input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
}
