/*
Theme Name:        Schach Lohr · Springer
Theme URI:         https://schach-lohr.de
Description:       Zweites Block-Theme der Schachabteilung des TSV 1846 Lohr. Vereinsrot, Schwarz und Weiß wie beim Hauptverein, Archivo als einzige Schrift, auf der Startseite ein roter Kopf mit großer Springer-Silhouette. Die Schach-Funktionen liefert das Plugin „TSV Schach“; zwischen diesem Theme und „Schach Lohr“ lässt sich jederzeit wechseln.
Author:            Schachabteilung TSV 1846 Lohr
Version:           0.2.0
Requires at least: 6.6
Tested up to:      6.8
Requires PHP:      7.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       schach-lohr-springer
*/

/*
 * Regeln
 * - Farben: Vereinsrot #D51317 und Schwarz #1D1D1B wie tsv-lohr.de, dazu Weiß. Rot trägt den Kopf der Startseite
 *   und heißt sonst „jetzt, als Nächstes, hier handeln“. Ergebnisse stehen in Schwarz.
 * - Eine Schrift: Archivo. Gewicht und Breite (font-stretch 62–125 %) machen die Hierarchie, keine zweite Familie.
 * - Abstände in Vielfachen von 8px.
 * - Die Schach-Blöcke des Plugins bekommen ihre Farben und Schriften über die Variablen --tsv-*; das Plugin bleibt unverändert.
 */

/* ---------- Grundlagen ---------- */
body { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
:where(h1, h2, h3) { text-wrap: balance; }
:where(h1) { font-stretch: 112%; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--wp--preset--color--rot); outline-offset: 2px; }
::selection { background: var(--wp--preset--color--rot); color: var(--wp--preset--color--weiss); }

@media (min-width: 782px) {
	html body { --wp--style--root--padding-left: 48px; --wp--style--root--padding-right: 48px; }
}

/* Links im Fließtext: Schwarz mit rotem Unterstrich */
:where(.wp-site-blocks) a:where(:not(.wp-element-button, .tsv-knopf)) {
	text-decoration-line: underline;
	text-decoration-color: var(--wp--preset--color--rot);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.22em;
}

/* Kleine Dachzeile über einem Titel: rotes Feld + fette Zeile, keine Versalien-Reihe */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	line-height: 16px;
	color: var(--wp--preset--color--schwarz);
}
.eyebrow::before { content: ""; width: 10px; height: 10px; background: var(--wp--preset--color--rot); flex-shrink: 0; }

/* ---------- Schach-Blöcke: Farben und Schrift des Themes ---------- */
body [class*="wp-block-tsv-schach-"] {
	--tsv-papier: var(--wp--preset--color--weiss);
	--tsv-tinte: var(--wp--preset--color--schwarz);
	--tsv-zweit: var(--wp--preset--color--text-zweit);
	--tsv-leise: var(--wp--preset--color--text-gedaempft);
	--tsv-linie: var(--wp--preset--color--linie);
	--tsv-akzent: var(--wp--preset--color--rot);
	--tsv-feld-hell: var(--wp--preset--color--brett-hell);
	--tsv-feld-dunkel: var(--wp--preset--color--brett-dunkel);
	--tsv-serif: var(--wp--preset--font-family--archivo);
	--tsv-sans: var(--wp--preset--font-family--archivo);
	--tsv-mono: var(--wp--preset--font-family--archivo);
}
/* Titel der Blöcke: fett und breit statt Serife */
.tsv-kopf__titel,
.tsv-status__titel,
.tsv-spieltag__team,
.tsv-sperre strong,
.tsv-fussbereich h2 { font-weight: 800 !important; font-stretch: 112%; letter-spacing: -0.02em !important; }
.tsv-kopf__titel { font-size: var(--wp--preset--font-size--titel) !important; }
.tsv-spieltag__stand, .tsv-formular__wert, .tsv-runde__stand { font-weight: 800; font-stretch: 112%; }
/* Etiketten: Archivo halbfett, etwas weiter, ohne Monospace-Kostüm */
.tsv-formular__label, .tsv-tabelle th, .tsv-pill, .tsv-chip, .tsv-brett__amzug, .tsv-aufgabe__nr, .tsv-kurz__label { font-weight: 700; letter-spacing: 0.06em; }
.tsv-eyebrow { color: var(--wp--preset--color--schwarz); font-weight: 700; letter-spacing: 0.04em; text-transform: none; font-size: var(--wp--preset--font-size--label); }
.tsv-eyebrow::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; background: var(--wp--preset--color--rot); vertical-align: 0; }
.tsv-fuss { font-size: 0.75rem; }

