/*
Theme Name: Adrien NF
Theme URI: https://www.adriennefe.com
Author: Adrien N.F.
Description: Custom block theme for adriennefe.com — comic-book style: bold outlines, flat colors, rounded type.
Version: 0.3.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adriennefe
*/

/* ---------- Card: the one shared surface (block style "Carte") ----------
   Tokens live in theme.json → settings.custom (outline, radius, shadow).
   Change them there and every card, pill and button follows. */

.is-style-card {
	border: var(--wp--custom--outline);
	border-radius: var(--wp--custom--radius--card);
	background-color: var(--wp--preset--color--surface);
	box-shadow: var(--wp--custom--shadow--card);
}

/* ---------- Button: the one pill button ----------
   Every clickable pill on the site: Button blocks, "Lire la suite",
   the search button, the comment form's submit. Change it here only;
   components below may adjust colour/spacing for context, nothing else.
   Black on gold 13.4:1, black on coral 7.0:1. */

.wp-element-button,
.wp-block-button__link,
.wp-block-read-more,
.post-comments input[type="submit"] {
	display: inline-block;
	padding: 8px 22px;
	border: var(--wp--custom--outline);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--accent-gold);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--custom--shadow--button);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
}

.wp-element-button:hover,
.wp-element-button:focus-visible,
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible,
.wp-block-read-more:hover,
.wp-block-read-more:focus-visible,
.post-comments input[type="submit"]:hover,
.post-comments input[type="submit"]:focus-visible {
	background-color: var(--wp--preset--color--accent-coral);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Header: tagline | title | search ---------- */

.site-header__top {
	display: grid;
	/* minmax(0, …) keeps the title centered even when the open search pill
	   is a little wider than its column (it overflows into the gap). */
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 24px;
}

.site-header__top > * {
	margin-block: 0;
}

.site-header__tagline {
	max-width: 22ch;
	line-height: 1.35;
}

.site-header__search {
	justify-self: end;
}

/* Search, open: one outlined pill — white field + gold button inside.
   Closed (searchfield-hidden): the wrapper melts away, only the button shows. */
.site-header__search .wp-block-search__inside-wrapper {
	align-items: center;
	padding: 4px;
	border: var(--wp--custom--outline);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--custom--shadow--raised);
}

.site-header__search.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper {
	padding: 0;
	border-color: transparent;
	background: transparent;
	box-shadow: none;
	overflow: visible;
}

.site-header__search .wp-block-search__input {
	width: 9rem;
	padding: 6px 8px 6px 14px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	outline: none;
}

.site-header__search .wp-block-search__input::placeholder {
	color: #555555; /* 7.5:1 on white */
	opacity: 1;
}

.site-header__search .wp-block-search__button {
	margin: 0;
	outline: none; /* the focus ring is drawn around the whole control */
}

/* Open: the button sits inside the pill, so it loses its outline + shadow. */
.site-header__search:not(.wp-block-search__searchfield-hidden) .wp-block-search__button {
	border-color: transparent;
	box-shadow: none;
}

/* One clear focus ring around the whole control (black on cream: 16.7:1). */
.site-header__search .wp-block-search__inside-wrapper:has(:focus-visible) {
	outline: var(--wp--custom--outline);
	outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.site-header__search .wp-block-search__input {
		transition: none;
	}
}

/* Title: black text (16.7:1 on cream) with a decorative coral offset. */
.site-header .wp-block-site-title {
	margin: 0;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-shadow: 3px 3px 0 var(--wp--preset--color--accent-coral);
}

.site-header .wp-block-site-title a {
	text-decoration: none;
}

.site-header .wp-block-site-title a:hover,
.site-header .wp-block-site-title a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
}

/* Decorative zig-zag under the title (pseudo-element: invisible to AT). */
.site-header__brand::after {
	content: "";
	display: block;
	width: min(320px, 70vw);
	height: 10px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M0 8 L6 2 L12 8' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-x left center / 12px 10px;
}

/* ---------- Nav pill (sticky) ---------- */

