/*
Theme Name: Z Hotel
Description: The Z Hotel, Puri: a beach-side hotel in a house built in 1917. Child theme of Twenty Twenty-Five.
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: z-hotel
License: GNU General Public License v2 or later
*/

/*
 * Colours, fonts and sizes are in theme.json. Since CITSPL-PROMPT 10 the page is black, as
 * on the old site, with the old site's silver text (#C0C0C0) and white headings; the house
 * gives the rest: its verandah's sea-green (lightened for black) for links and accents, and
 * a warm "lamplight" tan for captions and small print.
 * This file holds what theme.json cannot say: the header, the photographs (always at
 * their own size: they are small, and are never enlarged), the guests' letters, the
 * contact form and the footer.
 */

:root {
	/* The page is dark: the browser draws its own parts (scrollbars, the video's controls,
	   the form's resize handle) in dark colours too. */
	color-scheme: dark;
	--z-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--z-rule: 1px solid var(--wp--preset--color--line);
	--z-ui: var(--wp--preset--font-family--franklin);
	--z-field-border: #8A8276;
	--z-error: #FF9C87;
	--z-error-wash: #2B1410;
	--z-error-text: #FFC2B5;
	--z-sent-wash: #0F1C18;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Short pages: the footer stays at the bottom of the screen, not halfway up. */
.wp-site-blocks {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

::selection {
	background: var(--wp--preset--color--verandah);
	color: var(--wp--preset--color--night);
}

:where(a, button, input, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--verandah);
	outline-offset: 3px;
	border-radius: 2px;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* ---------- Header ---------- */

.z-header {
	padding-block: clamp(0.85rem, 2.5vw, 1.4rem);
	border-bottom: var(--z-rule);
}

.z-header__inner {
	gap: 1rem;
}

.z-logo img {
	display: block;
	width: clamp(72px, 18vw, 92px);
	height: auto;
}

.z-header__end {
	gap: clamp(0.75rem, 3vw, 2rem);
}

.z-header__phone {
	margin: 0;
	font-family: var(--z-ui);
	font-size: 0.9375rem;
	font-weight: 500;
	white-space: nowrap;
	font-variant-numeric: lining-nums tabular-nums;
}

.z-header__phone a {
	display: inline-block;
	padding-block: 13px;
	margin-block: -13px;
	text-decoration: none;
	color: var(--wp--preset--color--verandah);
}

.z-nav .wp-block-navigation__container {
	gap: clamp(1rem, 2.2vw, 1.75rem);
}

/* 600–960px: too narrow for logo, phone and seven menu items in one line, too wide for the
   phone menu. The menu moves to its own row under the phone number. */
@media (min-width: 600px) and (max-width: 60rem) {
	.z-header__end {
		flex-wrap: wrap !important;
		justify-content: flex-end;
		row-gap: 0.6rem;
	}
	.z-header__end .z-nav {
		flex-basis: 100%;
	}
}

/* The phone number as a menu item: only in the phone-sized menu. */
.z-nav .z-nav__call {
	display: none;
}

.z-nav .is-menu-open .z-nav__call {
	display: flex;
	margin-top: 1rem;
}

.z-nav .is-menu-open .z-nav__call .wp-block-navigation-item__content {
	font-family: var(--z-ui);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--wp--preset--color--verandah);
	font-variant-numeric: lining-nums;
}

.z-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--silver);
	text-decoration: none;
	padding-block: 0.35rem;
	border-bottom: 2px solid transparent;
	transition: border-color 160ms ease, color 160ms ease;
}

.z-nav .current-menu-item > .wp-block-navigation-item__content,
.z-nav [aria-current="page"] {
	border-bottom-color: var(--wp--preset--color--verandah);
}

@media (hover: hover) and (pointer: fine) {
	.z-nav .wp-block-navigation-item__content:hover {
		color: var(--wp--preset--color--verandah);
	}
}

/* The menu on phones: WordPress's own overlay, set in the house's colours. */
.z-nav .wp-block-navigation__responsive-container-open,
.z-nav .wp-block-navigation__responsive-container-close {
	padding: 10px;
	margin: -10px;
	color: var(--wp--preset--color--silver);
}

.z-nav .wp-block-navigation__responsive-container :is(a, button):focus:not(:focus-visible) {
	outline: none;
}

.z-nav .wp-block-navigation__responsive-container :is(a, button):focus-visible {
	outline: 2px solid var(--wp--preset--color--verandah);
	outline-offset: 3px;
}

/* (":not(.has-background)" matches WordPress's own rule, which would otherwise win.) */
.z-nav.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--night);
	color: var(--wp--preset--color--silver);
	padding: clamp(1.25rem, 6vw, 2.5rem);
}

.z-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.z-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start;
}

.z-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0.35rem;
}

.z-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--caslon-display);
	font-size: 2rem;
	font-weight: 400;
	padding-block: 0.25rem;
}

/* ---------- Page body ---------- */

