/*
Theme Name: Absolute Abfahrt Dark
Description: Dunkles, mobile-first Child-Theme von Twenty Twenty-Five für die Absolute Abfahrt (ILRC).
Template: twentytwentyfive
Version: 1.2.8
Requires at least: 6.7
Requires PHP: 7.4
Text Domain: aa-dark
*/

/* Header: sticky. Kein backdrop-filter – der würde das mobile Overlay-Menü auf die Header-Höhe einsperren. */
.aa-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background-color: #0e0f10f5 !important;
}
.admin-bar .aa-header { top: 0; }
@media (min-width: 601px) { .admin-bar .aa-header { top: 46px; } }
@media (min-width: 783px) { .admin-bar .aa-header { top: 32px; } }

.aa-brand { margin: 0; }
.aa-brand a {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	font-size: 1.15rem;
	letter-spacing: .01em;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	white-space: nowrap;
}

/* Mobiles Overlay-Menü: groß, gut tippbar */
.aa-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 800;
	font-style: italic;
	text-transform: uppercase;
	font-size: 1.6rem;
	padding: .35rem 0;
}
.aa-header .wp-block-navigation-item__content { min-height: 44px; display: inline-flex; align-items: center; }

/* Hero */
.aa-hero h1 { text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.aa-hero .aa-date {
	display: inline-block;
	border-left: 4px solid var(--wp--preset--color--accent-1);
	padding-left: .6rem;
}

/* Beitragskarten */
.aa-card {
	height: 100%;
	transition: transform .15s ease, border-color .15s ease;
}
.aa-card:hover { transform: translateY(-2px); border-color: var(--wp--preset--color--accent-1) !important; }
.aa-card .wp-block-post-featured-image img { aspect-ratio: 16/9; object-fit: cover; }

/* Sponsoren: helle Kacheln, da Logos weiße Hintergründe haben */
.aa-sponsors {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: .5rem;
}
@media (min-width: 600px) { .aa-sponsors { grid-template-columns: repeat(4, 1fr); gap: .75rem; } }
@media (min-width: 1000px) { .aa-sponsors { grid-template-columns: repeat(7, 1fr); } }
.aa-sponsors > .wp-block-image {
	position: relative;
	min-width: 0;
	width: auto !important;
	background: #fff;
	border-radius: 8px;
	margin: 0 !important;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	padding: 0 !important;
	display: block !important;
}
/* Logo-Box: alle Logos in gleich große Innenfläche einpassen, egal ob verlinkt oder nicht */
.aa-sponsors > .wp-block-image > a,
.aa-sponsors > .wp-block-image > img {
	position: absolute !important;
	inset: 14% 12%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.aa-sponsors > .wp-block-image img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain;
	margin: 0;
}

/* Fokus sichtbar */
:where(a, button):focus-visible { outline: 2px solid var(--wp--preset--color--accent-1); outline-offset: 2px; }

@media (max-width: 599px) {
	.aa-hero .wp-block-button__link { padding: .7rem 1rem; font-size: .9rem; }
	.aa-sponsors > .wp-block-image { border-radius: 6px; }
	.aa-sponsors > .wp-block-image > a, .aa-sponsors > .wp-block-image > img { inset: 10% 8%; }
}

/* News-Pagination als Button */
.wp-block-query-pagination a {
	display: inline-flex; align-items: center; gap: .4rem;
	min-height: 44px; padding: .6rem 1.2rem;
	border: 2px solid var(--wp--preset--color--accent-1); border-radius: 6px;
	font-family: var(--wp--preset--font-family--fira-sans); font-weight: 800; font-style: italic;
	text-transform: uppercase; text-decoration: none; color: var(--wp--preset--color--contrast);
}
.wp-block-query-pagination a:hover { background: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--base); }
.wp-block-query-pagination-next { margin-left: auto; }

/* Seitentitel: keine Trennung mitten im Wort (z. B. KONTAKT/IMPRESSUM), Umbruch nach "/" erlaubt */
main h1.wp-block-post-title {
	font-size: clamp(2rem, 8vw, 3.75rem);
	word-break: normal;
	overflow-wrap: normal;
	hyphens: manual;
}

