/*
Theme Name:        Digelite Verein
Description:       Schlankes Theme für reine Vereinswebsites mit dem Plugin „Digelite Verein“. Verein, Farbe, Schrift, Logo und Menü kommen aus der Vereinsverwaltung; das Theme gestaltet daraus Menüleiste und Footer und dazu Seiten, Beiträge, Suche und Fehlerseite im selben Stil. Läuft auch ohne das Plugin.
Version:           0.2.4
Requires at least: 6.4
Requires PHP:      8.1
Tested up to:      6.8
Author:            DigElite
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       digelite-verein-theme
*/

/* Farbe und Schrift kommen aus der Vereinsverwaltung (functions.php setzt --dgvt-akzent; das Plugin --dgv-schrift).
   Ohne das Plugin gelten die Vorgaben hier. */
:root {
	--dgvt-akzent: #1a4fd0;
	--dgvt-dunkel: color-mix(in srgb, var(--dgvt-akzent) 75%, #000);
	--dgvt-hell: color-mix(in srgb, var(--dgvt-akzent) 7%, #fff);
	--dgvt-linie: color-mix(in srgb, var(--dgvt-akzent) 18%, #fff);
	--dgvt-leise: #5b6270;
	--dgvt-rund: 12px;
	--dgvt-rund-knopf: 10px;
}

html {
	scroll-padding-top: 6.5rem;
}

body {
	-webkit-font-smoothing: antialiased;
	margin: 0;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Die Bühne: Der Inhalt füllt die Höhe, damit der Footer auch auf kurzen Seiten unten steht. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 60vh;
}

.dgvt-inhalt {
	flex: 1 0 auto;
	padding-block: clamp(2rem, 5vw, 4rem);
}

/* Seite mit der Landingpage: Sie bringt ihre Abstände selbst mit und reicht bis an die Menüleiste. */
body.dgv-lp-seite .dgvt-inhalt {
	padding-block: 0;
}

/* Seite über die volle Fensterbreite, ohne Titel und ohne Abstand: Vorlage „Volle Breite ohne Titel“ und Seiten des
   Plugins „Site Pages“. Der Inhalt gestaltet sich selbst und reicht bis an Menüleiste und Footer. */
body.dgvt-voll .dgvt-inhalt {
	padding: 0;
}

body.dgvt-voll .wp-block-post-title {
	display: none;
}

body.dgvt-voll .dgvt-inhalt > .wp-block-post-content,
body.dgvt-voll .dgvt-inhalt > .wp-block-post-content > * {
	margin-block: 0;
	margin-inline: 0;
	max-width: none;
}

/* Plugin „Site Pages“: Ohne eigenes Inhalts-Paket setzt es einen Ersatz-Kopf und -Fuß in den Inhalt. Menüleiste und
   Footer der Website sind die des Themes, sonst stünden beide doppelt da. */
.sp-default-header,
.sp-default-footer {
	display: none !important;
}

/* Was auf den ausgeblendeten Kopf folgt, ist das erste Sichtbare und bekommt keinen Abstand nach oben. */
.sp-default-header + * {
	margin-block-start: 0 !important;
}

/* Tastatur: überall deutlich sichtbar, wo man gerade ist. */
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--dgvt-dunkel);
	outline-offset: 3px;
}

.dgvt-inhalt a:not(.wp-element-button):not([class*="dgv-"]) {
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.2em;
}

.dgvt-inhalt a:not(.wp-element-button):not([class*="dgv-"]):hover {
	color: var(--dgvt-dunkel);
	text-decoration-thickness: 0.14em;
}

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.15s, color 0.15s;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	background: var(--dgvt-dunkel);
	color: #fff;
}

img {
	height: auto;
	max-width: 100%;
}

.dgvt-inhalt :where(.wp-block-image img, .wp-post-image) {
	border-radius: var(--dgvt-rund);
}

/* Kleine Zeile über einer Überschrift, wie auf der Landingpage. */
.dgvt-dach {
	color: var(--dgvt-akzent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin: 0 0 0.75rem;
	text-transform: uppercase;
}

.dgvt-datum {
	color: var(--dgvt-akzent);
	font-size: 0.9375rem;
	font-weight: 700;
}

/* Beiträge als Karten (Blog, Archiv, Suche): gleiches Bildformat, Titel zwei Zeilen, Anriss drei. */
.dgvt-karten.wp-block-post-template {
	gap: 2rem 1.5rem;
}

.dgvt-karten > li {
	display: flex;
	flex-direction: column;
	position: relative;
}

.dgvt-karten .wp-block-post-featured-image {
	margin: 0 0 0.9rem;
}

.dgvt-karten .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	border-radius: var(--dgvt-rund);
	object-fit: cover;
	width: 100%;
}

