/*
Theme Name: Ivosea
Theme URI: https://example.org
Author: Dominic A. Del Puerto
Author URI: https://github.com/DMNCDLPRT
Description: Block theme for organization websites: news, issuances, documents, videos and advisories, with the name, logo, colors, header and footer set in Appearance → Branding.
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.5
Version: 0.13.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ivosea
*/

/*
 * Typography, colors and spacing live in theme.json and styles/.
 * This file only holds what theme.json can't express.
 */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Links: thin underline with a little space below the text. */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* Visible keyboard focus on both light and dark backgrounds. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--highlight);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--wp--preset--color--primary-dark);
}

/* Section Title: short accent bar under the heading. */
.is-style-section-title::after {
	content: "";
	display: block;
	width: 3rem;
	height: 4px;
	margin-top: 0.5em;
	border-radius: 2px;
	background: var(--wp--preset--color--accent);
}

.is-style-section-title.has-text-align-center::after {
	margin-inline: auto;
}

.is-style-section-title.has-text-align-right::after {
	margin-left: auto;
}

/*
 * Logos. The organization's logos get their size from ivosea_brand_logo() and
 * ivosea_brand_image() (inc/branding.php).
 * For a logo added with the Image block, add one of these classes under
 * Advanced → Additional CSS class(es): logo-xs, logo-sm, logo-md, logo-lg, logo-xl, logo-xxl.
 */
.ivo-logo {
	display: block;
	max-width: 100%;
	height: auto;
}

.ivo-logos {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.logo-xs img { height: var(--wp--custom--logo-size--xs); width: auto; }
.logo-sm img { height: var(--wp--custom--logo-size--sm); width: auto; }
.logo-md img { height: var(--wp--custom--logo-size--md); width: auto; }
.logo-lg img { height: var(--wp--custom--logo-size--lg); width: auto; }
.logo-xl img { height: var(--wp--custom--logo-size--xl); width: auto; }
.logo-xxl img { height: var(--wp--custom--logo-size--xxl); width: auto; }

/*
 * Click-to-load map or form (assets/js/click-to-load.js): a rounded frame that
 * says what it holds, until the visitor chooses to load it.
 */
.ivo-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
}

.ivo-embed__placeholder {
	max-width: 36rem;
	padding: var(--wp--preset--spacing--40);
	text-align: center;
}

.ivo-embed__placeholder p {
	margin: 0;
}

.ivo-embed__name {
	color: var(--wp--preset--color--primary-dark);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.ivo-embed__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	margin-block: var(--wp--preset--spacing--40);
}

.ivo-embed__actions button.wp-element-button {
	cursor: pointer;
	border: 0;
}

/* Second button beside "Open the form": outlined, like the Button block's Outline style. */
.ivo-embed__actions button.ivo-embed__load--outline {
	border: 2px solid var(--wp--preset--color--primary);
	background: transparent;
	color: var(--wp--preset--color--primary);
	padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
}

.ivo-embed__link {
	font-weight: 600;
}

.ivo-embed__note {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.ivo-embed__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ivo-map {
	height: clamp(300px, 40vw, 420px);
}

.ivo-map__pin {
	color: var(--wp--preset--color--accent);
}

.ivo-map__address {
	margin-top: 0.25rem !important;
	color: var(--wp--preset--color--muted);
}

/* A form scrolls inside its frame; the frame leaves room to see the page around it. */
.ivo-embed--form.is-loaded {
	height: min(800px, 85vh);
}

/* Full-width sections placed back to back touch, with no white strip between. */
.alignfull[class*="is-style-section-"] + .alignfull[class*="is-style-section-"] {
	margin-block-start: 0;
}

/*
 * Form fields: white, rounded, with a faint shadow. Colors and sizes are in
 * theme.json (custom.field). The border keeps 3:1 contrast on White and Light
 * Gray, and the placeholder 4.5:1 on White; lighter grays fail WCAG.
 */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select,
.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wp--custom--field--border);
	border-radius: var(--wp--custom--field--radius);
	background-color: var(--wp--preset--color--base);
	box-shadow: var(--wp--custom--field--shadow);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}

