/*
 * Sunny Lab: layout details that theme.json cannot express.
 * Colours, sizes and spacing come only from theme.json presets (var(--wp--preset--…)).
 */

/* Sticky header. The template part wrapper is the sticky element, so it sticks
   for the whole page; it sits below the admin bar when one is shown. */
.sunnylab-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

/* Header, main and footer touch: the root block gap is meant for content, not for the page frame. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Full-width sections follow each other without a gap (their own padding sets the rhythm). */
.wp-block-post-content > .alignfull,
.wp-block-post-content > .alignfull + * {
	margin-block-start: 0;
}

/* WCAG 2.4.11: a focused element or an anchor target is never hidden under the sticky header. */
html {
	scroll-padding-top: calc(var(--wp--preset--spacing--7) + var(--wp-admin--admin-bar--height, 0px));
}

/* Header: game actions | logo | navigation. The logo stays centred whatever the width of each side. */
.sunnylab-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: var(--wp--preset--spacing--3);
	min-height: calc(var(--wp--preset--spacing--6) + var(--wp--preset--spacing--2));
	/* Same content width as the footer: the background spans the screen, the content
	   stops at the theme's wide size (theme.json), with the root side padding below it. */
	padding-inline: max(var(--wp--preset--spacing--4), calc((100% - var(--wp--style--global--wide-size)) / 2));
}

.sunnylab-header > * {
	margin-block: 0;
}

.sunnylab-header__game {
	gap: var(--wp--preset--spacing--3);
	min-width: 0;
}

.sunnylab-header__brand {
	text-align: center;
}

.sunnylab-header__brand .wp-block-site-title a {
	text-decoration: none;
}

/* Logo and title form one link: the title's link covers the whole group, so the logo is clickable
   too and the keyboard meets a single stop. The focus ring is drawn around the group. */
.sunnylab-header__brand {
	position: relative;
}
.sunnylab-header__brand .wp-block-site-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.sunnylab-header__brand .wp-block-site-title a:focus-visible {
	outline: none;
}
.sunnylab-header__brand:has(.wp-block-site-title a:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.sunnylab-header__nav {
	justify-self: end;
}

/* Header links use the frame colours, without underline except for the current page. */
.sunnylab-header__nav .wp-block-navigation-item__content {
	display: inline-block;
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--3);
	text-decoration: none;
}

/* The last label lines up with the footer's right edge (desktop menu only). */
.sunnylab-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation-item:last-child > .wp-block-navigation-item__content {
	padding-inline-end: 0;
}

.sunnylab-header__nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ciel);
	text-decoration: underline;
	text-underline-offset: 0.375rem;
}

/* Store icons: 44px targets (WCAG 2.5.8 asks for 24px; the design system keeps 44px). */
.sunnylab-stores {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sunnylab-stores__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 var(--wp--preset--spacing--1);
	border-radius: var(--wp--preset--border-radius--s);
	color: inherit;
}

/* No border: the logos alone read better (feedback of 07/11). */
.sunnylab-stores__link svg {
	width: auto;
	height: 1.75rem;
}

.sunnylab-stores__link:hover {
	color: var(--wp--preset--color--ciel);
}

/* Mobile menu (core overlay, full screen): every link spans the whole width,
   so the whole row is clickable, as in the mock-ups. */
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch;
	width: 100%;
	gap: 0;
}

.sunnylab-header__nav .is-menu-open .wp-block-navigation-item {
	width: 100%;
}

/* Same specificity as the core overlay rule that resets the link padding to 0. */
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: var(--wp--preset--spacing--6);
	box-sizing: border-box;
	padding: 0 var(--wp--preset--spacing--4);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--blanc) 12%, transparent);
	font-size: var(--wp--preset--font-size--heading-s);
	text-decoration: none;
}

/* Rows run edge to edge, with a rule above the first one, as in the mock-ups. */
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open {
	padding-inline: 0;
}

/* The container lost its side padding: the close button keeps its distance from the edge. */
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	top: var(--wp--preset--spacing--3);
	right: var(--wp--preset--spacing--3);
}