/* The bar is a direct child of .wp-site-blocks so it can stick for the
   whole page. scroll-state lets descendants know when it's stuck. */
.site-nav-bar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	container-type: scroll-state;
}

/* Keep anchor targets and keyboard focus from hiding under the bar. */
html {
	scroll-padding-top: 96px;
}

.site-nav-wrap {
	padding: 12px 16px;
}

/* At rest the pill hugs its links (centered by the constrained layout). */
.site-nav {
	position: relative;
	width: fit-content;
	border-radius: var(--wp--custom--radius--pill);
}

/* When stuck: the pill stretches into a full-width bar (Chromium; other
   browsers keep the pill, which still sticks). */
@container scroll-state(stuck: top) {
	.site-nav-wrap {
		padding: 0;
	}

	.site-nav-wrap > .site-nav {
		width: auto;
		max-width: none;
		border-radius: 0;
		border-inline-width: 0;
		box-shadow: var(--wp--custom--shadow--raised);
	}

	.site-nav::before { left: 0; }
	.site-nav::after { right: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.site-nav {
		transition: border-radius 0.2s ease, box-shadow 0.2s ease;
	}
}

/* Short horizontal "tabs" poking out of each end of the pill. */
.site-nav::before,
.site-nav::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 28px;
	height: 3px;
	background: var(--wp--preset--color--contrast);
	transform: translateY(-50%);
}

.site-nav::before { left: -10px; }
.site-nav::after { right: -10px; }

.site-nav .wp-block-navigation-item__content {
	text-decoration: none;
}

.site-nav .wp-block-navigation-item__content:hover,
.site-nav .wp-block-navigation-item__content:focus-visible,
.site-nav .current-menu-item > .wp-block-navigation-item__content,
.site-nav [aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
}

/* ---------- Post cards (blog listing) ---------- */

/* Meta row: calendar + date — category. Shared by cards and single posts. */
.post-meta {
	gap: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.post-meta > * {
	display: inline-flex;
	align-items: center;
	margin: 0;
}

/* Decorative calendar icon (mask so it follows the text color).
   .meta-date is the hand-written equivalent, used by the talk pattern. */
.post-meta .wp-block-post-date::before,
.post-meta .meta-date::before {
	content: "";
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.5em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 0h2v2h4V0h2v2h2a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h2zM2 6v8h12V6zm2 2h2v2H4zm3 0h2v2H7zm3 0h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 0h2v2h4V0h2v2h2a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h2zM2 6v8h12V6zm2 2h2v2H4zm3 0h2v2H7zm3 0h2v2h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Coral dash between meta items (decorative, not text). */
.post-meta > * + *::before {
	content: "";
	flex: none;
	width: 24px;
	height: 3px;
	margin-inline: 14px;
	border-radius: 2px;
	background: var(--wp--preset--color--accent-coral);
}

/* Several categories: let the list wrap inside the card instead of
   overflowing as one unbreakable line. */
.post-meta .wp-block-post-terms {
	flex-wrap: wrap;
	justify-content: center;
	min-width: 0;
	max-width: 100%;
	text-align: center;
}

/* In a flex row the separator's own trailing space collapses: re-add it
   after the comma only ("Maths, Programmation", no space before). */
.post-meta .wp-block-post-terms__separator {
	margin-right: 0.3em;
}

/* Phones: no room for one line → stack date over categories, drop the
   dashes (they'd be stranded at the start of a line). */
@media (max-width: 600px) {
	.post-meta {
		flex-direction: column;
		align-items: center;
		row-gap: 4px;
	}

	.talk-card .post-meta {
		align-items: flex-start;
	}

	.talk-card .post-meta .wp-block-post-terms {
		justify-content: flex-start;
	}

	.post-meta > * + *::before {
		display: none;
	}
}

/* On cards the meta row is a top band, ruled off from the body. */
.post-card > .post-meta {
	padding: 14px 24px;
	border-bottom: var(--wp--custom--outline);
}

.post-card__body .wp-block-post-featured-image {
	margin: 0;
}

.post-card .wp-block-post-title {
	margin-top: 28px;
}

/* Standalone heading link: identified by its position, underline on interaction. */
.post-card .wp-block-post-title a {
	text-decoration: none;
}

.post-card .wp-block-post-title a:hover,
.post-card .wp-block-post-title a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 5px;
}

.post-card .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/* "Lire la suite" pill flanked by two short rules. */
.post-card__actions {
	gap: 14px;
	margin-top: 8px;
}

.post-card__actions::before,
.post-card__actions::after {
	content: "";
	width: 48px;
	height: 3px;
	background: var(--wp--preset--color--contrast);
}

/* ---------- Single post ---------- */

.post-single .wp-block-post-featured-image {
	margin: 0;
}

.post-single .wp-block-post-title {
	margin: 0;
	line-height: 1.15;
}

.post-single__head {
	margin-bottom: 8px;
}

.post-single__content {
	margin-top: 32px;
	padding-inline: 16px;
}

.post-single__content :where(h2, h3, h4) {
	margin-top: 1.8em;
}

.post-single__content img {
	border-radius: 12px;
}

/* Tags: centered row of small bold "#tag" links. The "#" is visual only
   (empty alt text after the slash), so screen readers just read the tag. */
.post-single__tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 18px;
	margin-top: 40px;
	padding-inline: 16px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.post-single__tags a::before {
	content: "#" / "";
	color: var(--wp--preset--color--contrast);
}

/* ---------- Blog listing: posts + sidebar ---------- */

.with-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 48px;
	align-items: start;
}