/* Keep the focus ring's navy edge, which the field's shadow would replace. */
:is(input, textarea, select):focus-visible {
	box-shadow: 0 0 0 5px var(--wp--preset--color--primary-dark);
}

input::placeholder,
textarea::placeholder {
	color: var(--wp--custom--field--placeholder);
	font-weight: 600;
	opacity: 1;
}

/*
 * Other search boxes (issuance and document filters): a magnifying glass at the
 * right. It's only decoration, since those forms have their own Search button.
 * Same icon as the Search block, in the placeholder color.
 */
input[type="search"]:not(.wp-block-search__input) {
	padding-right: 2.75rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' transform='matrix(-1 0 0 1 24 0)' d='M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z'/%3E%3C/svg%3E");
	background-position: right 0.625rem center;
	background-repeat: no-repeat;
	background-size: 1.5rem;
}

/*
 * Drop-downs: a chevron instead of the browser's arrow, in the same gray and at
 * the same inset as the search icon. List boxes (multiple, size) keep theirs.
 */
select:not([multiple], [size]) {
	--ivo-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M17.5 10.4 12 14.8l-5.5-4.4.9-1.2 4.6 3.6 4.5-3.6z'/%3E%3C/svg%3E");
	appearance: none;
	padding-right: 2.75rem;
	background-image: var(--ivo-select-chevron);
	background-position: right 0.625rem center;
	background-repeat: no-repeat;
	background-size: 1.5rem;
	cursor: pointer;
}

/*
 * The open list, where the browser lets CSS style it (Chrome and Edge 135+):
 * a rounded white panel that scrolls, Light Gray rows on hover and focus, and
 * a check mark plus bold text on the chosen option. Other browsers open their
 * own list under the styled field.
 */
@supports (appearance: base-select) {
	select:not([multiple], [size]),
	::picker(select) {
		appearance: base-select;
	}

	/*
	 * The browser's label box can't take an ellipsis, so a long choice runs on
	 * and fades out under a white strip that holds the chevron.
	 */
	select:not([multiple], [size]) {
		display: inline-grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		padding-right: 0;
		overflow: hidden;
		background-image: none;
		white-space: nowrap;
	}

	select::picker-icon {
		content: "";
		box-sizing: content-box;
		width: 1.5rem;
		height: 1.5rem;
		padding-inline: 0.5rem 0.625rem;
		background:
			var(--ivo-select-chevron) left 0.5rem center / 1.5rem no-repeat,
			linear-gradient(to right, transparent, var(--wp--preset--color--base) 0.5rem);
	}

	/* Flipped, not rotated, so the fade stays on the left. */
	select:open::picker-icon {
		scale: 1 -1;
	}

	/*
	 * Below the field when it fits, like the native list; otherwise above.
	 * On phones it stops at the page gutter instead of the screen edge.
	 */
	::picker(select) {
		position-try-order: normal;
		max-block-size: min(20rem, 40dvh);
		margin-block: 0.25rem;
		margin-inline-end: 1rem;
		padding: 0.25rem;
		border: 1px solid var(--wp--custom--field--border);
		border-radius: var(--wp--custom--field--radius);
		background-color: var(--wp--preset--color--base);
		box-shadow: var(--wp--preset--shadow--card);
		scrollbar-color: var(--wp--custom--field--border) transparent;
		scrollbar-width: thin;
	}

	/* Text lines up with the field's text; long names wrap instead of widening the panel. */
	option {
		padding: 0.375rem 0.5rem;
		border-radius: var(--wp--preset--border-radius--small);
		white-space: normal;
		cursor: pointer;
	}

	option:hover,
	option:focus-visible {
		background-color: var(--wp--preset--color--surface);
	}

	option:focus-visible {
		outline: 2px solid var(--wp--preset--color--primary);
		outline-offset: -2px;
	}

	option:checked {
		font-weight: 700;
	}

	option::checkmark {
		content: "";
		order: 1;
		width: 1.5rem;
		height: 1.5rem;
		margin-inline-start: auto;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231D4ED8' d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 7.9z'/%3E%3C/svg%3E") center / contain no-repeat;
	}
}

