/*
Theme Name: einschpunk
Theme URI: https://www.einschpunk.de
Author: Nico Buschmann
Description: Block-Theme im einschpunk-Design: Papier, Grund, Tanne, ein bisschen Punk. Londrina Solid, Archivo, Lora (lokal eingebunden, keine Google-Verbindung).
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: einschpunk
*/

/* ---------- Grundlagen ---------- */
:root {
	--ep-radius-karte: 20px;
	--ep-radius-bild: 24px;
	--ep-schatten: 0 12px 32px rgba(20, 32, 27, .25);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--tanne); color: var(--wp--preset--color--papier); }

:where(a, button, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--punk);
	outline-offset: 3px;
	border-radius: 4px;
}

.ep-skip-link {
	position: absolute; left: -999px; top: 0; z-index: 1000;
	background: var(--wp--preset--color--grund); color: var(--wp--preset--color--papier);
	padding: .75rem 1rem;
}
.ep-skip-link:focus { left: 1rem; top: 1rem; }

/* Headlines: max. 2 Zeilen, nie zu breit */
h1, h2, .wp-block-post-title { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- Kopfzeile ---------- */
.ep-header {
	position: sticky; top: 0; z-index: 50;
	border-bottom: 1px solid var(--wp--preset--color--linie);
	backdrop-filter: saturate(1.2) blur(6px);
	background: color-mix(in srgb, var(--wp--preset--color--papier) 92%, transparent) !important;
}
.admin-bar .ep-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ep-header { top: 46px; } }
.ep-header .wp-block-site-title a:hover { color: var(--wp--preset--color--tanne); }
.ep-header .wp-block-navigation-item.current-menu-item > a,
.ep-header .wp-block-navigation-item a[aria-current="page"] {
	text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--tanne);
}
.ep-header .wp-block-navigation a:hover { color: var(--wp--preset--color--tanne); }
.ep-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--grund) !important; color: var(--wp--preset--color--papier) !important;
	font-family: var(--wp--preset--font-family--head); font-size: 2.25rem; font-weight: 900;
}

/* ---------- Block-Stile ---------- */

/* Label: kleine Überzeile über Titeln */
.is-style-label {
	font-size: var(--wp--preset--font-size--klein) !important;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	line-height: 1.3;
	margin-bottom: .5rem !important;
}

/* Karte */
.is-style-karte {
	background: var(--wp--preset--color--karte);
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: var(--ep-radius-karte);
	padding: clamp(1.5rem, 3vw, 2.5rem) !important;
	color: var(--wp--preset--color--grund);
}
.is-style-karte h3 { color: var(--wp--preset--color--tanne); }

/* Cover-Bild (9:16 / Buch) mit weichem Schatten */
.is-style-cover img { border-radius: 16px !important; box-shadow: var(--ep-schatten); }

/* Liste mit Leitbegriff */
ul.is-style-leitbegriff { list-style: none; padding: 0; margin-left: 0; }
ul.is-style-leitbegriff > li {
	display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: .25rem 1.5rem;
	padding: 1rem 0; border-top: 1px solid var(--wp--preset--color--linie);
}
ul.is-style-leitbegriff > li:last-child { border-bottom: 1px solid var(--wp--preset--color--linie); }
ul.is-style-leitbegriff > li > strong:first-child { color: var(--wp--preset--color--tanne); }
.has-tanne-background-color ul.is-style-leitbegriff > li > strong:first-child,
.has-grund-background-color ul.is-style-leitbegriff > li > strong:first-child { color: var(--wp--preset--color--glut); }
.has-tanne-background-color ul.is-style-leitbegriff > li,
.has-grund-background-color ul.is-style-leitbegriff > li { border-color: rgba(244,239,228,.25); }
@media (max-width: 600px) { ul.is-style-leitbegriff > li { grid-template-columns: 1fr; } }

/* Zahl groß (Trennfolien-Nummer) */
.ep-nummer { font-family: var(--wp--preset--font-family--head); font-weight: 900; line-height: .9; }

/* Bilder in Sektionen */
.wp-block-image.ep-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--ep-radius-bild); }