/* Kontaktformular */
.aa-kf form { display: grid; gap: .9rem; margin-top: 1rem; }
.aa-kf__feld { display: grid; gap: .35rem; margin: 0; }
.aa-kf label { font-weight: 700; font-size: .95rem; }
.aa-kf input[type=text], .aa-kf input[type=email], .aa-kf textarea {
	width: 100%; box-sizing: border-box;
	padding: .75rem .9rem; min-height: 48px;
	font: inherit; font-size: 16px; /* verhindert Zoom auf iOS */
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--accent-3);
	border: 1px solid var(--wp--preset--color--accent-6); border-radius: 6px;
}
.aa-kf input:focus, .aa-kf textarea:focus { outline: 2px solid var(--wp--preset--color--accent-1); outline-offset: 1px; border-color: transparent; }
.aa-kf__feld--rechnung input { max-width: 7rem; }
.aa-kf__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.aa-kf__hinweis { font-size: .85rem; color: var(--wp--preset--color--accent-4); margin: 0; }
.aa-kf button { cursor: pointer; border: 0; }
.aa-kf__meldung { padding: .8rem 1rem; border-radius: 6px; font-weight: 700; }
.aa-kf__meldung--erfolg { background: #12361f; border-left: 4px solid #3ecf6e; }
.aa-kf__meldung--fehler { background: #3a1610; border-left: 4px solid var(--wp--preset--color--accent-1); }

/* Menü: Mouse-Over mit orangem, 11° angeschrägtem Balken */
.aa-header .wp-block-navigation-item__content {
	position: relative;
	isolation: isolate;
	padding: .15rem .55rem;
	transition: color .15s ease;
}
.aa-header .wp-block-navigation-item__content::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--accent-1);
	transform: skewX(-11deg) scaleX(0);
	transform-origin: left center;
	transition: transform .18s ease;
}
.aa-header .wp-block-navigation-item__content:hover,
.aa-header .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--base) !important;
}
.aa-header .wp-block-navigation-item__content:hover::before,
.aa-header .wp-block-navigation-item__content:focus-visible::before {
	transform: skewX(-11deg) scaleX(1);
}
@media (prefers-reduced-motion: reduce) {
	.aa-header .wp-block-navigation-item__content::before { transition: none; }
}

/* Unterseiten: Titelbalken in Contentbreite, 11° angeschrägt; Titel links, Datum klein rechts unten */
main .aa-titlebar {
	position: relative;
	isolation: isolate;
	padding: .55rem 1.1rem .5rem;
	gap: 1rem;
	margin-bottom: var(--wp--preset--spacing--40);
}
main .aa-titlebar::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--accent-1);
	transform: skewX(-11deg);
}
main .aa-titlebar h1.wp-block-post-title {
	margin: 0;
	color: var(--wp--preset--color--base);
	line-height: 1;
}
main .aa-titlebar .wp-block-post-date {
	flex-shrink: 0;
	margin: 0 0 .2em;
	color: var(--wp--preset--color--base);
	font-size: .8rem;
	font-weight: 700;
	white-space: nowrap;
}
main .aa-titlebar .wp-block-post-date a { color: inherit; text-decoration: none; }

/* Mittlere Breiten (Tablet/kleiner Laptop): Menü einzeilig halten */
@media (min-width: 600px) and (max-width: 1150px) {
	.aa-header .wp-block-navigation__container { gap: .1rem !important; }
	.aa-header .wp-block-navigation { font-size: .8rem !important; }
	.aa-header .wp-block-navigation-item__content { padding: .15rem .4rem; }
	.aa-brand a { font-size: 1rem; }
}

/* Datumsmarke im Hero ebenfalls 11° angeschrägt */
.aa-hero .aa-date { border-left: 0 !important; position: relative; padding-left: 1rem !important; }
.aa-hero .aa-date::before {
	content: ""; position: absolute; left: 0; top: .1em; bottom: .1em; width: 5px;
	background: var(--wp--preset--color--accent-1); transform: skewX(-11deg);
}

/* Überschriften: aufrechte Schrift, exakt 11° geneigt (passend zu den Balken) */
:where(h1, h2, h3, h4, h5, h6).wp-block-heading,
h1.wp-block-post-title, h2.wp-block-post-title, h3.wp-block-post-title {
	font-style: normal;
	transform: skewX(-11deg);
	transform-origin: left bottom;
}

