/* Reusable components: buttons, cards, video facade. */

.button {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4);
	background: var(--color-primary);
	color: var(--color-primary-contrast);
	border: 2px solid var(--color-primary);
	border-radius: var(--radius);
	font-weight: 600;
	text-decoration: none;
}

.button:hover {
	background: transparent;
	color: var(--color-primary);
}

/* "My bookings" in the menus' visit details (template-parts/my-bookings-button.php):
 * ink with green words, like the reference in the booking emails. */
.my-bookings-button {
	display: inline-flex;
	justify-self: start;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--ink);
	border: 1px solid var(--green);
	color: var(--green);
	font: 700 0.9375rem/1 var(--m);
	text-decoration: none;
}

.my-bookings-button:hover,
.my-bookings-button[aria-current="page"] {
	background: var(--green);
	color: var(--ink);
}

/* ---------- News rows (template-parts/card.php) ----------
 * One post per row on paper: date, title and summary, the photo beside
 * them. The whole row is the link.
 */
.news {
	border-bottom: 1px solid var(--ink-rule);
}

.card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
	gap: clamp(1rem, 3vw, 3rem);
	align-items: start;
	padding-block: clamp(1.25rem, 2.4vw, 2rem);
	border-top: 1px solid var(--ink-rule);
}

.card:not(:has(.card__image)) {
	grid-template-columns: 1fr;
}

.card__meta {
	margin: 0 0 0.5rem;
	font: 500 0.75rem/1.4 var(--g);
	letter-spacing: 0.06em;
	color: var(--ink-mute);
}

.card__title {
	margin-bottom: 0.625rem;
	font: 700 clamp(1.5rem, 2.6vw, 2.25rem)/1.02 var(--m);
	letter-spacing: -0.035em;
}

.card__title a {
	text-decoration: none;
}

/* The link covers the whole row. */
.card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card:hover .card__title a {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.card__body p {
	max-width: 60ch;
	margin: 0;
	color: var(--ink-mute);
}

.card__image img {
	width: 100%;
	aspect-ratio: 10 / 7;
}

@media (max-width: 760px) {
	.card {
		grid-template-columns: 1fr;
	}

	.card__image {
		order: -1;
	}
}

/* ---------- Documents to download (template-parts/documents.php) ----------
 * On paper by default; set --docs-rule and --docs-mute for other grounds.
 */
.docs__title {
	margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
	font: 600 0.625rem/1.5 var(--g);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--docs-mute, var(--ink-mute));
}

.docs li {
	border-top: 1px solid var(--docs-rule, var(--ink-rule));
}

.docs a {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.75rem 0;
	font-weight: 600;
	text-decoration: none;
}

.docs a:hover span {
	text-decoration: underline;
}

.docs small {
	flex: none;
	font: 500 0.6875rem/1.4 var(--g);
	letter-spacing: 0.06em;
	color: var(--docs-mute, var(--ink-mute));
}

/* ---------- Forms (template-parts/contact-form.php) ----------
 * On paper: a label over each field, an ink rule under it that thickens
 * when in use, and what to fix in pink-red above the field. The button is
 * ink with cyan words, as the closing call to action.
 */
.form {
	display: grid;
	gap: clamp(1.125rem, 2vw, 1.5rem);
}

.form__row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1.125rem, 2vw, 1.5rem) clamp(1rem, 2.5vw, 2rem);
}

.form__field {
	display: grid;
	gap: 0.375rem;
	margin: 0;
}

.form__field label {
	font: 600 0.625rem/1.5 var(--g);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.form__hint {
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--ink-mute);
}

.form input,
.form select,
.form textarea {
	width: 100%;
	min-height: 2.875rem;
	padding: 0.625rem 0.75rem;
	background: #fff;
	border: 1px solid var(--ink-rule);
	border-bottom: 2px solid var(--ink);
	border-radius: 0;
	color: var(--ink);
	font-size: 1rem;
}

.form textarea {
	min-height: 9rem;
	line-height: 1.5;
	resize: vertical;
}

.form select {
	appearance: none;
	padding-right: 2.25rem;
	/* A small ink chevron. */
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111c1d' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 0.875rem center;
}

.form :is(input, select, textarea):focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 0;
	border-bottom-width: 3px;
}

.form [aria-invalid="true"] {
	border-color: #b3124f;
	border-bottom-width: 3px;
}

.form__error {
	margin: 0;
	font-weight: 700;
	font-size: 0.9375rem;
	color: #b3124f;
}

.form__problems {
	padding: 1rem 1.25rem;
	border: 3px solid #b3124f;
	background: #fff;
}

.form__problems h2 {
	margin-bottom: 0.5rem;
	font: 700 1.25rem/1.2 var(--m);
	letter-spacing: -0.02em;
}

.form__problems li + li {
	margin-top: 0.25rem;
}

.form__problems a {
	font-weight: 600;
	color: #b3124f;
}

/* Filled in only by bots. Off screen rather than display: none, which some bots skip. */
.form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Cloudflare Turnstile's box above Send: its height kept, so the page doesn't jump when it loads. */
.form__check {
	display: grid;
	gap: 0.5rem;
}

.form__check .cf-turnstile {
	min-height: 65px;
}

.form__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}

.form__submit {
	display: inline-flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 2.875rem;
	padding: 1rem 1.375rem;
	background: var(--ink);
	border: 0;
	color: var(--cyan);
	font: 700 1rem/1 var(--m);
}

.form__submit:hover {
	background: var(--pink);
	color: var(--ink);
}

.form__fine {
	flex: 1 1 16rem;
	margin: 0;
	font: 500 0.75rem/1.5 var(--g);
	color: var(--ink-mute);
}

