/*
Theme Name: Diefenbach
Theme URI: https://diefenbach-wiesbaden.de
Author: doubleplus
Description: Schlankes, eigenes Theme für Eisenwaren Diefenbach Wiesbaden. Ohne Page-Builder, Inhalte werden mit dem Block-Editor gepflegt.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: diefenbach
License: GNU General Public License v2 or later
*/

/* ---------- Fonts (self-hosted, keine Verbindung zu Google) ---------- */
@font-face { font-family: "Montserrat"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 300; font-style: normal; font-display: swap; src: url("assets/fonts/lato-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/lato-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-style: italic; font-display: swap; src: url("assets/fonts/lato-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/lato-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
	--c-primary: #273777;
	--c-primary-strong: #264295;
	--c-primary-dark: #1b2756;
	--c-light: #d1dbff;
	--c-medium: #acb8e9;
	--c-gray: #f5f5f5;
	--c-muted: #9a9a9a;
	--c-text: #222;
	--c-white: #fff;

	--f-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
	--f-body: "Lato", "Helvetica Neue", Arial, sans-serif;

	--w-content: 1140px;
	--w-narrow: 780px;
	--gutter: clamp(1.25rem, 4vw, 2rem);
	--section-y: clamp(3rem, 8vw, 6rem);
	--header-h: 84px;
	--radius: 4px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
	margin: 0;
	font-family: var(--f-body);
	font-weight: 300;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--c-text);
	background: var(--c-white);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-primary-strong); text-underline-offset: .2em; }
a:hover { color: var(--c-primary-dark); }

strong, b { font-weight: 700; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--f-head);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #111;
	margin: 0 0 1rem;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.875rem); }
h3 { font-size: clamp(1.15rem, 2.6vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p, ul, ol { margin: 0 0 1.25rem; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .35em; }

mark {
	background: var(--c-primary-strong);
	color: var(--c-white);
	padding: .05em .3em .1em;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: .5rem; left: .5rem; z-index: 1000;
	padding: .75rem 1rem;
	background: var(--c-white);
	color: var(--c-primary);
}

:focus-visible { outline: 3px solid var(--c-primary-strong); outline-offset: 2px; }

/* ---------- Layout helpers ---------- */
.container {
	width: 100%;
	max-width: calc(var(--w-content) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--c-white);
	border-bottom: 1px solid #e6e6e6;
	transition: box-shadow .2s ease;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.site-header.is-scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, .08); }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: var(--header-h);
}

.custom-logo-link { display: inline-flex; flex-shrink: 0; }
.custom-logo-link img { width: auto; height: 52px; }
.site-title {
	font-family: var(--f-head);
	font-weight: 700;
	font-size: 1.4rem;
	text-decoration: none;
	color: var(--c-white);
	background: var(--c-primary);
	padding: .25rem .9rem;
}