.z-main {
	padding-block: clamp(2rem, 6vw, 3.75rem) clamp(3rem, 9vw, 6rem);
}

.wp-site-blocks > .z-main,
.z-main > .wp-block-post-content,
.z-main > .wp-block-post-content > :first-child {
	margin-block-start: 0;
}

.z-page-title {
	margin-block-end: clamp(1.5rem, 4vw, 2.5rem);
	text-wrap: balance;
}

.z-main p {
	text-wrap: pretty;
}

/* ---------- Photographs: at their own size, never enlarged ---------- */

.z-main .wp-block-image {
	margin-block: 0;
}

/* No "width: auto": the width WordPress writes on each picture is its own size, which
   reserves the space before it loads (no jumping) and never enlarges it. */
.z-main .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 2px;
	/* On black, a hair-thin light edge keeps the dark black-and-white prints from melting
	   into the page. It frames the photograph; the picture itself is untouched. */
	box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

.z-main .wp-block-image figcaption {
	margin: 0.6rem 0 0;
	max-width: 22rem;
	text-wrap: balance;
}

/* A row of photographs, pinned up like prints: each at its own size, wrapping on phones. */
.z-prints.wp-block-group {
	gap: clamp(1rem, 3vw, 1.75rem);
	margin-block: clamp(1.75rem, 5vw, 3rem);
}

.z-prints > .wp-block-image {
	flex: 0 1 auto;
	max-width: 100%;
}

/* Home: the two pictures sit directly under the video, in its column (CITSPL-PROMPT 12). */
.z-prints--under-video.wp-block-group {
	margin-block: clamp(1.25rem, 3vw, 1.75rem) 0;
}

/* ---------- Home ---------- */

/* The grid and its column gap are set on the block (deploy/pages/home.html); only the
   space between rows is set here, so that two columns still fit. */
.z-welcome.wp-block-group {
	row-gap: clamp(2rem, 5vw, 3rem);
	align-items: start;
	margin-block-end: clamp(2rem, 6vw, 3.5rem);
}

.z-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	margin-block: 0;
}

.z-display {
	font-family: var(--wp--preset--font-family--caslon-display);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1;
	margin-block: clamp(1.25rem, 4vw, 2rem) 0.75rem;
}

/* TripAdvisor's three widgets (CITSPL-PROMPT 11): their own code and look, from TripAdvisor's
   servers. Only the space around them is set here. "color-scheme: light" keeps the page's
   dark setting from reaching into TripAdvisor's boxes (it made their review field dark). */
.z-ta {
	color-scheme: light;
}

.z-ta--excellent {
	margin-block: 0 1.5rem;
}

.z-ta--reviews {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	margin-block-start: 1.75rem;
}

.z-ta--reviews > * {
	max-width: 100%;
}

.z-video {
	margin: 0;
}

.z-video video {
	display: block;
	width: 100%;
	max-width: 640px;
	height: auto;
	aspect-ratio: 640 / 368;
	background: var(--wp--preset--color--panel);
	border-radius: 2px;
}

/* "more pics 1 … 10": the old site's row of numbers, kept as the way into the letters. */
.z-morepics {
	font-family: var(--z-ui);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--lamplight);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.35rem;
	margin-block: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.z-morepics a {
	display: inline-grid;
	place-items: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	font-family: var(--wp--preset--font-family--caslon);
	font-size: 1.125rem;
	text-decoration: none;
	color: var(--wp--preset--color--verandah);
	border: var(--z-rule);
	border-radius: 999px;
	transition: background-color 160ms ease, transform 160ms var(--z-ease);
}

.z-morepics a:active {
	transform: scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
	.z-morepics a:hover {
		background: var(--wp--preset--color--panel);
	}
}

.z-morepics__label {
	margin-inline-end: 0.5rem;
	font-style: italic;
	font-family: var(--wp--preset--font-family--caslon);
	font-size: 1rem;
}

/* ---------- About ---------- */

.z-about p:first-child::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--caslon-display);
	font-size: 3.6em;
	line-height: 0.82;
	margin: 0.08em 0.12em 0 0;
	color: var(--wp--preset--color--verandah);
}

/* ---------- More pictures: the guests' letters ---------- */

.z-entry {
	margin-block-start: clamp(3rem, 9vw, 5.5rem);
	scroll-margin-top: 1.5rem;
}

.z-entry__number {
	font-family: var(--wp--preset--font-family--caslon-display);
	font-size: clamp(3rem, 8vw, 4.5rem);
	line-height: 1;
	color: var(--wp--preset--color--verandah);
	margin-block: 0 1rem;
}

.z-letter {
	background: var(--wp--preset--color--panel);
	padding: clamp(1.25rem, 5vw, 2.25rem) clamp(1.25rem, 5vw, 2.5rem);
	border-radius: 2px;
}

.z-letter p {
	margin-block: 0 1em;
}

.z-letter > :last-child {
	margin-block-end: 0;
}