/* Focus ring drawn inside the row, so the screen edges do not cut it (WCAG 2.4.7). */
.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	outline-offset: -3px;
}

/* Open and close buttons of the mobile menu: the theme's ring, in the icon's colour, instead of
   the browser's blue one (2.97:1 on the night header, below WCAG 1.4.11). */
.sunnylab-header__nav .wp-block-navigation__responsive-container-open:focus-visible,
.sunnylab-header__nav .wp-block-navigation__responsive-container-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--blanc) 16%, transparent);
}

/* Chevron: tells the whole row is a link. Decorative, drawn in CSS so screen readers ignore it. */
.sunnylab-header__nav .is-menu-open .wp-block-navigation-item__content::after {
	content: "";
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content {
	background: color-mix(in srgb, var(--wp--preset--color--ciel) 14%, transparent);
	text-decoration: none;
}

.sunnylab-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	background: color-mix(in srgb, var(--wp--preset--color--blanc) 8%, transparent);
}

/* Footer: no underline on contact links except on hover, tagline readable on the dark frame. */
.sunnylab-footer .wp-block-site-title a {
	text-decoration: none;
}

.sunnylab-footer p {
	margin-block: 0;
}

/* Medium screens: the trailer button gives way to the store icons. */
@media (max-width: 80rem) {
	/* Two classes: the core Buttons stylesheet loads after this file and sets display:flex. */
	.sunnylab-header .sunnylab-header__trailer {
		display: none;
	}
}

/* Small screens: stores on the left, logo, then the navigation burger (core overlay menu, below 600px). */
@media (max-width: 53.75rem) {
	/* Stores and burger keep their natural width; the logo takes the space left between them. */
	.sunnylab-header {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: var(--wp--preset--spacing--2);
		padding-inline: var(--wp--preset--spacing--3) !important;
	}

	/* The site title stays visible next to the logo: together they form the link to the home page. */
	.sunnylab-header__brand .wp-block-site-logo img {
		width: 2.5rem;
		height: auto;
	}
}

@media (max-width: 30rem) {
	.sunnylab-stores {
		gap: var(--wp--preset--spacing--1);
	}

	.sunnylab-stores__link {
		min-width: 2.375rem;
		padding: 0;
	}

	.sunnylab-stores__link svg {
		height: 1.5rem;
	}
}

/* ── Shared section styles (block style variations in styles/blocks/) ── */

/* Card: a light surface in every section, night ones included, with the tone's own
   text, heading and link colours (defaults in styles/blocks/carte.json: game tone). */
.is-style-studio,
.is-style-studio-nuit {
	--sunnylab-carte-fond: var(--wp--preset--color--studio-relief);
	--sunnylab-carte-texte: var(--wp--preset--color--studio-encre);
	--sunnylab-carte-titre: var(--wp--preset--color--orio-prune);
	--sunnylab-carte-lien: var(--wp--preset--color--studio-lien);
}

/* List without bullets (store buttons, logo walls, asset grids): theme.json has no list-style. */
.wp-block-list.is-style-sans-puces {
	list-style: none;
}

/* Badge: sized to its text, not to the column. */
p.is-style-pastille {
	width: fit-content;
}
/* The constrained layout centres any child narrower than the column: put a left-aligned
   badge back on the column's left edge. */
.is-layout-constrained > p.is-style-pastille:not(.has-text-align-center):not(.has-text-align-right) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
}

/* Secondary button (core "Outline" style): drawn in the section's text colour, so it works
   on light and dark sections alike; a light tint on hover keeps the text contrast. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	padding-block: calc(0.75rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background-color: color-mix(in srgb, currentColor 12%, transparent);
	color: currentColor;
}

/* ── Hero and night closing (issue #13) ── */

