/*
 * Bloomer base: design tokens, page defaults, the outlined display headings, buttons, labels,
 * the play button and the YouTube player.
 *
 * Colours and fonts come from theme.json (--wp--preset--*); the rest of the tokens live here.
 */

:root {
	--bl-ink: var(--wp--preset--color--ink, #191414);
	--bl-cream: var(--wp--preset--color--cream, #fbf1e4);
	--bl-coral: var(--wp--preset--color--coral, #e7897f);
	--bl-yellow: var(--wp--preset--color--yellow, #f5d77e);
	--bl-lilac: var(--wp--preset--color--lilac, #b9a7e6);
	--bl-white: var(--wp--preset--color--white, #ffffff);
	--bl-muted: var(--wp--preset--color--muted, #5a4e4a);
	--bl-sand: var(--wp--preset--color--sand, #cfc3b4);
	--bl-ink-2: #2e2626;
	--bl-line-dark: #3a3030;

	--bl-display: var(--wp--preset--font-family--display, "Bowlby One", "Arial Black", sans-serif);
	--bl-sans: var(--wp--preset--font-family--sans, Archivo, system-ui, sans-serif);
	--bl-mono: var(--wp--preset--font-family--mono, "Space Mono", ui-monospace, monospace);

	--bl-wide: 1280px;
	--bl-gutter: clamp(20px, 4vw, 56px);
	--bl-space: clamp(72px, 9vw, 128px);
	--bl-header: calc(clamp(50px, 5vw, 72px) + 44px);
	--bl-border: 3px solid var(--bl-ink);
	--bl-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
	--bl-lift: transform 0.32s var(--bl-bounce), box-shadow 0.32s var(--bl-bounce), background-color 0.2s ease, color 0.2s ease;

	/* Stacked shadow of the outlined headings, and its deeper hover state. */
	--bl-stack: 0.01em 0.01em 0 var(--bl-ink), 0.02em 0.02em 0 var(--bl-ink), 0.03em 0.03em 0 var(--bl-ink), 0.04em 0.04em 0 var(--bl-ink), 0.05em 0.05em 0 var(--bl-ink), 0.06em 0.06em 0 var(--bl-ink);
	--bl-stack-short: 0.02em 0.02em 0 var(--bl-ink), 0.04em 0.04em 0 var(--bl-ink), 0.06em 0.06em 0 var(--bl-ink);
	--bl-stack-coral: 0.015em 0.015em 0 var(--bl-coral), 0.03em 0.03em 0 var(--bl-coral), 0.045em 0.045em 0 var(--bl-coral), 0.06em 0.06em 0 var(--bl-coral), 0.075em 0.075em 0 var(--bl-coral);

	/* Graph paper of the cream pages, and the white grid of the coloured bands. */
	--bl-graph: linear-gradient(rgba(25, 20, 20, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(25, 20, 20, 0.06) 1px, transparent 1px);
	--bl-grid-white: linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
}

@media (max-width: 759px) {
	:root {
		--bl-header: 94px;
	}
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--bl-cream);
	background-image: var(--bl-graph);
	background-size: 40px 40px;
	color: var(--bl-ink);
	font-family: var(--bl-sans);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

::selection {
	background: var(--bl-yellow);
	color: var(--bl-ink);
}

img {
	max-width: 100%;
	height: auto;
}

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

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

:focus-visible {
	outline: 3px solid var(--bl-ink);
	outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.bl-main {
	display: block;
}

/* Paragraphs and headings of the theme carry their own spacing. */
.bl-main :where(p, h1, h2, h3, h4, ul, ol, dl, figure, blockquote) {
	margin-block: 0;
}

.bl-icon {
	display: block;
	flex: none;
	width: 18px;
	height: 18px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}

	html {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------------ Display headings */

/* White letters with an ink outline and a stacked shadow, in the display face. */
.bl-display,
.wp-block-heading.is-style-outline {
	margin: 0;
	color: var(--bl-white);
	font-family: var(--bl-display);
	font-weight: 400;
	line-height: 0.95;
	text-transform: uppercase;
	-webkit-text-stroke: 0.055em var(--bl-ink);
	paint-order: stroke fill;
	text-shadow: var(--bl-stack);
	text-wrap: balance;
}

.bl-display--xl {
	font-size: clamp(50px, 7.6vw, 124px);
	text-shadow: var(--bl-stack), 0.07em 0.07em 0 var(--bl-ink);
	transition: transform 0.35s var(--bl-bounce), text-shadow 0.35s var(--bl-bounce);
}

.bl-display--xl:hover {
	transform: translate(-0.03em, -0.03em);
	text-shadow: 0.015em 0.015em 0 var(--bl-ink), 0.03em 0.03em 0 var(--bl-ink), 0.045em 0.045em 0 var(--bl-ink), 0.06em 0.06em 0 var(--bl-ink), 0.075em 0.075em 0 var(--bl-ink), 0.09em 0.09em 0 var(--bl-ink), 0.105em 0.105em 0 var(--bl-ink);
}

.bl-display--l {
	font-size: clamp(40px, 6.2vw, 96px);
}

.bl-display--m {
	font-size: clamp(38px, 5.6vw, 80px);
}

.bl-display--s {
	font-size: clamp(34px, 4.6vw, 66px);
	line-height: 0.98;
}

.bl-display--xs {
	font-size: clamp(30px, 3.4vw, 48px);
	line-height: 1;
	-webkit-text-stroke-width: 0.06em;
	text-shadow: var(--bl-stack-short);
}

/* On the dark band: white letters with a coral shadow, no outline. */
.bl-display--coral {
	-webkit-text-stroke: 0;
	text-shadow: var(--bl-stack-coral);
}

/* Solid ink titles in the display face. */
.bl-solid,
.wp-block-heading.is-style-solid {
	margin: 0;
	color: var(--bl-ink);
	font-family: var(--bl-display);
	font-weight: 400;
	line-height: 1.05;
	text-transform: uppercase;
	-webkit-text-stroke: 0;
	text-shadow: none;
}

/* ------------------------------------------------------------------ Buttons */

.wp-block-buttons.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}

.wp-block-button .wp-block-button__link,
.bl-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border: var(--bl-border);
	border-radius: 0;
	background: var(--bl-ink);
	box-shadow: 5px 5px 0 var(--bl-coral);
	color: var(--bl-cream);
	font-family: var(--bl-mono);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	transition: var(--bl-lift);
}

.wp-block-button .wp-block-button__link:hover,
.bl-button:hover {
	background: var(--bl-ink);
	box-shadow: 7px 7px 0 var(--bl-coral);
	color: var(--bl-cream);
	transform: translate(-2px, -2px);
}

.wp-block-button.is-style-cream .wp-block-button__link {
	background: var(--bl-cream);
	box-shadow: 5px 5px 0 var(--bl-ink);
	color: var(--bl-ink);
}

.wp-block-button.is-style-cream .wp-block-button__link:hover {
	background: var(--bl-yellow);
	box-shadow: 7px 7px 0 var(--bl-ink);
	color: var(--bl-ink);
}

.wp-block-button.is-style-yellow .wp-block-button__link {
	background: var(--bl-yellow);
	box-shadow: 5px 5px 0 var(--bl-coral);
	color: var(--bl-ink);
}

.wp-block-button.is-style-yellow .wp-block-button__link:hover {
	background: var(--bl-white);
	color: var(--bl-ink);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	padding: 12px 20px;
	border: var(--bl-border);
	background: transparent;
	box-shadow: none;
	color: var(--bl-ink);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--bl-yellow);
	box-shadow: none;
	color: var(--bl-ink);
	transform: none;
}

.wp-block-button.is-style-link .wp-block-button__link {
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--bl-ink);
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
}

.wp-block-button.is-style-link .wp-block-button__link:hover {
	background: none;
	box-shadow: none;
	color: var(--bl-ink);
	text-decoration-color: var(--bl-coral);
	transform: none;
}

/* An underlined link with an arrow, in the mono face. */
.bl-arrow-link {
	align-self: flex-start;
	color: var(--bl-ink);
	font-family: var(--bl-mono);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-transform: uppercase;
	text-underline-offset: 6px;
}

.bl-arrow-link:hover {
	color: var(--bl-ink);
	text-decoration-color: var(--bl-coral);
}

/* ------------------------------------------------------------------ Labels */

.bl-chip {
	display: inline-block;
	padding: 3px 9px;
	border: 2px solid var(--bl-ink);
	background: var(--bl-yellow);
	color: var(--bl-ink);
	font-family: var(--bl-mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-decoration: none;
	text-transform: uppercase;
}

.bl-chip--lilac {
	background: var(--bl-lilac);
}

.bl-chip--coral {
	background: var(--bl-coral);
}

a.bl-chip:hover {
	background: var(--bl-white);
	color: var(--bl-ink);
}

/* "▶ Video" on the covers of video posts. */
.bl-video-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	border: 2px solid var(--bl-ink);
	background: var(--bl-ink);
	color: var(--bl-yellow);
	font-family: var(--bl-mono);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	transform: rotate(-3deg);
}

.bl-video-badge::before {
	content: "";
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 9px solid currentColor;
}

/* The yellow round play button. */
.bl-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: -32px 0 0 -32px;
	border: var(--bl-border);
	border-radius: 50%;
	background: var(--bl-yellow);
	box-shadow: 4px 4px 0 var(--bl-ink);
	pointer-events: none;
	transition: transform 0.4s var(--bl-bounce);
}

.bl-play::before {
	content: "";
	width: 0;
	height: 0;
	margin-left: 5px;
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-left: 19px solid var(--bl-ink);
}

.bl-play--large {
	width: 104px;
	height: 104px;
	margin: -52px 0 0 -52px;
	box-shadow: 6px 6px 0 var(--bl-ink);
}

.bl-play--large::before {
	margin-left: 8px;
	border-top-width: 20px;
	border-bottom-width: 20px;
	border-left-width: 32px;
}

.bl-play--tiny {
	top: auto;
	bottom: 6px;
	left: 6px;
	width: 28px;
	height: 28px;
	margin: 0;
	border-width: 2px;
	box-shadow: none;
}

.bl-play--tiny::before {
	margin-left: 3px;
	border-top-width: 6px;
	border-bottom-width: 6px;
	border-left-width: 9px;
}

/* ------------------------------------------------------------------ YouTube player */

.bl-video {
	border: var(--bl-border);
	background: var(--bl-ink);
	box-shadow: 12px 12px 0 var(--bl-ink);
}

.bl-video__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	color: var(--bl-yellow);
	font-family: var(--bl-mono);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
}

.bl-video__label::before {
	content: "\25B6\00A0";
}

.bl-video__open,
.bl-video__open:hover {
	flex: none;
	color: var(--bl-cream);
	text-decoration: none;
}

.bl-video__open:hover {
	color: var(--bl-yellow);
}

.bl-video__screen {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--bl-coral);
}

.bl-video__play {
	position: absolute;
	inset: 0;
	display: block;
}

.bl-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 30%;
	transition: transform 0.5s var(--bl-bounce);
}

.bl-video__play:hover .bl-video__poster {
	transform: scale(1.04);
}

.bl-video__play:hover .bl-play {
	transform: scale(1.1) rotate(-6deg);
}

.bl-video__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bl-editor-placeholder {
	padding: 24px;
	border: 2px dashed var(--bl-ink);
	background: var(--bl-white);
	color: var(--bl-ink);
	font-family: var(--bl-mono);
	font-size: 13px;
	text-transform: uppercase;
}
