/*
Theme Name:   HBSV Child
Theme URI:    https://hbsv.de
Description:  Design des Hessischen Baseball & Softball Verbands auf Basis von Astra. Enthält fertige Bausteine (Vorlagen) für Startseite, Ergebnisse, Termine und Ansprechpartner.
Author:       HBSV
Template:     astra
Version:      0.1.4
Text Domain:  hbsv-child
*/

/* ---------- Farben aus dem Entwurf ---------- */
:root {
	--hbsv-blau: #0B3A75;
	--hbsv-blau-hell: #E8EFF8;
	--hbsv-rot: #D3242E;
	--hbsv-rot-hell: #FBE8E9;
	--hbsv-gold: #C9A227;
	--hbsv-text: #1B2330;
	--hbsv-grau: #5B6573;
	--hbsv-linie: #D5DAE1;
	--hbsv-flaeche: #F4F6F9;

	/* Astra-Globalfarben auf HBSV-Farben setzen */
	--ast-global-color-0: #0B3A75;
	--ast-global-color-1: #D3242E;
	--ast-global-color-2: #0B3A75;
	--ast-global-color-3: #1B2330;
	--ast-global-color-4: #F4F6F9;
	--ast-global-color-5: #FFFFFF;
	--ast-global-color-6: #D5DAE1;
	--ast-global-color-7: #E8EFF8;
	--ast-global-color-8: #5B6573;
}

