/*
Theme Name: zgno
Description: Block theme for Здружение на глуви и наглуви лица Охрид. No parent theme. Design values live in theme.json.
Author: Gjorgji Kirovski
Version: 0.1.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zgno
*/

/* Shared interaction timings: --zgno-fade for colour changes, --zgno-move for size and position. */
:root {
	--zgno-fade: 0.15s ease-in-out;
	--zgno-move: 0.2s ease-in-out;
}

/* Keyboard focus is always visible, on every focusable element. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
}

/* Header */
.zgno-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.zgno-header .wp-block-navigation-item__content {
	padding: 0.35em 0;
	border-bottom: 3px solid transparent;
}

.zgno-header .wp-block-navigation-item__content:hover,
.zgno-header .wp-block-navigation-item__content[aria-current="page"] {
	border-bottom-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

/* The menu button is a comfortable touch target. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	padding: 8px;
}

.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
	width: 32px;
	height: 32px;
}

/* Seven menu items need more room, so the menu button is used below 1200px instead of WordPress's 600px. */
@media (min-width: 600px) and (max-width: 1199px) {
	.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}

	.wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
}

/* Open menu: links start at the left edge, where reading starts. */
.zgno-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.zgno-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.zgno-header .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: flex-start;
}

/* Open menu: large, well spaced links. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--30);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* Footer */
.zgno-footer :focus-visible {
	outline-color: var(--wp--preset--color--base);
}

.zgno-footer a:hover {
	text-decoration-thickness: 2px;
}

.zgno-footer .wp-block-site-title a {
	text-decoration: none;
}

.zgno-footer__legal {
	border-top: 1px solid rgba(255, 255, 255, 0.3);
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
}

/* Page sections sit directly against the header, each other and the footer. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* "More" links under a section. */
.zgno-more a {
	font-weight: 600;
	text-underline-offset: 0.2em;
}

/* Group style "Картичка": a bordered box with a blue top edge. */
.wp-block-group.is-style-card {
	border: 1px solid var(--wp--preset--color--line);
	border-top: 4px solid var(--wp--preset--color--primary);
	border-radius: 6px;
	box-sizing: border-box;
	height: 100%;
	padding: var(--wp--preset--spacing--40);
}

.wp-block-group.is-style-card .wp-block-image img {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
}

.wp-block-group.is-style-card :where(h3) a,
.zgno-post-card .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.wp-block-group.is-style-card :where(h3) a:hover,
.zgno-post-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
}

/* The founding year on the homepage never breaks out of its column. */
.zgno-year {
	margin: 0;
}

/* Homepage hero: the motto in the left half, the photo cropped to the right half and fading in from the left. They never overlap. */
.zgno-hero {
	overflow: hidden;
	position: relative;
}

.wp-block-group.zgno-hero {
	padding-bottom: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--60);
}

.zgno-hero h1 {
	font-size: clamp(2.75rem, 5.6vw, 5rem);
	line-height: 1.08;
}

.wp-block-group.zgno-hero > :not(.zgno-hero__photo) {
	position: relative;
	z-index: 1;
}