/*
 * Search block (button inside): the box above goes on the wrapper, and the
 * button is a plain magnifying glass at its right end.
 */
.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	align-items: stretch;
	padding-block: 0;
	padding-right: 0;
}

.wp-block-search__button-inside .wp-block-search__input {
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* Core removes the input's outline here, so the ring goes around the whole box. */
.wp-block-search__button-inside .wp-block-search__input:focus-visible {
	outline: none;
	box-shadow: none;
}

.wp-block-search__button-inside .wp-block-search__inside-wrapper:has(.wp-block-search__input:focus-visible) {
	outline: 3px solid var(--wp--preset--color--highlight);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--wp--preset--color--primary-dark);
}

.wp-block-search__button-inside .wp-block-search__button.has-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--wp--custom--field--radius);
	background: none;
	color: var(--wp--custom--field--placeholder);
	cursor: pointer;
}

.wp-block-search__button-inside .wp-block-search__button.has-icon:hover {
	background: none;
	color: var(--wp--preset--color--primary);
}

/* Handle at the bottom right, like most search icons. */
.wp-block-search__button.has-icon svg {
	transform: scaleX(-1);
}

/* Tables: clean rows. */
.wp-block-table thead {
	border-bottom: 2px solid var(--wp--preset--color--primary-dark);
}

.wp-block-table th {
	background: var(--wp--preset--color--surface);
	text-align: left;
}

.wp-block-table td,
.wp-block-table th {
	border-color: var(--wp--preset--color--border);
	padding: 0.6em 0.8em;
}

/* A long e-mail address breaks only when the table can't fit it. */
.wp-block-table td a[href^="mailto:"] {
	overflow-wrap: break-word;
}

/*
 * Table style "Stacked on phones": on narrow screens each row is a block, its
 * cells one under the other, so a wide table (an office directory)
 * needs no sideways scrolling. The header row is hidden there, and the first
 * cell becomes a label above the rest.
 */
@media (max-width: 599px) {
	.wp-block-table.is-style-stack :is(table, tbody, tr, td) {
		display: block;
		width: 100%;
	}

	.wp-block-table.is-style-stack thead {
		display: none;
	}

	.wp-block-table.is-style-stack tr {
		padding-block: 0.75em;
		border-bottom: 1px solid var(--wp--preset--color--border);
	}

	.wp-block-table.is-style-stack td {
		border: 0;
		padding: 0.1em 0;
	}

	/* Like the Eyebrow paragraph style. */
	.wp-block-table.is-style-stack td:first-child {
		color: var(--wp--preset--color--primary);
		font-size: var(--wp--preset--font-size--x-small);
		font-weight: 700;
		letter-spacing: 0.1em;
		text-transform: uppercase;
	}

	.wp-block-table.is-style-stack td:empty {
		display: none;
	}
}

/* Date and writers under a post's title: "October 28, 2026 · By Ana Cruz". */
.wp-block-group.ivo-post-meta {
	align-items: baseline;
}

.ivo-post-meta > .wp-block-post-terms {
	color: var(--wp--preset--color--muted);
}

.ivo-post-meta > .wp-block-post-terms::before {
	content: "·";
	margin-inline: 0.4em;
}

/*
 * News and Updates list (patterns/posts-list.php): the thumbnail beside the
 * text, above it on phones.
 */
.ivo-news-item__thumb {
	flex: 0 0 12rem;
}

.ivo-news-item__text {
	min-width: 0;
}

@media (max-width: 599px) {
	.ivo-news-item.wp-block-group {
		flex-direction: column;
		align-items: stretch;
	}

	.ivo-news-item__thumb {
		flex-basis: auto;
	}
}

/* Homepage news list (patterns/posts-list-home.php): "View more" under it, like "View all issuances". */
.ivo-news-more {
	margin-top: 1.5rem;
	font-weight: 700;
}

