/**
 * site.css — theme-level styles that block markup cannot express.
 *
 * Scope: front-end only, enqueued globally via functions.php (section 13).
 * Colors and sizes reference theme.json presets — never hardcode values
 * a preset already covers.
 */

/* ── News section (front page) ──────────────────────────────────────── */

/* Short accent divider under the NEWS heading (template parity). */
.news-divider {
	width: 72px;
	max-width: 72px;
	border: none;
	border-bottom: 3px solid var(--wp--preset--color--accent);
	margin: var(--wp--preset--spacing--30) auto var(--wp--preset--spacing--60);
}

.news-card {
	text-align: center;
}

.news-card .wp-block-post-featured-image img {
	width: 100%;
	height: auto;
}

/* "Mehr lesen" styled as outline button like the template's READ MORE. */
.news-card .wp-block-read-more {
	align-self: center;
	display: inline-block;
	border: 1px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
	padding: 0.55rem 1.4rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.news-card .wp-block-read-more:hover {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--white);
}

.is-front-page .wp-block-query {
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--80);
}

/* ── Unterseiten: Grundabstände und Header-Versatz ──────────────────── */

/*
 * theme.json sets the global blockGap to 0 (the front page composes its
 * own spacing). Subpage content would glue cover, sections and footer
 * together — restore sensible flow spacing there.
 */
body:not(.is-front-page) .entry-content > * + *:not(.wp-block-separator) {
	margin-block-start: var(--wp--preset--spacing--70);
}

body:not(.is-front-page) .entry-content > :last-child {
	margin-block-end: var(--wp--preset--spacing--90);
}

/* Pages whose first block is no full-bleed cover must not slide under
   the fixed header (93px) — pad them down. Not needed when the page
   template already renders a cover above the content. */
body:not(.is-front-page):not(:has(.wp-site-blocks > .wp-block-cover)) .entry-content > :first-child:not(.wp-block-cover) {
	margin-block-start: calc(93px + var(--wp--preset--spacing--70));
}

/* Template-level cover (Zeitplan, Ergebnisse, Teilnehmer, Magazin):
   spacing between the cover and the first content block. */
body:not(.is-front-page):has(.wp-site-blocks > .wp-block-cover) .entry-content > :first-child {
	margin-block-start: var(--wp--preset--spacing--90);
}

/* ── Hero slider (front page) ───────────────────────────────────────── */

/* The template's hero has no pagination dots — arrows only. */
.is-front-page .entry-content > .wp-block-springertag-swiper-cover:first-child .swiper-pagination {
	display: none;
}

/*
 * Slider arrows: the template uses slim "‹ ›" glyphs (50px, light weight,
 * inset ~50px from the edges) instead of Swiper's default chevron icons.
 */
.wp-block-springertag-swiper-cover .swiper-button-prev,
.wp-block-springertag-swiper-cover .swiper-button-next {
	width: 60px;
	height: 70px;
	color: var(--wp--preset--color--white);
}

.wp-block-springertag-swiper-cover .swiper-button-prev {
	left: 40px;
}

.wp-block-springertag-swiper-cover .swiper-button-next {
	right: 40px;
}

.wp-block-springertag-swiper-cover .swiper-button-prev::after,
.wp-block-springertag-swiper-cover .swiper-button-next::after {
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: 50px;
	font-weight: 300;
	line-height: 1;
}

.wp-block-springertag-swiper-cover .swiper-button-prev::after {
	content: "‹";
}

.wp-block-springertag-swiper-cover .swiper-button-next::after {
	content: "›";
}

/* Grußworte slider: boxed arrows like the template's testimonial slider. */
.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-prev,
.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-next {
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.15);
}

.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-prev {
	left: 24px;
}

.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-next {
	right: 24px;
}

.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-prev::after,
.bdt-grid .wp-block-springertag-swiper-cover .swiper-button-next::after {
	font-size: 30px;
}

/* ── Countdown/info tile grid (front page) ──────────────────────────── */

/*
 * Template row heights: countdown row 294px, info row 386px. Without
 * this, the countdown row shrinks to its content and the covers blow
 * the info row up to their 430px default min-height.
 */
.countdown-grid {
	grid-template-rows: 18.375rem 24.125rem;
}

.countdown-grid > * {
	box-sizing: border-box; /* theme has no global reset; padding must not add to 100% height */
	height: 100%;
	min-height: 0;
}

.countdown-grid > .wp-block-cover {
	min-height: 0;
}

.countdown-grid > figure.wp-block-image {
	margin: 0;
}

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

/* WA tile: centered logo on white, like the template (~303px wide). */
.countdown-grid > figure.wa-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--white);
}

.countdown-grid > figure.wa-tile img {
	width: auto;
	height: auto;
	/* the source PNG carries generous internal whitespace — allow more room
	   so the logo itself lands at the template's ~300px */
	max-width: min(480px, 85%);
	max-height: 260px;
	object-fit: contain;
}

.countdown-grid > .wp-block-springertag-countdown {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Scroll indicator: animated mouse outline at the hero's bottom edge. */
.is-front-page .entry-content > .wp-block-springertag-swiper-cover:first-child::before {
	content: "";
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	width: 26px;
	height: 42px;
	border: 2px solid var(--wp--preset--color--white);
	border-radius: 14px;
	z-index: 5;
	pointer-events: none;
	opacity: 0.85;
}

.is-front-page .entry-content > .wp-block-springertag-swiper-cover:first-child::after {
	content: "";
	position: absolute;
	bottom: 56px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 8px;
	border-radius: 2px;
	background: var(--wp--preset--color--white);
	z-index: 5;
	pointer-events: none;
	animation: sp-scroll-hint 1.8s ease-in-out infinite;
}

@keyframes sp-scroll-hint {
	0% { opacity: 1; transform: translate(-50%, 0); }
	60% { opacity: 0; transform: translate(-50%, 14px); }
	100% { opacity: 0; transform: translate(-50%, 14px); }
}

/* ── Bild des Tages / Medaillenspiegel / Grußworte row (front page) ─── */

/*
 * The grid row is as tall as the Grußworte slider. Without these rules
 * the photo and the medal table sit top-aligned with dead whitespace
 * below (template: photo fills its cell, table is vertically centered).
 */
.bdt-grid > .wp-block-group:first-child {
	display: flex;
	flex-direction: column;
}

.bdt-grid > .wp-block-group:first-child > .wp-block-image {
	flex: 1;
	display: flex;
	margin: 0;
}

.bdt-grid > .wp-block-group:first-child > .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bdt-grid > .wp-block-springertag-medal-table {
	align-self: center;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer .footer-divider {
	width: 100%;
	max-width: none;
	border: none;
	/* preset palette has no alpha variant — subtle line over primary-dark */
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	margin-top: var(--wp--preset--spacing--60);
}

/* ── Back-to-top button (all pages, injected via wp_footer) ─────────── */

.sp-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 40;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	/* template: square button, accent blue, subtle glow ring */
	border-radius: 0;
	box-shadow: 0 0 1px 1px var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--accent);
	/* chevron-up as inline SVG — the previous text glyph rendered poorly */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 10 L10 3 L18 10' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	color: transparent;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.sp-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.sp-to-top:hover {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}
