/*
 * Site-wide rules that theme.json cannot express.
 * Colours, fonts and sizes come from theme.json presets (--wp--preset--*).
 */

/* Base ------------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wp--custom--header--height) + 1rem);
}

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

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

:where(.site-header, .site-footer, .is-style-section-night) :focus-visible {
	outline-color: var(--wp--preset--color--accent);
}

::selection {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base-2);
}

address {
	font-style: normal;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

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

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}

@media (max-width: 600px) {
	/* The admin bar scrolls away on small screens. */
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

.site-header {
	position: relative;
	min-height: var(--wp--custom--header--height-mobile);
}

@media (min-width: 1024px) {
	.site-header {
		min-height: var(--wp--custom--header--height);
	}
}

.site-header > .wp-block-group {
	min-height: inherit;
}

/* Double gold rule with a centred diamond along the bottom edge. */
.site-header::after,
.site-header::before {
	content: "";
	position: absolute;
	pointer-events: none;
}

.site-header::after {
	inset: auto 0 0;
	height: 5px;
	background:
		linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent)) left bottom / 100% 1px no-repeat,
		linear-gradient(var(--wp--preset--color--accent), var(--wp--preset--color--accent)) left bottom 4px / 100% 0.5px no-repeat;
}

.site-header::before {
	bottom: 0;
	left: 50%;
	width: 5px;
	height: 5px;
	z-index: 1;
	background: var(--wp--preset--color--accent);
	transform: translate(-50%, 2px) rotate(45deg);
}

.site-header .wp-block-site-logo img {
	width: auto;
	height: 28px;
	max-width: none;
}

@media (min-width: 640px) {
	.site-header .wp-block-site-logo img {
		height: 32px;
	}
}

/* Phones: WooCommerce adds the account and cart icons to the header, so tighten
   the gaps and let the logo shrink rather than push them off-screen. */
@media (max-width: 639.98px) {
	.site-header > .wp-block-group {
		gap: var(--wp--preset--spacing--30);
	}

	.site-header .wp-block-site-logo {
		min-width: 0;
	}

	.site-header .wp-block-site-logo img {
		max-width: 100%;
		height: auto;
		max-height: 28px;
	}
}

/* The logo is about 200px wide on small laptops and 240px from 1280px. */
@media (min-width: 1024px) {
	.site-header .wp-block-site-logo img {
		height: 28px;
	}
}

@media (min-width: 1280px) {
	.site-header .wp-block-site-logo img {
		height: 34px;
	}
}

/* Page structure ------------------------------------------------------------ */

/* Short pages (cart, empty search...) still fill the screen: the footer stays at the bottom. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.admin-bar .wp-site-blocks {
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > footer.wp-block-template-part {
	margin-top: auto;
}

/* Header, main and footer sit flush; full-width sections stack without gaps. */
body .wp-site-blocks > * + *,
.wp-block-post-content > .alignfull + .alignfull {
	margin-block-start: 0;
}

/* Page title (templates/page.html; hidden when the content has its own <h1>). */
.site-page-title .wp-block-post-title {
	max-width: var(--wp--custom--measure);
}

.site-page-title .wp-block-post-title::before {
	content: "";
	display: block;
	width: 7rem;
	height: 1.75rem;
	margin-bottom: 1.25rem;
	background: url("../images/ornaments/monogram-rule.svg") left center / contain no-repeat;
}

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

.site-footer {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 50%, transparent);
}

.site-footer :where(p):not(.has-text-color) {
	color: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
}

.site-footer .site-footer__legal:not(.has-text-color) {
	color: color-mix(in srgb, var(--wp--preset--color--base) 60%, transparent);
}

.site-footer a:where(:not(.wp-element-button)) {
	color: color-mix(in srgb, var(--wp--preset--color--base) 85%, transparent);
	text-decoration: none;
	transition: color var(--wp--custom--transition);
}

.site-footer a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--accent);
}

.site-footer .wp-block-site-logo img {
	width: auto;
	height: 32px;
	max-width: 100%;
}

@media (min-width: 640px) {
	.site-footer .wp-block-site-logo img {
		height: 36px;
	}
}