/* ---------- Dachzeile: schwarz, Verbindung zum Hauptverein ---------- */
.dachzeile { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); padding-top: 0; padding-bottom: 0; }
.dachzeile .tsv-dachzeile { padding-top: 8px; padding-bottom: 8px; font-size: 0.8125rem; line-height: 16px; font-weight: 500; }
.dachzeile .tsv-dachzeile a { color: var(--wp--preset--color--weiss); text-decoration-color: var(--wp--preset--color--rot); }

/* ---------- Kopf ---------- */
.site-kopf { padding-top: 24px; padding-bottom: 24px; }
.site-kopf > .wp-block-group { align-items: center; }
.site-kopf .wp-block-site-title { font-stretch: 125%; }
.site-kopf .wp-block-site-title a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.site-kopf .wp-block-navigation { gap: 8px 32px; }
.site-kopf .wp-block-navigation a { text-decoration: none; }
.site-kopf .wp-block-navigation .wp-block-navigation-item:not(.is-login) > a { padding: 8px 0; }
.site-kopf .wp-block-navigation .wp-block-navigation-item:not(.is-login) > a:hover { box-shadow: inset 0 -2px 0 currentColor; color: inherit; }
.site-kopf .wp-block-navigation .wp-block-navigation-item.is-login > a { padding: 8px 16px; box-shadow: inset 0 0 0 2px currentColor; }
.site-kopf .wp-block-navigation__responsive-container-open svg { width: 32px; height: 32px; }

/* Kopf rot: mit dem Held (Startseite) bzw. dem Seitenkopf (Unterseiten) eine Fläche */
.site-kopf { background: var(--wp--preset--color--rot); border-bottom: 0; }
.site-kopf,
.site-kopf .wp-block-site-title a,
.site-kopf .wp-block-navigation a,
.site-kopf .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--weiss); }
.site-kopf .wp-block-navigation [aria-current="page"] { box-shadow: inset 0 -3px 0 var(--wp--preset--color--weiss); }
/* Bildmarke: vier Felder eines Schachbretts, Weiß und Schwarz auf Rot */
.site-kopf .wp-block-site-title a::before {
	content: "";
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	background-position: center;
	background-size: contain;
	background-repeat: no-repeat;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'%3E%3Crect width='1' height='1' fill='%23FFFFFF'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23FFFFFF'/%3E%3Crect x='1' width='1' height='1' fill='%231D1D1B'/%3E%3Crect y='1' width='1' height='1' fill='%231D1D1B'/%3E%3C/svg%3E");
}
.site-kopf .wp-block-navigation .wp-block-navigation-item.is-login > a:hover { background: var(--wp--preset--color--weiss); color: var(--wp--preset--color--rot); box-shadow: inset 0 0 0 2px var(--wp--preset--color--weiss); }

