/* ==========================================================================
   Stolpersteine Bad Mergentheim – Theme-Styles
   Farben, Schriften und Größen stehen in theme.json.
   ========================================================================== */

/* ==========================================================================
   EINSTELLUNGEN – hier kannst du die wichtigsten Werte selbst ändern
   ========================================================================== */
:root {
	--banner-breite: 1200px;                 /* max. Breite des Banners (Originalgröße = 1200px, kleiner = niedriger) */
	--pfeil-groesse: 44px;                   /* Größe des Nach-oben-Pfeils */
	--pfeil-farbe: var(--wp--preset--color--menu);
	--pfeil-farbe-hover: var(--wp--preset--color--accent);
}

html {
	scroll-behavior: smooth;
}

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

/* Template-Teile (Banner, Menü, Footer) ohne Abstand untereinander */
.wp-site-blocks > * {
	margin-block-start: 0 !important;
}

/* --- Banner ------------------------------------------------------------- */

.site-header {
	background: var(--wp--preset--color--base);
}

/* Banner: höchstens so breit wie der Inhalt (und wie --banner-breite) */
.site-banner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 12px 24px 0;
}

.site-banner__link {
	display: block;
	max-width: var(--banner-breite);
	margin: 0 auto;
}

.site-banner__image {
	display: block;
	width: 100%;
	height: auto;
}

/* --- Sticky-Menü ---------------------------------------------------------
   Das Menü ist ein eigenes Template-Teil direkt unter .wp-site-blocks.
   Dadurch klebt es oben fest, während der Banner darüber wegscrollt. */

.site-nav {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--wp--preset--color--menu);
}

.admin-bar .site-nav {
	top: 32px;
}

/* Wird per JavaScript gesetzt, falls "sticky" vom Browser/Umfeld blockiert wird */
.site-nav.is-stuck {
	position: fixed;
	left: 0;
	right: 0;
	width: auto;
}

.site-nav-sentinel {
	height: 0;
}

@media (max-width: 782px) {
	.admin-bar .site-nav {
		top: 46px;
	}
}

.site-menu {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 24px;
}

.site-menu__list,
.site-menu__list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-menu__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.site-menu__list li {
	position: relative;
	margin: 0;
}

.site-menu__list a {
	display: block;
	padding: 14px 13px;
	color: var(--wp--preset--color--base);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.43;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.4s;
}

.site-menu__list a:hover,
.site-menu__list a:focus-visible,
.site-menu__list .current-menu-item > a,
.site-menu__list .current-menu-ancestor > a,
.site-menu__list .current_page_item > a,
.site-menu__list .current_page_ancestor > a {
	color: var(--wp--preset--color--accent);
}

/* Untermenü (z. B. Sprachauswahl von WPGlobus) */
.site-menu__list .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 100%;
	background: var(--wp--preset--color--submenu);
}

.site-menu__list li:hover > .sub-menu,
.site-menu__list li:focus-within > .sub-menu {
	display: block;
}

.site-menu__list .sub-menu a {
	padding: 10px 13px;
}

/* Hamburger-Schalter: nur auf kleinen Bildschirmen sichtbar */
.site-menu__toggle {
	display: none;
}

@media (max-width: 700px) {
	.js .site-menu__toggle {
		display: flex;
		align-items: center;
		gap: 12px;
		margin-left: auto;
		padding: 12px 0;
		background: none;
		border: 0;
		color: var(--wp--preset--color--base);
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}

	.js .site-menu__toggle:hover,
	.js .site-menu__toggle:focus-visible {
		color: var(--wp--preset--color--accent);
	}

	.site-menu__icon,
	.site-menu__icon::before,
	.site-menu__icon::after {
		display: block;
		width: 24px;
		height: 3px;
		background: currentColor;
		border-radius: 2px;
		transition: transform 0.2s, top 0.2s, background-color 0.2s;
	}

	.site-menu__icon {
		position: relative;
	}

	.site-menu__icon::before,
	.site-menu__icon::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.site-menu__icon::before {
		top: -8px;
	}

	.site-menu__icon::after {
		top: 8px;
	}

	.site-menu.is-open .site-menu__icon {
		background: transparent;
	}

	.site-menu.is-open .site-menu__icon::before {
		top: 0;
		transform: rotate(45deg);
	}

	.site-menu.is-open .site-menu__icon::after {
		top: 0;
		transform: rotate(-45deg);
	}

	.js .site-menu__list {
		display: none;
		flex-direction: column;
		padding-bottom: 8px;
	}

	.js .site-menu.is-open .site-menu__list {
		display: flex;
	}

	.site-nav.is-stuck {
		max-height: 100vh;
		overflow-y: auto;
	}

	.site-menu__list a {
		white-space: normal;
	}

	.site-menu__list .sub-menu {
		display: block;
		position: static;
		margin-left: 16px;
		background: var(--wp--preset--color--submenu);
	}
}

