/*
Theme Name:  bau-dein-ebike-v2
Theme URI:   https://www.bau-dein-ebike.de/
Author:      Matthias
Description: Modern lightweight WordPress theme for the bau-dein-ebike.de business website. Gutenberg-compatible and free of external dependencies.
Version:     1.2.5
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bau-dein-ebike-v2
Tags:        one-column, custom-logo, custom-menu, block-patterns, translation-ready
*/

/* ---------------------------------------------------------------
   Custom properties for the modernized original color palette
--------------------------------------------------------------- */
:root {
	--bde-green:        #34ae59;
	--bde-green-text:   #2d8345;
	--bde-green-light:  #5ed67a; /* Light green for the dark header. */
	--bde-green-nav:    #b2f2c0;
	--bde-green-dark:   #246a30;
	--bde-green-darker: #1b5226;
	--bde-brown:        #686158;
	--bde-brown-dark:   #4f4a43;
	--bde-light:        #f5f5f5;
	--bde-white:        #ffffff;
	--bde-text:         #2b2b2b;
	--bde-text-muted:   #6b6b6b;
	--bde-radius:       10px;
	--bde-shadow:       0 2px 12px rgba(0, 0, 0, 0.08);
	--bde-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--bde-container:    1140px;
}

/* ---------------------------------------------------------------
   Base
--------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scrollbar-color: var(--bde-brown) var(--bde-light);
	overflow-x: clip;
	container-type: inline-size;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

body {
	margin: 0;
	font-family: var(--bde-font);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--bde-text);
	background-color: var(--bde-green-dark);
	overflow-x: clip;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--bde-green-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--bde-green-text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid var(--bde-green-text);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.25;
	font-weight: 600;
	color: var(--bde-green-dark);
	margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.7rem); color: var(--bde-green-text); }
h3 { font-size: 1.25rem; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.skip-link {
	left: 0;
	top: 0;
	z-index: 200;
	background: var(--bde-green-dark);
	color: var(--bde-white);
	padding: 0.6rem 1rem;
}

.skip-link:focus {
	position: fixed !important;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
}

#bde-main {
	scroll-margin-top: 5.5rem;
}

#bde-main:focus {
	outline: none;
}

.bde-container {
	max-width: var(--bde-container);
	margin: 0 auto;
	padding: 0 1.25rem;
}

/* ---------------------------------------------------------------
   Top bar
--------------------------------------------------------------- */
.bde-topbar {
	background: var(--bde-light);
	color: var(--bde-green-dark);
	font-size: 0.875rem;
}

.bde-topbar .bde-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	justify-content: flex-end;
	padding-top: 0.45rem;
	padding-bottom: 0.45rem;
}

.bde-topbar a {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.bde-topbar a:hover {
	color: var(--bde-green-text);
}

/* ---------------------------------------------------------------
   Header and navigation
--------------------------------------------------------------- */
.bde-header {
	background: rgba(104, 97, 88, 0.96);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: var(--bde-shadow);
}

body.admin-bar .bde-header {
	top: 32px;
}

body.admin-bar .skip-link:focus {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .bde-header {
		top: 46px;
	}

	body.admin-bar .skip-link:focus {
		top: 46px;
	}
}

@media (max-width: 600px) {
	body.admin-bar .bde-header,
	body.admin-bar .skip-link:focus {
		top: 0;
	}
}

.bde-header .bde-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 70px;
}

.bde-branding {
	display: flex;
	align-items: center;
	padding: 0.5rem 0;
}

.bde-branding img {
	max-height: 52px;
	width: auto;
}

.bde-site-title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0;
}

.bde-site-title a {
	color: var(--bde-white);
	text-decoration: none;
}

.bde-nav {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.bde-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.25rem;
}

.bde-nav a {
	display: block;
	padding: 0.75rem 0.9rem;
	color: var(--bde-white);
	text-decoration: none;
	font-size: 1rem;
	border-radius: 6px;
	transition: color 0.15s ease;
}

.bde-nav a:hover,
.bde-nav .current-menu-item > a,
.bde-nav .current_page_item > a {
	color: var(--bde-green-nav);
}

/* Visible marker for menu links that open in a new browser tab. */
.bde-nav .bde-external-link::after {
	content: " ↗";
	display: inline-block;
	margin-left: 0.2em;
	font-size: 0.85em;
	line-height: 1;
	text-decoration: none;
}

.bde-theme-toggle {
	display: inline-grid;
	flex: 0 0 44px;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.65);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: var(--bde-white);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.bde-theme-toggle:hover {
	border-color: var(--bde-green-light);
	background: rgba(255, 255, 255, 0.16);
}

.bde-header a:focus-visible,
.bde-header button:focus-visible,
.bde-footer a:focus-visible,
.bde-slider button:focus-visible {
	outline-color: var(--bde-white);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7);
}

