/*
Theme Name: AWH Aufbereitungstechnik
Theme URI: https://hoefer-aufbereitungstechnik.de/
Description: Child-Theme von Twenty Twenty-Five für Aufbereitungstechnik Werner Höfer. Farben, Schriften, Abstände über theme.json; Seiten- und Abschnittsvorlagen als Patterns; Referenzen als eigener Inhaltstyp.
Author: David Mayer-Stankovic
Author URI: https://mayer-stankovic.de/
Template: twentytwentyfive
Version: 1.1.2
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: awh
*/

/* ---------------------------------------------------------------
   Nur, was theme.json nicht kann. Alles andere: Website-Editor.
---------------------------------------------------------------- */

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

/* Fokus sichtbar für Tastaturnutzung */
:where(a, button, input, textarea, select, .wp-element-button):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-1);
	outline-offset: 3px;
}

/* Sticky-Header: feine Linie, sobald Inhalt darunter liegt */
.awh-header { border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--base) 12%, transparent); }

/* Kleine Kennzeile über Überschriften ("Eyebrow") */
.is-style-awh-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: .08em;
	text-transform: uppercase;
}
.is-style-awh-eyebrow::before {
	content: "";
	display: inline-block;
	width: 1.75em;
	height: 2px;
	margin-right: .6em;
	vertical-align: middle;
	background: var(--wp--preset--color--accent-1);
}

/* Karten: ruhiger Hover, kein Gewackel */
.is-style-awh-card {
	transition: border-color .2s ease, transform .2s ease;
}
.is-style-awh-card:hover { border-color: var(--wp--preset--color--accent-1) !important; }
@media (prefers-reduced-motion: no-preference) {
	.is-style-awh-card:hover { transform: translateY(-2px); }
}

/* Ganze Karte klickbar, wenn sie einen Titel-Link enthält */
.awh-linked-card { position: relative; }
.awh-linked-card .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }

/* Kennzahlen: große Ziffern mit Tabellenziffern */
.awh-stat-number { font-variant-numeric: tabular-nums lining-nums; }

/* Projektliste (Referenzen kompakt) */
.awh-projektliste .wp-block-post-template > li {
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	padding-block: var(--wp--preset--spacing--30);
}
.awh-projektliste .wp-block-post-template > li:last-child {
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

/* Schlagworte (Anlagentyp, Leistung) als Chips */
.is-style-awh-chips a,
.is-style-awh-chips .wp-block-post-terms__separator + a { text-decoration: none; }
.is-style-awh-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.is-style-awh-chips .wp-block-post-terms__separator { display: none; }
.is-style-awh-chips a {
	display: inline-block;
	padding: .15rem .55rem;
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 2px;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	color: inherit;
}
.is-style-awh-chips a:hover { border-color: var(--wp--preset--color--accent-1); }

/* Taxonomie-Filter auf der Referenzen-Übersicht */
.awh-filter ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.awh-filter li a {
	display: inline-block;
	padding: .45rem .9rem;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
}
.awh-filter li a:hover,
.awh-filter li.current-cat a { border-color: var(--wp--preset--color--accent-1); background: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--contrast); }

/* Partnerleiste */
.awh-partner a { text-decoration: none; }

/* Telefonnummern nicht umbrechen */
.awh-nowrap { white-space: nowrap; }

/* Archivo-Breitenachse: Überschriften leicht schmal = technischer Charakter */
h1, h2, .wp-block-site-title, .awh-stat-number { font-stretch: 86%; }
h3, h4 { font-stretch: 94%; }

/* Keine Lücken zwischen Kopf, Inhalt, Kontakt-Aufruf und Fuß */
.wp-site-blocks > * { margin-block-start: 0; }
main > .wp-block-template-part { margin-block-start: 0; }

/* Bild füllt die Spalte */
.awh-bild-voll img { width: 100%; height: auto; }

/* Zitat-Quelle zurückhaltend */
.wp-block-quote cite {
	display: block;
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-style: normal;
	font-weight: 400;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-1);
}

/* Lange E-Mail-Adressen umbrechen statt überlaufen */
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* Nummernspalte in Listen (A01 …) */
.awh-nr { flex: 0 0 3.5rem; white-space: nowrap; }

/* Lange deutsche Komposita: Silbentrennung statt Überlauf */
h1, h2, h3, .wp-block-post-title { hyphens: manual; overflow-wrap: break-word; }
@media (max-width: 600px) {
	h1, h2, h3, .wp-block-post-title { hyphens: auto; hyphenate-limit-chars: 12 5 5; }
}

/* Mobil: Kopfzeile entschlacken */
@media (max-width: 781px) {
	.awh-header .wp-block-site-tagline,
	.awh-header .wp-block-buttons.awh-header-cta { display: none; }
}

/* Bilder ohne Browser-Standardeinzug (figure = 40px) */
:where(figure.wp-block-image, figure.wp-block-video) { margin-left: 0; margin-right: 0; }

/* Sprungmarken (z. B. /leistungen/#montage) nicht unter dem Sticky-Header verstecken */
[id] { scroll-margin-top: 6rem; }

/* Startbild: Inhalt bündig mit Logo und Inhaltsbreite */
.wp-block-cover.has-custom-content-position.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container { width: 100%; }

/* Referenz-Kacheln (Startseite, Übersicht, Filterseiten): responsives Raster
   Desktop 3 Spalten, Tablet 2, Handy 1 – unabhängig von den Block-Einstellungen der Seite */
.wp-block-post-template:has(.awh-linked-card.is-style-awh-card) {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
	gap: var(--wp--preset--spacing--30);
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-inline: auto;
}
.wp-block-post-template:has(.awh-linked-card.is-style-awh-card) > li { margin: 0; width: auto; max-width: none; }