.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: .25rem;
}
.main-nav li { margin: 0; }
.main-nav a {
	display: block;
	padding: .5rem .9rem;
	font-family: var(--f-head);
	font-weight: 600;
	font-size: .8125rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	color: #111;
	border-bottom: 2px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
	color: var(--c-primary-strong);
	border-bottom-color: var(--c-primary-strong);
}

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111;
	cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 24px; height: 2px;
	background: currentColor;
	transition: transform .2s ease, background-color .2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 800px) {
	:root { --header-h: 68px; }
	.custom-logo-link img { height: 40px; }
	.nav-toggle { display: inline-flex; }
	.main-nav {
		position: absolute;
		top: 100%; left: 0; right: 0;
		background: var(--c-white);
		border-bottom: 1px solid #e6e6e6;
		box-shadow: 0 12px 20px rgba(0, 0, 0, .08);
		display: none;
	}
	.nav-open .main-nav { display: block; }
	.main-nav ul { flex-direction: column; padding: .5rem var(--gutter) 1rem; }
	.main-nav a { padding: .85rem 0; border-bottom: 1px solid #eee; }
	.main-nav li:last-child a { border-bottom: 0; }
}

/* ---------- Page content ---------- */
.site-main { min-height: 50vh; }

.page-header {
	background: var(--c-primary);
	color: var(--c-white);
	padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.page-header h1 { color: var(--c-white); margin: 0; }

.entry-content { padding-block: var(--section-y); }
.has-sections .entry-content { padding-block: 0; }
.has-sections:not(.home) .entry-content > :first-child:not(.is-style-section) { margin-top: var(--section-y); }

.entry-content > * {
	max-width: var(--w-content);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.entry-content > .alignwide { max-width: calc(var(--w-content) + 10rem); }
.entry-content > .alignfull {
	max-width: none;
	padding-inline: 0;
}
.entry-content > .is-narrow { max-width: var(--w-narrow); }

/* Sections = full-width groups with a coloured background */
.entry-content > .is-style-section,
.entry-content > .is-style-section + .is-style-section {
	max-width: none;
	padding: var(--section-y) 0;
	margin-block: 0;
}
.is-style-section > * {
	max-width: var(--w-content);
	margin-inline: auto !important;
	padding-inline: var(--gutter);
}
.is-style-section > .is-narrow { max-width: var(--w-narrow); }
.is-style-section > :last-child { margin-bottom: 0; }
.entry-content > .is-style-section.is-compact { padding-block: clamp(2rem, 5vw, 3.5rem); }

.has-white-background-color { background-color: var(--c-white); }
.has-gray-background-color { background-color: var(--c-gray); }
.has-light-background-color { background-color: var(--c-light); }
.has-medium-background-color { background-color: var(--c-medium); }
.has-primary-background-color { background-color: var(--c-primary); }
.has-primary-color { color: var(--c-primary); }
.has-muted-color { color: var(--c-muted); }
.has-white-color { color: var(--c-white); }

.has-primary-background-color,
.has-primary-background-color h1,
.has-primary-background-color h2,
.has-primary-background-color h3,
.has-primary-background-color h4 { color: var(--c-white); }

.eyebrow {
	font-size: clamp(1rem, 2.2vw, 1.25rem);
	letter-spacing: .2em;
	color: #c6c6c6;
	text-align: center;
	margin-block: 2rem 2.5rem;
}

/* ---------- Core blocks ---------- */
.wp-block-image { margin: 0 0 1.5rem; }
.wp-block-image.aligncenter img,
.wp-block-image .aligncenter img { margin-inline: auto; }

.wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1.5rem, 4vw, 3rem);
	margin-bottom: 1.5rem;
}
.wp-block-column { flex: 1 1 0; min-width: 0; }
.wp-block-column > :last-child { margin-bottom: 0; }
@media (max-width: 781px) {
	.wp-block-columns:not(.is-not-stacked-on-mobile) { flex-direction: column; }
	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; }
}

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.wp-block-button__link,
.wpcf7-submit {
	display: inline-block;
	padding: .85rem 1.75rem;
	border: 2px solid var(--c-primary);
	border-radius: var(--radius);
	background: var(--c-primary);
	color: var(--c-white);
	font-family: var(--f-head);
	font-weight: 600;
	font-size: .8125rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.wp-block-button__link:hover,
.wpcf7-submit:hover {
	background: var(--c-primary-dark);
	border-color: var(--c-primary-dark);
	color: var(--c-white);
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--c-primary);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--c-primary);
	color: var(--c-white);
}

.wp-block-separator {
	border: 0;
	height: 1px;
	background: #ddd content-box;
	margin: 2.5rem auto;
}

.has-text-align-center { text-align: center; }

/* Grid layout fallback (core outputs the real grid CSS) */
.is-layout-grid { display: grid; gap: 2rem; }

/* Lists with check marks */
ul.is-style-checklist { list-style: none; padding-left: 0; }
.entry-content > ul.is-style-checklist,
.is-style-section > ul.is-style-checklist { padding-inline: var(--gutter); }
.is-style-checklist li { position: relative; padding-left: 1.75em; }
.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0; top: .45em;
	width: .9em; height: .5em;
	border-left: 2px solid var(--c-primary-strong);
	border-bottom: 2px solid var(--c-primary-strong);
	transform: rotate(-45deg);
}
@media (min-width: 700px) {
	.is-style-checklist.is-two-columns { columns: 2; column-gap: 3rem; }
	.is-style-checklist.is-two-columns li { break-inside: avoid; }
}