body {
	color: var(--hbsv-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.55;
}
a { color: var(--hbsv-blau); }
a:hover, a:focus { color: var(--hbsv-rot); }
h1, h2, h3, h4, .entry-title { color: var(--hbsv-blau); line-height: 1.25; }

/* ---------- Kopf und Menü ---------- */
.site-header .main-header-bar { border-bottom: 4px solid var(--hbsv-blau); }
.main-header-menu .menu-link { font-weight: 600; }
.main-header-menu > .menu-item.current-menu-item > .menu-link,
.main-header-menu > .menu-item.current-menu-ancestor > .menu-link {
	color: var(--hbsv-blau);
	box-shadow: inset 0 -4px 0 var(--hbsv-rot);
}

/* ---------- Fuß ---------- */
.site-footer, .site-below-footer-wrap, .site-primary-footer-wrap {
	background: var(--hbsv-blau) !important;
	color: #fff;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #FFD9DB; }

/* Seitentitel ausblenden auf der Startseite und auf Seiten mit dem Startseiten-Baustein */
.home .entry-header,
article:has(.hbsv-start) .entry-header { display: none; }

/* ---------- Bausteine ---------- */

/* Kasten mit Überschriftsleiste (Ergebnisse, Termine) */
.hbsv-box {
	border: 1px solid var(--hbsv-linie);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	height: 100%;
}
.hbsv-box > .wp-block-heading:first-child {
	margin: 0;
	padding: 10px 16px;
	background: var(--hbsv-blau);
	color: #fff;
	font-size: 1.05rem;
	border-bottom: 4px solid var(--hbsv-rot);
}
.hbsv-box > *:not(.wp-block-heading:first-child) { padding-left: 16px; padding-right: 16px; }
.hbsv-box > *:last-child { padding-bottom: 14px; }
.hbsv-box .hbsv-mehr { font-size: .9rem; font-weight: 600; margin-top: .6em; }

/* BSM-Tabellen im Kasten kompakt darstellen */
.hbsv-box table, .hbsv-bsm table {
	width: 100%;
	border-collapse: collapse;
	font-size: .88rem;
	margin: 8px 0;
	border: 0;
}
.hbsv-box th, .hbsv-box td, .hbsv-bsm th, .hbsv-bsm td {
	border: 0;
	border-bottom: 1px solid var(--hbsv-linie);
	padding: 6px 6px;
	text-align: left;
}
.hbsv-box th, .hbsv-box td:first-child, .hbsv-box td:last-child { white-space: nowrap; }
.hbsv-box td { overflow-wrap: normal; word-break: normal; hyphens: none; }
.hbsv-box table abbr, .hbsv-box table a { text-decoration: none; }
.hbsv-box .table-responsive, .hbsv-box > div:has(> table) { overflow-x: auto; }
/* Gruppen-Überschrift (Liga) in BSM-Tabellen */
.hbsv-liga { font-weight: 700; color: var(--hbsv-rot); font-size: .9rem; margin: 14px 0 0 !important; padding: 0 !important; }
.hbsv-box > div > .hbsv-liga:first-child { margin-top: 6px !important; }
.hbsv-box table[data-grouping] { margin-top: 2px; }
.hbsv-box caption, .hbsv-box h3, .hbsv-box h4 { text-align: left; font-size: .9rem; color: var(--hbsv-rot); margin: 12px 0 2px; }
.hbsv-box th, .hbsv-bsm th { background: var(--hbsv-flaeche); color: var(--hbsv-blau); font-weight: 700; }
.hbsv-box .table-responsive, .hbsv-bsm .table-responsive { overflow-x: auto; }

/* Termin-Liste */
.hbsv-termine { list-style: none; margin: 8px 0 0; padding: 0; }
.hbsv-termine li {
	display: flex;
	gap: 12px;
	align-items: baseline;
	padding: 8px 0;
	border-bottom: 1px solid var(--hbsv-linie);
	margin: 0;
}
.hbsv-termine li strong {
	min-width: 6.5em;
	color: var(--hbsv-blau);
	white-space: nowrap;
}
.hbsv-termin-wichtig {
	background: var(--hbsv-rot-hell);
	border-left: 4px solid var(--hbsv-rot);
	padding: 8px 12px !important;
	margin: 12px 16px 4px;
	border-radius: 0 6px 6px 0;
}

/* Schnellzugriff-Kacheln */
.hbsv-kachel {
	border: 1px solid var(--hbsv-linie);
	border-left: 5px solid var(--hbsv-rot);
	border-radius: 6px;
	background: #fff;
	padding: 14px 16px !important;
	height: 100%;
	transition: border-color .15s, box-shadow .15s;
}
.hbsv-kachel:hover { border-color: var(--hbsv-blau); box-shadow: 0 2px 10px rgba(11,58,117,.12); }
.hbsv-kachel h3 { margin: 0 0 .25em; font-size: 1.08rem; }
.hbsv-kachel h3 a { text-decoration: none; }
.hbsv-kachel p { margin: 0; color: var(--hbsv-grau); font-size: .93rem; }

/* Auffälliger Kasten */
.hbsv-hinweis {
	background: var(--hbsv-blau);
	color: #fff;
	border-left: 8px solid var(--hbsv-rot);
	border-radius: 6px;
	padding: 16px 20px !important;
	font-weight: 700;
}
.hbsv-hinweis a { color: #fff; }

/* Nachrichten-Karten */
.hbsv-news .wp-block-post {
	border: 1px solid var(--hbsv-linie);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.hbsv-news .wp-block-post > *:not(.wp-block-post-featured-image) { padding-left: 14px; padding-right: 14px; }
.hbsv-news .wp-block-post-featured-image { margin: 0 0 10px; }
.hbsv-news .wp-block-post-featured-image img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.hbsv-news .wp-block-post-date, .hbsv-news .taxonomy-category { font-size: .85rem; color: var(--hbsv-grau); }
.hbsv-news .wp-block-post-title { font-size: 1.05rem; margin: .3em 0; }
.hbsv-news .wp-block-post-title a { text-decoration: none; }

/* Personen */
.hbsv-person { text-align: left; }
.hbsv-person .wp-block-image img { border-radius: 8px; aspect-ratio: 1/1; object-fit: cover; }
.hbsv-person .hbsv-rolle { font-size: .8rem; font-weight: 700; color: var(--hbsv-rot); text-transform: uppercase; letter-spacing: .03em; margin: .6em 0 0; }
.hbsv-person .hbsv-name { font-weight: 700; color: var(--hbsv-blau); margin: 0; }

/* Abstände der Startseite */
.hbsv-start > * + * { margin-top: 28px; }
.hbsv-start .wp-block-columns { margin-bottom: 20px; }
.hbsv-start .wp-block-columns + .wp-block-columns { margin-top: 0; }

@media (max-width: 781px) {
	.hbsv-termine li { flex-direction: column; gap: 0; }
}