.with-sidebar > * {
	margin: 0 !important;
}

.site-sidebar {
	display: grid;
	gap: 48px;
}

/* Wide screens: the sidebar follows the reader. assets/js/sidebar.js sets
   --sidebar-top so that:
   - if the sidebar fits in the window, it sticks just under the nav;
   - if it's taller, it scrolls normally until its bottom reaches the bottom
     of the window, then sticks there — everything stays reachable.
   Without JS (no .has-sticky-sidebar class) it simply scrolls with the page. */
@media (min-width: 961px) {
	.has-sticky-sidebar .site-sidebar {
		position: sticky;
		top: var(--sidebar-top);
	}
}

/* Narrow: sidebar drops below the content (DOM order = reading order). */
@media (max-width: 960px) {
	.with-sidebar {
		grid-template-columns: minmax(0, 1fr);
		gap: 64px;
	}
}

/* ---------- Card tab: black label hanging from a card's top edge ----------
   A real h2 (sidebar card titles), styled as a label. White on #111: 18.9:1.
   Give the card ~64px top padding to make room. */

.is-style-card:has(> .card-tab) {
	position: relative;
}

.card-tab {
	position: absolute;
	top: -3px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0 !important;
	padding: 8px 36px 10px;
	border-radius: 0 0 18px 18px;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ---------- About card (patterns/about-card.php) ---------- */

.about-card {
	text-align: center;
}

.about-card > * {
	margin-inline: auto;
}

/* ---------- Categories card (parts/sidebar.html) ---------- */

.cat-pills {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Each category: a pill link with the count as a gold badge at the end. */
.cat-pills a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 4px 4px 18px;
	border: var(--wp--custom--outline);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--surface);
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
}

.cat-pills .cat-count {
	display: grid;
	place-items: center;
	flex: none;
	min-width: 32px;
	height: 32px;
	box-sizing: border-box;
	border: var(--wp--custom--outline);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent-gold);
	font-size: var(--wp--preset--font-size--small);
}

.cat-pills a:hover,
.cat-pills a:focus-visible {
	background: var(--wp--preset--color--accent-gold);
}

.cat-pills a:hover .cat-count,
.cat-pills a:focus-visible .cat-count {
	background: var(--wp--preset--color--accent-coral);
}

.cat-pills a:focus-visible {
	outline: var(--wp--custom--outline);
	outline-offset: 3px;
}

.about-card__photo {
	width: 180px;
	max-width: 100%;
}

.about-card__photo img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border: var(--wp--custom--outline);
	border-radius: 50%;
	box-sizing: border-box;
}

