/*
Theme Name: Fahrspur
Theme URI: https://photolium.de/
Author: photolium – Tom
Author URI: https://photolium.de/
Description: Block-Theme für Fahrschulen. Fertige Vorlagen für Startseite, Führerscheinklassen, Preise nach § 32 Fahrlehrergesetz, Theorieunterricht, Über uns, Kontakt, Impressum und Datenschutz. Schriften lokal eingebunden, keine externen Anfragen. Vier Farbvarianten, Musterinhalte für eine Fahrschule mit Auto, Motorrad und Lkw.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fahrspur
Tags: block-patterns, full-site-editing, one-column, custom-colors, editor-style, wide-blocks, business
*/

/* ---------------------------------------------------------
   Ergänzungen zu theme.json (Frontend + Editor)
   --------------------------------------------------------- */

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

/* Kein Abstand zwischen Kopf, Inhalt und Fuß */
.wp-site-blocks > main,
.wp-site-blocks > footer { margin-block-start: 0; }
:where(section, [id]) { scroll-margin-top: 110px; }

/* Sichtbarer Fokus für Tastaturnutzer */
:where(a, button, summary, input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}
.has-dark-background-color :where(a, button, summary):focus-visible,
.has-primary-background-color :where(a, button, summary):focus-visible {
	outline-color: var(--wp--preset--color--accent);
}

/* Header: bleibt beim Scrollen oben, unten eine Linie in Signalgelb */
.fs-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}
.admin-bar .fs-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .fs-header { top: 46px; } }

/* Kennzeile über Überschriften mit gestrichelter Leitlinie */
.fs-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
}
.fs-eyebrow::before {
	content: "";
	width: 40px;
	height: 4px;
	flex: none;
	background: repeating-linear-gradient(90deg, var(--wp--preset--color--accent) 0 12px, transparent 12px 18px);
}

/* Hero: Foto daneben */
.fs-hero .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	border-radius: 12px;
}

/* Karten */
.fs-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	height: 100%;
}
.fs-card .wp-block-image img { border-radius: 8px; }
.fs-card-accent { border-top: 4px solid var(--wp--preset--color--accent); }

/* Klassen-Kürzel als kleines Schild */
.fs-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	padding: 0.15rem 0.5rem;
	border-radius: 6px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	line-height: 1.5;
}

/* Klassenliste: Kürzel links, Beschreibung rechts */
.fs-classes { list-style: none; padding-left: 0; }
.fs-classes li {
	display: grid;
	grid-template-columns: 3.5rem 1fr;
	gap: 0.75rem;
	align-items: baseline;
	padding: 0.5rem 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.fs-classes li strong {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	color: var(--wp--preset--color--primary);
}

/* Schritte: Nummer im quadratischen Schild */
.fs-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 8px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	line-height: 1;
}

/* Vorteile auf dunklem Grund: Symbolfläche in Signalgelb */
.fs-feature-mark {
	width: 2.5rem;
	height: 6px;
	border-radius: 3px;
	background: var(--wp--preset--color--accent);
}

/* Raster mit vier Elementen: feste Spalten 4 / 2 / 1 statt 3 + 1 */
.wp-block-group.fs-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .wp-block-group.fs-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .wp-block-group.fs-grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Listen mit Punkt */
.fs-list { list-style: none; padding-left: 0; }
.fs-list li { position: relative; padding-left: 1.5rem; }
.fs-list li + li { margin-top: 0.5rem; }
.fs-list li::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 0.62em;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 2px;
	background: var(--wp--preset--color--primary);
}

/* Preistabelle */
.fs-prices table { border-collapse: collapse; width: 100%; }
.fs-prices th,
.fs-prices td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.7rem 0.75rem;
	text-align: left;
	vertical-align: top;
}
.fs-prices thead th {
	background: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--on-dark);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}
.fs-prices td + td,
.fs-prices th + th { text-align: right; white-space: nowrap; }
.fs-prices tbody tr:nth-child(even) { background: var(--wp--preset--color--soft); }
@media (max-width: 600px) {
	.fs-prices table { font-size: var(--wp--preset--font-size--small); }
	.fs-prices th,
	.fs-prices td { padding: 0.6rem 0.4rem; }
	.fs-prices thead th + th { white-space: normal; }
}
.fs-prices figcaption { margin-top: 0.75rem; }

/* Termine (Theorie) */
.fs-times { list-style: none; padding-left: 0; }
.fs-times li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.fs-times li strong { font-weight: 700; }

/* FAQ (Details-Block) */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1rem 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--large);
	list-style: none;
	display: flex;
	align-items: center;
	min-height: 44px;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	margin-left: auto;
	padding-left: 1rem;
	font-size: 1.5rem;
	font-weight: 400;
	color: var(--wp--preset--color--primary);
}
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details > :not(summary) { margin-top: 0.5rem; }

/* Platzhalter-Kästen (Porträt, Formular) */
.fs-placeholder {
	border: 2px dashed var(--wp--preset--color--line);
	border-radius: 12px;
	text-align: center;
}
.fs-portrait {
	aspect-ratio: 4 / 5;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Touch-Ziele im Header mindestens 44 px (Menü-Button nur auf kleinen Bildschirmen sichtbar) */
@media (max-width: 599px) {
	.fs-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		min-width: 44px;
		min-height: 44px;
		align-items: center;
		justify-content: center;
	}
}
.fs-header .wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	align-items: center;
	justify-content: center;
}
.fs-header .fs-header-cta .wp-block-button__link { min-height: 44px; display: inline-flex; align-items: center; }

/* Button im Header auf kleinen Bildschirmen kompakter */
@media (max-width: 600px) {
	.fs-header .fs-header-cta .wp-block-button__link { padding: 0.55rem 0.9rem; font-size: 0.9375rem; }
}

/* Links auf dunklem Grund */
.has-dark-background-color a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--on-dark); }

/* Buttons auf Signalgelb: dunkel */
.has-accent-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background: var(--wp--preset--color--dark);
	border-color: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--on-dark);
}
.has-accent-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background: transparent;
	color: var(--wp--preset--color--on-accent);
}
.has-accent-background-color a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--on-accent); }

/* Beginnt oder endet eine Seite mit einem vollbreiten Abschnitt, entfällt der zusätzliche Seitenabstand */
main .wp-block-post-content:has(> .alignfull:last-child) { padding-bottom: 0 !important; }
main .wp-block-post-content:has(> .alignfull:first-child) { padding-top: 0 !important; }