.dgvt-karten .wp-block-post-title {
	font-size: 1.375rem;
	line-height: 1.3;
	margin: 0.25rem 0 0.5rem;
}

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

.dgvt-karten .wp-block-post-title a:hover {
	color: var(--dgvt-akzent);
	text-decoration: underline;
}

/* Die ganze Karte ist anklickbar: Der Link im Titel spannt sich über die Karte. */
.dgvt-karten .wp-block-post-title a::after {
	content: "";
	inset: 0;
	position: absolute;
}

.dgvt-karten .wp-block-post-title,
.dgvt-karten .wp-block-post-excerpt__excerpt {
	-webkit-box-orient: vertical;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.dgvt-karten .wp-block-post-excerpt__excerpt {
	-webkit-line-clamp: 3;
	line-clamp: 3;
	margin: 0;
}

.dgvt-karten .wp-block-post-excerpt {
	margin: 0;
}

.wp-block-query-pagination {
	border-top: 1px solid var(--dgvt-linie);
	margin-top: 2.5rem;
	padding-top: 1.5rem;
}

/* Suche */
.wp-block-search__input {
	border: 1px solid #8a90a0;
	border-radius: var(--dgvt-rund-knopf);
	font: inherit;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
}

/* Kommentare, Zitate, Tabellen: ruhig und im selben Ton. */
.wp-block-quote {
	border-left: 3px solid var(--dgvt-akzent);
	margin-inline: 0;
	padding-left: 1.25rem;
}

.wp-block-table td,
.wp-block-table th {
	border-color: var(--dgvt-linie);
	padding: 0.6rem 0.75rem;
}

.wp-block-separator {
	border-color: var(--dgvt-linie);
}

/* Menüleiste und Footer. Die Angaben kommen aus der Vereinsverwaltung (inc/rahmen.php). */
.dgvt-kopf,
.dgvt-fuss {
	box-sizing: border-box;
	font-family: var(--dgv-schrift, inherit);
	font-size: 1rem;
	line-height: 1.5;
}

.dgvt-kopf *,
.dgvt-fuss * {
	box-sizing: border-box;
}

/* Sprunglink: unsichtbar, bis er mit der Tastatur erreicht wird. */
.dgvt-sprung {
	background: #fff;
	border: 3px solid #1d2433;
	border-radius: 8px;
	color: #1d2433;
	font-weight: 700;
	left: 0.75rem;
	padding: 0.75rem 1rem;
	position: fixed;
	top: 0.75rem;
	transform: translateY(-300%);
	z-index: 100000;
}

.dgvt-sprung:focus {
	transform: none;
}

.dgvt-kopf__name {
	font-family: var(--dgv-schrift-titel, var(--dgv-schrift, inherit));
}

/* Menüleiste */
.dgvt-kopf {
	background: #fff;
	border-bottom: 1px solid #e4e7ee;
	color: #1d2433;
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 900;
}

.dgvt-kopf__innen {
	align-items: center;
	display: flex;
	gap: 1rem 2rem;
	justify-content: space-between;
	margin: 0 auto;
	max-width: 80rem;
	min-height: 4.5rem;
	padding: 0.625rem clamp(1.25rem, 4vw, 2.5rem);
}

.dgvt-kopf a {
	color: inherit;
	text-decoration: none;
}

.dgvt-kopf__marke {
	align-items: center;
	display: flex;
	flex: 0 1 auto;
	gap: 0.75rem;
	min-width: 0;
}

.dgvt-kopf__logo {
	display: block;
	height: clamp(4rem, 3rem + 2.5vw, 5rem);
	max-width: min(22rem, 60vw);
	object-fit: contain;
	width: auto;
}

/* Nur für Screenreader. Mit Logo steht der Name nicht daneben, bleibt aber der Name des Links zur Startseite. */
.dgvt-nur-lesbar {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.dgvt-kopf__name {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.25;
	max-width: 16rem;
}

.dgvt-kopf__nav {
	align-items: center;
	display: flex;
	flex: 1 1 auto;
	gap: 0.5rem 1.25rem;
	justify-content: flex-end;
}

.dgvt-kopf__liste {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
	justify-content: flex-end;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dgvt-kopf__liste li {
	margin: 0;
	padding: 0;
}

.dgvt-kopf__liste a {
	border-bottom: 2px solid transparent;
	display: block;
	font-size: 0.9375rem;
	font-weight: 500;
	padding: 0.375rem 0;
	white-space: nowrap;
}

.dgvt-kopf__liste a:hover,
.dgvt-kopf__liste a:focus-visible {
	border-bottom-color: var(--dgvt-akzent);
	color: var(--dgvt-dunkel);
}

.dgvt-kopf__knoepfe {
	display: flex;
	flex: 0 0 auto;
	gap: 0.5rem;
	margin: 0;
}

.dgvt-kopf a.dgvt-kopf__cta {
	border: 2px solid var(--dgvt-akzent);
	border-radius: 10px;
	color: var(--dgvt-dunkel);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.5rem 0.875rem;
	white-space: nowrap;
}

.dgvt-kopf a.dgvt-kopf__cta--voll {
	background: var(--dgvt-akzent);
	color: #fff;
}

.dgvt-kopf a.dgvt-kopf__cta:hover,
.dgvt-kopf a.dgvt-kopf__cta:focus-visible {
	background: var(--dgvt-dunkel);
	border-color: var(--dgvt-dunkel);
	color: #fff;
}

.dgvt-kopf a:focus-visible,
.dgvt-kopf__knopf:focus-visible,
.dgvt-fuss a:focus-visible {
	outline: 3px solid var(--dgvt-akzent);
	outline-offset: 3px;
}

.dgvt-kopf__knopf {
	align-items: center;
	background: none;
	border: 2px solid #c9ced9;
	border-radius: 10px;
	color: inherit;
	cursor: pointer;
	display: none;
	font: inherit;
	font-weight: 600;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
}

.dgvt-kopf__striche,
.dgvt-kopf__striche::before,
.dgvt-kopf__striche::after {
	background: currentColor;
	border-radius: 2px;
	display: block;
	height: 2px;
	width: 1.125rem;
}

.dgvt-kopf__striche {
	position: relative;
}

.dgvt-kopf__striche::before,
.dgvt-kopf__striche::after {
	content: "";
	left: 0;
	position: absolute;
}

.dgvt-kopf__striche::before {
	top: -6px;
}

.dgvt-kopf__striche::after {
	top: 6px;
}

@media (max-width: 1100px) {
	.dgvt-kopf__innen {
		flex-wrap: wrap;
	}

	.dgvt-kopf__marke {
		flex: 1 1 0;
	}

	.dgvt-kopf__name {
		max-width: none;
	}

	.dgvt-kopf__knopf {
		display: inline-flex;
	}

	.dgvt-kopf__nav {
		align-items: stretch;
		border-top: 1px solid #e4e7ee;
		display: none;
		flex: 1 0 100%;
		flex-direction: column;
		max-height: calc(100vh - 7rem);
		overflow-y: auto;
		padding: 0.5rem 0 0.75rem;
	}

	.dgvt-kopf__nav--offen {
		display: flex;
	}

	.dgvt-kopf__liste {
		flex-direction: column;
		gap: 0;
	}

	.dgvt-kopf__liste a {
		border-bottom: 1px solid #eef0f5;
		padding: 0.75rem 0;
	}

	.dgvt-kopf__knoepfe {
		flex-wrap: wrap;
		margin-top: 0.75rem;
	}

	.dgvt-kopf a.dgvt-kopf__cta {
		flex: 1 1 10rem;
		text-align: center;
	}
}

/* Dasselbe, wenn das Menü auf einem breiten Bildschirm nicht in eine Zeile passt (assets/menue.js setzt die Klasse):
   lieber der Knopf „Menü“ als eine zweite Zeile. */
.dgvt-kopf--eng .dgvt-kopf__innen {
	flex-wrap: wrap;
}

.dgvt-kopf--eng .dgvt-kopf__marke {
	flex: 1 1 0;
}

.dgvt-kopf--eng .dgvt-kopf__name {
	max-width: none;
}

.dgvt-kopf--eng .dgvt-kopf__knopf {
	display: inline-flex;
}

.dgvt-kopf--eng .dgvt-kopf__nav {
	align-items: stretch;
	border-top: 1px solid #e4e7ee;
	display: none;
	flex: 1 0 100%;
	flex-direction: column;
	max-height: calc(100vh - 7rem);
	overflow-y: auto;
	padding: 0.5rem 0 0.75rem;
}

.dgvt-kopf--eng .dgvt-kopf__nav--offen {
	display: flex;
}

.dgvt-kopf--eng .dgvt-kopf__liste {
	flex-direction: column;
	gap: 0;
}

.dgvt-kopf--eng .dgvt-kopf__liste a {
	border-bottom: 1px solid #eef0f5;
	padding: 0.75rem 0;
}

.dgvt-kopf--eng .dgvt-kopf__knoepfe {
	flex-wrap: wrap;
	margin-top: 0.75rem;
}

.dgvt-kopf--eng a.dgvt-kopf__cta {
	flex: 1 1 10rem;
	text-align: center;
}


/* Footer */
.dgvt-fuss {
	/* Dunkel im Ton der Vereinsfarbe, wie der dunkle Schnellzugriff der Landingpage. */
	--dgvt-fuss-grund: color-mix(in srgb, var(--dgvt-akzent) 28%, #0b0d17);
	--dgvt-fuss-text: #dcdfe8;
	--dgvt-fuss-stark: #fff;
	--dgvt-fuss-leise: #b4bacb;
	--dgvt-fuss-linie: rgba(255, 255, 255, 0.16);
	background: #171c2b;
	background: var(--dgvt-fuss-grund);
	color: var(--dgvt-fuss-text);
	margin: 0;
}

.dgvt-fuss--neutral {
	--dgvt-fuss-grund: #171c2b;
}

.dgvt-fuss--akzent {
	--dgvt-fuss-grund: var(--dgvt-akzent);
	--dgvt-fuss-text: #fff;
	--dgvt-fuss-leise: #fff;
	--dgvt-fuss-linie: rgba(255, 255, 255, 0.3);
}

.dgvt-fuss--hell {
	--dgvt-fuss-grund: color-mix(in srgb, var(--dgvt-akzent) 6%, #fff);
	--dgvt-fuss-text: #2a3040;
	--dgvt-fuss-stark: #141824;
	--dgvt-fuss-leise: #4a5165;
	--dgvt-fuss-linie: color-mix(in srgb, var(--dgvt-akzent) 22%, #fff);
}

.dgvt-fuss__innen {
	margin: 0 auto;
	max-width: 80rem;
	padding: clamp(2.5rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
}

.dgvt-fuss__spalten {
	display: grid;
	gap: 2rem 3rem;
	grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
}

.dgvt-fuss p {
	margin: 0 0 0.75rem;
}

.dgvt-fuss__name {
	color: var(--dgvt-fuss-stark);
	font-size: 1.125rem;
	font-weight: 700;
}

.dgvt-fuss__titel {
	color: var(--dgvt-fuss-stark);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.dgvt-fuss ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dgvt-fuss li {
	margin: 0 0 0.5rem;
	padding: 0;
}

.dgvt-fuss a {
	color: inherit;
	text-decoration: none;
}

.dgvt-fuss a:hover,
.dgvt-fuss a:focus-visible {
	color: var(--dgvt-fuss-stark);
	text-decoration: underline;
}

.dgvt-fuss a:focus-visible {
	outline-color: var(--dgvt-fuss-stark);
}

.dgvt-fuss .dgvt-fuss__unten {
	align-items: center;
	border-top: 1px solid var(--dgvt-fuss-linie);
	color: var(--dgvt-fuss-leise);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.875rem;
	gap: 1rem 2rem;
	justify-content: space-between;
	margin: 2.5rem 0 0;
	padding-top: 1.25rem;
}

.dgvt-fuss .dgvt-fuss__unten p {
	margin: 0;
}

/* Widerrufsfunktion: als Knopf hervorgehoben, auf jeder Seite an derselben Stelle. */
.dgvt-fuss a.dgv-widerruf-knopf {
	border: 2px solid currentColor;
	border-radius: 6px;
	color: var(--dgvt-fuss-stark);
	display: inline-block;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.5em 1.1em;
}

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

/* Die offene Seite im Menü. */
.dgvt-kopf__liste a[aria-current="page"] {
	border-bottom-color: var(--dgvt-akzent);
	color: var(--dgvt-dunkel);
}

/* Seiten der Vereinsverwaltung: Die Liste der Angebote braucht Platz für mehrere Kacheln nebeneinander. */
body.dgv-seite-breit {
	--wp--style--global--content-size: min(1250px, calc(100vw - 2.5rem));
}

/* Die Landingpage und die Seiten mit Formularen bringen ihre Hauptüberschrift selbst mit. */
body.dgv-lp-seite .wp-block-post-title,
body.dgv-titel-aus .wp-block-post-title {
	display: none;
}

body.dgv-titel-aus .wp-block-post-content h1 {
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	line-height: 1.15;
	margin: 0 0 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}