/* Menü am Handy: schwarze Fläche, große Einträge */
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--schwarz) !important;
	color: var(--wp--preset--color--weiss) !important;
	padding: 24px;
}
.wp-block-navigation__responsive-container.is-menu-open a { color: var(--wp--preset--color--weiss) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 64px; }
.wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__responsive-container-content, .wp-block-navigation__container) { align-items: stretch !important; gap: 0 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; text-align: left; font-size: 2rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:not(.is-login) { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:not(.is-login) > a { padding: 12px 0; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.is-login { margin-top: 32px; align-self: flex-start; font-size: 1.0625rem; font-weight: 700; font-stretch: 100%; letter-spacing: 0; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.is-login > a { padding: 12px 20px; box-shadow: inset 0 0 0 2px var(--wp--preset--color--weiss); }

/* ---------- Held: roter Kopf der Startseite mit Springer ---------- */
.held {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: clamp(520px, calc(100svh - 216px), 760px);
	padding-top: 48px;
	padding-bottom: 80px;
	background: var(--wp--preset--color--rot);
	color: var(--wp--preset--color--weiss);
}
/* Brettfelder Rot auf Rot */
.held::before {
	content: "";
	position: absolute;
	z-index: -2;
	right: -4vw;
	bottom: -12%;
	width: min(60vw, 940px);
	aspect-ratio: 1;
	background: conic-gradient(var(--wp--preset--color--rot-tief) 0 25%, transparent 0 50%, var(--wp--preset--color--rot-tief) 0 75%, transparent 0) 0 0 / 25% 25%;
}
/* Springer-Silhouette, rechts angeschnitten */
.held::after {
	content: "";
	position: absolute;
	z-index: -1;
	right: -3vw;
	bottom: -1px;
	width: min(48vw, 800px);
	aspect-ratio: 36 / 32;
	background: url("assets/springer.svg") right bottom / contain no-repeat;
}
.held [class*="wp-block-tsv-schach-"] {
	--tsv-papier: var(--wp--preset--color--rot);
	--tsv-tinte: var(--wp--preset--color--weiss);
	--tsv-zweit: var(--wp--preset--color--weiss);
	--tsv-leise: var(--wp--preset--color--weiss);
	--tsv-linie: rgba(255, 255, 255, 0.55);
	--tsv-akzent: var(--wp--preset--color--weiss);
}
.wp-site-blocks > main.wp-block-group,
.wp-site-blocks > footer,
main > .wp-block-group.alignfull { margin-block-start: 0; }
.held > .alignwide { width: 100%; }
.held .tsv-status__titel { color: var(--wp--preset--color--weiss); }
.held .tsv-status { display: flex; flex-direction: column; align-items: flex-start; gap: 40px; max-width: 720px; }
.held .tsv-status__haupt { gap: 24px; }
.held .tsv-status__titel { font-size: clamp(2.75rem, 1rem + 5.2vw, 5.25rem) !important; font-weight: 900 !important; font-stretch: 125%; line-height: 0.92; letter-spacing: -0.035em !important; }
.held .tsv-status__text { font-size: 1.1875rem; line-height: 30px; max-width: 30em; }
.held .tsv-pill { font-size: 0.875rem; }
.held .tsv-pill--ausfall { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); }
.held .tsv-status__link {
	display: inline-flex;
	align-items: center;
	min-height: 56px;
	margin-top: 8px;
	padding: 0 28px;
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
	font-size: 1.0625rem;
	font-weight: 700;
	text-decoration: none !important;
}
.held .tsv-status__link:hover { background: var(--wp--preset--color--weiss); color: var(--wp--preset--color--rot); }
/* Im Kopf nur der Ort; Zusagen und Jugend stehen im schwarzen Band darunter */
.held .tsv-status__karte { border: 0; padding: 0; }
.held .tsv-status__karte > .tsv-formular__zeile { display: none; }
.held .tsv-status__ort { flex-direction: row; flex-wrap: wrap; gap: 4px 24px; padding: 0; font-size: 1.0625rem; line-height: 26px; }
.held .tsv-status__ort strong { font-weight: 700; }
.held .tsv-status__link::after { margin-left: 10px; }
.held .tsv-status__ort a { text-decoration-color: var(--wp--preset--color--weiss); }
@media (max-width: 781px) {
	.held { justify-content: flex-start; min-height: 0; padding-top: calc(58vw + 16px); padding-bottom: 48px; }
	.held::before { top: -2vw; bottom: auto; right: -30vw; width: 108vw; }
	.held::after { top: 4vw; bottom: auto; right: -16vw; width: 82vw; }
	.held .tsv-status { gap: 32px; }
}

/* ---------- Schwarzes Band unter dem Held ---------- */
.band--schwarz { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); padding-top: 8px; padding-bottom: 8px; }
.band--schwarz [class*="wp-block-tsv-schach-"] {
	--tsv-tinte: var(--wp--preset--color--weiss);
	--tsv-zweit: #C9C9C4;
	--tsv-leise: #B8B8B2;
	--tsv-linie: rgba(255, 255, 255, 0.2);
}
.band--schwarz .tsv-kurz__haupt { font-stretch: 112%; }
.band--schwarz .tsv-kurz__haupt a { color: var(--wp--preset--color--weiss); }

/* ---------- Bänder über die volle Breite ---------- */
.band { padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); }
.band + .band { border-top: 1px solid var(--wp--preset--color--linie); }
@media (min-width: 782px) {
	.band { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
}
/* Nachwuchs-Band auf der Startseite (Klassenname aus dem Muster): graue Fläche */
.band.band--gruen { background: var(--wp--preset--color--grau); border-top: 0; }
.band.band--gruen + .band { border-top: 0; }
.band--gruen .wp-block-heading { max-width: 16em; }

/* Knöpfe */
.wp-block-button.is-style-outline > .wp-element-button,
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--schwarz);
	border: 0;
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--schwarz);
}
.wp-block-button.is-style-outline > .wp-element-button:hover { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); }
.wp-block-buttons { gap: 12px; }

