/* =====================================================================
   chiliredV5 (11-2026)
   Modernes Layout fuer chilired.de: Systemschriften (keine externen
   Fonts), Farben ueber CSS-Variablen, heller und dunkler Modus,
   mobiles Menue ohne JavaScript.
   ===================================================================== */

:root {
	--red: #be1622;
	--red-dark: #9a1019;
	--red-soft: #fdecee;
	--navy: #0d2d6b;
	--text: #1b2236;
	--muted: #5b6478;
	--bg: #ffffff;
	--bg-alt: #f5f6f9;
	--surface: #ffffff;
	--border: #e3e6ee;
	--footer-bg: #0f1a33;
	--footer-text: #c9cfdd;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
	--radius: 14px;
	--wrap: 1120px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--red: #f0444f;
		--red-dark: #ff6670;
		--red-soft: #3a1418;
		--navy: #c7d4f2;
		--text: #e7e9f0;
		--muted: #a3abbe;
		--bg: #0e1424;
		--bg-alt: #141b2e;
		--surface: #182036;
		--border: #283252;
		--footer-bg: #090e1a;
		--footer-text: #a3abbe;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
		color-scheme: dark;
	}
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body.v5 {
	min-height: 100vh;
	display: flex; flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
}
body.v5 input, body.v5 textarea, body.v5 select, body.v5 button { font-family: var(--font); }