.about-card__name {
	margin-top: 20px !important;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	line-height: 1.15;
}

.about-card__bio {
	max-width: 32ch;
}

.about-card__links {
	gap: 18px !important;
	margin-top: 18px !important;
}

.about-card__links .wp-social-link svg {
	width: 28px;
	height: 28px;
}

.about-card__links .wp-social-link a:focus-visible {
	outline: var(--wp--custom--outline);
	outline-offset: 4px;
	border-radius: 6px;
}

/* ---------- Talk cards (patterns/talk.php) ---------- */

/* "Page en cartes" template: header card, then one card per item, each
   sitting on the page background with the same gap as the post list. */
.page-cards > * + * {
	margin-top: 56px;
}

.page-header-card .wp-block-post-title {
	margin: 0;
	line-height: 1.15;
}

/* Cover on top, details below — same reading order as the post cards. */
.talk-card {
	display: grid;
	gap: 20px;
}

.talk-card__body {
	padding: 0 12px 12px;
}

.talk-card > * {
	margin: 0 !important;
}

.talk-card__cover img {
	display: block;
	width: 100%;
	height: auto;
	border: var(--wp--custom--outline);
	border-radius: 12px;
	box-sizing: border-box;
}

.talk-card__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.2;
}

.talk-card .post-meta {
	row-gap: 4px;
}

/* ---------- Quotes (core/quote) ---------- */

/* Default: thick black bar on the left, bold text, italic attribution. */
.wp-block-quote {
	margin-block: 2em;
	margin-inline: 0;
	padding: 4px 0 4px 28px;
	border-left: 5px solid var(--wp--preset--color--contrast);
	font-weight: 600;
	line-height: 1.7;
}

.wp-block-quote > p,
.wp-block-quote > :where(p) {
	margin-block: 0 0.6em;
}

.wp-block-quote em {
	font-weight: 400;
}

.wp-block-quote cite {
	display: block;
	margin-top: 1em;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	font-style: italic;
}

/* "Citation vedette" (block style, registered in functions.php):
   black rounded box, gold quote badge, white bold italic text.
   White on #111: 18.9:1 · attribution #C4C4C4 on #111: 10.9:1. */
.wp-block-quote.is-style-featured {
	position: relative;
	padding: 88px 40px 36px;
	border: 0;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--surface);
	font-size: 1.25rem;
	font-weight: 700;
	font-style: italic;
	line-height: 1.5;
}

/* Gold disc with a closing quote mark, drawn as SVG (a font glyph doesn't
   centre reliably). Purely decorative: empty content, nothing announced.
   Colours are hard-coded in the data URI (gold #F7C948, black #111111):
   keep them in sync with the palette if it ever changes. */
.wp-block-quote.is-style-featured::before {
	content: "";
	position: absolute;
	top: 32px;
	left: 40px;
	width: 44px;
	height: 44px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill='%23F7C948'/%3E%3Cg fill='%23111111'%3E%3Ccircle cx='15.5' cy='19' r='4.5'/%3E%3Cpath d='M20 19q0 8-7.5 10.5l-1-2q4-2 4-5z'/%3E%3Ccircle cx='27.5' cy='19' r='4.5'/%3E%3Cpath d='M32 19q0 8-7.5 10.5l-1-2q4-2 4-5z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.wp-block-quote.is-style-featured em {
	font-weight: 500;
}

.wp-block-quote.is-style-featured cite {
	margin-top: 1.2em;
	color: #c4c4c4;
	font-style: normal;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Links stay identifiable (underlined) and readable on black. */
.wp-block-quote.is-style-featured a {
	color: inherit;
	text-decoration: underline;
}

.wp-block-quote.is-style-featured a:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-gold);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.wp-block-quote.is-style-featured {
		padding: 80px 24px 28px;
		font-size: 1.1rem;
	}

	.wp-block-quote.is-style-featured::before {
		top: 24px;
		left: 24px;
	}
}

/* ---------- Previous / next ---------- */

/* The block outputs an empty div when there is no previous/next post:
   hide it and let the other side take the full width. */
