/*
 * Components: one section per template part, named like its file.
 * e.g. template-parts/layout/site-header.php  →  "=== site-header ==="
 */

/* ===================================================================
 * template-parts/layout/
 * =================================================================== */

/* === skip-link (header.php) === */
.skip-link:focus {
	position: fixed !important;
}

/* === site-header === */
.site-header {
	background: var(--wp--preset--color--white);
	border-block-end: 3px solid var(--wp--preset--color--gold);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding: 14px max(4vw, 16px);
}

.regionvranov-ticket-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 2px solid var(--rv-yi);
	border-radius: 4px;
	background: var(--rv-yi);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	text-decoration: none;

	&:hover,
	&:focus-visible {
		border-color: var(--wp--preset--color--night);
		background: var(--wp--preset--color--night);
		color: var(--wp--preset--color--white);
	}
}

/* The header copy of the button hides on mobile (the menu has its own copy). */
.site-header__inner > .regionvranov-ticket-btn {
	@media (max-width: 767px) {
		display: none;
	}
}

/* Copy of the button at the end of the mobile menu: only on mobile, only while the menu is open. */
.regionvranov-ticket-btn--menu {
	margin-block-start: 12px;

	@media (min-width: 768px) {
		display: none;
	}
}

.js .primary-nav:not(.is-open) .regionvranov-ticket-btn--menu {
	display: none;
}

/* === site-branding === */
.site-branding {
	.custom-logo-link {
		display: block;
	}

	.custom-logo {
		display: block;
		height: 46px;
		width: auto;
	}
}

/* === menu-toggle === */
.menu-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: 44px;
	padding: 0.5em 0.75em;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	border: 1.5px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	cursor: pointer;

	@media (min-width: 768px) {
		display: none;
	}
}

/* Without JS there is nothing to toggle: keep the button hidden, menu open. */
html:not(.js) .menu-toggle {
	display: none;
}

.menu-toggle__icon,
.menu-toggle__icon::before,
.menu-toggle__icon::after {
	display: block;
	width: 1.125em;
	height: 2px;
	background: currentColor;
}

.menu-toggle__icon {
	position: relative;

	&::before,
	&::after {
		content: "";
		position: absolute;
		left: 0;
	}

	&::before { top: -6px; }
	&::after { top: 6px; }
}

/* === primary-nav === */
.primary-nav {
	flex-basis: 100%;

	@media (min-width: 768px) {
		flex-basis: auto;
	}
}

/* Collapsed on small screens only when JS is running (see navigation.js). */
.js .primary-nav:not(.is-open) .primary-nav__menu {
	@media (max-width: 767px) {
		display: none;
	}
}

.primary-nav__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px 22px;
	font-weight: 600;

	@media (min-width: 768px) {
		flex-direction: row;
		flex-wrap: wrap;
	}

	a {
		color: var(--wp--preset--color--ink);
		text-decoration: none;
		display: block;
		padding-block: 8px;
	}

	.current-menu-item > a,
	a:hover,
	a:focus-visible {
		color: var(--rv-yi);
		box-shadow: inset 0 -2px var(--rv-yi);
	}

	.sub-menu {
		list-style: none;
		margin: 0;
		padding-inline-start: 1em;
	}
}

/* === site-footer === */
.site-footer {
	background: var(--wp--preset--color--crimson);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--base);

	/* The global crimson focus ring would vanish on the crimson footer. */
	:focus-visible {
		outline-color: var(--wp--preset--color--white);
	}
}

.site-footer__inner {
	padding: 32px max(4vw, 16px);
}

.site-footer__main {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 40px;
}

.site-footer__crest {
	height: 64px;
	width: 64px;
	filter: brightness(0) invert(1); /* crest is drawn white on the crimson footer */
}

/* An image chosen in the Customizer keeps its own colours and proportions. */
.site-footer__crest--custom {
	width: auto;
	max-width: 160px;
	object-fit: contain;
	filter: none;
}

