/*
 * Section styles and editorial layouts.
 * Rule of rhythm: never two consecutive sections with the same style and structure.
 */

[class*="is-style-section-"] {
	padding-block: var(--wp--preset--spacing--xl);
	color: var(--sc-fg);
	background-color: var(--sc-bg);
}

.is-style-section-dark {
	--sc-bg: var(--wp--preset--color--ink);
	--sc-fg: var(--wp--preset--color--paper);
}

.is-style-section-black {
	--sc-bg: var(--wp--preset--color--black);
	--sc-fg: var(--wp--preset--color--paper);
}

/* Orange on paper fails contrast: text accents switch to the deep orange. */
.is-style-section-light {
	--sc-bg: var(--wp--preset--color--paper);
	--sc-fg: var(--wp--preset--color--ink);
	--sc-link: var(--wp--preset--color--accent-deep);
	--sc-accent-text: var(--wp--preset--color--accent-deep);
	--sc-muted: var(--wp--preset--color--muted-light);
	--sc-line: var(--wp--custom--line-on-light);
}

/* Paper on orange fails contrast: everything on orange is ink. */
.is-style-section-accent {
	--sc-bg: var(--wp--preset--color--accent);
	--sc-fg: var(--wp--preset--color--ink);
	--sc-link: var(--wp--preset--color--ink);
	--sc-accent-text: var(--wp--preset--color--ink);
	--sc-muted: var(--wp--preset--color--ink);
	--sc-line: rgb(17 17 17 / 0.3);
}

.is-style-section-accent .wp-element-button,
.is-style-section-accent .wp-block-button:not(.is-style-outline):not(.is-style-arrow) > .wp-block-button__link {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.is-style-section-accent .wp-element-button:hover,
.is-style-section-accent .wp-block-button:not(.is-style-outline):not(.is-style-arrow) > .wp-block-button__link:hover {
	background: var(--wp--preset--color--paper);
	border-color: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
}

/* Links inside sections follow the section. */
[class*="is-style-section-"] a:where(:not(.wp-element-button, .wp-block-button__link, .sc-link-arrow)) {
	color: var(--sc-link);
}

/* Headings coloured by the page stay readable in every section. */
[class*="is-style-section-"] :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
}

/* Muted text helper. */
.sc-muted,
.has-muted-color.sc-adaptive {
	color: var(--sc-muted) !important;
}

/* ---------- Section header: eyebrow + big title + lead + action ---------- */

.sc-section-head {
	gap: var(--wp--preset--spacing--m);
	margin-block-end: var(--wp--preset--spacing--l);
}

.sc-section-head > .wp-block-group:first-child {
	max-width: 60rem;
}

@media (min-width: 1080px) {
	.sc-section-head.is-layout-flex {
		align-items: flex-end;
		justify-content: space-between;
	}
}

/* ---------- Hero ---------- */

.sc-hero.wp-block-cover {
	min-height: min(92svh, 1000px);
	padding-top: calc(var(--wp--preset--spacing--l) + 1rem);
	padding-bottom: var(--wp--preset--spacing--l);
	align-items: flex-end;
}

/* Cover content aligns with the wide grid of the other sections. */
:is(.sc-hero, .sc-international).wp-block-cover {
	padding-inline: var(--wp--custom--gutter);
}

:is(.sc-hero, .sc-international) .wp-block-cover__inner-container {
	width: 100% !important;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto !important;
	padding-inline: 0 !important;
}

.sc-hero__columns {
	align-items: flex-end !important;
	gap: var(--wp--preset--spacing--l) !important;
}

.sc-hero__logo img {
	width: clamp(200px, 120px + 22vw, 460px);
	filter: drop-shadow(0 12px 32px rgb(0 0 0 / 0.45));
}

.sc-hero h1 {
	font-size: var(--wp--preset--font-size--display-xxl);
	line-height: 0.86;
	max-width: 10ch;
}

@media (max-width: 781px) {
	.sc-hero__columns {
		flex-direction: column-reverse;
		align-items: flex-start !important;
	}
}

/* ---------- Page header for inner pages ---------- */

.sc-page-head {
	padding-block: var(--wp--preset--spacing--l) var(--wp--preset--spacing--l);
	border-bottom: 1px solid var(--sc-line);
}

.sc-page-head h1 {
	font-size: var(--wp--preset--font-size--display-xl);
	line-height: 0.9;
}