/* --- Hauptbereich -------------------------------------------------------- */

.site-main {
	padding: 24px 24px 48px;
}

.wp-block-post-title {
	margin-top: 0.4em;
}

/* --- Biographien: zwei Spalten ------------------------------------------ */

.biographien-layout {
	gap: 40px;
}

.single-biographie .wp-block-post-title {
	color: var(--wp--preset--color--button);
}

.biographien-sidebar {
	font-size: 16px;
}

.biographien-sidebar .wp-block-search {
	margin-bottom: 24px;
}

.biographien-sidebar h5 {
	margin: 24px 0 8px;
}

.biographien-sidebar h5 a {
	color: var(--wp--preset--color--text);
}

.biographien-sidebar h6 {
	margin: 16px 0 6px;
	font-size: 18px;
}

/* Liste: Quadrat mit abgerundeten Ecken als Aufzählungszeichen */
.biographien-liste {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.biographien-liste__item {
	position: relative;
	margin: 0 0 8px;
	padding-left: 26px;
	font-weight: 500;
	line-height: 1.4;
}

.biographien-liste__item::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 0.42em;
	box-sizing: border-box;
	width: 0.75em;
	height: 0.75em;
	border: 2px solid var(--wp--preset--color--accent);
	border-radius: 3px;
	background: var(--wp--preset--color--accent);
}

/* ohnestein: gleiches Quadrat, aber ohne Füllung */
.biographien-liste__item.bio-ohnestein::before {
	background: transparent;
}

/* mitbio: etwas fetter */
.biographien-liste__item.bio-mitbio {
	font-weight: 800;
}

.biographien-liste__item a {
	text-decoration: none;
}

.biographien-liste__item a:hover,
.biographien-liste__item.is-current a {
	text-decoration: underline;
}

/* Suchfeld (weiß wie bisher) */
.wp-block-search__input {
	background: var(--wp--preset--color--white);
	border: 1px solid #c8c5ba;
	padding: 10px 12px;
	font-weight: 600;
}

.wp-block-search__button {
	background: var(--wp--preset--color--button);
	color: var(--wp--preset--color--white);
	border: 0;
}

/* --- Startseite: Aktuelles (max. 3 Spalten) ------------------------------ */

.aktuelles-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.aktuelles-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.aktuelles-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.aktuelles-item {
	margin: 0;
}

.aktuelles-item__thumb {
	display: block;
}

.aktuelles-item__image {
	display: block;
	width: 100%;
	height: auto;
}

.aktuelles-item__title {
	margin: 12px 0 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.aktuelles-item__title a {
	text-decoration: none;
}

.aktuelles-item__title a:hover {
	text-decoration: underline;
}

/* --- Footer ---------------------------------------------------------------- */

.site-footer {
	padding: 24px;
	background: var(--wp--preset--color--footer);
	color: var(--wp--preset--color--white);
	text-align: center;
}

.site-footer p {
	margin: 6px 0 0;
	font-size: 14px;
	font-weight: 400;
}

.footer-menu__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-menu__list li {
	margin: 0;
}

.footer-menu__list a {
	color: var(--wp--preset--color--white);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
}

.footer-menu__list a:hover,
.footer-menu__list a:focus-visible {
	color: var(--wp--preset--color--accent);
}

/* --- Schwebender Pfeil nach oben (nur ein offenes Dreieck) ----------------- */

.to-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--pfeil-groesse);
	height: var(--pfeil-groesse);
	padding: 0;
	background: none;
	color: var(--pfeil-farbe);
	border: 0;
	cursor: pointer;
	filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.6));
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s, color 0.3s, transform 0.2s;
}

.to-top svg {
	display: block;
	width: 100%;
	height: 100%;
}

.to-top.is-visible {
	opacity: 1;
	visibility: visible;
}

.to-top:hover,
.to-top:focus-visible {
	color: var(--pfeil-farbe-hover);
	transform: translateY(-3px);
}