/* === footer-nav === */
.footer-nav__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-weight: 600;

	a {
		color: var(--wp--preset--color--white);
		text-decoration: none;

		&:hover,
		&:focus-visible {
			color: var(--wp--preset--color--white);
			text-decoration: underline;
		}
	}
}

/* === site-info === */
.site-info {
	flex: 1 1 320px;
	font-style: normal;

	p {
		margin: 0;
	}

	.site-info__name {
		font-weight: 700;
	}

	.site-info__text {
		max-width: 62ch;
		margin-block-start: 4px;
	}

	.site-info__more {
		margin-block-start: 8px;
		font-weight: 700;
	}

	a {
		color: var(--wp--preset--color--white);

		&:hover,
		&:focus-visible {
			color: var(--wp--preset--color--white);
		}
	}
}

/* === copyright === */
.copyright {
	margin: 18px 0 0;
	padding-block-start: 14px;
	border-block-start: 1px solid rgb(255 255 255 / 30%);
	font-size: var(--wp--preset--font-size--small);
}

/* ===================================================================
 * template-parts/content/
 * =================================================================== */

/* === page-banner === */
.page-banner {
	background: var(--rv-y);
	color: var(--rv-yo);
	overflow: hidden;
}

.page-banner__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	min-height: 250px;

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}
}

/* Dance-steps motif: steps.svg used as a mask so it takes the text colour. */
.page-banner__motif {
	position: relative;
	min-height: 200px;
	background: currentcolor;
	mask: url("../images/steps.svg") center / cover no-repeat;

	@media (max-width: 760px) {
		min-height: 150px;
		order: -1;
	}
}

.page-banner__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-end;
	gap: 6px;
	padding: 48px max(4vw, 16px);
	text-align: end;

	@media (max-width: 760px) {
		align-items: flex-start;
		padding: 28px 16px;
		text-align: start;
	}
}

.page-banner__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.page-banner__mark {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1;

	span {
		padding: 2px 8px 0;
		border: 2px solid currentcolor;
	}
}

/* Front-page hero: taller, with buttons under the mark (arg "actions"). */
.page-banner--hero .page-banner__inner {
	min-height: 380px;

	@media (max-width: 760px) {
		min-height: 0;
	}
}

.page-banner__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	margin-block-start: 16px;

	@media (max-width: 760px) {
		justify-content: flex-start;
	}
}

/* Both variants sit on the year colour; .page-banner__actions raises specificity over .regionvranov-ticket-btn. */
.page-banner__actions .page-banner__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 2px solid var(--wp--preset--color--white);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	color: var(--rv-yi);
	font-weight: 700;
	text-decoration: none;

	&:hover,
	&:focus-visible {
		border-color: var(--wp--preset--color--night);
		background: var(--wp--preset--color--night);
		color: var(--wp--preset--color--white);
	}

	&:focus-visible {
		outline: 3px solid var(--rv-yo);
		outline-offset: 2px;
	}
}

.page-banner__actions .page-banner__btn--ghost {
	border-color: var(--rv-yo);
	background: transparent;
	color: var(--rv-yo);

	&:hover,
	&:focus-visible {
		border-color: var(--rv-yo);
		background: var(--rv-yo);
		color: var(--rv-y);
	}
}

/* === content-page === */
/* === content-single === */
.entry-header {
	margin-block-end: var(--wp--preset--spacing--40);

	.entry-title {
		margin-block-end: var(--wp--preset--spacing--20);
	}
}

.entry-footer {
	margin-block-start: var(--wp--preset--spacing--50);
}

.page-links {
	margin-block: var(--wp--preset--spacing--40);
}

/* === content-card === */
.card {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	padding-block-end: var(--wp--preset--spacing--50);
	margin-block-end: var(--wp--preset--spacing--50);
	border-block-end: 1px solid var(--wp--preset--color--line);

	@media (min-width: 640px) {
		&:has(.post-thumbnail) {
			grid-template-columns: 240px minmax(0, 1fr);
		}
	}
}