.bde-theme-toggle svg {
	width: 1.3rem;
	height: 1.3rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bde-theme-toggle__sun {
	display: none;
}

html[data-bde-theme="dark"] .bde-theme-toggle__moon {
	display: none;
}

html[data-bde-theme="dark"] .bde-theme-toggle__sun {
	display: block;
}

.bde-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	background: none;
	border: 2px solid var(--bde-white);
	border-radius: 6px;
	color: var(--bde-white);
	padding: 0.4rem 0.7rem;
	font-size: 1rem;
	cursor: pointer;
}

@media (max-width: 860px) {
	.bde-menu-toggle {
		display: inline-flex;
	}

	.bde-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--bde-brown-dark);
		box-shadow: var(--bde-shadow);
	}

	.bde-nav.is-open {
		display: block;
	}

	.bde-nav ul {
		flex-direction: column;
		padding: 0.5rem 0;
	}

	.bde-nav a {
		padding: 0.75rem 1.5rem;
	}

	.bde-nav .bde-theme-toggle {
		margin: 0.5rem 1.5rem 1rem;
	}
}

/* ---------------------------------------------------------------
   Content
--------------------------------------------------------------- */
.bde-main {
	background: var(--bde-white);
}

.bde-content {
	padding-top: 2.5rem;
	padding-bottom: 3rem;
}

.bde-page-header {
	margin-bottom: 1.5rem;
}

.bde-lead {
	max-width: 850px;
	margin: 0 0 1.75rem;
	color: var(--bde-brown-dark);
	font-size: clamp(1.1rem, 2vw, 1.3rem);
	line-height: 1.5;
}

.bde-page-copy {
	max-width: 850px;
	margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
	margin-right: auto;
	margin-left: 0;
}

.bde-page-copy > :last-child {
	margin-bottom: 0;
}

.bde-page-copy > .wp-block-buttons:last-child {
	margin-bottom: 0;
}

.bde-page-image {
	overflow: hidden;
	margin-top: 1.5rem;
	margin-bottom: 2rem;
	border-radius: var(--bde-radius);
}

.bde-page-image img {
	display: block;
	width: 100%;
	height: auto;
}

.bde-section-intro {
	max-width: 850px;
	margin-top: -0.25rem;
	margin-bottom: 1.75rem;
}

.bde-benefits .bde-card {
	align-items: flex-start;
	text-align: left;
}

.bde-benefits .bde-card h3 {
	color: var(--bde-green-dark);
}

.bde-cta {
	margin-top: 3rem;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	border-left: 5px solid var(--bde-green);
	border-radius: var(--bde-radius);
	background: var(--bde-light);
}

.bde-cta h2 {
	margin-top: 0;
	color: var(--bde-green-dark);
}

.bde-cta p {
	max-width: 760px;
}

.bde-page-content .wp-block-buttons {
	gap: 0.75rem 1rem;
	margin-top: 1.5rem;
	margin-bottom: 2rem;
}

.bde-cta .wp-block-buttons {
	margin-bottom: 0;
}

.bde-cta .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	border: 2px solid var(--bde-green-dark);
	background: transparent;
	color: var(--bde-green-dark);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--bde-green-dark);
	background: var(--bde-green-dark);
	color: var(--bde-white);
}

/*
 * Keep text lines readable on subpages without constraining visual blocks.
 */
body.page:not(.home) .bde-page-content > :where(
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	p,
	ul,
	ol,
	blockquote,
	.wp-block-buttons
) {
	max-width: 850px;
	margin-right: auto;
	margin-left: 0;
}

/* Wide Gutenberg alignments. */
.bde-content .alignwide {
	max-width: var(--bde-container);
	margin-left: auto;
	margin-right: auto;
}