.site-footer p.site-footer__title {
	margin-bottom: var(--wp--preset--spacing--20);
	line-height: 1.3;
}

.site-footer__legal {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 25%, transparent);
}

/*
 * Mobile booking bar, in the footer part. It is hidden on tablet and desktop
 * with the block's own visibility setting (Block settings > Visibility).
 */

.site-mobile-book-bar {
	position: fixed;
	inset: auto 0 0;
	z-index: 50;
	margin: 0 !important;
	padding: 0.75rem;
	background: color-mix(in srgb, var(--wp--preset--color--base) 95%, transparent);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 40%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.site-mobile-book-bar .wp-block-button,
.site-mobile-book-bar .wp-block-button__link {
	width: 100%;
}

@media (max-width: 639.98px) {
	body:has(.site-mobile-book-bar):not(:has(.wp-block-brillancourt-booking, .hide-book-bar)) {
		padding-bottom: 4.5rem;
	}
}

/* Not needed on the booking pages (add the class "hide-book-bar" to any block to hide it), nor over the open menu. */
body:has(.wp-block-brillancourt-booking, .hide-book-bar, .wp-block-navigation__responsive-container.is-menu-open) .site-mobile-book-bar {
	display: none;
}

/* Layout helpers ---------------------------------------------------------- */

/* Sections with a decorative element sticking out (seal tape, watermark). */
.has-overflow-clip {
	overflow-x: clip;
}

/* Keep long words (e-mail addresses, URLs) from overflowing narrow columns. */
.wp-block-post-content :where(p, li, td) {
	overflow-wrap: break-word;
}

/*
 * Line icons drawn in gold before a heading or paragraph: add the class
 * "has-line-icon-{name}" (watch, plan, tablet, lens, clock, pin, users, cake, key, mail, play)
 * in Block settings > Advanced. The files are in assets/images/icons/.
 */
[class*="has-line-icon-"] {
	display: flex;
	align-items: center;
}

[class*="has-line-icon-"]::before {
	content: "";
	flex: none;
	width: 1.6em;
	height: 1.6em;
	margin-right: 0.75rem;
	background-color: var(--wp--preset--color--accent);
	-webkit-mask: var(--brillancourt-icon) center / contain no-repeat;
	mask: var(--brillancourt-icon) center / contain no-repeat;
}

:where(h1, h2, h3, h4)[class*="has-line-icon-"]::before,
.is-small-icon[class*="has-line-icon-"]::before {
	width: 1.25rem;
	height: 1.25rem;
}

.is-small-icon[class*="has-line-icon-"] {
	align-items: flex-start;
}

.is-small-icon[class*="has-line-icon-"]::before {
	margin-top: 0.25em;
}

/* Large round play icon (video placeholder). */
.is-big-icon[class*="has-line-icon-"]::before {
	width: 5rem;
	height: 5rem;
	margin: 0;
}

.has-line-icon-watch { --brillancourt-icon: url("../images/icons/watch.svg"); }
.has-line-icon-plan { --brillancourt-icon: url("../images/icons/plan.svg"); }
.has-line-icon-tablet { --brillancourt-icon: url("../images/icons/tablet.svg"); }
.has-line-icon-lens { --brillancourt-icon: url("../images/icons/lens.svg"); }
.has-line-icon-clock { --brillancourt-icon: url("../images/icons/clock.svg"); }
.has-line-icon-pin { --brillancourt-icon: url("../images/icons/pin.svg"); }
.has-line-icon-users { --brillancourt-icon: url("../images/icons/users.svg"); }
.has-line-icon-cake { --brillancourt-icon: url("../images/icons/cake.svg"); }
.has-line-icon-key { --brillancourt-icon: url("../images/icons/key.svg"); }
.has-line-icon-mail { --brillancourt-icon: url("../images/icons/mail.svg"); }
.has-line-icon-play { --brillancourt-icon: url("../images/icons/play.svg"); }

/* Rows of a definition list built with groups (practical information). */
.has-rule-rows > * {
	padding-block: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--custom--line--medium);
}

.has-rule-rows {
	border-top: 1px solid var(--wp--custom--line--medium);
}