.card__title {
	font-size: var(--wp--preset--font-size--large);
	margin-block-end: var(--wp--preset--spacing--20);

	a {
		color: inherit;
		text-decoration: none;

		&:hover {
			color: var(--wp--preset--color--crimson);
		}
	}
}

.card__excerpt p:last-child {
	margin: 0;
}

/* === content-none === */
.no-results {
	margin-block-end: var(--wp--preset--spacing--50);
}

/* === content-404 === */
.error-404__heading {
	margin-block-start: var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--large);
}

/* ===================================================================
 * template-parts/post/
 * =================================================================== */

/* === post-meta === */
.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 1em;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gold-text);
	margin-block-end: var(--wp--preset--spacing--30);

	a {
		color: inherit;
	}
}

/* === post-thumbnail === */
.post-thumbnail {
	margin: 0 0 var(--wp--preset--spacing--40);

	img {
		display: block;
		width: 100%;
		height: auto;
	}

	.card & {
		margin: 0;
	}
}

/* === post-tags === */
.post-tags {
	font-size: var(--wp--preset--font-size--small);
}

.post-tags__label {
	font-weight: 600;
}

/* === post-navigation === */
.post-navigation {
	margin-block-start: var(--wp--preset--spacing--50);
	padding-block-start: var(--wp--preset--spacing--40);
	border-block-start: 1px solid var(--wp--preset--color--line);

	.nav-links {
		display: flex;
		justify-content: space-between;
		gap: var(--wp--preset--spacing--40);
	}

	.nav-next {
		margin-inline-start: auto;
		text-align: end;
	}
}

.post-navigation__label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gold-text);
}

/* === pagination === */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;

	.page-numbers {
		padding: 0.25em 0.75em;
		border: 1px solid var(--wp--preset--color--line);
		text-decoration: none;
	}

	.current {
		background: var(--wp--preset--color--ink);
		color: var(--wp--preset--color--white);
		border-color: var(--wp--preset--color--ink);
	}
}

/* ===================================================================
 * template-parts/front/
 * =================================================================== */

/* === date-band === */
.date-band {
	padding: 20px 16px 18px;
	border-block-end: 3px solid var(--rv-y);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--gold-text);
	text-align: center;

	p {
		margin: 0;
	}
}

.date-band__tagline {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.date-band__date {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.04em;
}

/* === countdown === */
.countdown {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 20px 32px;
	padding: 34px max(4vw, 16px);
	overflow: hidden;
	background: var(--rv-y);
	color: var(--rv-yo);

	/* Free dance-steps motif across the band: steps-band.svg as a mask in the text colour. */
	&::before {
		content: "";
		position: absolute;
		inset: 0;
		background: currentcolor;
		mask: url("../images/steps-band.svg") center / cover no-repeat;

		/* The steps run behind the small labels (tel., dní, min): at full strength they drop
		   white text to about 2.6:1. At 0.3 the steps stay visible and text keeps 4.5:1. */
		opacity: 0.3;

		/* The stacked mobile band is tall: keep the steps at desktop scale, repeated downwards. */
		@media (max-width: 760px) {
			mask-position: center top;
			mask-size: auto 170px;
			mask-repeat: repeat-y;
		}
	}

	> * {
		position: relative;
	}

	:where(p) {
		margin: 0;
	}

	/* Focus ring in the band's text colour (the global crimson ring is invisible on the year colour). */
	:focus-visible {
		outline-color: var(--rv-yo);
	}

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
		text-align: center;
	}
}

.countdown__title {
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
}

.countdown__phone {
	margin-block-start: 4px;
	font-size: 15px;

	a {
		color: var(--rv-yo);
		text-decoration: underline;
		text-underline-offset: 3px;

		&:hover,
		&:focus-visible {
			color: var(--rv-yo);
			text-decoration-thickness: 2px;
		}
	}
}