.zgno-hero__text {
	column-gap: var(--wp--preset--spacing--40);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.zgno-hero__text > * {
	grid-column: 1;
}

.wp-block-group.zgno-hero > .wp-block-image.zgno-hero__photo {
	bottom: 0;
	height: 100%;
	left: 50%;
	margin: 0;
	max-width: none;
	position: absolute;
	right: 0;
	top: 0;
	width: auto;
}

.wp-block-image.zgno-hero__photo img {
	--zgno-hero-fade-length: 12%;
	--zgno-hero-fade: linear-gradient(to right,
		rgba(0, 0, 0, 0) 0,
		rgba(0, 0, 0, 0.028) calc(var(--zgno-hero-fade-length) * 0.1),
		rgba(0, 0, 0, 0.104) calc(var(--zgno-hero-fade-length) * 0.2),
		rgba(0, 0, 0, 0.216) calc(var(--zgno-hero-fade-length) * 0.3),
		rgba(0, 0, 0, 0.352) calc(var(--zgno-hero-fade-length) * 0.4),
		rgba(0, 0, 0, 0.5) calc(var(--zgno-hero-fade-length) * 0.5),
		rgba(0, 0, 0, 0.648) calc(var(--zgno-hero-fade-length) * 0.6),
		rgba(0, 0, 0, 0.784) calc(var(--zgno-hero-fade-length) * 0.7),
		rgba(0, 0, 0, 0.896) calc(var(--zgno-hero-fade-length) * 0.8),
		rgba(0, 0, 0, 0.972) calc(var(--zgno-hero-fade-length) * 0.9),
		#000 var(--zgno-hero-fade-length));
	display: block;
	height: 100%;
	-webkit-mask-image: var(--zgno-hero-fade);
	mask-image: var(--zgno-hero-fade);
	max-width: none;
	object-fit: cover;
	object-position: 25% 80%;
	width: 100%;
}

/* On very wide screens the band grows so the photo's half stays at most 2.4 times wider than tall, and the swans keep their heads. */
@media (min-width: 1440px) {
	.wp-block-group.zgno-hero {
		align-content: center;
		display: grid;
		min-height: max(704px, calc(50vw / 2.4));
	}

	.wp-block-group.zgno-hero > .zgno-hero__text {
		width: 100%;
	}
}

/* Below 1280px the photo sits on top and fades down into the text. */
@media (max-width: 1279px) {
	.zgno-hero {
		--zgno-hero-photo: clamp(220px, 42vw, 360px);
	}

	.wp-block-group.zgno-hero {
		padding-top: calc(var(--zgno-hero-photo) * 0.92);
	}

	.wp-block-group.zgno-hero > .wp-block-image.zgno-hero__photo {
		bottom: auto;
		height: var(--zgno-hero-photo);
		left: 0;
		transform: none;
	}

	.wp-block-image.zgno-hero__photo img {
		--zgno-hero-fade: linear-gradient(to bottom,
			#000 70%,
			rgba(0, 0, 0, 0.972) 73%,
			rgba(0, 0, 0, 0.896) 76%,
			rgba(0, 0, 0, 0.784) 79%,
			rgba(0, 0, 0, 0.648) 82%,
			rgba(0, 0, 0, 0.5) 85%,
			rgba(0, 0, 0, 0.352) 88%,
			rgba(0, 0, 0, 0.216) 91%,
			rgba(0, 0, 0, 0.104) 94%,
			rgba(0, 0, 0, 0.028) 97%,
			rgba(0, 0, 0, 0) 100%);
		object-fit: cover;
		object-position: 50% 90%;
		width: 100%;
	}

	.zgno-hero__text {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Image style "Облик на логото": a circle cut by a diagonal, with two thin arcs. */
.wp-block-image.is-style-logo-shape {
	margin-inline: auto;
	max-width: 540px;
	position: relative;
	width: 88%;
}

.wp-block-image.is-style-logo-shape img {
	aspect-ratio: 1;
	display: block;
	height: auto;
	-webkit-mask: url(assets/images/logo-shape-mask.svg) center / 100% 100% no-repeat;
	mask: url(assets/images/logo-shape-mask.svg) center / 100% 100% no-repeat;
	object-fit: cover;
	width: 100%;
}

.wp-block-image.is-style-logo-shape::before,
.wp-block-image.is-style-logo-shape::after {
	border: 3px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	content: "";
	inset: -5%;
	pointer-events: none;
	position: absolute;
}

.wp-block-image.is-style-logo-shape::before {
	clip-path: polygon(0 55%, 55% 0, 0 0);
}

.wp-block-image.is-style-logo-shape::after {
	clip-path: polygon(100% 45%, 45% 100%, 100% 100%);
}

/* Stacked buttons are equal and full width everywhere. */
@media (max-width: 599px) {
	.wp-block-buttons {
		align-items: stretch;
		flex-direction: column;
	}

	.wp-block-buttons > .wp-block-button,
	.wp-block-buttons > .wp-block-button > .wp-block-button__link {
		box-sizing: border-box;
		text-align: center;
		width: 100%;
	}
}

/* A word spelled with the two-handed alphabet: white tiles on dark blue. */
.zgno-hands .wp-block-image {
	background: var(--wp--preset--color--base);
	border-radius: 6px;
	margin: 0;
	overflow: hidden;
}

.zgno-hands .wp-block-image img {
	display: block;
	height: auto;
	width: 100%;
}

.zgno-spell :focus-visible {
	outline-color: var(--wp--preset--color--base);
}

/* Below desktop width the tiles get the full row; on a phone they sit three by two. */
@media (max-width: 999px) {
	.zgno-spell .wp-block-columns {
		flex-wrap: wrap !important;
	}

	.zgno-spell .wp-block-column {
		flex-basis: 100% !important;
	}
}

@media (max-width: 599px) {
	.zgno-hands.zgno-hands {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Inner pages: title band. */
.zgno-page-head .wp-block-post-title {
	margin-block: 0;
}

/* Timeline: the year on the left, a line with a dot, the text on the right. */
.zgno-timeline__year {
	margin: 0;
}

.zgno-timeline > .wp-block-columns {
	margin-block: 0;
}

.zgno-timeline > .wp-block-columns > .wp-block-column:last-child {
	border-left: 3px solid var(--wp--preset--color--line);
	padding-bottom: var(--wp--preset--spacing--50);
	padding-left: var(--wp--preset--spacing--40);
	position: relative;
}

.zgno-timeline > .wp-block-columns > .wp-block-column:last-child::before {
	background: var(--wp--preset--color--primary);
	border: 4px solid var(--wp--preset--color--base);
	border-radius: 50%;
	content: "";
	height: 14px;
	left: -12.5px;
	position: absolute;
	top: 0.35em;
	width: 14px;
}

.zgno-timeline > .wp-block-columns:last-child > .wp-block-column:last-child {
	padding-bottom: 0;
}

.zgno-timeline > .wp-block-columns > .wp-block-column:last-child > :first-child {
	margin-top: 0;
}

@media (max-width: 781px) {
	.zgno-timeline > .wp-block-columns > .wp-block-column:first-child {
		flex-basis: auto !important;
	}
}

/* A column that only decorates: hidden where columns stack. */
@media (max-width: 781px) {
	.zgno-desktop-only {
		display: none;
	}
}

/* Grid of short text tiles: three, two or one per row. */
@media (max-width: 899px) {
	.zgno-tiles.zgno-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.zgno-tiles.zgno-tiles {
		grid-template-columns: 1fr;
	}
}

.zgno-tiles .is-style-card p {
	font-weight: 600;
	margin: 0;
}

/* Section heading with a "more" link on the same line. */
.zgno-section-head :where(h2, p) {
	margin-block: 0;
}

/* Post date and category above the title. */
.zgno-post-meta a {
	font-weight: 600;
}

/* Page numbers under a list of posts. */
.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
}

/* Sign cards: a photo with its word underneath. */
.zgno-signs .wp-block-image {
	margin: 0;
}

.zgno-signs .wp-block-image img {
	border-radius: 6px;
	display: block;
	height: auto;
	width: 100%;
}

.zgno-signs .wp-block-image figcaption {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	margin: 0.5em 0 0;
	text-align: center;
}

/* Alphabet tiles on a white page: the same tiles as on the homepage, with a border. */
.zgno-letters .wp-block-image {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	margin: 0;
	overflow: hidden;
}

.zgno-letters .wp-block-image img {
	display: block;
	height: auto;
	width: 100%;
}

/* Sign cards: six per row, three on tablets, so a group of six or nine never leaves one card alone. */
.zgno-signs.zgno-signs {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1199px) {
	.zgno-signs.zgno-signs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* On a phone: two sign cards and three letters per row. */
@media (max-width: 599px) {
	.zgno-signs.zgno-signs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.zgno-letters.zgno-letters {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Box with the whole poster or chart and its download. */
.zgno-download .wp-block-image {
	margin: 0;
}

.zgno-download .wp-block-image img {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
}

.wp-block-file {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em 1em;
}

.wp-block-file a:not(.wp-block-file__button) {
	font-weight: 600;
}

.wp-block-file .wp-block-file__button {
	margin-left: 0;
}

/* A card that only holds a picture keeps the height of the picture. */
.zgno-desktop-only > .wp-block-group.is-style-card {
	height: auto;
}

/* Text links that stand alone are tall enough to tap (about 44px). */
.zgno-more a,
.zgno-post-meta a {
	display: inline-block;
	padding-block: 0.55em;
}

/* Footer links: close together for a mouse, about 44px tall on touch screens. */
.zgno-footer p:not(.wp-block-site-title) a,
.zgno-footer .wp-block-navigation-item__content {
	display: inline-block;
	padding-block: 0.2em;
}

@media (pointer: coarse) {
	.zgno-footer p:not(.wp-block-site-title) a,
	.zgno-footer .wp-block-navigation-item__content {
		padding-block: 0.55em;
	}
}

.zgno-footer .wp-block-column > p:not(:first-child),
.zgno-footer .wp-block-column > .wp-block-navigation {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Partner logos: logo and name are one link, set apart from the motto. */
.zgno-footer .wp-block-column > p.zgno-partner {
	margin-block-start: var(--wp--preset--spacing--40);
}

.zgno-footer p.zgno-partner a {
	align-items: center;
	display: inline-flex;
	gap: 0.875rem;
}

.zgno-partner img {
	flex: none;
	height: 64px;
	width: auto;
}

/* The first line of every footer column starts at the same height. */
.zgno-footer .wp-block-column > :first-child {
	margin-block-start: 0;
}

.zgno-more {
	margin-block: 0.25em 0;
}

.zgno-footer .wp-block-navigation .wp-block-navigation__container {
	gap: 0;
}

/* The same for links that stand alone in a line of their own. */
.wp-block-file a:not(.wp-block-file__button),
.zgno-spell p a,
.is-style-card p a[href^="mailto:"],
.zgno-post-card .wp-block-post-title a {
	display: inline-block;
	padding-block: 0.5em;
}

/* WordPress sets the file name to 0.8em with a selector theme.json can't outrank. */
.wp-block-file.wp-block-file:not(.wp-element-button) {
	font-size: var(--wp--preset--font-size--medium);
}

/* The download button keeps the size of every other button. */
.wp-block-file .wp-block-file__button {
	font-size: inherit;
}

/* Homepage: the founding year beside the text about the association. */
.zgno-about__label,
.zgno-about__places {
	letter-spacing: 0.04em;
	margin: 0;
	text-transform: uppercase;
}

.zgno-about__label {
	font-weight: 600;
}

.zgno-about__places {
	margin-top: 0.6em;
}

@media (min-width: 782px) {
	.zgno-about__since {
		border-right: 3px solid var(--wp--preset--color--line);
		padding-right: var(--wp--preset--spacing--50);
	}
}

/* Jump links scroll smoothly, unless the visitor has asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Intro text above a wide grid ends at the same right edge as the grid. */
.is-layout-constrained > .zgno-text-wide {
	max-width: var(--wp--style--global--wide-size);
}

/* Fixed header that shrinks on scroll. The <header> is an empty placeholder at full height so the page never jumps; only the bar inside is fixed. (A sticky placeholder left an invisible strip that kept stale picture fragments after zooming.) */
.wp-site-blocks > header {
	height: calc(70px + 2 * var(--wp--preset--spacing--30) + 1px);
	position: relative;
}

.zgno-header {
	left: 0;
	position: fixed;
	right: 0;
	top: var(--zgno-header-top, var(--wp-admin--admin-bar--height, 0px));
	transition: box-shadow var(--zgno-move);
	/* Above everything on the page, including the "enlarge" buttons on pictures (100). */
	z-index: 1000;
}

.zgno-header > .wp-block-group {
	transition: padding var(--zgno-move);
}

/* The logo (855 x 240, ear symbol in the left square) is cropped from the left and both sizes animate, so the symbol stays whole while the header shrinks. */
.zgno-header .wp-block-site-logo img {
	height: 70px;
	object-fit: cover;
	object-position: left center;
	transition: height var(--zgno-move), width var(--zgno-move);
	width: calc(70px * 855 / 240);
}

.is-scrolled .zgno-header {
	box-shadow: 0 2px 10px rgba(20, 33, 61, 0.12);
}

.is-scrolled .zgno-header > .wp-block-group {
	padding-bottom: 0.25rem !important;
	padding-top: 0.25rem !important;
}

/* Small header: only the ear symbol shows. The name stays in the alt text for screen readers. */
.is-scrolled .zgno-header .wp-block-site-logo img {
	height: 40px;
	width: 41px;
}

@media (prefers-reduced-motion: reduce) {
	.zgno-header,
	.zgno-header > .wp-block-group,
	.zgno-header .wp-block-site-logo img {
		transition: none;
	}
}

/* Jump links and focus stop below the header. Set on the content, not the page: a page-wide offset made the browser scroll up whenever the menu button got focus. */
main [id],
main :focus-visible,
footer :focus-visible {
	scroll-margin-top: calc(57px + var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--40));
}

/* Hover and pressed states, all at --zgno-fade. Outline buttons get a light fill instead of turning solid: swapping text and background colours made the label blink halfway. */
a,
.wp-element-button,
.wp-block-button__link {
	transition: background-color var(--zgno-fade), border-color var(--zgno-fade), color var(--zgno-fade), text-decoration-color var(--zgno-fade);
}

a:where(:not(.wp-element-button):not(.wp-block-navigation-item__content)):hover {
	text-decoration-line: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--line);
	border-color: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--primary-dark);
}

.wp-element-button:active,
.wp-block-button__link:active {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-block-button.is-style-outline .wp-block-button__link:active {
	background-color: var(--wp--preset--color--line);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
}

.zgno-footer .wp-block-navigation-item__content:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.zgno-post-card .wp-block-post-featured-image {
	overflow: hidden;
}

.zgno-post-card .wp-block-post-featured-image img {
	transition: transform var(--zgno-move);
}

.zgno-post-card .wp-block-post-featured-image a:hover img {
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.zgno-post-card .wp-block-post-featured-image img {
		transition: none;
	}

	.zgno-post-card .wp-block-post-featured-image a:hover img {
		transform: none;
	}
}

/* Editor only: the title lines up with the content, as on the published page. */
.post-type-post .editor-visual-editor__post-title-wrapper > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: 900px;
}

.post-type-page .editor-visual-editor__post-title-wrapper > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: var(--wp--style--global--wide-size);
}

/* Gallery photos get the same rounded corners as every other picture. */
.wp-block-gallery.has-nested-images figure.wp-block-image img {
	border-radius: 6px;
}

/* Narrow screens: the year sits above its text, with the line running down the left of both. */
@media (max-width: 781px) {
	.zgno-timeline > .wp-block-columns {
		border-left: 3px solid var(--wp--preset--color--line);
		gap: var(--wp--preset--spacing--20);
		padding-bottom: var(--wp--preset--spacing--50);
		padding-left: var(--wp--preset--spacing--40);
		position: relative;
	}

	.zgno-timeline > .wp-block-columns:last-child {
		padding-bottom: 0;
	}

	.zgno-timeline > .wp-block-columns::before {
		background: var(--wp--preset--color--primary);
		border: 4px solid var(--wp--preset--color--base);
		border-radius: 50%;
		content: "";
		height: 14px;
		left: -12.5px;
		position: absolute;
		top: 0.75rem;
		width: 14px;
	}

	.zgno-timeline > .wp-block-columns > .wp-block-column:last-child {
		border-left: 0;
		padding-bottom: 0;
		padding-left: 0;
	}

	.zgno-timeline > .wp-block-columns > .wp-block-column:last-child::before {
		content: none;
	}
}

/* Text beside a photo that is exactly as tall as the text (intros of За нас and Активности и проекти). */
.wp-block-list.zgno-lines {
	border-bottom: 2px solid var(--wp--preset--color--line);
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
}

.wp-block-list.zgno-lines li {
	align-items: center;
	border-top: 2px solid var(--wp--preset--color--line);
	box-sizing: border-box;
	display: flex;
	font-weight: 600;
	gap: 0.9rem;
	line-height: 1.3;
	min-height: 4rem;
	padding: 0.4rem 0;
}

.wp-block-list.zgno-lines li::before {
	background: var(--wp--preset--color--primary);
	border-radius: 2px;
	content: "";
	flex: none;
	height: 0.6rem;
	width: 0.6rem;
}

.zgno-split .wp-block-column > :first-child {
	margin-top: 0;
}

.zgno-split__photo .wp-block-image {
	height: 100%;
	margin: 0;
}

.zgno-split__photo .wp-block-image img {
	border-radius: 6px;
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: var(--zgno-photo-focus, center);
	width: 100%;
}

/* Stacked: the photo comes first, as a wide strip. */
@media (max-width: 781px) {
	.zgno-split__photo {
		order: -1;
	}

	.zgno-split__photo .wp-block-image img {
		aspect-ratio: 16 / 9;
		height: auto;
	}
}

/* „На оваа страница“ section list (scroll.js marks the current section): a row at the top on narrow screens, a sticky column on the right from 1000px, in the page margin from 1700px. */
.zgno-toc {
	border-bottom: 2px solid var(--wp--preset--color--line);
	margin: 0 0 var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--20);
}

.zgno-toc__label {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	margin: 0;
	text-transform: uppercase;
}

.wp-block-list.zgno-toc__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.zgno-toc__list a {
	color: var(--wp--preset--color--contrast);
	display: inline-block;
	font-weight: 600;
	padding-block: 0.6em;
	text-decoration: none;
}

.zgno-toc__list a[aria-current] {
	color: var(--wp--preset--color--primary);
}

@media (min-width: 1000px) {
	.wp-block-post-content:has(> .zgno-toc) {
		box-sizing: border-box;
		padding-right: 266px;
		position: relative;
	}

	/* The column runs down past the content, so the list stays in place until near the footer. */
	.wp-block-post-content > .zgno-toc {
		border-bottom: 0;
		bottom: calc(var(--wp--preset--spacing--40) - var(--wp--preset--spacing--60));
		margin: 0;
		padding: 0;
		position: absolute;
		right: 0;
		top: 0;
		width: 210px;
	}

	/* One box holds the label and the links, so they stay together while it sticks. */
	.zgno-toc__inner {
		border-left: 3px solid var(--wp--preset--color--line);
		position: sticky;
		top: calc(89px + var(--wp-admin--admin-bar--height, 0px));
	}

	.zgno-toc__label {
		padding: 0.25rem 0 0.5rem 1rem;
	}

	.zgno-toc__inner {
		transition: opacity var(--zgno-fade), visibility var(--zgno-fade);
	}

	.zgno-toc__inner.is-leaving {
		opacity: 0;
		visibility: hidden;
	}

	.wp-block-list.zgno-toc__list {
		display: block;
	}

	.zgno-toc__list a {
		border-left: 3px solid transparent;
		display: block;
		margin-left: -3px;
		padding: 0.55rem 1rem;
	}

	.zgno-toc__list a[aria-current] {
		border-left-color: var(--wp--preset--color--primary);
	}
}

@media (min-width: 1700px) {
	.wp-block-post-content:has(> .zgno-toc) {
		padding-right: 0;
	}

	.wp-block-post-content > .zgno-toc {
		right: -266px;
	}
}

/* On a phone the section links sit one under another, so none wraps alone. */
@media (max-width: 599px) {
	.wp-block-list.zgno-toc__list {
		display: block;
	}

	.zgno-toc__list a {
		display: block;
	}
}

/* The first block after the section list starts right below or beside it, with no extra gap. */
.wp-block-post-content > .zgno-toc + * {
	margin-top: 0 !important;
}

/* WordPress blurs the background of the "enlarge" button; many blurred layers made nearby elements flash on hover. */
.wp-lightbox-container button {
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
	background-color: rgba(20, 33, 61, 0.55) !important;
}

/* Album tile on "Галерија": date and number of photos on one line. */
.zgno-album__meta {
	align-items: baseline;
}

.zgno-album__meta > * {
	margin: 0;
}

.zgno-album__count {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
}

.zgno-album__count:empty {
	display: none;
}

/* The part of the photo that stays in view when it is cropped to the text height. */
.zgno-split__photo.is-focus-left {
	--zgno-photo-focus: 30% center;
}

/* The whole photo, uncropped, for photos with something that must stay complete, like a photographer's mark. */
.zgno-split__photo.is-whole {
	align-self: center;
}

.zgno-split__photo.is-whole .wp-block-image,
.zgno-split__photo.is-whole .wp-block-image img {
	aspect-ratio: auto;
	height: auto;
}

/* Short pages: the footer stays at the bottom of the window. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* За нас: the opening sentence large beside the photo, the two paragraphs with icons below. */
.zgno-lead {
	font-size: clamp(1.375rem, 2.3vw, 1.875rem);
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
}

.zgno-point > p {
	margin: 0;
}

.zgno-point__icon {
	flex: none;
}

/* A thin line between the two paragraphs while they sit side by side. */
@media (min-width: 782px) {
	.zgno-points > .wp-block-column + .wp-block-column {
		border-left: 2px solid var(--wp--preset--color--line);
		padding-left: var(--wp--preset--spacing--60);
	}

	.zgno-points.zgno-points {
		gap: var(--wp--preset--spacing--60);
	}
}

/* Title band of inner pages: navy with flowing lines, ending along the lowest line instead of a straight edge. The bottom padding keeps the title above the white edge, which reaches at most 48% up the picture. */
.zgno-page-head {
	--zgno-flow: clamp(100px, 13vw, 170px);
	overflow: hidden;
	position: relative;
}

.wp-block-group.zgno-page-head {
	padding-bottom: calc(var(--zgno-flow) * 0.56);
	padding-top: clamp(1.5rem, 3.5vw, 2.5rem);
}

.zgno-page-head > * {
	position: relative;
	z-index: 1;
}

/* Which of the six pictures is used is set per page in inc/title-band.php. */
.zgno-page-head::after {
	background: center bottom / 100% 100% no-repeat;
	bottom: -1px;
	content: "";
	height: var(--zgno-flow);
	left: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
}


/* On a narrow screen only the right half of the pattern is used, so the lines keep their spacing. */
@media (max-width: 600px) {
	.zgno-page-head::after {
		background-position: right bottom;
		background-size: 200% 100%;
	}
}

.zgno-page-head :where(h1, a) {
	color: var(--wp--preset--color--base);
}

.zgno-page-head :focus-visible {
	outline-color: var(--wp--preset--color--base);
}

/* The band is pulled up over the empty space under its lowest line, so the content starts closer to the curve. */
.wp-block-group.zgno-page-head {
	margin-bottom: calc(var(--zgno-flow) * -0.22 - var(--wp--preset--spacing--30));
}

.zgno-page-head + * {
	position: relative;
	z-index: 1;
}

.zgno-page-head :where(.wp-block-post-date, .wp-block-post-terms, p) {
	color: var(--wp--preset--color--base);
}
