/*
Theme Name: Schlawuzis Pilgertagebuch
Theme URI: https://www.leikra.de
Author: Alexander
Description: Block-Theme für das Pilgertagebuch auf leikra.de. Diashow im Kopf, eine Kachel je Pilgerreise, Reiseübersicht chronologisch vom Prolog bis zum letzten Tag, ruhige Leseansicht für Beiträge.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: schlawuzis
*/

/* ---------- Grundlagen ---------- */
body { position: relative; }
img { max-width: 100%; height: auto; }

/* ---------- Kopfleiste über dem Bild ---------- */
.kopfleiste {
	position: absolute;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 20;
	background: rgba(16, 22, 28, 0.55);
}
.kopfleiste a,
.kopfleiste .wp-block-navigation-item__content { color: #fff; text-decoration: none; }
.kopfleiste a:hover { color: #F2C230; }
.kopfleiste .wp-block-navigation__responsive-container-open,
.kopfleiste .wp-block-navigation__responsive-container-close { color: #fff; }
.kopfleiste .wp-block-site-title a { font-weight: 700; display: inline-flex; align-items: center; gap: 12px; }
.kopfleiste .wp-block-site-title a::before {
	content: "";
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 14h16M14 6l8 8-8 8' fill='none' stroke='%23F2C230' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Seiten ohne großes Kopfbild bekommen Abstand unter der Leiste */
.ohne-kopfbild { padding-top: 112px; }

/* ---------- Kopfbild, Diashow, Reisekopf, Beitragskopf ---------- */
.held {
	position: relative;
	height: 50vh;
	min-height: 360px;
	max-height: 640px;
	overflow: hidden;
	background: #1D2731;
	margin: 0;
}
.held > img,
.held .dia {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.held .dia { opacity: 0; transition: opacity 1.2s ease; }
.held .dia.ist-aktiv { opacity: 1; }
.held-panel {
	position: absolute;
	left: clamp(16px, 4vw, 56px);
	bottom: 40px;
	max-width: min(760px, calc(100% - 32px));
	box-sizing: border-box;
	padding: 24px 28px;
	background: rgba(16, 22, 28, 0.72);
	color: #fff;
	z-index: 5;
}
.held-panel .ueberzeile {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 14px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #F2C230;
}
.held-panel h1,
.held-panel .wp-block-post-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--bricolage);
	font-weight: 700;
	font-size: clamp(28px, 4vw, 50px);
	line-height: 1.08;
	color: #fff;
}
.held-panel .unterzeile { margin: 10px 0 0; font-size: 20px; line-height: 1.4; color: #E4E7EA; }
.held-panel a { color: inherit; text-decoration: none; }
.held .punkte {
	position: absolute;
	right: clamp(16px, 4vw, 56px);
	bottom: 44px;
	display: flex;
	gap: 4px;
	z-index: 6;
}
.held .punkte button {
	width: 32px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.held .punkte span {
	display: block;
	width: 12px;
	height: 12px;
	box-sizing: border-box;
	border: 2px solid #fff;
	border-radius: 50%;
}
.held .punkte button[aria-current="true"] span { background: #F2C230; }

/* Beitragskopf (Cover mit Beitragsbild) */
.wp-block-cover.beitragskopf { min-height: 50vh !important; max-height: 640px; padding: 0 !important; align-items: flex-end; }
.wp-block-cover.beitragskopf .wp-block-cover__inner-container { width: 100%; max-width: none; position: static; }
.wp-block-cover.beitragskopf .held-panel .wp-block-post-terms,
.wp-block-cover.beitragskopf .held-panel .wp-block-post-date { display: inline; }

/* ---------- Kacheln (Reisen) und Karten (Beiträge) ---------- */
.kacheln {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
}
.kachel,
.wp-block-post-template.karten > li {
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1D2731;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(29, 39, 49, 0.08);
	transition: transform 0.25s ease;
	overflow: hidden;
}
.kachel:hover,
.wp-block-post-template.karten > li:hover { transform: translateY(-3px); }
.kachel .bild,
.karten .wp-block-post-featured-image { overflow: hidden; background: #DADCD8; margin: 0; }
.kachel .bild { aspect-ratio: 16 / 10; }
.kachel img,
.karten .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.kachel:hover img,
.karten > li:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.kachel .text { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.kachel .meta,
.karten .wp-block-post-date {
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5A6470;
}
.kachel .name { font-family: var(--wp--preset--font-family--bricolage); font-weight: 700; font-size: 24px; line-height: 1.2; }
.kachel .route { font-size: 18px; line-height: 1.45; color: #4F5A66; }
.karten > li { padding-bottom: 22px; }
.karten > li > :not(.wp-block-post-featured-image) { padding-left: 20px; padding-right: 20px; }
.karten .wp-block-post-date { margin-top: 18px; }
.karten .wp-block-post-title {
	margin: 8px 0 0;
	font-size: 22px;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.5em;
}
.karten .wp-block-post-title a { color: #1D2731; text-decoration: none; }
.karten .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.karten > li { position: relative; }

/* ---------- Beitragsinhalt ---------- */
.wp-block-post-content img { max-width: 100%; height: auto; display: block; }
.wp-block-post-content p > img { margin: 0 0 24px; }
.wp-block-post-content blockquote { margin: 0; padding: 0; border: 0; }
.wp-block-post-content h2.is-wissenswertes {
	margin-top: 48px;
	margin-bottom: 0;
	padding: 28px 32px 12px;
	background: #E8EEF1;
	font-size: 22px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.wp-block-post-content h2.is-wissenswertes::before {
	content: "";
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M3 11h12M11 5l6 6-6 6' fill='none' stroke='%231F5C7A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.wp-block-post-content h2.is-wissenswertes + ul,
.wp-block-post-content h2.is-wissenswertes + .wp-block-list {
	margin-top: 0;
	padding: 4px 32px 28px 52px;
	background: #E8EEF1;
	font-size: 18px;
	line-height: 1.6;
}
.wp-block-post-content h2.is-wissenswertes + ul li + li { margin-top: 10px; }

/* ---------- Brotkrumen, Nachbartage, Reisenavigation ---------- */
.brotkrumen { font-family: var(--wp--preset--font-family--bricolage); font-size: 15px; color: #5A6470; }
.nachbarn {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
}
.nachbarn a {
	display: flex;
	gap: 16px;
	align-items: center;
	background: #fff;
	padding: 14px;
	color: #1D2731;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(29, 39, 49, 0.08);
	transition: transform 0.25s ease;
}
.nachbarn a:hover { transform: translateY(-3px); }
.nachbarn a.weiter { justify-content: flex-end; text-align: right; }
.nachbarn img { width: 112px; height: 84px; object-fit: cover; flex-shrink: 0; }
.nachbarn .richtung {
	display: block;
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5A6470;
}
.nachbarn .titel { display: block; font-family: var(--wp--preset--font-family--bricolage); font-weight: 700; font-size: 19px; line-height: 1.25; }
.reisenav {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
	border-top: 1px solid #D5D8D3;
	padding-top: 32px;
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 17px;
}
.reisenav a { min-height: 48px; display: inline-flex; align-items: center; }
.startknopf {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	min-height: 48px;
	box-sizing: border-box;
	background: #1D2731;
	color: #fff !important;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 16px;
}
.startknopf:hover { background: #2C3A47; }

@media (prefers-reduced-motion: reduce) {
	.held .dia, .kachel, .kachel img, .karten > li, .karten img, .nachbarn a { transition: none; }
}
@media (max-width: 600px) {
	.held-panel { bottom: 72px; padding: 18px 20px; }
	.held .punkte { right: 50%; transform: translateX(50%); bottom: 16px; }
}

/* ---------- Abstände zwischen den Hauptbereichen ---------- */
.wp-site-blocks > * { margin-block-start: 0; }
.wp-site-blocks > .wp-block-template-part:last-child { margin-top: 0; }

/* Überzeile im Beitragskopf (Kategorie · Datum) */
.held-panel .ueberzeile { margin: 0 0 8px; }
.held-panel .ueberzeile p,
.held-panel .ueberzeile a,
.held-panel .ueberzeile .wp-block-post-date,
.held-panel .ueberzeile .wp-block-post-terms {
	margin: 0;
	font-family: var(--wp--preset--font-family--bricolage);
	font-size: 14px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #F2C230;
}
.wp-block-query-title { margin-top: 0; }

/* Menü in der Kopfleiste immer hell, Untermenüs dunkel */
.kopfleiste .wp-block-navigation a,
.kopfleiste .wp-block-navigation .wp-block-navigation-item__content,
.kopfleiste .wp-block-navigation .wp-block-navigation-submenu__toggle,
.kopfleiste .wp-block-navigation .wp-block-pages-list__item__link { color: #fff !important; }
.kopfleiste .wp-block-navigation a:hover { color: #F2C230 !important; }
.kopfleiste .wp-block-navigation__submenu-icon svg { stroke: #fff; }
.kopfleiste .wp-block-navigation .wp-block-navigation__submenu-container {
	background: #1D2731 !important;
	border: 0 !important;
	padding: 8px 0;
}
.kopfleiste .wp-block-navigation__responsive-container.is-menu-open { background: #1D2731 !important; color: #fff !important; }