.countdown__timer {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	font-size: 68px;
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;

	@media (max-width: 760px) {
		font-size: 40px;
	}
}

.countdown__unit {
	margin: 0 16px 0 6px;
	font-size: 16px;
	font-style: normal;
	font-weight: 500;

	@media (max-width: 760px) {
		margin: 0 10px 0 4px;
		font-size: 14px;
	}

	&:last-child {
		margin-inline-end: 0;
	}
}

/* Without JS the numbers would never fill: hide the counter, keep the rest. */
html:not(.js) .countdown__timer {
	display: none;
}

.countdown__action {
	justify-self: end;

	@media (max-width: 760px) {
		justify-self: center;
	}
}

/* On the year colour the ticket button is white with the ink text (board: .btn.inv). */
.countdown__action .countdown__btn {
	border-color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--white);
	color: var(--rv-yi);

	&:hover,
	&:focus-visible {
		border-color: var(--wp--preset--color--night);
		background: var(--wp--preset--color--night);
		color: var(--wp--preset--color--white);
	}

	&:focus-visible {
		outline: 3px solid var(--rv-yo);
		outline-offset: 2px;
	}
}

.countdown__thanks {
	display: none;
	grid-column: 1 / -1;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	line-height: 1.15;
	text-align: center;
	text-transform: uppercase;
}

/* After the start (countdown.js adds .is-over to <html>, every page): no ticket buttons anywhere.
 * !important: a state override that must beat every button's own display (header, hero, band). */
html.is-over .regionvranov-ticket-btn {
	display: none !important;
}

/* …and on the front page the thank-you line instead of the counter. */
html.is-over {
	.countdown__intro,
	.countdown__timer,
	.countdown__action {
		display: none;
	}

	.countdown__thanks {
		display: block;
	}
}

/* === recent-photos === */
.recent-photos {
	background: var(--wp--preset--color--cream);
}

/* 4 square columns with a 2 × 2 first tile (9 or 5 photos); 3 columns for 3; 2; 1 wide tile. */
.recent-photos__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;

	@media (max-width: 760px) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

.recent-photos__grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 840px;
	margin-inline: auto;
}

.recent-photos__grid--1 {
	grid-template-columns: minmax(0, 1fr);
	max-width: 840px;
	margin-inline: auto;

	.recent-photos__tile {
		aspect-ratio: 16 / 9;
	}
}

.recent-photos__tile {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--wp--preset--color--night);

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

.recent-photos__tile--big {
	grid-column: span 2;
	grid-row: span 2;
}

.recent-photos__more {
	color: var(--wp--preset--color--white);
	text-decoration: none;

	&:focus-visible {
		outline: 3px solid var(--wp--preset--color--night);
		outline-offset: 3px;
	}
}

.recent-photos__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px;
	background: var(--wp--custom--color--overlay);
	color: var(--wp--preset--color--white);
	text-align: center;
	transition: background 0.2s;

	b {
		font-size: 26px;
		line-height: 1.15;

		@media (max-width: 760px) {
			font-size: var(--wp--preset--font-size--medium);
		}
	}

	/* Hover darkens (the board lightens; darker keeps white text >= 4.5:1 on any photo). */
	.recent-photos__more:hover &,
	.recent-photos__more:focus-visible & {
		background: var(--wp--custom--color--overlay-strong);
		color: var(--wp--preset--color--white);
	}
}

.recent-photos__all {
	font-weight: 600;
	border-block-end: 2px solid currentcolor;

	@media (max-width: 760px) {
		font-size: var(--wp--preset--font-size--small);
	}
}

/* ===================================================================
 * template-parts/rocnik/
 * =================================================================== */