a { color: var(--red); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.v5-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.v5-skip { position: absolute; left: 8px; top: 8px; transform: translateY(-200%); z-index: 1000; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; }
.v5-skip:focus { transform: none; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kopfbereich ---------- */
.v5-header {
	position: sticky; top: 0; z-index: 100;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 2px solid var(--red);
}
/* Logo liegt mit der Unterkante immer auf der roten Linie unter dem Kopfbereich */
.v5-header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.v5-logo { align-self: flex-end; display: block; line-height: 0; padding-top: 18px; }
.v5-logo img { width: 190px; height: auto; display: block; }
@media (prefers-color-scheme: dark) { .v5-logo img { filter: brightness(0) invert(1); } }

.v5-nav ul { list-style: none; margin: 0; padding: 0; }
.v5-nav > ul { display: flex; gap: 4px; align-items: center; }
.v5-nav li { position: relative; }
.v5-nav a {
	display: block; padding: 8px 14px; border-radius: 999px;
	color: var(--text); font-weight: 500; font-size: 15px;
}
.v5-nav a:hover { background: var(--bg-alt); text-decoration: none; }
.v5-nav a.active { color: var(--red); background: var(--red-soft); }
.v5-nav li ul {
	position: absolute; top: 100%; left: 0; min-width: 220px; padding: 6px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.v5-nav li ul a { border-radius: 8px; }

.v5-nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.v5-burger { display: none; cursor: pointer; width: 44px; height: 44px; border-radius: 10px; position: relative; }
.v5-burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.v5-burger span:nth-child(1) { top: 15px; }
.v5-burger span:nth-child(2) { top: 21px; }
.v5-burger span:nth-child(3) { top: 27px; }
.v5-burger em, .v5-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
	.v5-header-inner { min-height: 60px; gap: 0; }
	.v5-logo { padding-top: 14px; }
	.v5-logo img { width: 160px; }
	.v5-burger { display: block; }
	/* Menue klappt als Overlay unter der Linie auf, das Logo bleibt auf der Linie */
	.v5-nav { display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; padding: 8px 18px 16px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
	.v5-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
	.v5-nav a { border-radius: 10px; padding: 12px 14px; font-size: 16px; }
	.v5-nav li ul { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; background: transparent; }
	.v5-nav-toggle:checked ~ .v5-nav { display: block; }
	.v5-nav-toggle:checked + .v5-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
	.v5-nav-toggle:checked + .v5-burger span:nth-child(2) { opacity: 0; }
	.v5-nav-toggle:checked + .v5-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
	.v5-nav-toggle:focus-visible + .v5-burger { outline: 3px solid var(--red); }
}

/* ---------- Inhalt ---------- */
.v5-main { flex: 1 0 auto; padding: 56px 0 72px; overflow-x: clip; }
.v5-main article.content { display: flow-root; }
body:not(.page-startseite) .v5-main article.content { max-width: 860px; }
/* zweispaltige Seiten (.left + .right) duerfen die volle Breite nutzen */
body.v5:not(.page-startseite) .v5-main article.content:has(> .left):has(> .right) { max-width: none; }

.content h1, .content h2, .content h3 {
	color: var(--text); line-height: 1.2; letter-spacing: -.015em; font-weight: 750;
	margin: 1.6em 0 .5em;
}
.content h1 { font-size: clamp(30px, 4vw, 42px); margin-top: 0; }
.content h2 { font-size: clamp(24px, 3vw, 30px); }
.content h3 { font-size: 20px; }
.content > :first-child { margin-top: 0; }
.content p { margin: 0 0 1em; }
.content ul { padding-left: 0; list-style: none; margin: 0 0 1.2em; }
.content ul li { position: relative; padding-left: 22px; margin: 4px 0; }
.content ul li::before {
	content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px;
	border-radius: 2px; background: var(--red); transform: rotate(45deg);
}
.content ol { padding-left: 22px; }
.content strong, .content b { font-weight: 650; }
.content table { border-collapse: collapse; width: 100%; }
.content td, .content th { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* alte Inhalte mit leeren Absaetzen nicht unnoetig strecken */
.content p:empty { display: none; }

/* Zweispaltig (Kontakt, Domain-Seiten): .left / .right */
.content .left, .content .right { margin-bottom: 24px; }
@media (min-width: 900px) {
	.content:has(> .left):has(> .right) { display: grid; grid-template-columns: 1fr 1.2fr; gap: 0 48px; align-items: start; }
	.content:has(> .left):has(> .right) > :not(.left):not(.right) { grid-column: 1 / -1; }
}

/* ---------- Meldungen ---------- */
.warning {
	padding: 12px 16px; margin: 0 0 20px; border-radius: 10px; font-size: 15px;
	border: 1px solid #f5c2c7; background: var(--red-soft); color: var(--red-dark);
}
.warning.prio3 { border-color: #b7e4c7; background: #e9f7ef; color: #1e6b3d; }
@media (prefers-color-scheme: dark) { .warning.prio3 { background: #123222; color: #8fe0b0; border-color: #1f5236; } }

/* ---------- Formulare (Kontakt) ---------- */
form.form, #kontakt { margin: 0; }
#kontaktFields { display: grid; gap: 12px; }
input[type="text"], input[type="email"], input[type="search"], input[type="password"], textarea, select {
	width: 100%; font-size: 16px; line-height: 1.4; color: var(--text);
	background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
	padding: 12px 14px; margin: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 180px; resize: vertical; }
input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
	outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft);
}
::placeholder { color: var(--muted); opacity: 1; }

button, input[type="submit"], .v5-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-size: 16px; font-weight: 650; line-height: 1;
	padding: 14px 24px; border-radius: 999px; border: 2px solid var(--red);
	background: var(--red); color: #fff; cursor: pointer; text-decoration: none;
	transition: background .15s, border-color .15s, transform .15s;
}
button:hover, input[type="submit"]:hover, .v5-btn:hover { background: var(--red-dark); border-color: var(--red-dark); text-decoration: none; color: #fff; }
button:active, .v5-btn:active { transform: translateY(1px); }
.v5-btn-ghost { background: transparent; color: var(--red); }
.v5-btn-ghost:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
#kontaktSubmit { margin-top: 16px; }
#kontaktSubmit button { width: 100%; }

/* Datenschutz-Checkbox aus dem Kontaktformular */
p.checkbox { position: relative; padding-left: 38px; margin: 4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
label.checkbox { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
label.checkbox input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
label .checkmark { position: absolute; inset: 0; border: 2px solid var(--border); border-radius: 6px; background: var(--surface); transition: border-color .15s, background .15s; }
label.checkbox:hover .checkmark, label.checkbox input:focus-visible ~ .checkmark { border-color: var(--red); }
label.checkbox input:checked ~ .checkmark { background: var(--red); border-color: var(--red); }
label.checkbox input:checked ~ .checkmark::after {
	content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
	border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* Captcha */
.form-group.captcha { display: grid; gap: 6px; margin-top: 12px; }
.form-group.captcha label { font-size: 14px; font-weight: 600; color: var(--muted); }
.form-group.captcha .captcha-img { margin: 0 !important; border: 1px solid var(--border); }
.form-group.captcha input { max-width: 220px; letter-spacing: .15em; text-transform: uppercase; }

/* ---------- Startseite ---------- */
.page-startseite .v5-main { padding-top: 0; }

.v5-hero {
	position: relative; margin: 0 -24px 8px; padding: 88px 24px 72px;
	text-align: left;
}
.v5-hero::before {
	content: ""; position: absolute; inset: 0 -100vw; z-index: -1;
	background:
		radial-gradient(60% 80% at 85% 10%, color-mix(in srgb, var(--red) 16%, transparent), transparent 70%),
		radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--navy) 12%, transparent), transparent 70%),
		var(--bg-alt);
	border-bottom: 1px solid var(--border);
}
.v5-eyebrow {
	display: inline-block; margin: 0 0 18px !important; padding: 6px 14px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--border);
	font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.content .v5-hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -.03em; max-width: 14ch; margin: 0 0 20px; }
.content .v5-hero h1 em { font-style: normal; color: var(--red); }
.v5-lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 60ch; margin-bottom: 28px !important; }
.v5-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 !important; }

.v5-section { padding: 64px 0 0; }
.content .v5-section > h2 { margin: 0 0 8px; }
.v5-sub { color: var(--muted); max-width: 62ch; margin-bottom: 32px !important; }

.v5-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .v5-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .v5-cards { grid-template-columns: minmax(0, 1fr); } }

/* Schwerpunkt-Karten (2 grosse) und weitere Leistungen (4 kompakte) */
.v5-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.v5-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .v5-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .v5-cards-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .v5-cards-4 { grid-template-columns: minmax(0, 1fr); } }
.v5-card-lg { padding: 32px 30px 24px; border-top: 4px solid var(--red); }
.v5-card-lg::after { top: 44px; left: 42px; }
.content .v5-card-lg h3 { font-size: 24px; margin-top: 18px; }
.content .v5-card-lg .v5-card-intro { color: var(--text); font-size: 16.5px; margin: 0 0 14px; }
.content .v5-card-lg ul { font-size: 16px; }
.content .v5-card-lg ul:has(> li:nth-child(6)) { columns: 2; column-gap: 28px; }
.content .v5-card-lg ul li { break-inside: avoid; }
@media (max-width: 560px) { .content .v5-card-lg ul, .content .v5-card-lg ul:has(> li:nth-child(6)) { columns: 1; } }