/* Heights are design tokens: theme.json settings.custom.hauteur. */
/* Game hero (Games and Press), 16/11/2026: the illustration's own ratio (16:9), so nothing is
   cropped on phones and tablets; but never taller than the window minus the header, so the
   cloud edge always shows and invites to scroll. When that cap applies, the picture stays
   anchored at the top and is cropped at the bottom only: the logo, Lunne's head and Orio
   stay whole; the rooftops, then Lunne's legs and the foot of the tower, go first. */
.wp-block-cover.sunnylab-hero {
	/* Fill the line, full-width negative margins included: with an automatic width, the
	   height cap would narrow the block through aspect-ratio. */
	width: -webkit-fill-available;
	width: -moz-available;
	width: stretch;
	min-height: 0;
	aspect-ratio: var(--wp--custom--ratio--hero);
	max-height: var(--wp--custom--hauteur--hero-max);
}
/* !important beats the focal point written inline by the block, here or set by an editor. */
.wp-block-cover.sunnylab-hero > img.wp-block-cover__image-background {
	object-position: 50% 0 !important;
}
/* Cloud edge scaled with the hero: at most ~6 % of its height, below Lunne's shoes and the
   foot of the tower. */
.sunnylab-hero.sunnylab-nuages::after {
	height: var(--wp--custom--hauteur--nuages-hero);
}

/* Cloud edge at the bottom of a section, in the colour of the game sections below it. */
.sunnylab-nuages::after {
	content: "";
	position: absolute;
	inset: auto 0 -1px;
	z-index: 1;
	height: var(--wp--custom--hauteur--nuages);
	background-color: var(--wp--preset--color--creme);
	-webkit-mask: url("../images/nuages.svg") center bottom / 100% 100% no-repeat;
	mask: url("../images/nuages.svg") center bottom / 100% 100% no-repeat;
	pointer-events: none;
}

.sunnylab-cloture__image {
	position: relative;
	margin-block: 0;
}
.wp-block-image.sunnylab-cloture__image img { /* Beats core .wp-block-image.alignfull img { height: auto }. */
	display: block;
	width: 100%;
	height: var(--wp--custom--hauteur--cloture);
	object-fit: cover;
}
.wp-block-video.sunnylab-cloture__image video {
	height: var(--wp--custom--hauteur--cloture);
	object-fit: cover;
}
/* The video's height is fractional (56.25vw, the 16:9 ratio of the media): the fade overlaps its last row of pixels. */
.is-style-cadre .wp-block-video.sunnylab-cloture__image::after {
	bottom: -1px;
}
.sunnylab-cloture--image .wp-block-image.sunnylab-cloture__image img {
	height: var(--wp--custom--hauteur--cloture-image);
}

/* The picture fades into the night background under the closing title (decorative). */
.is-style-cadre .sunnylab-cloture__image::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 30%;
	background: linear-gradient(transparent, var(--wp--preset--color--nuit-paris));
	pointer-events: none;
}

/* ── Buy section (issue #14) ── */

.sunnylab-achat .sunnylab-achat__pitch {
	max-width: var(--wp--custom--largeur--lecture);
}

.sunnylab-achat .sunnylab-achat__stores {
	max-width: var(--wp--custom--largeur--achat);
}

.sunnylab-achat .sunnylab-achat__stores h3 {
	color: var(--wp--preset--color--encre);
	font-weight: 700;
}

.sunnylab-achat__boutons {
	gap: var(--wp--preset--spacing--2);
}

/* Store buttons: the platform logo, drawn in the button's text colour. */
.sunnylab-store .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
	white-space: nowrap;
}
.sunnylab-store .wp-block-button__link::before {
	content: "";
	flex: none;
	width: 1.25em;
	height: 1.25em;
	background-color: currentColor;
	-webkit-mask: var(--sunnylab-store-icon) center / contain no-repeat;
	mask: var(--sunnylab-store-icon) center / contain no-repeat;
}
.sunnylab-store--steam { --sunnylab-store-icon: url("../icons/steam.svg"); }
.sunnylab-store--playstation { --sunnylab-store-icon: url("../icons/playstation.svg"); }
.sunnylab-store--xbox { --sunnylab-store-icon: url("../icons/xbox.svg"); }
.sunnylab-store--nintendo-switch { --sunnylab-store-icon: url("../icons/nintendo-switch.svg"); }
.sunnylab-store--nintendo-switch-2 { --sunnylab-store-icon: url("../icons/nintendo-switch-2.svg"); }