/* ---------- Home: hours ---------- */
.opening-badge { text-align: center; margin-bottom: 1.5rem; }
.opening-hours {
	text-align: center;
	font-size: clamp(1.05rem, 2.6vw, 1.5rem);
	margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---------- Brands ---------- */
.brand-list h3 {
	font-family: var(--f-body);
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: 0;
	text-transform: none;
	margin-bottom: .75rem;
}
.brand-list ul { list-style: none; padding: 0; margin: 0; }
.brand-list li { margin: 0; padding: .3rem 0; border-bottom: 1px solid rgba(39, 55, 119, .15); }

/* Logo-Slider: Galerie mit Blockstil „Logo-Slider“ */
.wp-block-gallery.is-style-logo-slider {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1.5rem 2.5rem;
	list-style: none;
	margin-block: 0 1rem;
}
/* !important: core gallery rules use :not(#individual-image) (ID specificity) */
.wp-block-gallery.is-style-logo-slider .wp-block-image {
	flex: 0 0 auto !important;
	width: 160px !important;
	margin: 0 !important;
}
.wp-block-gallery.is-style-logo-slider .wp-block-image img {
	width: 160px !important;
	height: 120px !important;
	object-fit: contain !important;
	mix-blend-mode: multiply;
}

.logo-marquee {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logo-marquee .wp-block-gallery.is-style-logo-slider {
	flex-wrap: nowrap;
	justify-content: flex-start;
	width: max-content;
	max-width: none;
	padding: 0;
	animation: logo-marquee var(--marquee-duration, 40s) linear infinite;
}
.logo-marquee:hover .wp-block-gallery.is-style-logo-slider { animation-play-state: paused; }

@keyframes logo-marquee {
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.logo-marquee .wp-block-gallery.is-style-logo-slider { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
	.logo-marquee .is-clone { display: none; }
	.logo-marquee { -webkit-mask-image: none; mask-image: none; }
}

/* ---------- Map (lädt erst nach Klick) ---------- */
.map-embed {
	position: relative;
	width: 100%;
	min-height: clamp(320px, 38vw, 420px);
	background: var(--c-primary);
	display: flex;
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--c-white);
}
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-embed__consent {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1.5rem;
	text-align: center;
	background:
		repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 48px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 48px),
		var(--c-primary);
}
.map-embed__pin {
	width: 44px; height: 44px;
	border-radius: 50% 50% 50% 0;
	background: var(--c-white);
	transform: rotate(-45deg);
	position: relative;
}
.map-embed__pin::after {
	content: "";
	position: absolute;
	inset: 13px;
	border-radius: 50%;
	background: var(--c-primary);
}
.map-embed__address { font-family: var(--f-head); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.map-embed__note { font-size: .875rem; max-width: 30rem; margin: 0; opacity: .85; }
.map-embed__note a { color: inherit; }
.map-embed__button {
	padding: .75rem 1.5rem;
	border: 2px solid var(--c-white);
	border-radius: var(--radius);
	background: transparent;
	color: var(--c-white);
	font-family: var(--f-head);
	font-weight: 600;
	font-size: .8125rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
}
.map-embed__button:hover { background: var(--c-white); color: var(--c-primary); }

/* ---------- Contact Form 7 ---------- */
.wpcf7 { max-width: var(--w-narrow); }
.wpcf7 label { display: block; font-weight: 700; margin-bottom: 1.25rem; }
.wpcf7 .wpcf7-form-control-wrap { display: block; margin-top: .4rem; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	padding: .8rem 1rem;
	border: 1px solid #c9c9c9;
	border-radius: var(--radius);
	font: inherit;
	font-weight: 400;
	background: var(--c-white);
}
.wpcf7 input:focus,
.wpcf7 textarea:focus { outline: none; border-color: var(--c-primary-strong); box-shadow: 0 0 0 3px rgba(38, 66, 149, .2); }
.wpcf7 textarea { min-height: 10rem; resize: vertical; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; }
.wpcf7 .wpcf7-acceptance input { margin-top: .35em; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7-not-valid-tip { color: #b3261e; font-weight: 400; font-size: .9rem; }
.wpcf7 form .wpcf7-response-output { margin: 1.5rem 0 0; padding: .8rem 1rem; border-radius: var(--radius); }

/* ---------- Legal pages ---------- */
.legal-text h2 { margin-top: 2.5rem; }
.legal-text h3 {
	font-size: 1.05rem;
	letter-spacing: .06em;
	margin-top: 2rem;
	margin-bottom: .5rem;
}

/* ---------- Footer ---------- */
.site-footer {
	background: var(--c-primary-dark);
	color: rgba(255, 255, 255, .85);
	font-size: .95rem;
}
.site-footer a { color: var(--c-white); }
.site-footer__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem 3rem;
	padding-block: clamp(2.5rem, 6vw, 4rem);
}
.site-footer h2 {
	font-size: .875rem;
	letter-spacing: .15em;
	color: var(--c-white);
	margin-bottom: 1rem;
}
.site-footer p { margin-bottom: .75rem; }
.site-footer__logo img { height: 46px; width: auto; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin: 0 0 .35rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	padding-block: 1.25rem;
	font-size: .85rem;
	color: rgba(255, 255, 255, .6);
}

/* ---------- Back to top ---------- */
.back-to-top {
	position: fixed;
	right: 1.25rem; bottom: 1.25rem;
	z-index: 90;
	width: 46px; height: 46px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--c-primary);
	color: var(--c-white);
	text-decoration: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--c-primary-dark); color: var(--c-white); }
.back-to-top::before {
	content: "";
	width: 12px; height: 12px;
	border-left: 2px solid currentColor;
	border-top: 2px solid currentColor;
	transform: translateY(3px) rotate(45deg);
}

/* ---------- 404 ---------- */
.not-found { padding-block: var(--section-y); text-align: center; }