/* Post without any image: the organization's logo (Appearance → Branding), faded, on the gray tile. */
.ivosea-news-thumb.is-placeholder .ivo-logo {
	opacity: 0.35;
}

/* Top bar */
.ivo-topbar {
	font-weight: 600;
}

.ivo-topbar p {
	margin: 0;
}

.ivo-topbar a {
	text-decoration: none;
}

.ivo-topbar a:hover {
	text-decoration: underline;
}

.ivo-clock__time {
	font-variant-numeric: tabular-nums;
}

/* Masthead */
.ivo-masthead p {
	margin: 0;
}

.ivo-masthead {
	container-type: inline-size;
}

/*
 * Organization heading beside the logo (patterns/header.php): optional small
 * lines above the name, the name, and an optional line below, from
 * Appearance → Branding. The logo is as tall as the lines; long names wrap.
 */
.ivo-heading {
	display: flex;
	align-items: center;
	gap: 0.75em;
	min-width: 0;
	max-width: 100%;
	font-size: 1rem;
	color: var(--wp--preset--color--primary-dark);
	text-decoration: none;
}

.ivo-heading .ivo-logo {
	flex: none;
	width: auto;
	height: var(--wp--custom--logo-size--xl);
}

.ivo-heading__lines {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	line-height: 1.2;
}

.ivo-heading__above {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125em;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.ivo-heading__above + .ivo-heading__above {
	padding-top: 0.125em;
}

.ivo-heading__above:last-of-type {
	align-self: stretch;
	padding-bottom: 0.25em;
	margin-bottom: 0.25em;
	border-bottom: 1px solid;
}

.ivo-heading__name {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.25em, 4cqi, 1.75em);
	font-weight: 800;
	overflow-wrap: anywhere;
}

.ivo-heading__below {
	margin-top: 0.125em;
	font-size: 0.8125em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

@container (width < 28rem) {
	.ivo-heading .ivo-logo {
		height: var(--wp--custom--logo-size--lg);
	}
}

/*
 * Right side: the phone and the email above the search box and the badges.
 * It is as tall as the heading, with the phone row at the heading's top edge
 * and the search row at its bottom edge, so both sides leave the same space
 * above and below (header.php: stretch and space-between). It wraps under the
 * heading when the row runs out of room. Phone and email sit together at the
 * right end, above the badges.
 */
.ivo-masthead__aside {
	flex: 0 1 30rem;
	min-width: 0;
}

.ivo-masthead__contact {
	display: flex;
	flex-wrap: wrap;
	align-self: stretch;
	justify-content: flex-end;
	gap: 0 var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ivo-masthead__contact a {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 24px;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.ivo-masthead__contact a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

.ivo-masthead__contact svg {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	fill: var(--wp--preset--color--primary);
}

/*
 * The row is kept close to the search box, so the links are 24px tall (the
 * WCAG 2.2 AA minimum). Touch screens get the full 44px.
 */
@media (pointer: coarse) {
	.ivo-masthead__contact a {
		min-height: 44px;
	}
}

/* The search box takes the room left beside the badges and shrinks first. */
.ivo-masthead__search {
	align-self: stretch;
}

.ivo-masthead__search .wp-block-search {
	flex: 1 1 auto;
	min-width: 0;
}

.ivo-masthead__badge {
	display: block;
	flex: none;
}

/*
 * The blue menu bar stays at the top of the screen while the page scrolls; the
 * top bar and masthead scroll away. A sticky element only sticks inside its
 * parent, so the header wrapper gives up its own box (front end only; in the
 * Site Editor the header isn't a direct child of .wp-site-blocks).
 */
.wp-site-blocks > header.wp-block-template-part {
	display: contents;
}

.ivo-navbar {
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* Below the logged-in toolbar, which is only fixed from 601px. */
@media (min-width: 601px) {
	.admin-bar .ivo-navbar {
		top: var(--wp-admin--admin-bar--height, 0px);
	}
}

/*
 * Home page: the carousel stops right under the menu bar and the sections after
 * it slide up over it like a sheet. assets/js/home-carousel.js keeps
 * --ivo-navbar-height current and adds is-pinned only when the carousel fits
 * under the bar (front end only).
 */
.ivo-home-carousel.is-pinned {
	position: sticky;
	top: var(--ivo-navbar-height, 3rem);
	z-index: 0;
}

@media (min-width: 601px) {
	.admin-bar .ivo-home-carousel.is-pinned {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--ivo-navbar-height, 3rem));
	}
}

/* Solid, so the carousel doesn't show between the sections. */
.ivo-home-carousel.is-pinned + .ivo-home-content {
	position: relative;
	z-index: 1;
	background-color: var(--wp--preset--color--base);
	box-shadow: 0 -6px 16px -6px rgba(15, 23, 42, 0.3);
}

/* In-page links (#section) scroll to just below the bar, not under it. */
html {
	scroll-padding-top: 5rem;
}

/* Jumps within a page glide instead of cutting, unless the visitor prefers reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/*
 * Main menu on the blue bar. theme.json sets the 14px bold uppercase labels;
 * the menu tree is in inc/navigation.php.
 */
.ivo-main-menu .wp-block-navigation-item__content {
	text-decoration: none;
}

.ivo-main-menu .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.ivo-main-menu .wp-block-navigation__container > .current-menu-item > .wp-block-navigation-item__content,
.ivo-main-menu .wp-block-navigation__container > .current-menu-ancestor > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--highlight);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.5em;
}