/* ── Game loop and Heart Palace (issue #16) ── */

/* Pillar card: the picture runs to the card's edges, the text keeps the card's padding. */
.is-style-carte.sunnylab-pilier {
	padding: 0;
	overflow: hidden;
	height: 100%;
}
.sunnylab-pilier .sunnylab-pilier__image {
	margin: 0;
}
.sunnylab-pilier .sunnylab-pilier__image img {
	width: 100%;
	display: block;
}
.sunnylab-pilier .sunnylab-pilier__image video {
	aspect-ratio: 16 / 10;
	object-fit: cover;
}
.sunnylab-pilier__texte {
	padding: var(--wp--preset--spacing--4);
}
.sunnylab-pilier__texte > * + * {
	margin-block-start: var(--wp--preset--spacing--2);
}

/* Rounded picture or clip (Heart Palace, media). The clip keeps the screenshot's 16:9 frame. */
.sunnylab-arrondi img,
.sunnylab-arrondi video {
	border-radius: var(--wp--preset--border-radius--m);
}
.wp-block-video.sunnylab-arrondi video {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Night section with a light dot pattern (decorative). */
.sunnylab-pois {
	background-image: radial-gradient(color-mix(in srgb, var(--wp--preset--color--blanc) 12%, transparent) 3px, transparent 3.5px);
	background-size: 2.5rem 2.5rem;
}

/* ── Awards and recognition (issue #17, client feedback of 11/11) ── */

.sunnylab-awards {
	gap: var(--wp--preset--spacing--5) var(--wp--preset--spacing--4);
}

/* One award: laurel picture, label and name, centred. Three side by side, wrapping on small screens. */
.sunnylab-award {
	flex: 1 1 var(--wp--custom--largeur--award);
	max-width: calc(var(--wp--custom--largeur--award) * 1.5);
	text-align: center;
}
.sunnylab-award > * {
	margin: 0;
}
.sunnylab-award > * + * {
	margin-block-start: var(--wp--preset--spacing--1);
}
.sunnylab-award > .sunnylab-award__label {
	margin-block-start: var(--wp--preset--spacing--3);
}

/* Laurels of different widths share one height (the client's files are drawn at 2x). */
.sunnylab-award__laurier img {
	display: block;
	width: auto;
	height: var(--wp--custom--hauteur--laurier);
	margin-inline: auto;
}

.sunnylab-award__nom {
	font-weight: 600;
	line-height: 1.3;
}

/* ── Community and consulting teaser (issue #18) ── */

/* Cards side by side keep the same height. */
.sunnylab-hauteur-pleine {
	height: 100%;
}

.sunnylab-teaser .sunnylab-teaser__image {
	flex: none;
	width: var(--wp--custom--largeur--vignette);
	margin: 0;
}
.sunnylab-teaser .sunnylab-teaser__image img {
	width: 100%;
	height: auto;
}
.sunnylab-teaser__texte {
	flex: 1 1 26rem;
	min-width: 0;
}

/* ── Consulting: studio hero, story and logos (issue #19) ── */

/* Decorative circles of the studio hero (lilac and potion presets, see the mock-up). */
.sunnylab-hero-studio {
	background-image:
		radial-gradient(circle at 91% 12%, color-mix(in srgb, var(--wp--preset--color--orio-lilas) 45%, transparent) 7.5rem, transparent 7.55rem),
		radial-gradient(circle at 82% 93%, color-mix(in srgb, var(--wp--preset--color--orio-lilas) 35%, transparent) 4.4rem, transparent 4.45rem),
		radial-gradient(circle at 4% 93%, color-mix(in srgb, var(--wp--preset--color--orio-lilas) 25%, transparent) 5.6rem, transparent 5.65rem);
}

/* Lead paragraph, a step above body text. */
.sunnylab-chapo {
	font-size: var(--wp--preset--font-size--heading-s);
	line-height: 1.55;
	font-weight: 500;
	max-width: var(--wp--custom--largeur--lecture);
}

/* Orio in a potion-yellow circle. */
.wp-block-image.sunnylab-medaillon {
	width: min(100%, 21.25rem);
	aspect-ratio: 1;
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--orio-potion);
}