/* === facts === */
.facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 1px;
	background: var(--wp--custom--color--divider);
	border-block-end: 1px solid var(--wp--custom--color--divider);

	p {
		margin: 0;
	}
}

.facts__item {
	padding: 16px max(2vw, 16px);
	background: var(--wp--preset--color--white);
}

.facts__label {
	font-size: 13px;
	color: var(--wp--custom--color--muted);
}

.facts__value {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}

/* === performers === */
.performers__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px 48px;

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
	}
}

.performer {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 4px 0;

	@media (max-width: 760px) {
		align-items: flex-start;
		gap: 16px;
	}
}

/* Fixed logo frame: white, thin line, 5:3 (no layout shift while the logo loads). */
.performer__logo {
	display: flex;
	flex: 0 0 170px;
	align-self: start;
	align-items: center;
	justify-content: center;
	width: 170px;
	aspect-ratio: 5 / 3;
	padding: 12px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--night);

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	@media (max-width: 760px) {
		flex-basis: 112px;
		width: 112px;
		padding: 8px;
	}
}

.performer__text p {
	margin: 0;
}

.performer__role {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}

.performer__name {
	margin: 4px 0 6px;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	line-height: 1.15;
}

.performer__desc {
	font-size: 16px;
	line-height: 1.5;
	color: var(--wp--custom--color--muted);
}

/* Without a logo the text takes the whole row (no empty frame). */
.performer--no-logo .performer__text {
	flex: 1 1 auto;
}

/* Main performer: the dark stage card (spotlight from the top, year-colour glow, gold inner frame). */
.performer--main {
	position: relative;
	grid-column: 1 / -1;
	gap: 44px;
	padding: 48px 52px;
	overflow: hidden;
	border-radius: 8px;
	outline: 1px solid var(--wp--preset--color--gold);
	outline-offset: -12px;
	color: var(--wp--preset--color--white);
	background:
		radial-gradient(ellipse 60% 120% at 22% 0%, rgb(255 255 255 / 16%), transparent 60%),
		radial-gradient(ellipse 50% 90% at 85% 100%, var(--rv-yi), transparent 70%),
		var(--wp--preset--color--night);

	.performer__logo {
		flex: 0 0 380px;
		align-self: center;
		width: 380px;
		aspect-ratio: 16 / 9;
		padding: 24px 28px;
		border: 0;
		box-shadow: 0 18px 40px rgb(0 0 0 / 45%);
	}

	.performer__role {
		font-size: 15px;
		letter-spacing: 0.18em;
		color: var(--wp--custom--color--stage-label);
	}

	.performer__name {
		margin: 12px 0 14px;
		font-size: clamp(40px, 4.8vw, 68px);
		line-height: 1;
		letter-spacing: 0.01em;
		overflow-wrap: anywhere;
	}

	.performer__desc {
		max-width: 46ch;
		font-size: var(--wp--preset--font-size--medium);
		color: var(--wp--preset--color--white);
	}

	@media (max-width: 760px) {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		padding: 32px 22px;

		.performer__logo {
			flex-basis: auto;
			width: 100%;
		}

	}
}

.performers__host {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 28px 0 0;
	font-size: var(--wp--preset--font-size--medium);
}

.performers__mic {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--rv-yt);
	color: var(--rv-yi);
}

/* === partners === */
.partners {
	border-block-start: 6px solid var(--rv-y);
	background: var(--wp--preset--color--cream);
}

.partners__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px 18px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;

	@media (max-width: 760px) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 12px;
	}
}

/* Tile (link or plain box); --tc is the tier colour. */
.partner {
	--tc: var(--wp--preset--color--line);

	position: relative;
	display: block;
	height: 100%;
	border: 2px solid var(--tc);
	border-radius: 8px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: box-shadow 0.2s;

	&:is(a):hover,
	&:is(a):focus-visible {
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--ink);
		box-shadow: 0 6px 18px var(--wp--custom--color--shade);
	}

	&:is(a):focus-visible {
		outline: 3px solid var(--wp--preset--color--night);
		outline-offset: 3px;
	}
}