.post-pager {
	display: flex;
	overflow: hidden;
}

.post-pager:not(:has(a)),
.post-pager > :not(:has(a)) {
	display: none;
}

.post-pager > * {
	flex: 1 1 0;
	margin: 0 !important;
	padding: 24px;
	text-align: center;
}

.post-pager > .post-navigation-link-previous:has(a) + .post-navigation-link-next {
	border-left: var(--wp--custom--outline);
}

@media (max-width: 600px) {
	.post-pager {
		flex-direction: column;
	}

	.post-pager > .post-navigation-link-previous:has(a) + .post-navigation-link-next {
		border-left: 0;
		border-top: var(--wp--custom--outline);
	}
}

.post-pager a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	font-weight: 700;
	text-decoration: none;
}

/* Black tab label, like the reference's "PREV POST" tabs. */
.post-pager .post-navigation-link__label {
	padding: 4px 16px;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.post-pager a:hover .post-navigation-link__title,
.post-pager a:focus-visible .post-navigation-link__title {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 5px;
}

/* The arrow sits outside the link; put it inside the tab row visually. */
.post-pager [class*="__arrow"] {
	display: none;
}

/* ---------- Comments ---------- */

/* Hide the whole card when there is nothing to show (no comments, closed). */
.post-comments:not(:has(.wp-block-comment-template, .comment-respond)) {
	display: none;
}

.post-comments {
	box-shadow: var(--wp--custom--shadow--card);
}

.post-comments .wp-block-comment-template {
	display: grid;
	gap: 16px;
	padding: 0;
	list-style: none;
}

.post-comments .wp-block-comment-template ol {
	margin-top: 16px;
	padding-left: 24px;
	list-style: none;
}

.post-comments input:not([type="submit"]):not([type="checkbox"]),
.post-comments textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border: var(--wp--custom--outline);
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
	font: inherit;
}

/* The card is gold, so its submit button flips to white to stay visible
   (hover/focus stays coral, from the shared button rule). */
.post-comments input[type="submit"]:not(:hover):not(:focus-visible) {
	background-color: var(--wp--preset--color--surface);
}

/* ---------- Nav dropdown (Catégories) ---------- */

/* "Catégories" is a <button aria-expanded> (openSubmenusOnClick): style it
   exactly like the other nav items. */
.site-nav .wp-block-navigation-submenu__toggle {
	padding: 0;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	cursor: pointer;
}

.site-nav .wp-block-navigation-submenu__toggle:hover,
.site-nav .wp-block-navigation-submenu__toggle:focus-visible,
.site-nav .wp-block-navigation-submenu__toggle[aria-expanded="true"] {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-underline-offset: 6px;
}

.site-nav .wp-block-navigation__submenu-icon svg {
	stroke-width: 2.5;
}

.site-nav .wp-block-navigation-submenu__toggle:focus-visible {
	outline: var(--wp--custom--outline);
	outline-offset: 4px;
	border-radius: 6px;
}

/* The dropdown itself: a small comic card under the pill. Desktop menu only:
   inside the phone overlay, core lists sub-items inline and must stay as is. */
@media (min-width: 600px) {
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
		top: calc(100% + 14px) !important;
		left: 50% !important;
		min-width: 240px !important;
		padding: 10px !important;
		border: var(--wp--custom--outline) !important;
		border-radius: var(--wp--custom--radius--inner);
		background: var(--wp--preset--color--surface) !important;
		box-shadow: var(--wp--custom--shadow--raised);
		transform: translateX(-50%);
	}

	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		padding: 10px 14px !important;
		border-radius: 10px;
		text-align: left;
		white-space: nowrap;
	}

	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
	.site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
		background: var(--wp--preset--color--accent-gold);
	}
}

/* ---------- Narrow screens: stack the header (the open search needs room) ---------- */

@media (max-width: 1040px) {
	.site-header__top {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
	}

	.site-header__tagline {
		order: 2;
		max-width: none;
	}

	.site-header__search {
		order: 3;
		justify-self: center;
	}
}