/*
 * The six top-level items don't fit on one line below 782px, and core only places
 * nested submenus beside their parent from 782px. So the menu button is used up to
 * 781px (core switches at 600px).
 */
@media (min-width: 600px) and (max-width: 781px) {
	.ivo-main-menu .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.ivo-main-menu .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Desktop dropdowns: white panels with the Card shadow. */
@media (min-width: 782px) {
	.ivo-main-menu .wp-block-navigation__submenu-container {
		min-width: 16rem;
		padding-block: 0.375rem;
		border: 1px solid var(--wp--preset--color--border);
		border-radius: 8px;
		background-color: var(--wp--preset--color--base);
		box-shadow: var(--wp--preset--shadow--card);
		color: var(--wp--preset--color--contrast);
		text-transform: none;
		letter-spacing: normal;
	}

	/* Core sets 200px on open panels with these selectors. */
	.ivo-main-menu.wp-block-navigation .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container,
	.ivo-main-menu.wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within > .wp-block-navigation__submenu-container,
	.ivo-main-menu.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
		min-width: 16rem;
	}

	.ivo-main-menu.wp-block-navigation .has-child:not(.open-on-click):hover > .wp-block-navigation__submenu-container:has(> .ivo-year-link),
	.ivo-main-menu.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .wp-block-navigation__submenu-container:has(> .ivo-year-link) {
		min-width: 14rem;
	}

	.ivo-main-menu .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		color: var(--wp--preset--color--contrast);
	}

	.ivo-main-menu .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
		padding: 0.625rem 1rem;
	}

	.ivo-main-menu .wp-block-navigation__submenu-container .wp-block-navigation-item:hover,
	.ivo-main-menu .wp-block-navigation__submenu-container .wp-block-navigation-item:focus-within {
		background-color: var(--wp--preset--color--surface);
	}

	.ivo-main-menu .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content,
	.ivo-main-menu .wp-block-navigation__submenu-container .current-menu-ancestor > .wp-block-navigation-item__content {
		color: var(--wp--preset--color--primary);
	}

	/* Year lists: three columns instead of one long list. */
	.ivo-main-menu .wp-block-navigation__submenu-container:has(> .ivo-year-link) {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
	}

	.ivo-main-menu .has-child .wp-block-navigation__submenu-container > .ivo-year-link > .wp-block-navigation-item__content {
		justify-content: center;
		padding-inline: 0.5rem;
	}
}

.ivo-main-menu .ivo-year-link--more {
	grid-column: 1 / -1;
}

/* Phone and tablet menu: full-screen navy panel, every item at least 44px tall. */
.ivo-navbar .ivo-main-menu .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
	background-color: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--base);
}

