/*
Theme Name: Metallbau Bay
Theme URI: https://media-line.de
Author: media-line
Author URI: https://media-line.de
Description: One-Page WordPress-Theme für Metallbau Holger Bay, Nümbrecht. Stahl/Graphit-Design mit Funken-Akzent, umfassender Customizer, Elementor-optimiert, Dark Mode, Leaflet/OSM, Contact Form 7.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: metallbau-bay
*/

/* ═══════════════════════════════════════════════════════
   TOKENS  (Light = Standard; per Customizer überschreibbar)
   ═══════════════════════════════════════════════════════ */
:root {
	/* Stahl & Graphit */
	--graphite:     #1F262B; /* dunkle Panels: Hero, Footer */
	--brand:        #41525C; /* Stahl */
	--brand-strong: #2D3942;
	--steel:        #5E8CA8; /* kühler Stahlblau-Highlight / Links */
	--accent:       #E8622A; /* Funken / Schweißhitze */
	--accent-warm:  #C9501E;

	/* Flächen & Text */
	--bg:        #F5F6F7;
	--surface:   #FFFFFF;
	--ink:       #1B2227;
	--ink-soft:  #5A6970;
	--line:      #E0E3E6;

	/* auf dunklen Panels */
	--on-dark:        #EDF1F3;
	--on-dark-soft:   #9DAcB4;

	--header-h:    86px;
	--radius:      4px;   /* kantig – Stahl ist nicht rund */
	--radius-lg:   8px;
	--shadow:      0 14px 40px rgba(20, 30, 36, 0.14);
	--shadow-soft: 0 4px 16px rgba(20, 30, 36, 0.08);

	--font-display: "Oswald", "Arial Narrow", system-ui, sans-serif;
	--font-body:    "IBM Plex Sans", system-ui, sans-serif;
}

html[data-theme="dark"] {
	--bg:        #161B1F;
	--surface:   #1E262B;
	--graphite:  #11161A;
	--brand:     #7C92A0;
	--brand-strong: #97AAB6;
	--ink:       #E7ECEF;
	--ink-soft:  #9DACB4;
	--line:      #2A343A;

	--on-dark:      #EDF1F3;
	--on-dark-soft: #9DACB4;

	--shadow:      0 14px 40px rgba(0, 0, 0, 0.5);
	--shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.38);
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background-color .3s ease, color .3s ease;
}

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

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.08;
	margin: 0 0 .55em;
	color: var(--ink);
	text-transform: uppercase;
	letter-spacing: .005em;
}
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.2rem; letter-spacing: .02em; }

p { margin: 0 0 1.1em; }
a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--brand-strong); }

.container { width: min(1160px, 92%); margin-inline: auto; }

section { padding: clamp(64px, 9vw, 112px) 0; }

/* Eyebrow mit Funken-Strich */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-display);
	font-size: .82rem;
	font-weight: 600;
	letter-spacing: .26em;
	text-transform: uppercase;
	color: var(--brand);
	margin-bottom: 14px;
}
.eyebrow::before {
	content: "";
	width: 30px;
	height: 3px;
	background: var(--accent);
}

.section-head { max-width: 660px; margin-bottom: clamp(34px, 5vw, 58px); }
.section-head p { color: var(--ink-soft); }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: #fff;
	padding: 10px 18px;
	z-index: 9999;
}
.skip-link:focus { left: 0; }

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

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: .98rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 15px 30px;
	border-radius: var(--radius);
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff !important; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--accent-warm); color: #fff !important; }

.btn-ghost { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* Ghost-Variante auf dunklem Grund (Hero) */
.on-dark .btn-ghost { border-color: var(--on-dark-soft); color: var(--on-dark); }
.on-dark .btn-ghost:hover { background: var(--on-dark); color: var(--graphite); }

/* ═══════════════════════════════════════════════════════
   HEADER (fixed)
   ═══════════════════════════════════════════════════════ */
.site-header {
	position: fixed;
	inset: 0 0 auto;
	height: var(--header-h);
	z-index: 1000;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color .25s ease, box-shadow .25s ease, background-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-soft); }