.partner--gen {
	--tc: var(--rv-y);
}

.partner--hl {
	--tc: var(--wp--preset--color--night);
}

.partner--vy {
	--tc: var(--wp--custom--color--partner-significant);
}

.partner--re {
	--tc: var(--wp--preset--color--line);
}

/* Full tier name on a white legend in the top border. */
.partner__tier {
	position: absolute;
	top: -10px;
	left: 50%;
	max-width: calc(100% - 12px);
	padding: 0 10px;
	transform: translateX(-50%);
	overflow: hidden;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--gold-text);
	font-size: 12px;
	font-weight: 700;
	line-height: 18px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-overflow: ellipsis;
	white-space: nowrap;

	.partner--gen & {
		color: var(--rv-yi);
	}

	.partner--hl & {
		color: var(--wp--preset--color--night);
	}

	@media (max-width: 760px) {
		padding: 0 6px;
		font-size: 10px;
		letter-spacing: 0.08em;
	}
}

.partner__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 2 / 1;
	padding: 14px 20px;

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: contain;
	}
}

/* No logo: the partner's name. */
.partner__name {
	font-size: 20px;
	font-weight: 800;
	line-height: 1.15;
	text-align: center;
	overflow-wrap: anywhere;

	@media (max-width: 760px) {
		font-size: 16px;
	}
}

/* === gallery === */
.gallery {
	background: var(--wp--preset--color--cream);
}

.gallery__content {
	> * {
		max-width: var(--wp--style--global--content-size, 720px);
		margin-inline: auto;
	}

	> .wp-block-gallery {
		max-width: none;
		margin-block-end: 0;
	}
}

/* Core gallery as the board's grid: 4 square columns (2 on mobile), the first photo 2 × 2. */
.gallery .wp-block-gallery.has-nested-images {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;

	figure.wp-block-image:not(#individual-image) {
		width: auto;
		margin: 0;
		aspect-ratio: 1;
	}

	figure.wp-block-image:first-child {
		grid-column: span 2;
		grid-row: span 2;
	}

	figure.wp-block-image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	figure.wp-block-image a {
		display: block;
		height: 100%;

		&:focus-visible {
			outline: 3px solid var(--wp--preset--color--night);
			outline-offset: 2px;
		}
	}

	@media (max-width: 760px) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* A single photo: one centred square instead of the left half of the grid. */
	&:has(> figure.wp-block-image:only-child) {
		grid-template-columns: minmax(0, 620px);
		justify-content: center;

		figure.wp-block-image:first-child {
			grid-column: auto;
			grid-row: auto;
		}
	}
}

/* Lightbox (assets/js/lightbox.js): native <dialog>, dark backdrop, photo fits the viewport. */
.lightbox {
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 56px 64px 24px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--white);

	&::backdrop {
		background: var(--wp--custom--color--backdrop);
	}

	&[open] {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	figure {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 10px;
		max-height: 100%;
		margin: 0;
	}

	img {
		display: block;
		max-width: 100%;
		max-height: calc(100dvh - 140px);
		width: auto;
		height: auto;
		object-fit: contain;
	}

	figcaption {
		font-size: var(--wp--preset--font-size--small);
		text-align: center;
	}

	@media (max-width: 760px) {
		padding: 56px 8px 72px;
	}
}

.lightbox__btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 2px solid var(--wp--preset--color--white);
	border-radius: 4px;
	background: var(--wp--preset--color--night);
	color: var(--wp--preset--color--white);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;

	&:hover,
	&:focus-visible {
		background: var(--wp--preset--color--white);
		color: var(--wp--preset--color--night);
	}

	&:focus-visible {
		outline: 3px solid var(--wp--preset--color--white);
		outline-offset: 2px;
	}
}