/* Once the columns stack (core breakpoint, 781px), Orio would push the page down: hide him
   (studio hero, 404 page). */
@media (max-width: 781px) {
	.sunnylab-hero-studio .wp-block-column:has(> .sunnylab-medaillon),
	.sunnylab-erreur .wp-block-column:has(> .sunnylab-orio) {
		display: none;
	}
}

/* Orio on the 404 page: cut out on a transparent background, shown whole (same size as the
   standalone error pages, wp-content/sunny-lab-erreurs/erreurs.css). */
.wp-block-image.sunnylab-orio {
	display: flex;
	justify-content: center;
}
.wp-block-image.sunnylab-orio img {
	width: auto;
	height: auto;
	max-width: min(100%, 20rem);
	max-height: 26rem;
}
.wp-block-image.sunnylab-medaillon img {
	width: 82%;
	height: auto;
}

/* Logo wall: every logo in a white tile, scaled to fit. The rules target any Image block in
   the grid, not only the pattern's own (class sunnylab-logo): a logo inserted from the editor
   has no class, and may carry a width set by hand, an alignment, a link or a caption
   (16/11/2026: such a logo broke the grid in STG). */
.sunnylab-logos {
	gap: var(--wp--preset--spacing--2);
}
.sunnylab-logos > .wp-block-image {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	float: none;
	width: auto;
	max-width: none;
	height: 6.5rem;
	margin: 0;
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--3);
	overflow: hidden;
	background-color: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--studio-filet);
	border-radius: var(--wp--preset--border-radius--s);
}
.sunnylab-logos > .wp-block-image > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
/* !important beats the width and height an editor sets by resizing (inline on the img). */
.sunnylab-logos > .wp-block-image img {
	min-height: 0;
	max-width: 100%;
	max-height: 100%;
	width: auto !important;
	height: auto !important;
	aspect-ratio: auto !important;
	object-fit: contain;
}
.sunnylab-logos > .wp-block-image figcaption {
	display: none; /* The tile has room for the logo only: its name is the alt text. */
}

/* ── Consulting: services and method (issue #20) ── */

.sunnylab-lecture {
	max-width: var(--wp--custom--largeur--lecture);
}

/* Service number in a pink circle. */
.sunnylab-numero {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--orio-rose);
	color: var(--wp--preset--color--studio-encre);
	font-weight: 700;
}

/* Method steps: a grid of numbered steps, each under a plum rule. The number is drawn by CSS:
   screen readers already announce the position in the ordered list. */
.wp-block-list.sunnylab-etapes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: var(--wp--preset--spacing--3);
	counter-reset: sunnylab-etape;
}
.sunnylab-etapes > li {
	counter-increment: sunnylab-etape;
	padding-top: var(--wp--preset--spacing--3);
	border-top: 3px solid var(--wp--preset--color--orio-prune);
}
.sunnylab-etapes > li > strong {
	color: var(--wp--preset--color--orio-prune);
	text-transform: uppercase;
}
.sunnylab-etapes > li > strong::before {
	content: counter(sunnylab-etape) ". ";
}

/* ── Consulting: team (issue #21) ── */

.sunnylab-equipe {
	gap: var(--wp--preset--spacing--4);
}
.sunnylab-equipe .sunnylab-pilier__texte > * + * {
	margin-block-start: var(--wp--preset--spacing--1);
}

/* ── Consulting: contact (issue #22) ── */

.sunnylab-contact__texte {
	flex: 1 1 26rem;
	min-width: 0;
}

/* ── Press: header, factsheet (issue #23) ── */