.header-inner {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.site-logo { display: flex; align-items: center; gap: 14px; }
.site-logo img { height: 54px; width: auto; }

/* Text-Logo mit I-Träger-Glyphe */
.logo-lockup { display: flex; align-items: center; gap: 12px; }
.logo-ibeam {
	width: 26px; height: 30px;
	display: grid;
	grid-template-rows: 6px 1fr 6px;
	flex: 0 0 auto;
}
.logo-ibeam span { background: var(--accent); }
.logo-ibeam span:nth-child(2) { width: 6px; justify-self: center; background: var(--brand); }
.logo-text { display: flex; flex-direction: column; line-height: 1.04; }
.logo-text strong {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.15rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink);
}
.logo-text span {
	font-size: .66rem;
	letter-spacing: .34em;
	text-transform: uppercase;
	color: var(--accent);
	font-weight: 600;
	font-family: var(--font-display);
}

.main-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.main-nav a {
	display: block;
	padding: 10px 14px;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: .96rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--ink);
	border-radius: var(--radius);
}
.main-nav a:hover { color: var(--accent); }
.main-nav .current-menu-item > a { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.header-cta { padding: 12px 20px; font-size: .9rem; }

.burger {
	display: none;
	width: 46px; height: 46px;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: var(--radius);
	cursor: pointer;
	position: relative;
}
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); transition: transform .25s ease, opacity .2s ease, top .25s ease; }
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 22px; }
.burger span:nth-child(3) { top: 29px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* Mobile-Menü: per JS-Portal an <body> (WebKit backdrop-filter Fix) */
.mobile-menu {
	position: fixed;
	inset: var(--header-h) 0 auto;
	z-index: 999;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
	box-shadow: var(--shadow);
	padding: 14px 5%;
	display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu a {
	display: block;
	padding: 14px 8px;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 1.08rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--ink);
	border-bottom: 1px solid var(--line);
}
.mobile-menu li:last-child a { border-bottom: 0; }
.mobile-menu a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════
   HERO  (dunkles Graphit-Panel mit Stahl-Diagonalverband)
   ═══════════════════════════════════════════════════════ */
.hero {
	position: relative;
	background: var(--graphite);
	color: var(--on-dark);
	padding: calc(var(--header-h) + clamp(60px, 11vw, 130px)) 0 clamp(76px, 12vw, 140px);
	overflow: hidden;
}

/* Signatur: diagonaler Stahl-Verband (Fachwerk/Diagonalverband) */
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		repeating-linear-gradient( 45deg, rgba(232,98,42,0.00) 0 38px, rgba(232,98,42,0.07) 38px 40px),
		repeating-linear-gradient(-45deg, rgba(255,255,255,0.00) 0 38px, rgba(255,255,255,0.045) 38px 40px);
	pointer-events: none;
}
/* Verlauf, der den Verband nach links ausblendet, damit Text lesbar bleibt */
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, var(--graphite) 30%, color-mix(in srgb, var(--graphite) 60%, transparent) 70%, transparent 100%);
	pointer-events: none;
}

.hero-inner { position: relative; z-index: 2; max-width: 740px; }
.hero .eyebrow { color: var(--accent); }
.hero h1 { color: var(--on-dark); }
.hero h1 .accent { color: var(--accent); }

.hero-sub {
	font-size: clamp(1.05rem, 2vw, 1.28rem);
	color: var(--on-dark-soft);
	max-width: 580px;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.hero-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-top: clamp(40px, 6vw, 60px);
	border-top: 1px solid rgba(255,255,255,0.14);
}
.hero-facts .fact { padding: 22px 30px 0 0; margin-right: 30px; }
.hero-facts .fact + .fact { border-left: 1px solid rgba(255,255,255,0.14); padding-left: 30px; }
.hero-facts strong {
	display: block;
	font-family: var(--font-display);
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--accent);
}
.hero-facts span { font-size: .86rem; color: var(--on-dark-soft); }

/* ═══════════════════════════════════════════════════════
   LEISTUNGEN
   ═══════════════════════════════════════════════════════ */
#leistungen { background: var(--surface); border-bottom: 1px solid var(--line); }