.v5-card {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 26px 24px 18px; box-shadow: var(--shadow);
	transition: transform .2s, border-color .2s;
}
.v5-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.content .v5-card h3 { margin: 16px 0 10px; font-size: 20px; }
.content .v5-card ul { margin: 0 0 6px; font-size: 15.5px; color: var(--muted); }
.content .v5-card ul li { margin: 3px 0; }
.content .v5-card ul li::before { width: 6px; height: 6px; top: .7em; }
.v5-card p:last-child { margin-bottom: 4px; font-size: 15px; }

/* Icons der Leistungen (als Maske, Farbe folgt --red) */
.v5-card::before {
	content: ""; display: block; width: 48px; height: 48px; border-radius: 12px;
	background: var(--red-soft);
}
.v5-card { position: relative; }
.v5-card::after {
	content: ""; position: absolute; left: 36px; top: 38px; width: 24px; height: 24px;
	background: var(--red);
	-webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.v5-ico-web   { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='3' width='20' height='14' rx='2'/><path d='M8 21h8M12 17v4M7 8l-2 2 2 2M17 8l2 2-2 2'/></svg>"); }
.v5-ico-cloud { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 18h10.5a4 4 0 0 0 .4-7.98A6 6 0 0 0 6.2 9.1 4.5 4.5 0 0 0 7 18z'/></svg>"); }
.v5-ico-it    { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='7' rx='2'/><rect x='3' y='14' width='18' height='7' rx='2'/><path d='M7 6.5h.01M7 17.5h.01M11 6.5h6M11 17.5h6'/></svg>"); }
.v5-ico-print { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9V3h12v6'/><rect x='3' y='9' width='18' height='8' rx='2'/><path d='M7 14h10v7H7z'/></svg>"); }
.v5-ico-photo { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h3l2-3h6l2 3h3a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z'/><circle cx='12' cy='13' r='4'/></svg>"); }
.v5-ico-3d    { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2l9 5v10l-9 5-9-5V7z'/><path d='M3 7l9 5 9-5M12 12v10'/></svg>"); }

/* Vorteile */
.v5-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 800px) { .v5-features { grid-template-columns: 1fr; gap: 18px; } }
.v5-feature { border-top: 3px solid var(--red); padding-top: 16px; }
.content .v5-feature h3 { margin: 0 0 6px; font-size: 19px; }
.v5-feature p { color: var(--muted); margin: 0 !important; }

/* Abschluss-Aufruf */
.v5-cta {
	margin-top: 72px; padding: 44px 40px; border-radius: 20px;
	background: linear-gradient(135deg, var(--red) 0%, #8e0f18 100%); color: #fff;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
}
.content .v5-cta h2 { color: #fff; margin: 0 0 6px; }
.v5-cta p { margin: 0 !important; color: rgba(255, 255, 255, .88); }
.v5-cta .v5-btn { background: #fff; border-color: #fff; color: #9a1019; }
.v5-cta .v5-btn:hover { background: #ffe9eb; border-color: #ffe9eb; color: #9a1019; }

/* ---------- Fussbereich ---------- */
.v5-footer { background: var(--footer-bg); color: var(--footer-text); font-size: 15px; padding: 44px 0 20px; }
.v5-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; padding-bottom: 28px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.v5-footer-brand { width: fit-content; max-width: 100%; }
/* Footer: weisse Linie wie das Logo, so breit wie der Text darunter */
.v5-footer-logo { display: block; line-height: 0; border-bottom: 1px solid rgba(255, 255, 255, .95); margin-bottom: 14px; }
.v5-footer-brand img { width: 160px; height: auto; display: block; filter: brightness(0) invert(1); opacity: .95; }
.v5-footer-brand p { margin: 0; line-height: 1.6; }
.v5-footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-start; }
.v5-footer-links a { color: #fff; font-weight: 500; }
.v5-footer-copy { padding-top: 18px; font-size: 13px; opacity: .75; }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
	body.v5 { font-size: 16px; }
	.v5-wrap { padding: 0 18px; }
	.v5-main { padding: 36px 0 56px; }
	.v5-hero { margin: 0 -18px 0; padding: 56px 18px 48px; }
	.v5-eyebrow { border-radius: 12px; letter-spacing: .02em; }
	.v5-section { padding-top: 48px; }
	.v5-actions .v5-btn { flex: 1 1 100%; }
	.v5-cta { padding: 32px 24px; margin-top: 56px; }
	.v5-cta .v5-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.v5-card, .v5-burger span { transition: none; }
	.v5-card:hover { transform: none; }
}

/* Druck */
@media print {
	.v5-header, .v5-footer, .v5-cta, .v5-actions { display: none !important; }
	body.v5 { background: #fff; color: #000; }
	.v5-card { box-shadow: none; break-inside: avoid; }
}
