/*
Theme Name:  elektroplan elbe
Description: Child-Theme für Divi 5 – 1:1-Nachbau der früheren TYPO3-Website elektroplanelbe.de
Author:      mandego oHG
Author URI:  https://www.mandego.de
Template:    Divi
Version:     0.1.1
Text Domain: elektroplan-elbe
*/

/* ==========================================================================
   Schriften (DIN W01, Lizenz liegt bei elektroplan elbe / mandego)
   ========================================================================== */
@font-face {
	font-family: "DIN W01 Regular";
	src: url("fonts/din-w01-regular.woff2") format("woff2"), url("fonts/din-w01-regular.woff") format("woff");
	font-display: swap;
}
@font-face {
	font-family: "DIN W01 Bold";
	src: url("fonts/din-w01-bold.woff2") format("woff2"), url("fonts/din-w01-bold.woff") format("woff");
	font-display: swap;
}

/* ==========================================================================
   Grundwerte (aus dem alten Stylesheet übernommen)
   ========================================================================== */
:root {
	--epe-weinrot: #9f2241;
	--epe-weinrot-dunkel: #751930;
	--epe-rot: #d05559;
	--epe-rot-dunkel: #aa2f33;
	--epe-text: #3d505d;
	--epe-grau: #b9c0c4;
	--epe-container: 1140px;
	--epe-header-hoehe: 100px;
}

body,
body.et_divi_theme,
#page-container {
	font-family: "DIN W01 Regular", sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: var(--epe-text);
	background: #fff;
}

body strong,
body b {
	font-family: "DIN W01 Bold", sans-serif;
	font-weight: normal;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
	font-family: "DIN W01 Regular", sans-serif;
	font-weight: 300;
	line-height: 1.1;
	color: var(--epe-rot);
	padding-bottom: 0;
	margin: 0 0 .5em;
}
body h1 { font-size: 32px; }
body h2 { font-size: 28px; }
body h4 { font-size: 20px; margin-top: 1.4em; }
@media (min-width: 768px) {
	body h1 { font-size: 35.2px; }
	body h4 { font-size: 22px; }
}
@media (min-width: 992px) {
	body h1 { font-size: 38.4px; }
	body h4 { font-size: 24px; }
}

body p { padding-bottom: 0; margin: 0 0 12px; }
body p.lead { font-size: 18px; font-weight: 300; line-height: 1.4; margin-bottom: 24px; }
@media (min-width: 768px) { body p.lead { font-size: 19.2px; } }
@media (min-width: 992px) { body p.lead { font-size: 20.8px; } }

body a { color: var(--epe-rot); }
body a:hover { color: var(--epe-rot-dunkel); }

.epe-container {
	width: 100%;
	max-width: calc(var(--epe-container) + 40px);
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

/* Divi: Platz für festen Kopf entfällt, der Kopf liegt über dem Kopfbild */
#page-container { padding-top: 0 !important; }
#main-header, #top-header { display: none !important; }

/* ==========================================================================
   Kopfbereich
   ========================================================================== */
.epe-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 1030;
	height: var(--epe-header-hoehe);
	background: rgba(255, 255, 255, .85);
	transition: height .27s cubic-bezier(0, 0, .58, 1), background-color .27s;
}
body.admin-bar .epe-header { top: 32px; }
.epe-header.is-klein { height: 50px; background: #fff; }

.epe-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
}
.epe-header__logo { display: flex; align-items: center; height: 100%; }
.epe-header__logo img { height: 65%; max-height: 65px; width: auto; display: block; }
.epe-header.is-klein .epe-header__logo img { max-height: 32px; }

.epe-nav { height: 100%; }
.epe-nav ul { list-style: none; margin: 0; padding: 0; }
.epe-nav > ul { display: flex; height: 100%; }
.epe-nav > ul > li { position: relative; }
.epe-nav > ul > li > a {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0 10px;
	color: var(--epe-weinrot);
	text-transform: uppercase;
	font-size: 16px;
	letter-spacing: .02em;
	position: relative;
}
.epe-nav > ul > li:last-child > a { padding-right: 0; }
.epe-nav > ul > li > a:hover { color: var(--epe-rot); }