.bde-content .alignfull {
	width: auto;
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/*
 * Container units account for classic browser scrollbars, unlike vw units.
 */
@supports (width: 100cqw) {
	.bde-content .alignfull {
		width: 100cqw;
		margin-left: calc(50% - 50cqw);
		margin-right: calc(50% - 50cqw);
	}
}

/* ---------------------------------------------------------------
   Reusable block pattern components
--------------------------------------------------------------- */

/* Hero */
.bde-hero {
	position: relative;
	border-radius: var(--bde-radius);
	overflow: hidden;
	margin-bottom: 2rem;
}

.bde-hero img {
	display: block;
	width: 100%;
	object-fit: cover;
	max-height: 480px;
}

/* Lightweight slideshow based on a Gutenberg gallery. */
.bde-slider {
	position: relative;
	display: block !important;
	overflow: hidden;
	margin-bottom: 2rem;
	background: var(--bde-brown);
	border-radius: var(--bde-radius);
}

.wp-block-gallery.bde-slider > figure.wp-block-image {
	width: 100% !important;
	margin: 0 !important;
}

/* Convert the gallery layout only after JavaScript has initialized it. */
.wp-block-gallery.bde-slider.is-ready {
	height: clamp(260px, 44vw, 520px);
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image {
	position: absolute;
	inset: 0;
	display: block !important;
	transition: transform 0.6s ease;
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image:not(.is-active) {
	display: none !important;
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image.is-active {
	display: block !important;
	transform: translateX(0);
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image.is-entering-next {
	transform: translateX(100%);
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image.is-entering-prev {
	transform: translateX(-100%);
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image.is-exiting-next {
	transform: translateX(-100%);
}

.wp-block-gallery.bde-slider.is-ready > figure.wp-block-image.is-exiting-prev {
	transform: translateX(100%);
}

.bde-slider > .wp-block-image img {
	display: block;
	width: 100%;
	height: clamp(260px, 44vw, 520px);
	object-fit: cover;
}

.bde-slider__button {
	display: grid;
	position: absolute;
	top: 50%;
	z-index: 2;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	transform: translateY(-50%);
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: var(--bde-white);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
}

.bde-slider__button svg {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bde-slider__button:hover {
	background: var(--bde-green-dark);
}

.bde-slider__button--prev {
	left: 1rem;
}

.bde-slider__button--next {
	right: 1rem;
}

.bde-slider__dots {
	display: flex;
	position: absolute;
	right: 0;
	bottom: 0.9rem;
	left: 0;
	z-index: 2;
	justify-content: center;
	gap: 0.55rem;
}

.bde-slider__dot {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.bde-slider__dot::before {
	content: "";
	width: 0.8rem;
	height: 0.8rem;
	border: 1px solid var(--bde-white);
	border-radius: 50%;
	background: transparent;
}

.bde-slider__dot.is-active::before {
	background: var(--bde-white);
}

@media (max-width: 600px) {
	.wp-block-gallery.bde-slider.is-ready {
		height: 260px;
	}

	.bde-slider__button {
		width: 2.75rem;
		height: 2.75rem;
		font-size: 1.4rem;
	}
}

/* Card grids for motors and teasers. */
.bde-grid {
	display: grid;
	gap: 1.5rem;
	margin: 2rem 0;
}

.bde-grid--4 { grid-template-columns: repeat(4, 1fr); }
.bde-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 940px) {
	.bde-grid--4 { grid-template-columns: repeat(2, 1fr); }
	.bde-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
	.bde-grid--4,
	.bde-grid--3 { grid-template-columns: 1fr; }
}

.bde-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--bde-white);
	border: 1px solid #e6e6e6;
	border-radius: var(--bde-radius);
	padding: 1.5rem;
	text-align: center;
	box-shadow: var(--bde-shadow);
}

.bde-card h2,
.bde-card h3 {
	font-size: 1.1rem;
	color: var(--bde-green-text);
}

/* Rotate only motor images in the dark motor band. */
.bde-band .bde-card img,
.bde-rotate img,
img.bde-rotate {
	margin: 0.75rem auto;
	transform: rotate(0);
}

.bde-card img.bde-card-image {
	display: block;
	width: 150px;
	height: 150px;
	margin: 0.75rem auto;
	object-fit: contain;
}

@keyframes bde-motor-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Apply hover animation only on devices with a precise pointer. */
@media (hover: hover) and (pointer: fine) {
	.bde-band .bde-card:hover img,
	.bde-rotate:hover img,
	img.bde-rotate:hover {
		animation: bde-motor-spin 2s ease-in-out;
	}
}

/* JavaScript applies this class only to the motor currently being touched. */
.bde-band .bde-card.is-touch-active img,
.bde-rotate.is-touch-active img,
img.bde-rotate.is-touch-active {
	animation: bde-motor-spin 2s ease-in-out;
}

.bde-card .bde-more {
	display: inline-block;
	margin-top: auto;
	padding-top: 0.75rem;
	font-weight: 600;
	color: var(--bde-green-dark);
}

/* Dark section based on the original motor band. */
.bde-band {
	background: var(--bde-brown);
	color: var(--bde-white);
	padding: 2.5rem 0;
	border-radius: var(--bde-radius);
	margin: 2rem 0;
}

.bde-band h2 {
	color: var(--bde-white);
}

.bde-band a {
	color: var(--bde-white);
}

/* Button */
.bde-button,
.wp-block-button__link {
	display: inline-block;
	background: var(--bde-green-dark);
	color: var(--bde-white);
	border: none;
	border-radius: 999px;
	padding: 0.7rem 1.6rem;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bde-button:hover,
.wp-block-button__link:hover {
	background: var(--bde-green-darker);
	color: var(--bde-white);
}

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.bde-footer {
	background: var(--bde-green-dark);
	color: var(--bde-white);
	padding: 1.25rem 0;
	font-size: 0.9rem;
}

.bde-footer .bde-container {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
}

.bde-footer a {
	color: var(--bde-white);
	text-decoration: none;
}

.bde-footer a:hover,
.bde-footer a:focus-visible {
	text-decoration: underline;
}

.bde-trademark-notice {
	flex: 0 0 100%;
	margin: 0.5rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid rgba(255, 255, 255, 0.28);
	color: rgba(255, 255, 255, 0.84);
	font-size: 0.75rem;
	line-height: 1.5;
}

/* Stack the footer menu and retain the original arrow marker. */
.bde-footer-menu ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
}

.bde-footer-menu a::before {
	content: "›";
	display: inline-block;
	margin-right: 0.5rem;
	font-size: 1.2em;
	line-height: 1;
	vertical-align: -0.05em;
}

@media (max-width: 600px) {
	.bde-footer .bde-container {
		flex-direction: column;
		align-items: flex-start;
	}

	.bde-footer-menu ul {
		align-items: flex-start;
	}
}

/* ---------------------------------------------------------------
   Dark color scheme
--------------------------------------------------------------- */
html[data-bde-theme="dark"] {
	color-scheme: dark;
	scrollbar-color: #78df8f #151a17;
	--bde-text:       #e5ebe6;
	--bde-text-muted: #b7c1b9;
	--bde-light:      #202722;
	--bde-shadow:     0 2px 14px rgba(0, 0, 0, 0.35);
}

html[data-bde-theme="light"] {
	color-scheme: light;
}

html[data-bde-theme="dark"] body {
	color: var(--bde-text);
	background-color: #111512;
}

html[data-bde-theme="dark"] .bde-main {
	background: #151a17;
}

html[data-bde-theme="dark"] h1,
html[data-bde-theme="dark"] h2,
html[data-bde-theme="dark"] h3,
html[data-bde-theme="dark"] h4,
html[data-bde-theme="dark"] h5,
html[data-bde-theme="dark"] h6 {
	color: #78df8f;
}

html[data-bde-theme="dark"] a {
	color: #8be8a0;
}

html[data-bde-theme="dark"] a:hover {
	color: #b2f2c0;
}

html[data-bde-theme="dark"] .bde-topbar {
	background: #202722;
	color: #dce7de;
}

html[data-bde-theme="dark"] .bde-header {
	background: rgba(48, 46, 42, 0.98);
}

html[data-bde-theme="dark"] .bde-lead,
html[data-bde-theme="dark"] .bde-section-intro {
	color: #d1dad3;
}

html[data-bde-theme="dark"] .bde-card,
html[data-bde-theme="dark"] .bde-cta {
	border-color: #39453d;
	background: #202722;
	color: var(--bde-text);
}

html[data-bde-theme="dark"] .bde-card h2,
html[data-bde-theme="dark"] .bde-card h3,
html[data-bde-theme="dark"] .bde-benefits .bde-card h3,
html[data-bde-theme="dark"] .bde-cta h2 {
	color: #78df8f;
}

html[data-bde-theme="dark"] .bde-card .bde-more {
	color: #8be8a0;
}

html[data-bde-theme="dark"] .bde-band {
	background: #302e2a;
}

html[data-bde-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: #8be8a0;
	color: #8be8a0;
}

html[data-bde-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: #8be8a0;
	background: #8be8a0;
	color: #142017;
}

html[data-bde-theme="dark"] .bde-button,
html[data-bde-theme="dark"] .wp-block-button__link {
	background: var(--bde-green-dark);
	color: var(--bde-white);
}

html[data-bde-theme="dark"] .bde-button:hover,
html[data-bde-theme="dark"] .wp-block-button__link:hover {
	background: var(--bde-green-darker);
	color: var(--bde-white);
}

html[data-bde-theme="dark"] .bde-footer {
	background: #1b5226;
}

html[data-bde-theme="dark"] .bde-footer a {
	color: var(--bde-white);
}

/* ---------------------------------------------------------------
   404 and search results
--------------------------------------------------------------- */
.bde-notfound {
	padding: 3rem 0;
	text-align: center;
}

.bde-notfound--404 {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(1.5rem, 3vw, 2.25rem);
	padding: clamp(1rem, 4vw, 3rem) 0;
	text-align: center;
}

.bde-notfound__content {
	max-width: 31rem;
}

.bde-notfound__content h1 {
	margin-top: 0;
}

.bde-notfound__action {
	margin-top: 2rem;
	margin-bottom: 0;
}

.bde-notfound__figure {
	width: min(100%, 26rem);
	margin: 0;
}

.bde-notfound__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--bde-radius);
	box-shadow: var(--bde-shadow);
}

@media (max-width: 700px) {
	.bde-notfound--404 {
		gap: 1.5rem;
		padding-top: 0.5rem;
	}

	.bde-notfound__content {
		max-width: none;
	}
}