.karte { background: var(--wp--preset--color--weiss); padding: 24px; border-radius: 0; }

.wp-block-columns.raster-8 { gap: 48px 64px; }
@media (min-width: 1100px) {
	.wp-block-columns.raster-8 { column-gap: 96px; }
}

/* ---------- Fuß: schwarz ---------- */
.site-fuss { background: var(--wp--preset--color--schwarz); color: var(--wp--preset--color--weiss); padding-top: 64px; padding-bottom: 64px; font-size: var(--wp--preset--font-size--klein); }
.site-fuss [class*="wp-block-tsv-schach-"] {
	--tsv-tinte: var(--wp--preset--color--weiss);
	--tsv-zweit: #C9C9C4;
	--tsv-leise: #B8B8B2;
	--tsv-linie: rgba(255, 255, 255, 0.2);
}
.site-fuss a { color: var(--wp--preset--color--weiss); }
.site-fuss :is(h1, h2, h3) { color: var(--wp--preset--color--weiss); }
.site-fuss .tsv-gedaempft { color: #B8B8B2; }

/* ---------- Beitragslisten ---------- */
.wp-block-post-template.liste { gap: 0; margin: 0; padding: 0; border-bottom: 1px solid var(--wp--preset--color--linie); }
.wp-block-post-template.liste > li { border-top: 1px solid var(--wp--preset--color--linie); padding-top: 24px; padding-bottom: 24px; margin: 0; }
.wp-block-post-template.liste > li > * { margin-top: 0; margin-bottom: 0; }
.wp-block-post-template.liste > li > * + * { margin-top: 8px; }
.wp-block-post-template.liste .wp-block-post-title a { text-decoration: none; }
.wp-block-post-template.liste .wp-block-post-title a:hover { color: var(--wp--preset--color--rot); }
.wp-block-post-template.liste .wp-block-post-excerpt__excerpt { margin: 0; color: var(--wp--preset--color--text-zweit); max-width: 38em; }
@media (min-width: 782px) {
	.wp-block-post-template.liste > li { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 48px; }
	.wp-block-post-template.liste > li > .wp-block-post-date { grid-row: 1 / span 3; padding-top: 6px; }
	.wp-block-post-template.liste > li > :not(.wp-block-post-date) { grid-column: 2; }
}
.wp-block-post-date { font-size: var(--wp--preset--font-size--klein); font-weight: 600; color: var(--wp--preset--color--text-gedaempft); }
.wp-block-post-date a { text-decoration: none; color: inherit; }

/* ---------- Inhalte aus dem Editor ---------- */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table :is(th, td) { border: 0; border-bottom: 1px solid var(--wp--preset--color--linie); padding: 12px 16px 12px 0; text-align: left; vertical-align: top; }
.wp-block-table thead { border-bottom: 0; }
.wp-block-table th { border-bottom: 2px solid var(--wp--preset--color--schwarz); font-size: var(--wp--preset--font-size--label); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wp--preset--color--text-gedaempft); }
.wp-block-table td:first-child { font-weight: 700; }
.wp-block-table figcaption { margin-top: 8px; }

.wp-block-details { border-top: 1px solid var(--wp--preset--color--linie); padding: 16px 0; }
.wp-block-details + .wp-block-details { margin-top: 0; }
.wp-block-details:last-of-type { border-bottom: 1px solid var(--wp--preset--color--linie); }
.wp-block-details summary { cursor: pointer; font-weight: 700; }
.wp-block-details summary:hover { color: var(--wp--preset--color--rot); }
.wp-block-details > :not(summary) { margin-top: 16px; }

.wp-block-separator { border: 0; border-top: 2px solid currentColor; opacity: 1; }
.wp-block-quote { border: 0; padding: 24px; background: var(--wp--preset--color--grau); }

:where(.wp-site-blocks) :is(ul, ol):not(.wp-block-post-template, .tsv-termine, .tsv-online, .wp-block-navigation__container) { padding-left: 24px; }

