/* tesla-firmenwagen.de – einziges Stylesheet */

/* ---------- Grundlagen ---------- */

:root {
	--text: #272626;
	--muted: #5d5d5d;
	--accent: #2f5aae;
	--accent-dark: #24478c;
	--light: #f4f5f7;
	--line: #dcdfe4;
	--good: #1c6b3a;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: #fff;
	color: var(--text);
	font: 17px/1.65 Arial, Helvetica, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover, a:focus-visible { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.25; margin: 2em 0 0.6em; scroll-margin-top: 16px; }
h1 { font-size: 2em; margin-top: 0; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }
p, ul, ol, figure, table { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.skip-link { position: absolute; left: -999em; }
.skip-link:focus { left: 8px; top: 8px; padding: 8px 12px; background: #fff; z-index: 10; }

/* ---------- Seitenrahmen ---------- */

.site-header, .site-content, .site-footer {
	max-width: 780px;
	margin: 0 auto;
	padding: 0 20px;
}
.site-header { padding-top: 22px; padding-bottom: 22px; }
.site-header a { color: inherit; text-decoration: none; }
.site-title { margin: 0; font-size: 1.25em; font-weight: bold; line-height: 1.3; }
.site-description { margin: 0; font-size: 0.8em; color: var(--muted); }
.site-header-line { border-bottom: 1px solid var(--line); }
.site-content { padding-top: 34px; padding-bottom: 20px; }
.site-footer {
	margin-top: 30px;
	padding-top: 22px;
	padding-bottom: 40px;
	border-top: 1px solid var(--line);
	font-size: 0.85em;
	color: var(--muted);
}

/* ---------- Beitrag ---------- */

.entry-meta { color: var(--muted); font-size: 0.85em; margin-top: -0.4em; }
.lead { font-size: 1.1em; }
.note {
	margin-bottom: 1.2em;
	padding: 14px 18px;
	background: var(--light);
	border-left: 4px solid var(--accent);
}
.note > :last-child { margin-bottom: 0; }
.toc { padding: 16px 20px; background: var(--light); }
.toc h2 { margin: 0 0 0.5em; font-size: 1.1em; }
.toc ul { margin: 0; }
.toc ul ul { margin-top: 0.4em; }
figure img { display: block; margin: 0 auto; }
figcaption { margin-top: 8px; font-size: 0.82em; color: var(--muted); text-align: center; }
a[data-lightbox] { cursor: zoom-in; }
.button {
	display: inline-block;
	padding: 10px 18px;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	border-radius: 3px;
	font-weight: bold;
}
.button:hover, .button:focus-visible { background: var(--accent-dark); color: #fff; }

/* ---------- Startseite ---------- */

.teaser h2 { margin-top: 0.8em; }
.teaser h2 a { color: inherit; text-decoration: none; }
.teaser h2 a:hover { color: var(--accent); }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
.table-wrap table { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--light); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td, tr.total th { font-weight: bold; border-top: 2px solid var(--text); background: none; }
tbody th { background: none; font-weight: normal; }

/* ---------- Rechner ---------- */

.rechner {
	margin: 0 0 1.4em;
	padding: 20px;
	border: 1px solid var(--line);
	border-top: 4px solid var(--accent);
	background: #fff;
}
.rechner h3 { margin-top: 0; }
.rechner-form {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px 20px;
	margin-bottom: 20px;
}
.rechner-form label { display: block; font-size: 0.85em; font-weight: bold; }
.rechner-form label span { display: block; font-weight: normal; color: var(--muted); }
.rechner-form input, .rechner-form select {
	display: block;
	width: 100%;
	margin-top: 5px;
	padding: 8px 10px;
	border: 1px solid #9aa0aa;
	border-radius: 3px;
	background: #fff;
	color: var(--text);
	font: inherit;
}
.rechner-form input[type="range"] { padding: 0; border: 0; }
.rechner-form input:focus-visible, .rechner-form select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rechner .col-e { color: var(--good); }
.rechner-fazit { margin: 16px 0 0; padding: 12px 16px; background: var(--light); font-weight: bold; }
.rechner-hinweis { margin: 12px 0 0; font-size: 0.82em; color: var(--muted); }
.rechner-warnung { margin: 12px 0 0; padding: 10px 14px; border-left: 4px solid #b3261e; background: #fbeceb; font-size: 0.9em; }

/* ---------- Lightbox ---------- */

.lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.92);
	color: #fff;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img {
	max-width: 100%;
	max-height: 100%;
	padding: 48px 8px;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.2s;
	cursor: zoom-out;
}
.lightbox img.is-loaded { opacity: 1; }
.lightbox button {
	position: absolute;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font: 32px/1 sans-serif;
	cursor: pointer;
	opacity: 0.8;
}
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox-close { top: 0; right: max(4px, env(safe-area-inset-right)); }
.lightbox-prev { left: max(4px, env(safe-area-inset-left)); top: calc(50% - 24px); }
.lightbox-next { right: max(4px, env(safe-area-inset-right)); top: calc(50% - 24px); }
.lightbox-count { position: absolute; top: 14px; left: 14px; margin: 0; font-size: 13px; opacity: 0.8; }

/* ---------- Kleinere Bildschirme ---------- */

@media (max-width: 600px) {
	body { font-size: 16px; }
	h1 { font-size: 1.6em; }
	h2 { font-size: 1.3em; }
	.rechner { padding: 14px; margin-left: -8px; margin-right: -8px; }
	.rechner-form { grid-template-columns: 1fr; }
	th, td { padding: 7px 5px; }
	table { font-size: 0.8em; }
	thead th.num { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