@media (max-width: 620px) {
	.form__row {
		grid-template-columns: 1fr;
	}
}

.video-facade {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	cursor: pointer;
}

.video-facade img,
.video-facade iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
}

.video-facade__play {
	position: absolute;
	inset: 50% auto auto 50%;
	width: 4.5rem;
	height: 3.25rem;
	transform: translate(-50%, -50%);
	background: rgb(0 0 0 / 0.75);
	border: 0;
	border-radius: 0.75rem;
	cursor: pointer;
}

.video-facade__play::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 0.7rem 0 0.7rem 1.2rem;
	border-color: transparent transparent transparent #fff;
}

.search-results {
	padding: 0;
	list-style: none;
}

.search-results li {
	padding-block: var(--space-4);
	border-bottom: 1px solid var(--color-border);
}

/* ---------- Steps along a line ----------
 * Numbered steps (or years) that read left to right along one line, like
 * today's timeline: how booking works, the centre's story, the way in.
 * <ol class="line-steps"><li><b>01</b><p>…</p></li></ol>, or with a <div>
 * holding a heading and text beside the <b>.
 *
 * --n is the figures' size and --pad-y the block's padding: the line runs
 * through the middle of the blocks. Colours: --steps-line, --steps-block
 * and --steps-figure (ink, ink and green by default, for paper).
 */
.line-steps {
	--n: clamp(1.5rem, 2.2vw, 2.125rem);
	--pad-y: 0.625rem;
	position: relative;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: 0 clamp(1.25rem, 3vw, 3rem);
}

.line-steps::before {
	content: "";
	position: absolute;
	top: calc(var(--n) / 2 + var(--pad-y) - 1px);
	left: 0;
	right: 0;
	height: 2px;
	background: var(--steps-line, var(--ink));
}

.line-steps b {
	position: relative;
	display: inline-block;
	margin-bottom: clamp(1rem, 1.8vw, 1.5rem);
	padding: var(--pad-y) 0.875rem;
	background: var(--steps-block, var(--ink));
	color: var(--steps-figure, var(--green));
	font: 700 var(--n)/1 var(--m);
	letter-spacing: -0.025em;
	font-variant-numeric: tabular-nums;
}

.line-steps p {
	max-width: 26ch;
	margin: 0;
	font-size: clamp(1rem, 1.3vw, 1.1875rem);
	line-height: 1.4;
	letter-spacing: -0.01em;
}

/* Narrow screens: a list, each number beside its step, the line running down
   through the middle of the blocks. --col is the width of the numbers' column. */
@media (max-width: 760px) {
	.line-steps {
		--n: 1.625rem;
		--col: 4rem;
		--gap-y: 1.25rem;
		grid-auto-flow: row;
		gap: var(--gap-y);
	}

	.line-steps::before {
		top: calc(var(--n) / 2 + var(--pad-y));
		bottom: calc(var(--n) / 2 + var(--pad-y));
		left: calc(var(--col) / 2 - 1px);
		right: auto;
		width: 2px;
		height: auto;
	}

	.line-steps li {
		display: grid;
		grid-template-columns: var(--col) 1fr;
		gap: 1rem;
		align-items: center;
	}

	.line-steps b {
		justify-self: center;
		margin: 0;
	}

	/* Longer steps: each number at the top of its step, and the line drawn
	   from each number to the next, so it stops at the last one. */
	.line-steps--long::before {
		display: none;
	}

	.line-steps--long li {
		position: relative;
		align-items: start;
	}

	.line-steps--long li:not(:last-child)::before {
		content: "";
		position: absolute;
		top: calc(var(--n) / 2 + var(--pad-y));
		bottom: calc(-1 * var(--gap-y) - var(--n) / 2 - var(--pad-y));
		left: calc(var(--col) / 2 - 1px);
		width: 2px;
		background: var(--steps-line, var(--ink));
	}
}

/* ---------- "How many of you?" (template-parts/people-slider.php) ----------
 * The number of people as a slider between two ink rules, the number large
 * beside it. Used by the space finder and the floor plan.
 */
.people {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.625rem clamp(1rem, 2.4vw, 2.25rem);
	margin-top: clamp(1.5rem, 3vw, 2.75rem);
	padding: 0.875rem 0;
	border-block: 2px solid var(--ink);
}

.people label {
	font: 600 0.6875rem/1.3 var(--g);
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.people input {
	width: 100%;
	height: 2rem;
	accent-color: var(--ink);
}

.people output {
	min-width: 4.4ch;
	font: 700 clamp(2rem, 3.6vw, 3.5rem)/1 var(--m);
	letter-spacing: -0.04em;
	text-align: right;
}

.people output small {
	margin-left: 0.375rem;
	font: 500 0.8125rem/1 var(--g);
	letter-spacing: 0;
}

@media (max-width: 620px) {
	.people {
		grid-template-columns: 1fr auto;
	}

	.people input {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}

html:not(.js) .people {
	display: none;
}

/* ---------- "Not sure? Just phone us and ask" (template-parts/phone-ask.php) ----------
 * A quiet line beside a booking button, in the colour of what it sits on;
 * the number is the link, underlined in --phone-line (pink unless the
 * background is pink) and never broken across lines.
 */
.phone-ask {
	margin: 0;
	font: 500 0.875rem/1.45 var(--m);
	letter-spacing: -0.01em;
}

.phone-ask a {
	display: inline-block;
	padding-block: 0.375rem;
	color: inherit;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: underline;
	text-decoration-color: var(--phone-line, var(--pink));
	text-decoration-thickness: 2px;
	text-underline-offset: 0.25em;
}

.phone-ask a:hover {
	text-decoration-color: currentColor;
}