.z-letter__title {
	font-weight: 700;
	font-style: italic;
}

.z-letter__poem {
	font-style: italic;
	line-height: 1.55;
}

.z-letter__sign {
	font-style: italic;
	text-align: right;
	color: var(--wp--preset--color--lamplight);
}

.z-jump {
	margin-block: 0;
	scroll-margin-top: 1.5rem;
}

.z-entry__back {
	margin-block: 1.5rem 0;
	font-family: var(--z-ui);
	font-size: var(--wp--preset--font-size--small);
}

.z-entry__back a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	padding-inline: 0.25rem;
	color: var(--wp--preset--color--lamplight);
	text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
	.z-entry__back a:hover {
		color: var(--wp--preset--color--verandah);
	}
}

/* ---------- Contact ---------- */

.z-contact.wp-block-group {
	row-gap: clamp(2rem, 6vw, 3rem);
	align-items: start;
}

.z-call {
	padding-top: 1rem;
	border-top: 2px solid var(--wp--preset--color--verandah);
}

@media (max-width: 37rem) {
	.z-contact > .z-call {
		order: -1;
	}
}

.z-call p {
	margin: 0;
}

.z-call__label {
	font-family: var(--z-ui);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--lamplight);
}

.z-call__number {
	font-family: var(--wp--preset--font-family--caslon-display);
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	font-variant-numeric: lining-nums;
}

.z-call__number a {
	color: var(--wp--preset--color--verandah);
	text-decoration-thickness: 1px;
}

.z-cf {
	font-family: var(--z-ui);
}

.z-cf__field {
	display: grid;
	gap: 0.35rem;
	margin: 0 0 1.25rem;
}

.z-cf__field label {
	font-size: 0.9375rem;
	font-weight: 600;
}

.z-cf__optional {
	font-weight: 400;
	color: var(--wp--preset--color--lamplight);
}

.z-cf input,
.z-cf textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 1rem;      /* 16px: phones don't zoom in on the field */
	line-height: 1.5;
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--field);
	border: 1px solid var(--z-field-border);
	border-radius: 3px;
	padding: 0.7rem 0.8rem;
	transition: border-color 160ms ease;
}

.z-cf textarea {
	resize: vertical;
	min-height: 9rem;
}

.z-cf input,
.z-cf textarea {
	caret-color: var(--wp--preset--color--verandah);
}

/* Browsers paint autofilled fields pale; keep them dark, with white text. */
.z-cf input:-webkit-autofill,
.z-cf input:-webkit-autofill:hover,
.z-cf input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--wp--preset--color--white);
	box-shadow: 0 0 0 100px var(--wp--preset--color--field) inset;
	transition: background-color 9999s;
}

.z-cf input:focus-visible,
.z-cf textarea:focus-visible {
	border-color: var(--wp--preset--color--verandah);
	outline-offset: 1px;
}

.z-cf__field.has-error input,
.z-cf__field.has-error textarea {
	border-color: var(--z-error);
}

.z-cf__error {
	font-size: 0.875rem;
	color: var(--z-error);
}

.z-cf__alert {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem;
	font-size: 0.9375rem;
	color: var(--z-error-text);
	background: var(--z-error-wash);
	border-radius: 3px;
}

.z-cf__trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.z-cf__actions {
	margin: 1.75rem 0 0;
}

.z-cf__send.wp-element-button {
	padding: 0.85rem 1.6rem;
	border: 0;
	cursor: pointer;
	transition: background-color 160ms ease, transform 160ms var(--z-ease);
}

.z-cf__send:active {
	transform: scale(0.97);
}

.z-cf__send:disabled {
	opacity: 0.7;
	cursor: progress;
}

@media (hover: hover) and (pointer: fine) {
	.z-cf__send:hover {
		background: var(--wp--preset--color--verandah-strong);
	}
}

.z-cf--sent {
	padding: clamp(1.25rem, 4vw, 1.75rem);
	background: var(--z-sent-wash);
	color: var(--wp--preset--color--white);
	border-top: 2px solid var(--wp--preset--color--verandah);
	border-radius: 2px;
}

.z-cf--sent:focus {
	outline: none;
}

.z-cf__thanks {
	font-family: var(--wp--preset--font-family--caslon-display);
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 0.5rem;
}

.z-cf--sent p:last-child {
	margin: 0;
}

/* ---------- Footer ---------- */

.z-footer {
	padding-block: clamp(1.75rem, 5vw, 2.75rem);
	border-top: var(--z-rule);
	background: var(--wp--preset--color--panel);
}

.z-footer__inner {
	gap: 1.25rem 3rem;
}

.z-footer__call {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.z-footer__call a {
	display: inline-block;
	padding-block: 0.5rem;
	margin-block: -0.5rem;
	font-variant-numeric: lining-nums;
}

.z-footer__small {
	max-width: 30rem;
	font-family: var(--z-ui);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	color: var(--wp--preset--color--lamplight);
}

.z-footer__small p {
	margin: 0 0 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