/* ---------- Split: photo / text ---------- */

.sc-split {
	gap: var(--wp--preset--spacing--l) !important;
	align-items: center !important;
}

.sc-split .wp-block-image {
	margin: 0;
}

.sc-split .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

@media (min-width: 782px) {
	.sc-split--reverse {
		flex-direction: row-reverse;
	}
}

/* ---------- Competition categories: 4 columns like a judging sheet ---------- */

.sc-categories {
	gap: 0 !important;
	border-top: 1px solid var(--sc-line);
}

.sc-categories > .wp-block-column {
	padding: var(--wp--preset--spacing--m) var(--wp--preset--spacing--m) var(--wp--preset--spacing--m) 0;
	border-bottom: 1px solid var(--sc-line);
}

.sc-categories .sc-cat-num {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--display-l);
	line-height: 1;
	color: var(--sc-accent-text);
	margin: 0;
}

.sc-categories .wp-block-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
}

@media (min-width: 782px) {
	.sc-categories > .wp-block-column {
		border-bottom: 0;
		padding-left: var(--wp--preset--spacing--m);
		border-left: 1px solid var(--sc-line);
	}

	.sc-categories > .wp-block-column:first-child {
		border-left: 0;
		padding-left: 0;
	}
}

/* ---------- International: full-bleed photo band ---------- */

.sc-international.wp-block-cover {
	min-height: 70svh;
	padding-block: var(--wp--preset--spacing--xl);
}

/* ---------- Posts: cards ---------- */

.sc-posts .wp-block-post-template {
	gap: var(--wp--preset--spacing--l) var(--wp--preset--spacing--m);
}

.sc-post-card {
	gap: var(--wp--preset--spacing--s);
}

.sc-post-card .wp-block-post-featured-image {
	margin: 0;
}

.sc-post-card .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
	transition: transform 300ms ease-out;
}

.sc-post-card .wp-block-post-featured-image a {
	display: block;
	overflow: hidden;
}

.sc-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.sc-post-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--heading-m);
	line-height: 1;
	margin: 0;
}

.sc-post-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.sc-post-card .wp-block-post-title a:hover {
	color: var(--sc-link);
}

.sc-post-card .wp-block-post-date,
.sc-post-card .wp-block-post-terms {
	color: var(--sc-muted);
	margin: 0;
}

.sc-post-card .wp-block-post-terms {
	font-family: var(--wp--preset--font-family--condensed);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.sc-post-card .wp-block-post-terms a {
	color: var(--sc-accent-text);
	text-decoration: none;
}

.sc-post-card--lead .wp-block-post-title {
	font-size: var(--wp--preset--font-size--display-l);
}

.sc-pit {
	gap: var(--wp--preset--spacing--l) !important;
}

/* ---------- Social grid ---------- */

.sc-social-grid.wp-block-gallery {
	--wp--style--unstable-gallery-gap: 4px;
	gap: 4px !important;
}

.sc-social-grid.wp-block-gallery .wp-block-image img {
	aspect-ratio: 1;
	object-fit: cover;
}

/* ---------- Final CTA ---------- */

.sc-final-cta h2 {
	font-size: var(--wp--preset--font-size--display-xxl);
	line-height: 0.86;
	max-width: 12ch;
}

/* ---------- Single post / event / competition ---------- */

.sc-single-head {
	padding-block: var(--wp--preset--spacing--l);
}

.sc-single-head .wp-block-post-title {
	font-size: var(--wp--preset--font-size--display-l);
	line-height: 0.92;
}

.sc-single-media img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.sc-aside-sticky {
	position: sticky;
	top: calc(var(--sc-header-h) + var(--wp--preset--spacing--m));
	align-self: flex-start;
}

.wp-block-post-content > .wp-block-image,
.wp-block-post-content > figure {
	margin-block: var(--wp--preset--spacing--l);
}

/* ---------- Pagination (query loop) ---------- */

.wp-block-query-pagination {
	font-family: var(--wp--preset--font-family--condensed);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	gap: var(--wp--preset--spacing--s);
}

.wp-block-query-pagination a {
	color: var(--sc-fg);
}

.wp-block-query-pagination .current {
	color: var(--sc-link);
}

.sc-split--top {
	align-items: flex-start !important;
	padding-bottom: var(--wp--preset--spacing--l);
}