:where(.wp-block-post-content) > :is(h2, [class*="wp-block-tsv-schach-"], .wp-block-group.alignfull):not(:first-child) { margin-top: var(--wp--preset--spacing--60); }
:where(.wp-block-post-content) > :is(h3):not(:first-child) { margin-top: var(--wp--preset--spacing--50); }
:where(.wp-block-post-content) > .eyebrow + :is(h1, h2) { margin-top: 16px; }
:where(.wp-block-post-content) > h1 + p { font-size: var(--wp--preset--font-size--mittel); line-height: 32px; color: var(--wp--preset--color--text-zweit); max-width: 36em; }
.wp-block-post-content > .band { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
.wp-block-post-content > .band.band--gruen,
.wp-block-post-content > .band.alignfull { padding-left: var(--wp--style--root--padding-left); padding-right: var(--wp--style--root--padding-right); }

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
}

/* ---------- Seitenkopf: roter Streifen mit Figur (Unterseiten) ---------- */
/*
 * Gruppe mit der Klasse „seitenkopf“ (in den Seitenmustern und Vorlagen). Sie läuft über die volle Breite,
 * der Text bleibt bündig mit dem Inhalt. Die Figur kommt aus der Zusatzklasse: seitenkopf--dame, --koenig,
 * --turm, --bauer, --laeufer (Standard), --springer.
 */
.wp-site-blocks { overflow-x: clip; }
main.band:has(> .seitenkopf:first-child),
main.band:has(> .wp-block-post-content > .seitenkopf:first-child) { padding-top: 0; }
.seitenkopf {
	--figur: url("assets/laeufer.svg");
	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	min-height: 320px;
	margin-top: 0 !important;
	margin-inline: calc(50% - 50vw) !important;
	max-width: none !important;
	padding: 48px max(calc(50vw - 50%), calc(50vw - 600px)) 56px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 16px;
	background: var(--wp--preset--color--rot);
	color: var(--wp--preset--color--weiss);
}
.seitenkopf--dame { --figur: url("assets/dame.svg"); }
.seitenkopf--koenig { --figur: url("assets/koenig.svg"); }
.seitenkopf--turm { --figur: url("assets/turm.svg"); }
.seitenkopf--bauer { --figur: url("assets/bauer.svg"); }
.seitenkopf--springer { --figur: url("assets/springer.svg"); }
.seitenkopf > * { position: relative; z-index: 1; max-width: min(760px, 62%); margin: 0 !important; }
/* Brettfelder und Figur, rechts bündig mit dem Inhalt */
.seitenkopf::before,
.seitenkopf::after {
	content: "";
	position: absolute;
	right: max(0px, calc(50vw - 648px));
	bottom: 0;
}
.seitenkopf::before {
	z-index: -2;
	width: 384px;
	height: 288px;
	background: conic-gradient(var(--wp--preset--color--rot-tief) 0 25%, transparent 0 50%, var(--wp--preset--color--rot-tief) 0 75%, transparent 0) 0 0 / 96px 96px;
}
.seitenkopf::after {
	z-index: -1;
	right: max(24px, calc(50vw - 600px));
	bottom: -24px;
	width: 300px;
	height: 300px;
	background: var(--figur) right bottom / contain no-repeat;
}
.seitenkopf :is(h1, h2, .wp-block-post-title, .wp-block-query-title) { color: var(--wp--preset--color--weiss); font-weight: 900; font-stretch: 125%; letter-spacing: -0.035em; line-height: 0.95; }
.seitenkopf .eyebrow { color: var(--wp--preset--color--weiss); }
.seitenkopf .eyebrow::before { background: var(--wp--preset--color--weiss); }
.seitenkopf p:not(.eyebrow) { font-size: var(--wp--preset--font-size--mittel); line-height: 30px; max-width: 36em; }
.seitenkopf a { color: var(--wp--preset--color--weiss); text-decoration-color: var(--wp--preset--color--weiss) !important; }
.seitenkopf .wp-block-post-date { color: var(--wp--preset--color--weiss); }
/* Abstand zum Inhalt danach */
.seitenkopf + * { margin-top: var(--wp--preset--spacing--60) !important; }
@media (max-width: 781px) {
	.seitenkopf { min-height: 0; padding-top: 152px; padding-bottom: 40px; }
	.seitenkopf > * { max-width: 100%; }
	.seitenkopf::before { top: 0; bottom: auto; right: -24px; width: 192px; height: 144px; background-size: 48px 48px; }
	.seitenkopf::after { top: 16px; bottom: auto; right: 16px; width: 128px; height: 128px; }
}
