/*
Theme Name: LCCR Castra Regina
Theme URI: https://www.lc-regensburg-castra-regina.de
Author: Lions Club Regensburg Castra Regina
Description: Schlankes Block-Theme für den Lions Club Regensburg Castra Regina. Lions-Farben (Blau/Gold), Systemschriften (keine externen Fonts, DSGVO-freundlich), mobil optimiert.
Version: 1.2.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lccr
*/

/* Feinschliff, der in theme.json nicht abbildbar ist */

/* ---- Kopfbereich: bleibt oben, groß am Anfang, kompakt beim Scrollen ---- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
	/* Auf dem Handy scrollt die Adminleiste mit weg. */
	.admin-bar header.wp-block-template-part { top: 0; }
}

.lccr-header {
	border-bottom: 4px solid var(--wp--preset--color--accent);
	transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.lccr-header-logos .wp-block-image,
.lccr-header-logos .wp-block-image img {
	transition: width 0.25s ease, height 0.25s ease;
}
/* Startzustand (mobile first): große Logos */
.lccr-header-logos .wp-block-image img {
	width: 64px !important;
	height: 64px !important;
}
.lccr-header .wp-block-site-title { font-size: 1.05rem; line-height: 1.2; }
.lccr-tagline { transition: opacity 0.2s ease, max-height 0.25s ease; max-height: 3em; overflow: hidden; }

@media (min-width: 782px) {
	.lccr-header-logos .wp-block-image img { width: 84px !important; height: 84px !important; }
	.lccr-header .wp-block-site-title { font-size: var(--wp--preset--font-size--large); }
}

/* Beim Scrollen: kompakt */
.lccr-scrolled .lccr-header {
	padding-top: 0.4rem !important;
	padding-bottom: 0.4rem !important;
	box-shadow: 0 4px 16px rgba(0, 32, 91, 0.12);
}
.lccr-scrolled .lccr-header-logos .wp-block-image img { width: 38px !important; height: 38px !important; }
.lccr-scrolled .lccr-tagline { opacity: 0; max-height: 0; margin: 0; }

@media (max-width: 480px) {
	.lccr-header .wp-block-site-title { font-size: 0.95rem; }
	.lccr-tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.lccr-header, .lccr-header-logos .wp-block-image img, .lccr-tagline { transition: none; }
}

/* ---- Karussell ---- */
.lccr-karussell {
	position: relative;
	background: var(--wp--preset--color--primary-dark);
}
.lccr-k-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.lccr-k-track::-webkit-scrollbar { display: none; }
.lccr-k-track:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: -3px; }
.lccr-k-slide {
	position: relative;
	flex: 0 0 100%;
	scroll-snap-align: start;
	aspect-ratio: 4 / 3;
	max-height: 78vh;
}
@media (min-width: 782px) {
	.lccr-k-slide { aspect-ratio: 21 / 9; max-height: 560px; }
}
.lccr-k-link { display: block; height: 100%; color: #fff; text-decoration: none; }
.lccr-k-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lccr-k-caption {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 3rem clamp(1rem, 5vw, 4rem) 3.2rem;
	background: linear-gradient(to top, rgba(0, 20, 60, 0.85), rgba(0, 20, 60, 0));
}
.lccr-k-date { font-size: 0.85rem; opacity: 0.85; }
.lccr-k-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: clamp(1.25rem, 3.5vw, 2.2rem);
	line-height: 1.2;
	text-wrap: balance;
}
.lccr-k-more { color: var(--wp--preset--color--accent); font-weight: 700; margin-top: 0.25rem; }
.lccr-k-link:hover .lccr-k-more, .lccr-k-link:focus-visible .lccr-k-more { text-decoration: underline; }

.lccr-k-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--wp--preset--color--primary-dark);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
}
.lccr-k-prev { left: 0.75rem; }
.lccr-k-next { right: 0.75rem; }
.lccr-k-btn:hover { background: var(--wp--preset--color--accent); }
@media (max-width: 600px) { .lccr-k-btn { display: none; } }

.lccr-k-nav {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.9rem;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
}
.lccr-k-dots { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.lccr-k-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}
.lccr-k-dot[aria-current="true"] { background: var(--wp--preset--color--accent); border-color: var(--wp--preset--color--accent); }
.lccr-k-pause {
	border: 0;
	background: rgba(255, 255, 255, 0.85);
	color: var(--wp--preset--color--primary-dark);
	border-radius: 999px;
	font-size: 0.7rem;
	width: 28px;
	height: 28px;
	cursor: pointer;
}
:where(.lccr-k-btn, .lccr-k-dot, .lccr-k-pause):focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.35em;
}

.lccr-card {
	border-top: 4px solid var(--wp--preset--color--accent);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lccr-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 34, 102, 0.12);
}

.lccr-footer a {
	color: inherit;
	text-decoration-color: var(--wp--preset--color--accent);
}

.lccr-todo {
	background: #fff4cc;
	border-left: 4px solid var(--wp--preset--color--accent);
	padding: 0.75em 1em;
}

.wp-block-gallery img {
	border-radius: 4px;
}

:where(a:focus-visible, button:focus-visible) {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.lccr-card {
		transition: none;
	}
}

/* Kopfbereich Desktop: Titel umbrechen statt Menü */
@media (min-width: 600px) {
	.lccr-header .wp-block-site-title { max-width: 15em; }
	.lccr-header .wp-block-navigation__container { flex-wrap: nowrap; }
}
@media (min-width: 600px) and (max-width: 1199px) {
	.lccr-header .wp-block-navigation { font-size: 0.92rem; }
	.lccr-header .wp-block-navigation .wp-block-navigation__container { gap: 0.9em; }
	.lccr-tagline { display: none; }
}

/* Karussell direkt an das Titelbild anschließen */
.lccr-karussell-wrap { margin-block: 0 !important; }
.lccr-karussell-wrap + * { margin-block-start: 0 !important; }

/* Tablet (600–1023 px): Menü als ☰-Overlay statt Umbruch */
@media (min-width: 600px) and (max-width: 1023px) {
	.lccr-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.lccr-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.lccr-header .wp-block-site-title { max-width: none; }
}
@media (min-width: 1024px) {
	.lccr-header .wp-block-navigation-item__content { white-space: nowrap; }
}

/* Logos nicht zusammendrücken lassen; der Titel bricht stattdessen um */
.lccr-header-logos, .lccr-header-logos .wp-block-image { flex-shrink: 0; }
.lccr-header-logos .wp-block-image { width: auto !important; }
@media (max-width: 480px) {
	.lccr-header-logos { gap: 0.35rem !important; }
	.lccr-header .wp-block-site-title { font-size: 0.88rem; }
}

/* Karussell: Bildausschnitt leicht nach oben, damit Köpfe sichtbar bleiben */
.lccr-k-img { object-position: 50% 30%; }

/* Karussell: Hochformat-Fotos vollständig zeigen, Rand mit unscharfer Kopie */
.lccr-k-slide.is-portrait { overflow: hidden; }
.lccr-k-blur {
	position: absolute;
	inset: -40px;
	background-size: cover;
	background-position: center;
	filter: blur(28px) brightness(0.55) saturate(1.2);
	transform: scale(1.1);
}
.lccr-k-slide.is-portrait .lccr-k-img {
	position: relative;
	object-fit: contain;
	object-position: center;
}