/* Download and key buttons share the card's width. */
.sunnylab-fiche__actions > .wp-block-button {
	flex: 1 1 14rem;
}
.sunnylab-fiche__actions .wp-block-button__link {
	width: 100%;
}

.sunnylab-fiche {
	gap: var(--wp--preset--spacing--3) var(--wp--preset--spacing--4);
}
.sunnylab-fiche__entree > * {
	margin-block: 0;
}
/* Client feedback of 11/11: a 1px line under each entry makes the factsheet easier to scan. */
.sunnylab-fiche__entree {
	padding-block-end: var(--wp--preset--spacing--2);
	border-block-end: 1px solid var(--wp--preset--color--filet);
}

/* Platform list: the store logo before each name (same icons as the store buttons). */
.sunnylab-plateformes > li {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2);
	margin-block-start: var(--wp--preset--spacing--1);
}
.sunnylab-plateformes > li::before {
	content: "";
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	background-color: currentColor;
	-webkit-mask: var(--sunnylab-store-icon) center / contain no-repeat;
	mask: var(--sunnylab-store-icon) center / contain no-repeat;
}
.sunnylab-plateformes > li.sunnylab-sans-icone::before {
	background-color: transparent;
}

/*
 * Video cover: a link to YouTube without JavaScript, a play button with it (assets/js/video.js),
 * then the YouTube player in place. Play badge: yellow disc (::before), night-blue triangle (::after).
 */
.sunnylab-couverture-video > a,
.sunnylab-video__lecture {
	position: relative;
	display: block;
	border-radius: var(--wp--preset--border-radius--m);
}
.sunnylab-video__lecture {
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
/* Same ring as links and buttons in theme.json (the button is created by the script). */
.sunnylab-video__lecture:focus-visible {
	outline: 2px solid var(--wp--preset--color--bleu-nuit);
	outline-offset: 2px;
}
/* On a dark section (Press trailers), white like the section's links. */
.is-style-cadre .sunnylab-video__lecture:focus-visible {
	outline-color: var(--wp--preset--color--blanc);
}
.sunnylab-video__lecteur {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--wp--preset--border-radius--m);
}
/* Picture kept under the consent notice until the visitor accepts (assets/js/video.js). */
.sunnylab-video__attente {
	position: relative;
	overflow: hidden;
	border-radius: var(--wp--preset--border-radius--m);
}
.sunnylab-video__attente img {
	display: block;
	width: 100%;
	height: auto;
}

/* YouTube consent notice over a video picture (assets/js/consentement.js, decision of
   18/11/2026): carousel and video covers. Opaque night, so the white text keeps its contrast
   whatever the picture underneath (and the automatic check can measure it). */
.sunnylab-consentement {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--2);
	padding: var(--wp--preset--spacing--3);
	overflow: auto;
	background: var(--wp--preset--color--nuit-paris);
	color: var(--wp--preset--color--blanc);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	text-align: center;
}
.sunnylab-consentement__texte {
	max-width: 30rem;
	margin: 0;
}
.sunnylab-consentement__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--2) var(--wp--preset--spacing--3);
}
.sunnylab-consentement .sunnylab-consentement__accepter {
	font-size: var(--wp--preset--font-size--small);
}
.sunnylab-consentement__lien {
	color: var(--wp--preset--color--blanc);
	text-decoration: underline;
}
/* On the night background, the theme's night-blue ring would not show: yellow instead
   (two classes, to win over the carousel's button ring). */
