/*
Theme Name: Schreinerei Schuster
Theme URI: https://www.meister-schuster.de/
Author: die Flora / Felix Schuster
Description: Block-Theme für die Schreinerei Markus Schuster, Essen-Heidhausen. Farben und Schriften sind fest hinterlegt, Texte und Bilder im Editor änderbar.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: schuster
*/

/* ---------- Grundlagen ---------- */

:root {
	--grund: var(--wp--preset--color--hobelspan);
	--schnur: var(--wp--preset--color--marke);
	--schnur-text: var(--wp--preset--color--marke-text);
	--linie: var(--wp--preset--color--linie);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

p, li { max-width: 68ch; }
.has-text-align-center { margin-left: auto; margin-right: auto; }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--schnur);
	outline-offset: 3px;
	border-radius: 2px;
}

.screen-reader-text:focus {
	position: fixed; top: .5rem; left: .5rem; z-index: 1000;
	background: #fff; padding: .75rem 1rem; clip: auto; width: auto; height: auto;
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.wp-block-image img { display: block; }

/* Abschnitte mit anderem Grund geben die Farbe an die Maßlinien weiter */
.has-ahorn-background-color { --grund: var(--wp--preset--color--ahorn); }
.has-weiss-background-color { --grund: #fff; }
.has-raeuchereiche-background-color { --grund: var(--wp--preset--color--raeuchereiche); }

/* ---------- Kopfzeile ---------- */

/* Weiße Leiste, das Logo hängt wie auf der alten Seite als graue Kachel von der Oberkante herab. */
.kopf {
	position: relative; z-index: 20;
	background: #fff;
	border-bottom: 1px solid var(--linie);
}
.kopf__leiste { min-height: 5rem; align-items: flex-start !important; }
.kopf__logo {
	flex: none;
	margin: 0 0 -4.25rem;
	padding: 1.1rem 1.15rem .95rem 0;
	background: var(--wp--preset--color--logo-grau);
	position: relative; z-index: 2;
	line-height: 0;
}
.kopf__logo img { width: 150px; height: auto; }
.kopf__rechts { align-self: center; padding-block: 1.1rem; }
@media (max-width: 781px) {
	.kopf__leiste { min-height: 4rem; }
	.kopf__logo { margin-bottom: -2.25rem; padding: .7rem .75rem .6rem 0; }
	.kopf__logo img { width: 104px; }
	.kopf__rechts { padding-block: .6rem; }
}

.kopf .wp-block-navigation a { text-decoration: none; }
.kopf .wp-block-navigation a:hover,
.kopf .wp-block-navigation .current-menu-item > a { text-decoration: underline; text-decoration-color: var(--schnur); text-decoration-thickness: 2px; text-underline-offset: .35em; }

.kopf__telefon .wp-block-button__link { white-space: nowrap; }
@media (max-width: 781px) { .kopf__telefon { display: none !important; } }

/* Menü schon unter 1180 px als Aufklapp-Menü (WordPress schaltet sonst erst unter 600 px um) */
@media (max-width: 1179px) {
	.kopf .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.kopf .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
.kopf .wp-block-navigation__responsive-container-open svg { width: 32px; height: 32px; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem); }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { gap: 1rem; font-size: 1.5rem; font-family: var(--wp--preset--font-family--barlow-condensed); font-weight: 600; }

/* ---------- Maßlinie (Bildstil „Mit Maßlinie“) ----------
   Die Bildunterschrift wird zur Beschriftung einer technischen Maßlinie:
   Hilfslinien an beiden Enden, Schrägstriche als Maßbegrenzung, Text mittig. */

.wp-block-image.is-style-bemasst {
	position: relative;
	padding-bottom: 2.6rem;
	margin-bottom: 0;
}
.wp-block-image.is-style-bemasst::before,
.wp-block-image.is-style-bemasst::after {
	content: "";
	position: absolute;
	pointer-events: none;
}
/* Hilfslinien + Schrägstriche an den Enden */
.wp-block-image.is-style-bemasst::before {
	left: 0; right: 0; bottom: .35rem; height: 1.9rem;
	background:
		linear-gradient(var(--schnur), var(--schnur)) left top / 1px 100% no-repeat,
		linear-gradient(var(--schnur), var(--schnur)) right top / 1px 100% no-repeat,
		linear-gradient(135deg, transparent calc(50% - .75px), var(--schnur) calc(50% - .75px), var(--schnur) calc(50% + .75px), transparent calc(50% + .75px)) left calc(100% - .3rem) / 14px 14px no-repeat,
		linear-gradient(135deg, transparent calc(50% - .75px), var(--schnur) calc(50% - .75px), var(--schnur) calc(50% + .75px), transparent calc(50% + .75px)) right calc(100% - .3rem) / 14px 14px no-repeat;
	transform: translateX(0);
}
/* eigentliche Maßlinie */
.wp-block-image.is-style-bemasst::after {
	left: 0; right: 0; bottom: calc(.35rem + .3rem + 7px); height: 1px;
	background: var(--schnur);
}
.wp-block-image.is-style-bemasst figcaption,
.wp-block-image.is-style-bemasst .wp-element-caption {
	position: absolute;
	left: 50%; bottom: .35rem;
	transform: translateX(-50%);
	z-index: 1;
	width: max-content; max-width: 86%;
	margin: 0;
	padding: 0 .7em;
	background: var(--grund);
	color: var(--schnur-text);
	font-family: var(--wp--preset--font-family--barlow-condensed);
	font-weight: 500;
	font-size: 1rem;
	line-height: 1.6rem;
	letter-spacing: .02em;
	font-variant-numeric: tabular-nums;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
@media (max-width: 600px) {
	.wp-block-image.is-style-bemasst figcaption,
	.wp-block-image.is-style-bemasst .wp-element-caption { font-size: .875rem; }
}

/* ---------- Startseite: Einstieg ---------- */

.einstieg { overflow: clip; }
.einstieg h1 { margin-top: 0; }
.einstieg__text { font-size: var(--wp--preset--font-size--large); line-height: 1.5; color: var(--wp--preset--color--graphit); }
.einstieg__fakten {
	display: flex; flex-wrap: wrap; gap: .4rem 1.5rem;
	padding: 0; margin: 0; list-style: none;
	font-size: .9375rem; color: var(--wp--preset--color--grau);
}
.einstieg__fakten li { padding-left: 1.1rem; position: relative; }
.einstieg__fakten li::before {
	content: ""; position: absolute; left: 0; top: .62em;
	width: .55rem; height: 1px; background: var(--schnur);
}

/* Zweiter Button: Umriss */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--graphit);
	border: 2px solid var(--wp--preset--color--graphit);
	padding: calc(.8em - 2px) calc(1.4em - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--graphit);
	color: #fff;
}

/* ---------- Leistungen ---------- */

.leistung { border-top: 1px solid var(--linie); }
.leistung:last-child { border-bottom: 1px solid var(--linie); }
.leistung h3 { font-size: var(--wp--preset--font-size--x-large); margin-top: 0; }
.leistung ul { padding-left: 0; list-style: none; columns: 14rem 2; column-gap: 2rem; }
.leistung ul li { break-inside: avoid; padding: .2rem 0 .2rem 1.1rem; position: relative; }
.leistung ul li::before {
	content: ""; position: absolute; left: 0; top: .95em;
	width: .55rem; height: 1px; background: var(--schnur);
}
.leistung .wp-block-media-text__media img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Ablauf (echte Reihenfolge, daher nummeriert) ---------- */

.ablauf { counter-reset: schritt; list-style: none; padding: 0; margin: 0;
	display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem;
	position: relative;
}
.ablauf::before {
	content: ""; position: absolute; left: 0; right: 0; top: 1.25rem; height: 1px;
	background: var(--schnur);
}
.ablauf li { counter-increment: schritt; position: relative; padding-top: 3.25rem; max-width: none; }
.ablauf li::before {
	content: counter(schritt);
	position: absolute; top: 0; left: 0;
	width: 2.5rem; height: 2.5rem;
	display: grid; place-items: center;
	background: var(--grund);
	border: 1px solid var(--schnur);
	border-radius: 50%;
	color: var(--schnur-text);
	font-family: var(--wp--preset--font-family--barlow-condensed);
	font-weight: 600; font-size: 1.125rem;
}
.ablauf strong { display: block; font-family: var(--wp--preset--font-family--barlow-condensed); font-size: 1.375rem; font-weight: 600; line-height: 1.15; margin-bottom: .35rem; }
.ablauf span { color: var(--wp--preset--color--grau); font-size: 1rem; line-height: 1.5; display: block; }
@media (max-width: 900px) {
	.ablauf { grid-template-columns: 1fr; gap: 0; }
	.ablauf::before { left: 1.25rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
	.ablauf li { padding: 0 0 1.75rem 3.75rem; }
}

/* ---------- Referenzen ---------- */

.referenzen .wp-block-gallery .wp-block-image img { aspect-ratio: 1; object-fit: cover; }
.referenzen .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	background: linear-gradient(0deg, rgba(20, 18, 16, .78), rgba(20, 18, 16, 0));
	font-size: .9375rem; padding: 2rem .75rem .6rem; text-align: left;
}

.galerie-seite .wp-block-gallery .wp-block-image img { object-fit: cover; }

/* ---------- Zitat Inhaber ---------- */

.inhaber blockquote,
.inhaber .wp-block-quote {
	border: 0; padding: 0; margin: 0;
	font-family: var(--wp--preset--font-family--barlow-condensed);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}
.inhaber .wp-block-quote p { max-width: 30ch; }
.inhaber .wp-block-quote cite {
	display: block; margin-top: 1rem;
	font-family: var(--wp--preset--font-family--barlow);
	font-size: 1rem; font-style: normal; font-weight: 500;
	color: var(--wp--preset--color--grau);
}

/* ---------- Einzugsgebiet ---------- */

.orte { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.orte li {
	border: 1px solid var(--linie); border-radius: 2rem;
	padding: .25rem .85rem; font-size: .9375rem; background: #fff;
}

/* ---------- Anfrage / Formular (Contact Form 7) ---------- */

.anfrage { --grund: var(--wp--preset--color--raeuchereiche); }
.anfrage, .anfrage h2, .anfrage h3 { color: #F2F2F0; }
.anfrage a { color: #fff; }
.anfrage p { color: #D2D3D5; }
.anfrage__telefon {
	font-family: var(--wp--preset--font-family--barlow-condensed);
	font-weight: 600;
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1;
	margin: 0;
}
.anfrage__telefon a { text-decoration: none; color: #fff; }
.anfrage__telefon a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

.wpcf7 form p { margin: 0 0 1rem; max-width: none; }
.wpcf7 label { display: block; font-weight: 500; font-size: 1rem; }
.wpcf7 .feld-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .wpcf7 .feld-reihe { grid-template-columns: 1fr; } }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%; box-sizing: border-box;
	margin-top: .35rem;
	padding: .75rem .85rem;
	font: inherit; font-size: 1.0625rem;
	color: var(--wp--preset--color--graphit);
	background: #fff;
	border: 1px solid #8E9094;
	border-radius: 3px;
}
.wpcf7 textarea { min-height: 9rem; resize: vertical; }
.wpcf7 input[type="file"] { margin-top: .35rem; font-size: .9375rem; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; font-size: .9375rem; display: flex; gap: .6rem; align-items: flex-start; }
.wpcf7 .wpcf7-acceptance input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.wpcf7 input[type="submit"] {
	background: var(--schnur); color: var(--wp--preset--color--graphit); border: 0; border-radius: 3px;
	padding: .9rem 1.8rem; font: 600 1.0625rem var(--wp--preset--font-family--barlow);
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: #fff; color: var(--wp--preset--color--graphit); }
.wpcf7 .wpcf7-spinner { vertical-align: middle; }
.wpcf7 .wpcf7-not-valid-tip { color: #FFB4A6; font-size: .9375rem; margin-top: .3rem; }
.wpcf7 form .wpcf7-response-output { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: 3px; }
.feld-hinweis { font-size: .875rem; opacity: .8; font-weight: 400; }

/* helle Variante (Kontaktseite) */
.formular-hell .wpcf7 .wpcf7-not-valid-tip { color: #B3261E; }
.formular-hell .wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--graphit); color: #fff; }

/* ---------- Ratgeber (Beiträge) ---------- */

.ratgeber-liste .wp-block-post { border-top: 1px solid var(--linie); padding-top: 1.25rem; }
.ratgeber-liste .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--graphit); }
.ratgeber-liste .wp-block-post-title a:hover { color: var(--schnur-text); }
.ratgeber-liste .wp-block-post-featured-image img { aspect-ratio: 3 / 2; object-fit: cover; }

.beitrag .wp-block-post-content h2 { font-size: 1.875rem; margin-top: 2.5rem; }
.beitrag .wp-block-post-content h3 { margin-top: 2rem; }

/* ---------- Seitenkopf Unterseiten ---------- */

.seitenkopf { border-bottom: 1px solid var(--linie); }
.seitenkopf h1 { margin: 0; }

/* ---------- Fußzeile ---------- */

.fuss { color: #D2D3D5; font-size: 1rem; }
.fuss h2, .fuss h3 { color: #F2F2F0; font-size: 1.375rem; margin: 0 0 .75rem; }
.fuss a { color: #F2F2F0; }
.fuss ul { list-style: none; padding: 0; margin: 0; }
.fuss li { padding: .15rem 0; }
.fuss p { margin: 0 0 .5rem; }
.fuss__recht { border-top: 1px solid rgba(255, 255, 255, .15); font-size: .9375rem; color: #A3A5A8; }
.fuss__recht a { color: #D2D3D5; }

/* ---------- Anrufleiste Handy ---------- */

.anrufleiste { display: none; }
@media (max-width: 781px) {
	.anrufleiste {
		display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
		padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom));
		background: var(--wp--preset--color--raeuchereiche);
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .18);
	}
	.anrufleiste a {
		display: flex; align-items: center; justify-content: center; gap: .5rem;
		min-height: 3rem; border-radius: 3px;
		font-weight: 600; font-size: 1.0625rem; text-decoration: none;
	}
	.anrufleiste__anruf { background: var(--schnur); color: var(--wp--preset--color--graphit); }
	.anrufleiste__anfrage { background: #F2F2F0; color: var(--wp--preset--color--graphit); }
	.anrufleiste svg { width: 1.2rem; height: 1.2rem; flex: none; }
	body { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
}

/* ---------- Kleinigkeiten ---------- */

.klein-grau { color: var(--wp--preset--color--grau); font-size: .9375rem; }
.wp-block-separator { border-color: var(--linie); opacity: 1; }

/* ---------- Ergänzungen Seitenaufbau ---------- */

/* Platz für die herabhängende Logo-Kachel */
.einstieg { padding-top: calc(var(--wp--preset--spacing--60) + 2.5rem) !important; }
@media (max-width: 781px) { .einstieg { padding-top: calc(var(--wp--preset--spacing--50) + 2.5rem) !important; } }
.einstieg--seite h1 { font-size: clamp(2.5rem, 5.5vw, 4rem); }

.ablauf li { color: var(--wp--preset--color--grau); }
.ablauf li strong { color: var(--wp--preset--color--graphit); }

.kontakt .anfrage__telefon a { color: var(--wp--preset--color--graphit); }
.kontakt h2 { font-size: 1.75rem; }

.leistung .wp-block-media-text__content { padding-left: clamp(0rem, 4vw, 3.5rem); padding-right: clamp(0rem, 4vw, 3.5rem); }
@media (max-width: 600px) { .leistung .wp-block-media-text__content { padding: 1.5rem 0 0; } }

.wpcf7 textarea { height: 10rem; }