.lightbox__btn--close {
	top: 8px;
	right: 8px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

.lightbox__btn--prev,
.lightbox__btn--next {
	top: 50%;
	transform: translateY(-50%);

	@media (max-width: 760px) {
		top: auto;
		bottom: 12px;
		transform: none;
	}
}

.lightbox__btn--prev {
	left: 8px;
}

.lightbox__btn--next {
	right: 8px;
}

.lightbox__count {
	position: absolute;
	top: 18px;
	left: 16px;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);

	@media (max-width: 760px) {
		top: auto;
		bottom: 24px;
		left: 50%;
		transform: translateX(-50%);
	}
}

/* === download === */
.download__box {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px 20px;
	padding: 20px;
	border: 2px dashed var(--rv-yi);
	border-radius: 6px;
	background: var(--rv-yt);
	color: var(--wp--preset--color--ink);

	@media (max-width: 760px) {
		grid-template-columns: auto minmax(0, 1fr);
	}
}

.download__icon {
	width: 40px;
	height: 40px;
	color: var(--rv-yi);
}

.download__text {
	margin: 0;
}

.download__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 2px solid var(--rv-yi);
	border-radius: 4px;
	background: var(--rv-yi);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	text-decoration: none;

	&:hover,
	&:focus-visible {
		border-color: var(--wp--preset--color--night);
		background: var(--wp--preset--color--night);
		color: var(--wp--preset--color--white);
	}

	@media (max-width: 760px) {
		grid-column: 1 / -1;
	}
}

/* === prev-next === */
.prev-next {
	background: var(--wp--preset--color--cream);
}

.prev-next__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Each link carries its target's palette (--rv-* set inline). */
.prev-next__link {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 22px 20px;
	border-radius: 4px;
	background: var(--rv-y);
	color: var(--rv-yo);
	text-decoration: none;

	&:hover,
	&:focus-visible {
		background: var(--rv-yi);
		color: var(--wp--preset--color--white);
	}

	&:focus-visible {
		outline: 3px solid var(--wp--preset--color--night);
		outline-offset: 3px;
	}
}

.prev-next__link--next {
	grid-column: -2;
	align-items: flex-end;
	text-align: end;

	@media (max-width: 760px) {
		grid-column: auto;
	}
}

.prev-next__dir {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.prev-next__mark {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 34px;
	font-weight: 700;
	line-height: 1;

	span {
		padding: 1px 6px 0;
		border: 2px solid currentcolor;
	}
}

/* === archive-tile === */
/* Square tile in the year colour; --rv-* set inline per tile. Grid: .rocnik-archive (layout.css). */
.archive-tile {
	margin: 0;
}

.archive-tile__link {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	aspect-ratio: 1;
	padding: 14px;
	border-radius: 4px;
	background: var(--rv-y);
	color: var(--rv-yo);
	text-decoration: none;

	&:hover,
	&:focus-visible {
		background: var(--rv-yi);
		color: var(--wp--preset--color--white);
	}

	&:focus-visible {
		outline: 3px solid var(--wp--preset--color--night);
		outline-offset: 3px;
	}
}

.archive-tile__mark {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 40px;
	font-weight: 700;
	line-height: 1;

	span {
		padding: 2px 6px 0;
		border: 2px solid currentcolor;
	}
}

.archive-tile__label {
	margin-block-start: 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ===================================================================
 * template-parts/page/
 * =================================================================== */

/* === people === */
.people__title {
	font-size: 30px;
	margin-block-end: 18px;
}

.people__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
	}
}

.people__item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.people__photo {
	flex: none;
	width: 72px;
	height: 72px;
	border: 2px solid var(--wp--preset--color--gold);
	border-radius: 50%;
	object-fit: cover;
}

.people__photo--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rv-yt);
	color: var(--rv-yi);
	font-size: 26px;
	font-weight: 800;
}

.people__name {
	display: block;
	font-size: 18px;
	font-weight: 700;
}