.sunnylab-consentement .sunnylab-consentement__accepter:focus-visible,
.sunnylab-consentement .sunnylab-consentement__lien:focus-visible {
	outline: 2px solid var(--wp--preset--color--jaune-soleil);
	outline-offset: 2px;
}
.sunnylab-couverture-video > a::before,
.sunnylab-couverture-video > a::after,
.sunnylab-video__lecture::before,
.sunnylab-video__lecture::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	pointer-events: none;
}
.sunnylab-couverture-video > a::before,
.sunnylab-video__lecture::before {
	width: 4.5rem;
	height: 4.5rem;
	margin: -2.25rem 0 0 -2.25rem;
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--jaune-soleil);
}
.sunnylab-couverture-video > a::after,
.sunnylab-video__lecture::after {
	width: 1.5rem;
	height: 1.625rem;
	margin: -0.8125rem 0 0 -0.5rem;
	background-color: var(--wp--preset--color--bleu-nuit);
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.sunnylab-couverture-video > a:hover::before,
.sunnylab-video__lecture:hover::before {
	background-color: var(--wp--preset--color--blanc);
}

/* ── Press: download grids (issue #24) ── */

.sunnylab-assets__grille {
	gap: var(--wp--preset--spacing--4);
}
.sunnylab-assets--carre .sunnylab-assets__grille {
	gap: var(--wp--preset--spacing--3);
}
.sunnylab-asset > * {
	margin-block: 0;
}
.sunnylab-asset > * + * {
	margin-block-start: var(--wp--preset--spacing--2);
}
.wp-block-image.sunnylab-asset__image img {
	width: 100%;
	border-radius: var(--wp--preset--border-radius--s);
}

/* Creator assets: each card on a slightly lighter night tile, centred. */
.sunnylab-assets--carre .sunnylab-asset {
	padding: var(--wp--preset--spacing--3);
	border-radius: var(--wp--preset--border-radius--s);
	background-color: color-mix(in srgb, var(--wp--preset--color--blanc) 8%, var(--wp--preset--color--nuit-paris));
	text-align: center;
}
.sunnylab-assets--carre .sunnylab-asset__image img {
	object-fit: contain !important; /* Characters are cut-outs: shown whole, not cropped. */
}
.sunnylab-assets--carre .sunnylab-asset__legende {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Logos: in a white tile, scaled to fit. */
.wp-block-image.sunnylab-asset__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 9.375rem;
	padding: var(--wp--preset--spacing--3);
	background-color: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--filet);
	border-radius: var(--wp--preset--border-radius--s);
}
.wp-block-image.sunnylab-asset__logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* ── Error pages: 404 template ── */

/* Large error code, in the game's yellow outlined with night blue, next to the eyebrow. */
.sunnylab-erreur .sunnylab-code-erreur {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--display);
	line-height: 1;
	color: var(--wp--preset--color--jaune-soleil);
	-webkit-text-stroke: 2px var(--wp--preset--color--bleu-nuit);
}

/* ── Looping videos (game clips, night closing): pause button, WCAG 2.2.2 ── */

.wp-block-video.sunnylab-video-boucle {
	position: relative;
	margin-block: 0; /* Not the inline margins: they make a full-width block reach the edges. */
}
.wp-block-video.sunnylab-video-boucle video {
	display: block;
	width: 100%;
}
.sunnylab-video-boucle__bouton {
	position: absolute;
	z-index: 1; /* Above the closing picture's fade. */
	inset: var(--wp--preset--spacing--2) var(--wp--preset--spacing--2) auto auto;
	width: 2.75rem; /* 44 px target. */
	height: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 2px solid var(--wp--preset--color--blanc);
	border-radius: var(--wp--preset--border-radius--pill);
	background-color: var(--wp--preset--color--nuit-paris);
	color: var(--wp--preset--color--blanc);
	cursor: pointer;
}
.sunnylab-video-boucle__bouton[hidden] {
	display: none;
}
.sunnylab-video-boucle__bouton:hover {
	background-color: var(--wp--preset--color--bleu-nuit);
}
.sunnylab-video-boucle__bouton:focus-visible {
	outline: 3px solid var(--wp--preset--color--jaune-soleil);
	outline-offset: 2px;
}
.sunnylab-video-boucle .sunnylab-video-boucle__lecture,
.sunnylab-video-boucle.is-paused .sunnylab-video-boucle__pause {
	display: none;
}
.sunnylab-video-boucle.is-paused .sunnylab-video-boucle__lecture {
	display: block;
}
