/* =========================================================
   ReGaWatt Footer (Theme-Part footer/v1)
   Tokens: hell #f4f5f2 | dunkelbraun #4a2e15 | orange #f48520
           Ueberschrift muted rgba(74,46,21,.5) | Rahmen rgba(74,46,21,.3)
   Font-Sizes in rem, Spacing in px. Raster nach Figma 14:413.
   ========================================================= */

.rw_footer {
	--rw-gutter: 70px;       /* Seitenabstand wie m30/m36 */
	--rw-top: 115px;         /* Figma: Spalten-Ueberschriften 115px unter Footer-Top */
	background-color: #f4f5f2;
	color: #4a2e15;
}

.rw_footer_inner {
	position: relative;
	width: calc(100% - var(--rw-gutter) * 2);
	margin: 0 auto;
	padding: var(--rw-top) 0 80px;
}

/* ---------- Back-to-top (rechts neben den Spalten, auf Hoehe der Ueberschriften) ---------- */
.rw_footer_totop {
	position: absolute;
	top: var(--rw-top);
	right: 0;
	width: 60px;
	height: 60px;
	aspect-ratio: 1 / 1;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: none;
	box-shadow: none !important;
	background-color: #4a2e15 !important;
	color: #f4f5f2 !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: background-color .25s ease, transform .25s ease;
}
.rw_footer_totop svg { width: 30px; height: 30px; display: block; }
.rw_footer_totop:hover { background-color: #f48520 !important; transform: translateY(-3px); }
.rw_footer_totop:hover svg { color: #4a2e15 !important; }

/* ---------- Grid (5 Spalten + reservierte rechte Spur fuer den Button) ---------- */
/* Zwei Zeilen-Tracks: alle Menue-Spalten teilen sie per Subgrid, damit die zweiten
   Ueberpunkte (Zeile 2) ueber alle drei Menues auf gleicher Hoehe beginnen. */
.rw_footer_grid {
	display: grid;
	grid-template-columns: 1.15fr 1.1fr 1fr 1fr 1fr;
	grid-template-rows: auto auto;
	gap: 0 40px;   /* kein Zeilen-Gap -> Abstand der 2. Reihe rein ueber margin-top */
	align-items: start;
	padding-right: 84px;   /* Platz fuer den Back-to-top-Button rechts */
}
/* Logo- und Adress-Spalte ueberspannen beide Zeilen (zwingen Zeile 1 nicht in die Hoehe) */
.rw_footer_col_brand,
.rw_footer_col_address {
	grid-row: 1 / span 2;
}
/* Menue-Spalten als Subgrid: 1. Group -> Zeile 1, 2. Group -> Zeile 2 (zeilenweise buendig) */
.rw_footer_col_menu {
	grid-row: 1 / span 2;
	display: grid;
	grid-template-rows: subgrid;
	align-content: start;
}

/* ---------- Spalte 1: Logo im weissen Panel + Social ---------- */
/* Weisses Panel ragt zur linken Viewport-Kante und zur Footer-Oberkante (Figma Rect 79, 269x199) */
.rw_footer_brand_panel {
	display: block;
	width: max-content;
	margin-top: calc(var(--rw-top) * -1);          /* hoch bis zur Footer-Oberkante */
	margin-left: calc(var(--rw-gutter) * -1);      /* links bis zur Viewport-Kante */
	padding: 0 var(--rw-gutter) var(--rw-gutter) var(--rw-gutter);   /* Logo buendig oben, Innenabstand = Gutter (folgt den Breakpoints) */
	background-color: #fff;
	line-height: 0;          /* Baseline-Luecke unter dem Logo entfernen */
}
.rw_footer_logo { display: inline-block; line-height: 0; }
.rw_footer_logo img,
.rw_footer_logo svg,
.rw_footer_logo_svg { display: block; width: 129px; height: 129px; }

.rw_footer_social { margin-top: 41px; }
.rw_footer_social_label {
	display: block;
	margin-bottom: 24px;
	font-size: 0.9375rem !important;   /* 15px */
	font-weight: 400;
	line-height: 25px;
	color: rgba(74, 46, 21, 0.5);
	text-transform: uppercase;
}
.rw_footer_social_items { display: flex; gap: 12px; }
.rw_footer_social_item {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 51px;
	height: 51px;
	color: #4a2e15 !important;
	background-color: #f4f5f2;
	border: 1px solid rgba(74, 46, 21, 0.3);
	transition: border-color .25s ease, transform .25s ease;
}
.rw_footer_social_item svg { width: 30px; height: 30px; display: block; }
.rw_footer_social_item:hover { border-color: #4a2e15; transform: translateY(-3px); }

/* ---------- Spalte 2: Adresse / Kontakt ---------- */
/* Adress-Spalte 45px weiter nach links (Figma) */
.rw_footer_col_address {
	margin-left: -45px;
}
.rw_footer_address,
.rw_footer_contact {
	margin: 0;
	font-size: 1rem !important;   /* 16px */
	font-weight: 400;
	line-height: 25px;
	color: #4a2e15;
}
/* !important: schlaegt die globale Regel body...flexible_content span/a { font-weight:400 } */
.rw_footer_firma { display: block; font-weight: 600 !important; }
.rw_footer_contact { margin-top: 48px; }
.rw_footer_contact a { font-size: 1rem !important; color: #4a2e15 !important; font-weight: 600 !important; text-decoration: none; }
.rw_footer_contact a:hover { color: #f48520 !important; }

/* ---------- Spalten 3-5: Menues ---------- */
/* Mindestabstand der zweiten Group zur ersten (per Subgrid liegen die 2. Ueberpunkte
   ohnehin auf gleicher Hoehe; dieser Wert ist der garantierte Mindest-Gap). */
.footer_col_group + .footer_col_group { margin-top: 41px; }
.footer_col_heading {
	display: block;
	margin-bottom: 19px;
	font-size: 0.9375rem !important;   /* 15px */
	font-weight: 400;
	line-height: 25px;
	color: rgba(74, 46, 21, 0.5) !important;
	text-transform: uppercase;
	text-decoration: none;
}
a.footer_col_heading:hover { color: #4a2e15 !important; }
.footer_col_links { list-style: none; margin: 0; padding: 0; }
.footer_link_item { margin: 0; }
.footer_link_item a {
	display: inline-block;
	font-size: 1rem !important;   /* 16px */
	font-weight: 400;
	line-height: 25px;
	color: #4a2e15 !important;
	text-decoration: none;
	transition: color .2s ease;
}
.footer_link_item a:hover { color: #f48520 !important; }

/* Kein Unterstreichungs-Hover irgendwo im Footer (Credit-Link behaelt seine Deko separat) */
.rw_footer a,
.rw_footer a:hover,
.rw_footer a:focus,
.rw_subfooter_legal a,
.rw_subfooter_legal a:hover { text-decoration: none !important; }

/* ---------- Active State (aktuelle Seite = current-menu-item) ---------- */
.footer_link_item.current-menu-item > a,
.footer_link_item.current_page_item > a {
	color: #f48520 !important;
	font-weight: 600;
}
a.footer_col_heading.current-menu-item,
a.footer_col_heading.current_page_item,
a.footer_col_heading.current-menu-ancestor {
	color: #f48520 !important;
}

/* ---------- SubFooter ---------- */
.rw_subfooter { background-color: #fff; }
.rw_subfooter_inner {
	width: calc(100% - var(--rw-gutter) * 2);
	margin: 0 auto;
	min-height: 45px;
	padding: 10px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	font-size: 0.9375rem;   /* 15px */
	line-height: 25px;
}
.rw_subfooter_inner,
.rw_subfooter_inner a { font-size: 0.9375rem !important; }   /* 15px, gegen Elementor-Kit */
.rw_subfooter_copy { color: rgba(74, 46, 21, 0.5); }
.rw_subfooter_legal { display: flex; gap: 32px; flex: 1; justify-content: center; }
.rw_subfooter_legal a { color: #4a2e15 !important; text-decoration: none; }
.rw_subfooter_legal a:hover { color: #f48520 !important; }
.rw_subfooter_credit { color: rgba(74, 46, 21, 0.5); text-align: right; }
.rw_subfooter_credit a { color: rgba(74, 46, 21, 0.5) !important; text-decoration: underline; }
.rw_subfooter_credit a:hover { color: #4a2e15 !important; }

/* =========================================================
   Responsive
   ========================================================= */
@media screen and (max-width: 1200px) {
	.rw_footer { --rw-gutter: 40px; --rw-top: 64px; }
	.rw_footer_grid { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: none; gap: 48px 32px; }
	/* Subgrid/Zeilen-Spanning + Adress-Versatz aufloesen (umgebrochenes Layout) */
	.rw_footer_col_brand,
	.rw_footer_col_address,
	.rw_footer_col_menu { grid-row: auto; }
	.rw_footer_col_menu { display: block; grid-template-rows: none; }
	.rw_footer_col_address { margin-left: 0; }
	.rw_footer_col_brand { grid-column: 1 / -1; }
	/* Panel sitzt im eigenen vollbreiten Row -> nicht mehr hochziehen, nur links bluten */
	.rw_footer_brand_panel { margin-top: calc(var(--rw-top) * -1); }
	.rw_footer_col_brand .rw_footer_social { margin-top: 28px; }
}

@media screen and (max-width: 991px) {
	.rw_footer { --rw-gutter: 24px; }
	.rw_footer_grid { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 600px) {
	.rw_footer { --rw-top: 56px; }
	.rw_footer_grid { grid-template-columns: 1fr; gap: 0; padding-right: 0; }
	.rw_footer_col_brand { margin-bottom: 44px; }
	.rw_footer_col_address { margin-bottom: 8px; }

	/* ---- Akkordeon-Dropdowns ---- */
	.rw_footer_col_menu { margin: 0; }
	.footer_col_group,
	.footer_col_group + .footer_col_group { margin-top: 0; }
	.footer_col_group { border-top: 1px solid rgba(74, 46, 21, 0.18); }
	/* unterster Punkt bekommt auch unten einen Trennstrich */
	.rw_footer_col_menu:last-child .footer_col_group:last-child {
		border-bottom: 1px solid rgba(74, 46, 21, 0.18);
	}

	.footer_col_heading {
		position: relative;
		margin: 0;
		padding: 17px 32px 17px 0;
	}
	/* Chevron nur bei Punkten mit Unterpunkten */
	.footer_col_group:has(.footer_col_links) > .footer_col_heading { cursor: pointer; }
	.footer_col_group:has(.footer_col_links) > .footer_col_heading::after {
		content: '';
		position: absolute;
		top: 50%;
		right: 4px;
		width: 9px;
		height: 9px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-70%) rotate(45deg);
		transition: transform .25s ease;
	}
	.footer_col_group.is-open:has(.footer_col_links) > .footer_col_heading::after {
		transform: translateY(-30%) rotate(-135deg);
	}

	.footer_col_links { display: none; padding: 0 0 18px; }
	.footer_col_group.is-open .footer_col_links { display: block; }
	.footer_link_item a { padding: 4px 0; }

	.rw_subfooter_inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	.rw_subfooter_legal { justify-content: flex-start; flex: none; }
	.rw_subfooter_credit { text-align: left; }
}