/* Balken oben beim Überfahren (wie im Original) */
.epe-nav > ul > li > a::before {
	content: "";
	position: absolute;
	top: -10px; left: 10px; right: 10px;
	height: 4px;
	background: var(--epe-weinrot);
	opacity: 0;
	transition: top .19s ease-in-out, opacity .25s ease-in-out;
}
.epe-nav > ul > li:hover > a::before,
.epe-nav > ul > li.current-menu-item > a::before,
.epe-nav > ul > li.current-menu-ancestor > a::before { top: 0; opacity: 1; }

/* Untermenü */
.epe-nav .sub-menu {
	position: absolute;
	top: 100%; left: 0;
	min-width: 220px;
	padding: 5px 0;
	background: rgba(255, 255, 255, .85);
	box-shadow: 0 6px 12px rgba(0, 0, 0, .1);
	opacity: 0; visibility: hidden;
	transition: opacity .2s;
}
.epe-nav li:hover > .sub-menu,
.epe-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.epe-nav .sub-menu a {
	display: block;
	padding: 6px 20px;
	color: #333;
	white-space: nowrap;
}
.epe-nav .sub-menu a:hover,
.epe-nav .sub-menu .current-menu-item > a { color: #fff; background: var(--epe-rot); }

.epe-nav-toggle { display: none; }

/* ==========================================================================
   Kopfbild + drei Kacheln
   ========================================================================== */
.epe-hero {
	height: 600px;
	background: #333 center / cover no-repeat;
}
.epe-kacheln { position: relative; z-index: 10; margin-top: -63px; min-height: 73px; }
.epe-kacheln ul {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	gap: 1%;
}
.epe-kacheln li {
	flex: 0 0 32.3%;
	margin: 10px 0;
	background: rgba(255, 255, 255, .8);
	text-align: center;
	line-height: 50px;
}
.epe-kacheln a {
	display: block;
	color: var(--epe-weinrot);
	text-transform: uppercase;
	font-size: 23px;
	font-weight: 600;
}
.epe-kacheln a:hover { color: var(--epe-weinrot-dunkel); }

/* Seiten ohne Kopfbild: Inhalt unter den festen Kopf schieben */
body.epe-ohne-hero #et-main-area { padding-top: var(--epe-header-hoehe); }

/* ==========================================================================
   Fußbereich
   ========================================================================== */
.epe-footer {
	background: var(--epe-weinrot);
	color: #fff;
	padding: 5em 0 3em;
}
.epe-footer__logo img { width: 272px; max-width: 100%; height: auto; display: block; margin-bottom: 30px; }
.epe-footer__spalten { display: flex; gap: 40px; }
.epe-footer__spalten > div { flex: 1 1 0; }
.epe-footer p { margin: 0 0 12px; color: #fff; }
.epe-footer a { color: var(--epe-rot); }
.epe-footer a:hover { color: var(--epe-rot-dunkel); text-decoration: underline; }
.epe-footer ul { list-style: none; margin: 0; padding: 0; }

/* Handy-Leiste unten */
.epe-dock { display: none; }

/* ==========================================================================
   Tablet und Handy
   ========================================================================== */
@media (max-width: 991px) {
	.epe-hero { height: 400px; }
	.epe-header { height: 50px; }
	.epe-header__logo img { max-height: 40px; }
	body.epe-ohne-hero #et-main-area { padding-top: 50px; }

	.epe-nav-toggle {
		display: block;
		width: 34px; height: 34px;
		padding: 6px;
		background: none; border: 0;
		cursor: pointer;
	}
	.epe-nav-toggle span { display: block; height: 2px; margin: 5px 0; background: var(--epe-weinrot); }

	.epe-nav {
		position: absolute;
		top: 100%; left: 0; right: 0;
		height: auto;
		max-height: 0;
		overflow: hidden;
		background: #fff;
		transition: max-height .3s;
	}
	.epe-nav.is-offen { max-height: 80vh; overflow-y: auto; }
	.epe-nav > ul { display: block; height: auto; padding: 10px 20px; }
	.epe-nav > ul > li > a { height: auto; padding: 10px 0; }
	.epe-nav > ul > li > a::before { display: none; }
	.epe-nav .sub-menu { position: static; opacity: 1; visibility: visible; box-shadow: none; background: none; padding: 0 0 0 15px; }
	.epe-nav .sub-menu a { padding: 6px 0; }

	.epe-kacheln a { font-size: 18px; }
	.epe-footer__spalten { flex-direction: column; gap: 10px; }

	.epe-dock {
		display: flex;
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 1000;
		background: var(--epe-weinrot);
		border-top: 1px solid #fff;
	}
	.epe-dock a, .epe-dock button {
		flex: 1 1 20%;
		display: flex; justify-content: center;
		background: none; border: 0; padding: 0; cursor: pointer;
	}
	.epe-dock img { height: 50px; width: auto; }
	body { padding-bottom: 51px; }
}

@media (max-width: 767px) {
	.epe-kacheln { margin-top: 0; background: var(--epe-weinrot); }
	.epe-kacheln ul { flex-direction: column; gap: 0; padding: 5px 0; }
	.epe-kacheln li { margin: 5px 0; background: #fff; }
}

@media (max-width: 480px) {
	.epe-hero { height: 200px; }
}

/* ==========================================================================
   Inhaltsbausteine
   ========================================================================== */
/* Teaser auf grauem Grund (z. B. „Partner im Ingenieurwerk“) */
.epe-teaser { color: var(--epe-weinrot); }
.epe-teaser h1, .epe-teaser h2, .epe-teaser h3, .epe-teaser h4 { color: #fff; }
.epe-teaser h2 { font-size: 30px; }

/* Rahmen-Button wie im Original */
a.epe-button {
	display: inline-block;
	margin-top: 20px;
	padding: 6px 12px;
	font-size: 16px;
	line-height: 1.55;
	color: #fff;
	border: 1px solid #fff;
	background: transparent;
	transition: background-color .2s, color .2s;
}
a.epe-button:hover { background: #fff; color: var(--epe-weinrot); }

/* Divi-Textmodul an das Original angleichen */
.et_pb_text, .et_pb_text p, .et_pb_text li { line-height: 1.55; }
.et_pb_text h4 { margin-top: 1.6em; }
.et_pb_text h1 + p, .et_pb_text h4 + p { margin-top: 0; }

/* Tablet/Handy wie im Original: Logo mittig, Menü nur über die Leiste unten */
@media (max-width: 991px) {
	.epe-header__inner { justify-content: center; }
	.epe-nav-toggle { display: none; }
}

/* Aktiver Hauptmenüpunkt wie im Original: weinrot hinterlegt, weiße Schrift */
.epe-nav > ul > li.current-menu-item > a,
.epe-nav > ul > li.current-menu-ancestor > a,
.epe-nav > ul > li.current-menu-parent > a {
	background: var(--epe-weinrot);
	color: #fff;
	padding: 0 10px;
}
.epe-nav > ul > li:last-child.current-menu-item > a { padding-right: 10px; }
.epe-nav > ul > li.current-menu-item > a::before,
.epe-nav > ul > li.current-menu-ancestor > a::before { display: none; }

/* Eingerückter Inhalt (TYPO3 „frame-indent“): schmalere Textspalte */
@media (min-width: 992px) {
	.epe-einzug { padding: 0 calc(100% / 6); }
}

/* Karte als Bild mit Link zu Google Maps */
a.epe-karte { display: block; position: relative; margin-top: 20px; }
a.epe-karte img { display: block; width: 100%; height: auto; }
a.epe-karte::after {
	content: "In Google Maps öffnen ↗";
	position: absolute;
	right: 12px; top: 12px;
	padding: 6px 12px;
	background: var(--epe-weinrot);
	color: #fff;
	font-size: 14px;
}
a.epe-karte:hover::after { background: var(--epe-rot); }

.et_pb_text h2 { margin-top: 1.6em; }

/* Einleitungsabsatz (TYPO3 „lead“), auch als Zwischenüberschrift genutzt */
.et_pb_text p.lead, .et_pb_toggle p.lead { font-size: 18px; line-height: 1.4; margin-bottom: 24px; color: var(--epe-text); }
@media (min-width: 768px) { .et_pb_text p.lead, .et_pb_toggle p.lead { font-size: 19.2px; } }
@media (min-width: 992px) { .et_pb_text p.lead, .et_pb_toggle p.lead { font-size: 20.8px; } }

/* Unternavigation links (Leistungen) */
.epe-unternavi ul { list-style: none; margin: 0; padding: 0; border: 1px solid #ddd; max-width: 255px; }
.epe-unternavi li { border-top: 1px solid #ddd; padding: 0 !important; }
.epe-unternavi li:first-child { border-top: 0; }
.epe-unternavi a { display: block; padding: 6px 15px; font-size: 13px; color: #9aa7b0; }
.epe-unternavi a:hover, .epe-unternavi .is-aktiv a { color: var(--epe-rot); }
@media (max-width: 991px) { .epe-unternavi { display: none; } }

/* Bildunterschrift */
.epe-bildunterschrift { font-size: 14px; color: #777; margin-top: -10px; }

/* Stellenangebote: Toggles wie im Original (grau, Plus rechts) */
.et_pb_toggle.et_pb_module {
	background: #f5f5f5;
	border: 1px solid #ddd;
	padding: 0;
	margin-bottom: 5px !important;
}
.et_pb_toggle .et_pb_toggle_title {
	padding: 8px 40px 8px 15px;
	font-size: 16px !important;
	line-height: 1.55;
	color: #333 !important;
	font-family: "DIN W01 Regular", sans-serif;
	font-weight: normal;
}
.et_pb_toggle .et_pb_toggle_title::before {
	content: "+";
	font-family: "DIN W01 Bold", sans-serif;
	font-size: 22px;
	right: 15px;
	color: #333;
	margin-top: -14px;
}
.et_pb_toggle_open .et_pb_toggle_title::before { content: "–"; }
.et_pb_toggle .et_pb_toggle_content { background: #fff; padding: 15px; border-top: 1px solid #ddd; }

/* Korrekturen nach Vergleich mit dem Original */
.et_pb_toggle .et_pb_toggle_title { padding: 8px 40px 8px 15px !important; }
.et_pb_toggle .et_pb_toggle_title::before {
	font-family: "DIN W01 Bold", sans-serif !important;
	content: "+" !important;
	font-size: 22px !important;
	top: 50% !important;
	margin-top: -14px !important;
	right: 15px !important;
}
.et_pb_toggle_open .et_pb_toggle_title::before { content: "–" !important; }
.et_pb_text h3 { font-size: 28px; margin-top: 1.4em; }
.et_pb_text h3 + h4 { margin-top: 0; }
.epe-unternavi a { font-size: 12px; white-space: nowrap; }
.epe-bildunterschrift { font-size: 12px; margin-top: -20px; }

/* Kacheln wie im Original: bündig auf der Unterkante des Kopfbilds, kein Überstand in den Inhalt */
@media (min-width: 768px) {
	.epe-kacheln { margin-top: -60px; min-height: 0; height: 60px; }
	.epe-kacheln li { margin: 10px 0 0; }
}
.epe-kacheln a { font-weight: normal; }
/* Abstand Kopfbild → erste Überschrift wie im Original */
#main-content .et_pb_section:first-child { padding-top: 41px; }
@media (min-width: 768px) {
	.epe-kacheln li { margin-top: 7px; line-height: 53px; }
}