@media (min-width: 782px) {
	.has-rule-rows > * {
		display: grid;
		grid-template-columns: 18rem minmax(0, 1fr);
		column-gap: 2.5rem;
		align-items: baseline;
	}

	.has-rule-rows > * > * {
		margin-block: 0 !important;
	}
}

/* Story opening: a large gold initial (class "has-initial" on a paragraph). */
p.has-initial::first-letter {
	float: left;
	margin: 0.08em 0.5rem 0 0;
	color: var(--wp--preset--color--accent-2);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 4.2rem;
	font-weight: 600;
	line-height: 0.85;
}

/* Divided columns: gold hairline between columns (above them on phones). */
@media (max-width: 781.98px) {
	.wp-block-columns.has-dividers > .wp-block-column + .wp-block-column {
		padding-top: var(--wp--preset--spacing--50);
		border-top: 1px solid var(--wp--preset--color--accent);
	}
}

@media (min-width: 782px) {
	.wp-block-columns.has-dividers {
		gap: 0;
	}

	.wp-block-columns.has-dividers > .wp-block-column {
		padding-inline: var(--wp--preset--spacing--50);
	}

	.wp-block-columns.has-dividers > .wp-block-column + .wp-block-column {
		border-left: 1px solid var(--wp--preset--color--accent);
	}

	.wp-block-columns.has-dividers.is-flush-start > .wp-block-column:first-child {
		padding-left: 0;
	}
}

/* Arched photo of a page header: smaller on phones so the title stays in view. */
.is-header-photo {
	width: 100%;
	max-width: 16rem;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.is-header-photo {
		max-width: 24rem;
	}
}

@media (max-width: 1023.98px) {
	.is-header-photo img {
		max-height: 40vh;
	}

	.is-style-watermark .is-header-photo img {
		max-height: 50vh;
	}
}

/* Video or screenshot still to come: framed box with centred text. */
.is-placeholder-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Fixed proportions for placeholders and frames. */
.is-ratio-video {
	aspect-ratio: 16 / 9;
}

.is-ratio-4-3 {
	aspect-ratio: 4 / 3;
}

/* Tablet frame (screenshot of the game interface). */
.is-tablet-frame {
	border: 1.5px solid var(--wp--preset--color--accent);
	border-radius: 28px;
}

.is-tablet-frame > * {
	border: 1px solid var(--wp--custom--line--strong);
	border-radius: 14px;
	overflow: hidden;
}

/* Home hero: the stacked gold logo, smaller on phones, never wider than its column. */
.is-hero-logo img {
	width: min(320px, 100%) !important;
	height: auto;
}

@media (min-width: 1024px) {
	.is-hero-logo img {
		width: min(460px, 100%) !important;
	}
}

.is-style-watermark .is-header-photo {
	max-width: 22rem;
}

@media (min-width: 1024px) {
	.is-style-watermark .is-header-photo {
		max-width: 28rem;
	}
}

/* The experience: the story is set in the serif face, the photo follows the reader. */
.is-story > p:not([class*="is-style-"]) {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.3125rem;
	line-height: 1.65;
}

.is-story > .is-story-aside {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.75rem);
	font-style: italic;
	line-height: 1.35;
}

@media (min-width: 782px) {
	.is-sticky-column {
		position: sticky;
		top: calc(var(--wp--custom--header--height) + 2.5rem);
		align-self: flex-start;
	}
}

/* Roman numeral of a step. */
p.is-roman {
	color: var(--wp--preset--color--accent-2);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.875rem;
	font-weight: 600;
	line-height: 1;
}

/* Pinned timeline as an ordered list: no list markers or indent. */
ol.wp-block-group.is-style-pinned {
	margin-block-end: 0;
	list-style: none;
}

/* Blog: category filter (hidden until a category has posts) and category label. */
.is-category-filter:has(.cat-item-none) {
	display: none;
}

.is-category-filter .wp-block-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.is-category-filter .wp-block-categories a,
.is-post-category a {
	text-decoration: none;
}

.is-category-filter .current-cat > a {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
}

.is-post-category {
	color: var(--wp--preset--color--accent-2);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.is-post-category a {
	color: inherit;
}