.leistungen-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
}

.leistung-card {
	position: relative;
	background: var(--surface);
	padding: 32px 28px 30px;
	transition: background-color .2s ease;
}
.leistung-card::before {
	content: "";
	position: absolute;
	top: 0; left: 0;
	width: 0; height: 3px;
	background: var(--accent);
	transition: width .25s ease;
}
.leistung-card:hover { background: var(--bg); }
.leistung-card:hover::before { width: 100%; }

.leistung-icon {
	width: 46px; height: 46px;
	display: grid; place-items: center;
	color: var(--accent);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	margin-bottom: 18px;
}
.leistung-card h3 { margin-bottom: 10px; }
.leistung-card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* ═══════════════════════════════════════════════════════
   ÜBER UNS
   ═══════════════════════════════════════════════════════ */
.ueber-inner {
	display: grid;
	grid-template-columns: minmax(280px, 440px) 1fr;
	gap: clamp(34px, 6vw, 74px);
	align-items: center;
}
.ueber-image { position: relative; }
.ueber-image .img-wrap {
	aspect-ratio: 4 / 5;
	border-radius: var(--radius-lg);
	overflow: hidden;
	background:
		repeating-linear-gradient(45deg, color-mix(in srgb, var(--brand) 16%, transparent) 0 22px, transparent 22px 44px),
		linear-gradient(160deg, var(--brand), var(--graphite));
	border: 1px solid var(--line);
	display: grid; place-items: center;
}
.ueber-image .img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.img-badge {
	position: absolute;
	right: -16px; bottom: 28px;
	background: var(--accent);
	color: #fff;
	border-radius: var(--radius);
	padding: 16px 22px;
	box-shadow: var(--shadow);
	display: flex; flex-direction: column; line-height: 1.2;
}
.img-badge .badge-title { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; opacity: .9; font-family: var(--font-display); }
.img-badge .badge-main { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; text-transform: uppercase; }

.check-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: baseline; color: var(--ink-soft); }
.check-list li::before { content: ""; flex: 0 0 14px; height: 14px; background: var(--accent); transform: translateY(2px); clip-path: polygon(14% 44%, 0 60%, 40% 100%, 100% 16%, 86% 0, 38% 72%); }

/* ═══════════════════════════════════════════════════════
   REFERENZEN
   ═══════════════════════════════════════════════════════ */
#referenzen { background: var(--surface); border-block: 1px solid var(--line); }
.galerie-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}
.galerie-item {
	aspect-ratio: 4 / 3;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--line);
	background:
		repeating-linear-gradient(45deg, color-mix(in srgb, var(--brand) 12%, transparent) 0 16px, transparent 16px 32px),
		linear-gradient(150deg, var(--bg), var(--surface));
	display: grid; place-items: center;
	color: var(--ink-soft);
	font-family: var(--font-display);
	letter-spacing: .08em;
	text-transform: uppercase;
	font-size: .82rem;
	text-align: center;
	padding: 12px;
}
.galerie-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.galerie-item:hover img { transform: scale(1.04); }
.galerie-hinweis { margin-top: 22px; color: var(--ink-soft); font-size: .9rem; }

/* ═══════════════════════════════════════════════════════
   KONTAKT
   ═══════════════════════════════════════════════════════ */
.kontakt-grid {
	display: grid;
	grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.2fr);
	gap: clamp(34px, 5vw, 66px);
	align-items: start;
}
.kontakt-info-card {
	background: var(--graphite);
	color: var(--on-dark);
	border-radius: var(--radius-lg);
	padding: 34px 30px;
	box-shadow: var(--shadow-soft);
}
.kontakt-info-card .eyebrow { color: var(--accent); }
.kontakt-info-card h3 { color: var(--on-dark); }
.kontakt-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 18px; }
.kontakt-list li { display: flex; gap: 14px; align-items: flex-start; }
.kontakt-list .k-icon {
	flex: 0 0 42px; height: 42px;
	display: grid; place-items: center;
	border-radius: var(--radius);
	background: rgba(255,255,255,0.08);
	color: var(--accent);
}
.kontakt-list .k-label { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-soft); font-family: var(--font-display); }
.kontakt-list a, .kontakt-list .k-value { font-weight: 500; color: var(--on-dark); font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .02em; }
.kontakt-list a:hover { color: var(--accent); }