/* Menü-Hover: Schrift ebenfalls 11° neigen, passend zum Balken */
.aa-header .wp-block-navigation-item__label {
	display: inline-block;
	transition: transform .18s ease;
}
.aa-header .wp-block-navigation-item__content:hover .wp-block-navigation-item__label,
.aa-header .wp-block-navigation-item__content:focus-visible .wp-block-navigation-item__label {
	transform: skewX(-11deg);
}

/* Buttons einheitlich: 11° angeschrägt (Fläche + Schrift), Hover als Wischeffekt */
.wp-block-button__link,
.wp-block-query-pagination a {
	transform: skewX(-11deg);
	border-radius: 0 !important;
	font-style: normal !important;
	background-repeat: no-repeat !important;
	background-position: left center !important;
	background-size: 0% 100% !important;
	transition: background-size .18s ease, color .18s ease, border-color .18s ease;
}
.wp-block-button__link:hover, .wp-block-button__link:focus-visible,
.wp-block-query-pagination a:hover, .wp-block-query-pagination a:focus-visible {
	background-size: 100% 100% !important;
}
/* Gefüllt (z. B. Formular-Button): Akzentfläche mit gleich starkem Rahmen, kein Farbwechsel beim Hover */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link,
.aa-kf button.wp-block-button__link {
	background-color: var(--wp--preset--color--accent-1) !important;
	background-image: none !important;
	border: 2px solid var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--base) !important;
}
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.aa-kf button.wp-block-button__link:hover { filter: brightness(1.12); }

/* Outline + Pagination: Rahmen, beim Hover wischt die Akzentfläche rein */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-query-pagination a {
	background-color: transparent !important;
	background-image: linear-gradient(var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1)) !important;
	border: 2px solid var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--contrast) !important;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible,
.wp-block-query-pagination a:hover, .wp-block-query-pagination a:focus-visible {
	border-color: var(--wp--preset--color--accent-1) !important;
	color: var(--wp--preset--color--base) !important;
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link, .wp-block-query-pagination a { transition: none; }
}

/* Sponsoren-Kacheln: 11° angeschrägt, eckig, Logos bleiben gerade; Hover: rote Outline zieht sich animiert um die Kachel */
.aa-sponsors { column-gap: 1rem !important; }
.aa-sponsors > .wp-block-image {
	transform: skewX(-11deg);
	border-radius: 0 !important;
	overflow: visible !important;
}
.aa-sponsors > .wp-block-image > a,
.aa-sponsors > .wp-block-image > img {
	transform: skewX(11deg);
}
.aa-sponsors > .wp-block-image::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	--aa-line: 3px;
	background:
		linear-gradient(var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1)) left top / 0 var(--aa-line) no-repeat,
		linear-gradient(var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1)) right top / var(--aa-line) 0 no-repeat,
		linear-gradient(var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1)) right bottom / 0 var(--aa-line) no-repeat,
		linear-gradient(var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-1)) left bottom / var(--aa-line) 0 no-repeat;
	transition: background-size .35s ease;
}
.aa-sponsors > .wp-block-image:hover::after,
.aa-sponsors > .wp-block-image:focus-within::after {
	background-size: 100% var(--aa-line), var(--aa-line) 100%, 100% var(--aa-line), var(--aa-line) 100%;
}
@media (prefers-reduced-motion: reduce) {
	.aa-sponsors > .wp-block-image::after { transition: none; }
}

/* Sponsoren: Flex statt Grid – Desktop 5 je Reihe (5/5/4), letzte Reihe mittig, gleicher Abstand */
.aa-sponsors {
	--aa-cols: 3;
	--aa-gap: .75rem;
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--aa-gap) calc(var(--aa-gap) + .5rem) !important;
}
.aa-sponsors > .wp-block-image {
	flex: 0 0 calc((100% - (var(--aa-cols) - 1) * (var(--aa-gap) + .5rem)) / var(--aa-cols));
}
@media (min-width: 600px) { .aa-sponsors { --aa-cols: 4; --aa-gap: 1rem; } }
@media (min-width: 1000px) { .aa-sponsors { --aa-cols: 5; --aa-gap: 1.25rem; } }

/* Titelbalken: Titel darf schrumpfen (für das Einpassen), Datum auf dem Handy unter den Titel */
main .aa-titlebar h1.wp-block-post-title { min-width: 0; flex: 1 1 auto; }
@media (max-width: 599px) {
	main .aa-titlebar { flex-wrap: wrap !important; }
	main .aa-titlebar .wp-block-post-date { width: 100%; margin: .2rem 0 0; }
}