.people__role {
	display: block;
	font-size: 15px;
	color: var(--wp--custom--color--muted);
}

/* === contact-map === */
.contact-map {
	padding: 48px max(4vw, 16px) 0;

	@media (max-width: 760px) {
		padding: 32px 16px 0;
	}
}

/* With a map image: full-width band, card over its left side (below it on mobile). */
.contact-map--band {
	position: relative;
	padding: 0;
}

.contact-map__map {
	height: 460px;
	background: var(--wp--preset--color--cream);

	@media (max-width: 760px) {
		height: 220px;
	}
}

.contact-map__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.contact-map__card {
	width: min(520px, 100%);
	padding: 34px 38px;
	border-radius: 6px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	box-shadow: 0 14px 40px var(--wp--custom--color--card-shadow);

	p {
		margin: 0;
	}

	@media (max-width: 760px) {
		padding: 26px 22px;
	}
}

.contact-map--band .contact-map__card {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: max(4vw, 16px);
	width: min(520px, 90%);
	transform: translateY(-50%);

	@media (max-width: 760px) {
		position: relative;
		inset: auto;
		width: auto;
		margin: -40px 16px 0;
		transform: none;
	}
}

.contact-map__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);

	&:not(:first-child) {
		margin-block-start: 22px;
	}
}

.contact-map__phone {
	margin-block-start: 10px;
	font-size: clamp(40px, 4.2vw, 56px);
	font-weight: 800;
	line-height: 1;

	a {
		color: var(--rv-yi);
		text-decoration: none;
		white-space: nowrap;

		&:hover,
		&:focus-visible {
			color: var(--rv-yi);
			text-decoration: underline;
			text-decoration-thickness: 3px;
			text-underline-offset: 8px;
		}

		&:focus-visible {
			outline: 3px solid var(--wp--preset--color--night);
			outline-offset: 4px;
		}
	}

	@media (max-width: 760px) {
		font-size: var(--wp--preset--font-size--x-large);
	}
}

.contact-map__value {
	margin-block-start: 6px;
	font-size: 18px;
	font-weight: 600;
	overflow-wrap: anywhere;

	a {
		color: var(--rv-yi);

		&:hover,
		&:focus-visible {
			color: var(--rv-yi);
		}
	}
}

.contact-map__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-block-start: 24px;
	padding: 0 20px;
	border: 2px solid var(--rv-yi);
	border-radius: 4px;
	background: var(--rv-yi);
	color: var(--wp--preset--color--white);
	font-weight: 700;
	text-decoration: none;

	&:hover,
	&:focus-visible {
		border-color: var(--wp--preset--color--night);
		background: var(--wp--preset--color--night);
		color: var(--wp--preset--color--white);
	}

	&:focus-visible {
		outline: 3px solid var(--wp--preset--color--night);
		outline-offset: 2px;
	}
}

/* === billing === */
.billing {
	padding-block-end: 64px;
}

/* Small label-style heading on the left (overrides the centred section > h2). */
section > .billing__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.14em;
	text-align: start;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}

.billing__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px 36px;
	margin: 14px 0 0;

	dt {
		font-size: 13px;
		color: var(--wp--custom--color--muted);
	}

	dd {
		margin: 2px 0 0;
		font-size: 17px;
		font-weight: 600;
		overflow-wrap: anywhere;
	}

	@media (max-width: 760px) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ===================================================================
 * Root-level components
 * =================================================================== */

/* === searchform (searchform.php) === */
.search-form {
	display: flex;
	gap: 0.5em;
	margin-block-end: var(--wp--preset--spacing--40);
	max-width: 32rem;
}

.search-form__input {
	flex: 1;
	min-width: 0;
	padding: 0.5em 0.75em;
	border: 1px solid var(--wp--preset--color--gold-text);
	border-radius: 4px;
}

.search-form__submit {
	padding: 0.5em 1em;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}