.ivo-navbar .ivo-main-menu .is-menu-open .wp-block-navigation__container,
.ivo-navbar .ivo-main-menu .is-menu-open .wp-block-navigation__submenu-container {
	gap: 0;
	padding-top: 0;
	background-color: transparent;
	border: 0;
}

/* Core indents each level by 2em and gives it 200px, too wide three levels deep on a phone. */
.ivo-navbar .ivo-main-menu .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container {
	min-width: 0;
	padding-right: 0;
	padding-left: 1rem;
	border-left: 1px solid rgba(255, 255, 255, 0.25);
	text-transform: none;
	letter-spacing: normal;
}

.ivo-navbar .ivo-main-menu .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding-block: 0.375rem;
	color: var(--wp--preset--color--base);
}

.ivo-navbar .ivo-main-menu .is-menu-open .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--highlight);
}

/* Years in three columns; fits three levels deep on a 360px screen. */
.ivo-navbar .ivo-main-menu .is-menu-open .wp-block-navigation__submenu-container:has(> .ivo-year-link) {
	display: grid;
	grid-template-columns: repeat(3, 4.5rem);
}

/* Footer link lists */
.ivo-footer-links {
	list-style: none;
	padding-left: 0;
}

.ivo-footer-links li + li {
	margin-top: 0.4em;
}

/*
 * Quick Links (patterns/quick-links.php): one link per tile, logo above the label.
 * 2 per row on phones, 3 on tablets, 6 on desktops; a short last row stays centred.
 */
.ivo-quick-links {
	--ivo-quick-links-columns: 2;
	--ivo-quick-links-gap: var(--wp--preset--spacing--30);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--ivo-quick-links-gap);
	margin-block: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.ivo-quick-links {
		--ivo-quick-links-columns: 3;
	}
}

@media (min-width: 1024px) {
	.ivo-quick-links {
		--ivo-quick-links-columns: 6;
	}
}

.ivo-quick-links > li {
	flex: 0 0 calc((100% - (var(--ivo-quick-links-columns) - 1) * var(--ivo-quick-links-gap)) / var(--ivo-quick-links-columns));
	min-width: 0;
	margin: 0;
}

.ivo-quick-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	box-sizing: border-box;
	height: 100%;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
	overflow-wrap: break-word;
}

.ivo-quick-link:hover {
	border-color: var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--primary);
}

.ivo-quick-link:hover .ivo-quick-link__label {
	text-decoration: underline;
}

/* Same box for every logo, so the labels line up whatever the logo's shape. */
.ivo-quick-link__logo {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--wp--custom--logo-size--lg);
}

@media (min-width: 600px) {
	.ivo-quick-link__logo {
		height: var(--wp--custom--logo-size--xl);
	}
}

.ivo-quick-link__logo .ivo-logo {
	width: auto;
	max-height: 100%;
	border-radius: 8px;
}

@media (prefers-reduced-motion: no-preference) {
	.ivo-quick-link {
		transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	}
}

/* Footer brand block: the logos, then the name and the footer text. */
.ivo-footer-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--40);
}

.ivo-footer-brand > .ivo-logo {
	flex: none;
}

.ivo-footer-brand__body {
	display: flex;
	flex: 1 1 16rem;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
}

.ivo-footer-brand__logos {
	gap: var(--wp--preset--spacing--50);
}

.ivo-footer-brand__text {
	margin: 0;
	line-height: 1.5;
}

/* Bottom bar: copyright on the left, links on the right, highlight stripe at the very bottom. */
.ivo-bottom-bar {
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 3px solid var(--wp--preset--color--highlight);
}

.ivo-bottom-bar p {
	margin: 0;
}

.ivo-bottom-bar a {
	color: inherit;
	text-decoration: none;
}

.ivo-bottom-bar a:hover {
	text-decoration: underline;
}

.ivo-bottom-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ivo-bottom-links li + li::before {
	content: "•";
	margin-inline-end: 0.5rem;
}

.ivo-site-footer a {
	text-decoration: none;
}

.ivo-site-footer a:hover {
	text-decoration: underline;
}