/* CF7 */
.wpcf7 form { display: grid; gap: 16px; }
.wpcf7 label { font-weight: 600; font-size: .9rem; font-family: var(--font-display); letter-spacing: .04em; text-transform: uppercase; display: block; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea {
	width: 100%; margin-top: 6px;
	padding: 13px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.wpcf7 input:focus, .wpcf7 textarea:focus {
	outline: none; border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}
.wpcf7 input[type="submit"] {
	background: var(--accent); color: #fff; border: 0;
	border-radius: var(--radius);
	padding: 15px 32px;
	font-family: var(--font-display); font-weight: 600; font-size: 1rem;
	letter-spacing: .06em; text-transform: uppercase;
	cursor: pointer; justify-self: start;
	transition: background-color .2s ease;
}
.wpcf7 input[type="submit"]:hover { background: var(--accent-warm); }
.wpcf7 .wpcf7-not-valid-tip { color: #C0392B; font-size: .85rem; }
.wpcf7 .wpcf7-response-output { border-radius: var(--radius); padding: 12px 16px; margin: 0; }

.fallback-form { display: grid; gap: 16px; }
.fallback-form input, .fallback-form textarea {
	width: 100%; padding: 13px 16px;
	border: 1px solid var(--line); border-radius: var(--radius);
	background: var(--surface); color: var(--ink); font: inherit;
}

/* ═══════════════════════════════════════════════════════
   KARTE
   ═══════════════════════════════════════════════════════ */
#karte { padding: 0; }
.map-wrap { position: relative; height: clamp(320px, 45vw, 480px); border-top: 1px solid var(--line); }
#mb-map { position: absolute; inset: 0; z-index: 1; }
.map-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: var(--brand); color: var(--on-dark); z-index: 0; font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
html[data-theme="dark"] .leaflet-layer,
html[data-theme="dark"] .leaflet-control-zoom,
html[data-theme="dark"] .leaflet-control-attribution { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92); }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.site-footer { background: var(--graphite); color: var(--on-dark-soft); padding: 52px 0 28px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
.footer-brand .logo-lockup { margin-bottom: 12px; }
.footer-brand .logo-text strong { color: var(--on-dark); }
.footer-brand p { font-size: .9rem; max-width: 320px; margin: 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-nav a { color: var(--on-dark-soft); font-size: .92rem; font-family: var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom {
	margin-top: 38px; padding-top: 20px;
	border-top: 1px solid rgba(255,255,255,0.14);
	display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
	font-size: .82rem;
}
.footer-bottom a { color: var(--on-dark); }
.footer-bottom a:hover { color: var(--accent); }

/* Back to top */
.back-to-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 900;
	width: 48px; height: 48px; border-radius: var(--radius); border: 0;
	background: var(--accent); color: #fff; font-size: 1.2rem; cursor: pointer;
	box-shadow: var(--shadow);
	opacity: 0; pointer-events: none; transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease, background-color .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-warm); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	*, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
	.main-nav { display: none; }
	.burger { display: block; }
	.header-cta { display: none; }
}
@media (max-width: 720px) {
	:root { --header-h: 72px; }
	.site-logo img { height: 44px; }
	.logo-text span { display: none; }
	.ueber-inner { grid-template-columns: 1fr; }
	.ueber-image { max-width: 420px; }
	.img-badge { right: 12px; }
	.kontakt-grid { grid-template-columns: 1fr; }
	.hero-facts .fact + .fact { border-left: 0; padding-left: 0; }
	.footer-inner, .footer-bottom { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════
   ELEMENTOR
   ═══════════════════════════════════════════════════════ */
/* Auf mit Elementor erstellten Seiten kein Theme-Section-Padding erzwingen */
.elementor-page .elementor section { padding: revert; }
/* Volle Breite für Elementor-Canvas / Page-Builder-Inhalte */
.mb-page-content > .elementor { width: 100%; }