/* Buttons */
.wp-block-button.is-style-punk .wp-block-button__link {
	background: var(--wp--preset--color--punk); color: var(--wp--preset--color--papier);
}
.wp-block-button.is-style-punk .wp-block-button__link:hover { background: #b92f68; }
.wp-block-button.is-style-hell .wp-block-button__link {
	background: var(--wp--preset--color--papier); color: var(--wp--preset--color--grund);
}
.wp-block-button.is-style-hell .wp-block-button__link:hover { background: var(--wp--preset--color--karte); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; border: 2px solid currentColor; padding: calc(.8rem - 2px) calc(1.6rem - 2px);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: rgba(127,127,127,.12); }

/* Textlinks auf dunklen Flächen */
.has-grund-background-color a:not(.wp-block-button__link),
.has-tanne-background-color a:not(.wp-block-button__link) { color: var(--wp--preset--color--papier); }

/* ---------- Beitragskarten (Blog) ---------- */
.ep-beitraege .wp-block-post {
	background: var(--wp--preset--color--karte);
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: var(--ep-radius-karte);
	overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform .2s ease, box-shadow .2s ease;
}
.ep-beitraege .wp-block-post:hover { transform: translateY(-3px); box-shadow: var(--ep-schatten); }
.ep-beitraege .wp-block-post-featured-image { margin: 0; }
.ep-beitraege .wp-block-post-featured-image img { border-radius: 0 !important; aspect-ratio: 16/10; object-fit: cover; }
.ep-beitraege .ep-karte-text { padding: 1.5rem 1.75rem 1.75rem; }
.ep-beitraege .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.ep-beitraege .wp-block-post { position: relative; }

/* ---------- Einzelbeitrag ---------- */
.ep-artikel .wp-block-post-content > p:first-of-type { font-size: var(--wp--preset--font-size--gross); line-height: 1.4; }
.ep-artikel .wp-block-post-content h2 { font-size: 2.25rem; margin-top: 3rem; }
.ep-artikel .wp-block-post-content h3 { margin-top: 2.25rem; }
.ep-artikel .wp-block-post-content blockquote { font-family: var(--wp--preset--font-family--quote); font-style: italic; font-size: 1.375rem; border-left: 4px solid var(--wp--preset--color--tanne); padding-left: 1.5rem; margin-left: 0; }

/* ---------- Presse-Zeitleiste ---------- */
.ep-presse-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.ep-chip {
	font: 600 1rem/1 var(--wp--preset--font-family--body);
	padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer;
	background: transparent; color: var(--wp--preset--color--grund);
	border: 1px solid var(--wp--preset--color--linie);
}
.ep-chip:hover { border-color: var(--wp--preset--color--tanne); }
.ep-chip[aria-pressed="true"] { background: var(--wp--preset--color--tanne); color: var(--wp--preset--color--papier); border-color: var(--wp--preset--color--tanne); }
.ep-presse-jahr { scroll-margin-top: 6rem; }
.ep-presse-jahr[hidden] { display: none; }
ul.ep-presse > li[hidden] { display: none; }
ul.ep-presse > li .ep-meta { display: block; font-size: var(--wp--preset--font-size--klein); color: var(--wp--preset--color--gedaempft); }

/* ---------- Fußzeile ---------- */
.ep-footer a { text-decoration: none; }
.ep-footer a:hover { text-decoration: underline; }
.ep-footer .wp-block-navigation { font-weight: 500; }

/* ---------- Kleinkram ---------- */
.ep-platzhalter { color: var(--wp--preset--color--punk); font-weight: 700; }
.wp-block-separator { border-top-width: 1px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ---------- Einzelnes Reel ---------- */
.ep-reel-einzeln__raster { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.ep-reel-einzeln__inhalt { display: contents; }
.ep-reel-einzeln__inhalt > .wp-block-video { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
.ep-reel-einzeln__inhalt > .wp-block-video video { height: min(78vh, 720px); width: auto; max-width: 100%; aspect-ratio: 9/16; object-fit: contain; background: #000; border-radius: 16px; }
.ep-reel-einzeln__inhalt > :not(.wp-block-video) { grid-column: 2; max-width: 40ch; margin: 0; }
.ep-reel-einzeln__kopf { grid-column: 2; grid-row: 1; align-self: end; }
.ep-reel-einzeln__kopf .wp-block-post-title { margin: .25rem 0 .75rem; }
.ep-reel-einzeln__kopf .wp-block-post-date { color: var(--wp--preset--color--papier); opacity: .8; }
.ep-reel-einzeln__kopf .wp-block-post-terms a { color: var(--wp--preset--color--glut) !important; text-decoration: none; }
@media (max-width: 760px) {
	.ep-reel-einzeln__raster { grid-template-columns: 1fr; }
	.ep-reel-einzeln__kopf, .ep-reel-einzeln__inhalt > * { grid-column: 1 !important; grid-row: auto !important; }
	.ep-reel-einzeln__inhalt > .wp-block-video video { height: auto; width: 100%; max-height: 75vh; }
}

/* ---------- Zitate ---------- */
.wp-block-pullquote { padding: 0; margin: 0; }
.wp-block-pullquote blockquote p { font-size: inherit; line-height: 1.2; }
.wp-block-pullquote cite {
	display: block; margin-top: 1.5rem;
	font-family: var(--wp--preset--font-family--body); font-style: normal; font-weight: 700;
	font-size: var(--wp--preset--font-size--klein); letter-spacing: .1em; text-transform: uppercase;
	color: var(--wp--preset--color--tanne);
}
.has-grund-background-color .wp-block-pullquote cite,
.has-tanne-background-color .wp-block-pullquote cite { color: var(--wp--preset--color--glut); }
.has-tanne-background-color .wp-block-pullquote cite { color: var(--wp--preset--color--papier); opacity: .85; }

/* Presse: Medium links, Datum + Titel rechts */
ul.ep-presse > li { align-items: start; }
ul.ep-presse > li > strong:first-child { grid-row: 1 / span 2; }
ul.ep-presse > li > .ep-meta, ul.ep-presse > li > a { grid-column: 2; }
ul.ep-presse > li > a { font-weight: 600; text-decoration-color: var(--wp--preset--color--linie); text-underline-offset: 4px; }
ul.ep-presse > li > a:hover { text-decoration-color: currentColor; }
@media (max-width: 600px) { ul.ep-presse > li > strong:first-child { grid-row: auto; } ul.ep-presse > li > .ep-meta, ul.ep-presse > li > a { grid-column: 1; } }

/* ---------- Ab Version 2.0: Konto, Workshops, Presse, Bereich ---------- */

/* Konto-Link in der Kopfzeile */
.ep-konto { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: 1.0625rem; text-decoration: none; color: var(--wp--preset--color--grund); white-space: nowrap; }
.ep-konto:hover { color: var(--wp--preset--color--tanne); }
.ep-konto[aria-current="page"] span { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--wp--preset--color--tanne); }
@media (max-width: 1100px) { .ep-konto span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 480px) { .ep-header-cta { display: none; } }

/* Zweiter Knopf als Kontur (für Knöpfe, die nicht aus dem Editor kommen) */
.wp-element-button.is-kontur { background: transparent !important; color: inherit !important; border: 2px solid currentColor; padding: calc(.8rem - 2px) calc(1.6rem - 2px); }
.wp-element-button.is-kontur:hover { background: rgba(127,127,127,.12) !important; }
a.wp-element-button { display: inline-block; text-decoration: none; }

/* Abschnitte, die nur erscheinen, wenn es Inhalt gibt */
.ep-nur-mit-inhalt:not(:has(.ep-presse:not(.is-leer), .ep-workshops:not(.is-leer))) { display: none; }

/* Label mit Link */
.is-style-label a { text-decoration: none; color: inherit !important; }
.is-style-label a:hover { text-decoration: underline; }

/* Presse-Kacheln auf Karte-Fläche: Karten in Papier */
.has-karte-background-color .ep-pk { background: var(--wp--preset--color--papier); }

/* Einzelner Presse-Eintrag */
.ep-presse-stimme { font-family: var(--wp--preset--font-family--quote); font-style: italic; font-size: var(--wp--preset--font-size--titel); line-height: 1.15; border: 0 !important; padding: 0 !important; margin: 0 0 var(--wp--preset--spacing--50) !important; }
.ep-presse-stimme p { margin: 0; }
.ep-presse-ausschnitt { margin: 0 0 var(--wp--preset--spacing--50); }
.ep-presse-ausschnitt img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--wp--preset--color--linie); box-shadow: var(--ep-schatten); }
.ep-presse-links { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: var(--wp--preset--spacing--50); }

/* Anmelden / Mein Bereich */
.ep-bereich h2 { font-size: var(--wp--preset--font-size--titel); margin: 0 0 1rem; }
.ep-bereich input[type=password] { width: 100%; box-sizing: border-box; font: inherit; padding: .8rem 1rem; border: 1px solid var(--wp--preset--color--linie); border-radius: 12px; background: var(--wp--preset--color--karte); color: var(--wp--preset--color--grund); }
.ep-bereich input[type=password]:focus { outline: 3px solid var(--wp--preset--color--tanne); outline-offset: 1px; border-color: transparent; }
.is-style-karte .ep-bereich input { background: var(--wp--preset--color--papier); }
.ep-bereich__meldung { padding: 1rem 1.25rem; border-radius: 12px; margin: 0 0 1.5rem; }
.ep-bereich__meldung.is-ok { background: var(--wp--preset--color--tanne); color: var(--wp--preset--color--papier); }
.ep-bereich__meldung.is-fehler { background: var(--wp--preset--color--grund); color: var(--wp--preset--color--papier); }
.ep-bereich__knoepfe { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.ep-bereich__klein { font-size: var(--wp--preset--font-size--klein); color: var(--wp--preset--color--gedaempft); font-weight: 400; }
.ep-bereich__hallo { font-family: var(--wp--preset--font-family--head); }
.ep-bereich__teil { margin-bottom: var(--wp--preset--spacing--60); }
.ep-bereich__teil h3 { margin: var(--wp--preset--spacing--50) 0 1rem; }
.ep-bereich__details { margin: 1.5rem 0; border-top: 1px solid var(--wp--preset--color--linie); border-bottom: 1px solid var(--wp--preset--color--linie); padding: 1rem 0; }
.ep-bereich__details summary { cursor: pointer; font-weight: 700; }
.ep-bereich__details form { margin-top: 1.25rem; max-width: 30rem; }
.ep-bereich button { cursor: pointer; border: 0; }

/* Workshop-Kopf auf Grund */
.has-grund-background-color .wp-block-post-excerpt__excerpt { max-width: 46ch; }
.has-grund-background-color .ep-wk-angaben ul.is-style-leitbegriff > li > strong:first-child { color: var(--wp--preset--color--glut); }
.has-grund-background-color .ep-wk-angaben ul.is-style-leitbegriff > li { border-color: rgba(244,239,228,.25); }
