/* ==========================================================================
   RVM-Tech – Corporate Design
   Farben exakt nach Design Guide: Anthrazit #1F1F1F · Rot #DA101A · Blau #1A61A8
   Formensprache: eckig, flach, dünne Linien (analog zum Logo), keine Verläufe/Schatten.
   ========================================================================== */

:root {
    --ink: #1F1F1F;
    --ink-deep: #161616;
    --ink-soft: #2B2B2D;
    --red: #DA101A;
    --red-dark: #B30D15;
    --blue: #1A61A8;
    --blue-soft: #5FA3E6;       /* Blau-Variante für dunkle Flächen (Kontrast) */

    --paper: #FFFFFF;
    --mist: #F4F4F5;
    --line: #E1E1E5;
    --line-dark: rgba(255, 255, 255, 0.14);
    --text: #1F1F1F;
    --muted: #5A5A62;
    --muted-dark: #A9A9B2;

    --radius: 2px;
    --container: 1200px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --header-h: 76px;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    /* Kompatibilität zu bestehenden Seiten */
    --primary-color: var(--red);
    --secondary-color: var(--ink);
    --tertiary-color: var(--blue);
    --light-bg: var(--mist);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover { color: var(--red); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.on-dark :focus-visible, header :focus-visible, footer :focus-visible { outline-color: var(--blue-soft); }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 2000;
    background: var(--paper); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------- Typografie ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.005em; }
h4 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
p { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.6; color: var(--muted); max-width: 62ch; }

/* Eyebrow – rote Linie wie die Trennlinien neben „TECH“ im Logo */
.eyebrow {
    display: inline-flex; align-items: center; gap: 0.85rem;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--ink);
}
.eyebrow::before { content: ""; width: 2rem; height: 2px; background: var(--red); flex: none; }
.on-dark .eyebrow, .eyebrow--light { color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.9rem 1.6rem; border: 1px solid transparent; border-radius: var(--radius);
    font: 700 0.8rem/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
    cursor: pointer; transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.on-dark .btn-outline, .btn-outline--light { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.on-dark .btn-outline:hover, .btn-outline--light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-secondary:hover { background: var(--ink-soft); color: #fff; }
.btn-info { background: var(--blue); color: #fff; }
.btn-info:hover { background: #144f89; color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.72rem; }
.btn .arrow { width: 0.95rem; height: 0.95rem; flex: none; }

.link-arrow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--ink); text-decoration: none;
}
.link-arrow svg { width: 0.95rem; height: 0.95rem; transition: transform .18s ease; }
.link-arrow:hover { color: var(--red); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--ink); color: #fff;
    border-bottom: 1px solid var(--line-dark);
}
.site-header nav {
    display: flex; align-items: center; justify-content: space-between; gap: 2rem;
    max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 38px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 2.25rem; list-style: none; margin-left: auto; }
.nav-links a {
    position: relative; display: inline-block; padding: 0.4rem 0;
    color: rgba(255, 255, 255, 0.78); text-decoration: none;
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    transition: color .18s ease;
}
.nav-links a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: #fff; }
.nav-links a.nav-cta {
    padding: 0.7rem 1.4rem; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: var(--radius); color: #fff;
}
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover, .nav-links a.nav-cta.active { background: var(--red); border-color: var(--red); }

.nav-toggle {
    display: none; width: 44px; height: 44px; margin-left: auto;
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--radius); cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block; width: 18px; height: 2px; background: #fff; margin: 0 auto; position: relative; transition: transform .2s ease, background .2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: absolute; left: 0; right: 0; top: var(--header-h);
        flex-direction: column; align-items: stretch; gap: 0; margin: 0;
        background: var(--ink); border-bottom: 1px solid var(--line-dark);
        padding: 0.5rem var(--gutter) 1.5rem; display: none;
    }
    .nav-open .nav-links { display: flex; }
    .nav-links li { border-bottom: 1px solid var(--line-dark); }
    .nav-links li:last-child { border-bottom: 0; padding-top: 1rem; }
    .nav-links a { display: block; padding: 1rem 0; }
    .nav-links a::after { display: none; }
    .nav-links a.active { color: var(--red); }
    .nav-links a.nav-cta { text-align: center; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section--mist { background: var(--mist); }
.section--dark { background: var(--ink); color: #fff; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark p, .section--dark .lead { color: var(--muted-dark); }

.section-head { max-width: 760px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .eyebrow { margin-bottom: 1.25rem; }
.section-head h2 { margin-bottom: 1.1rem; }

/* Grid-Helfer (kompatibel zu bestehenden Seiten) */
.grid { display: grid; gap: 1.5rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) {
    .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Hero (Startseite)
   ========================================================================== */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: var(--ink-deep);
}
.hero::before {                       /* feines Konstruktionsraster */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 70% 40%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 80% 90% at 70% 40%, #000 20%, transparent 75%);
}
.hero-main {
    position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center; gap: clamp(1.5rem, 4vw, 4rem);
    padding-top: clamp(3.5rem, 7vw, 6rem); padding-bottom: clamp(3rem, 6vw, 5rem);
    min-height: min(680px, calc(100vh - var(--header-h) - 160px));
}
.hero h1 { color: #fff; text-transform: uppercase; font-size: clamp(2.5rem, 5.6vw, 4.6rem); line-height: 1; margin: 1.5rem 0 1.5rem; }
.hero h1 .dot { color: var(--red); }
.hero-tagline { font-size: clamp(1.15rem, 2vw, 1.5rem); color: #fff; font-weight: 500; margin-bottom: 0.75rem; }
.hero-text { color: var(--muted-dark); max-width: 46ch; margin-bottom: 2.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-visual { position: relative; aspect-ratio: 1.55 / 1; width: 100%; }
.hero-visual canvas, .hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-visual img { object-fit: contain; padding: 4%; transition: opacity .6s ease; }
.hero-visual.is-ready img { opacity: 0; }
.hero-visual canvas { opacity: 0; transition: opacity .6s ease; touch-action: pan-y; }
.hero-visual.is-ready canvas { opacity: 1; }

.hero-points {
    position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
    border-top: 1px solid var(--line-dark);
}
.hero-point { position: relative; padding: 2rem 2rem 2.25rem 0; }
.hero-point + .hero-point { padding-left: 2rem; border-left: 1px solid var(--line-dark); }
.hero-point::before {
    content: ""; position: absolute; top: -1px; left: 0; width: 3rem; height: 3px; background: var(--c, var(--red));
}
.hero-point + .hero-point::before { left: 2rem; }
.hero-point:nth-child(1) { --c: var(--red); }
.hero-point:nth-child(2) { --c: var(--blue-soft); }
.hero-point:nth-child(3) { --c: #fff; }
.hero-point h3 { color: #fff; font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 0.5rem; }
.hero-point p { color: var(--muted-dark); font-size: 0.95rem; max-width: 34ch; }

@media (max-width: 960px) {
    .hero-main { grid-template-columns: 1fr; min-height: 0; }
    .hero-visual { order: -1; max-width: 560px; margin: 0 auto; }
    .hero-points { grid-template-columns: 1fr; }
    .hero-point, .hero-point + .hero-point { padding: 1.5rem 0; border-left: 0; }
    .hero-point + .hero-point { border-top: 1px solid var(--line-dark); }
    .hero-point + .hero-point::before { left: 0; top: -1px; }
}

/* ---------- Seiten-Hero (Unterseiten) ---------- */
.page-hero {
    position: relative; overflow: hidden; background: var(--ink); color: #fff;
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem);
    border-bottom: 3px solid var(--red);
}
.page-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: url("../img/v-mark.svg") no-repeat right -4% center / auto 135%;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; margin: 1.25rem 0 1rem; max-width: 22ch; font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.page-hero p { color: var(--muted-dark); font-size: clamp(1.05rem, 1.6vw, 1.2rem); max-width: 56ch; }
.page-hero .eyebrow { color: #fff; }

/* ==========================================================================
   Cards / Listen
   ========================================================================== */
.card {
    position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 2rem; transition: border-color .2s ease;
}
.card::before {
    content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; background: var(--red);
    transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.card:hover { border-color: var(--ink); }
.card:hover::before { transform: scaleX(1); }
.card h3 { margin-bottom: 0.9rem; }
.card p { line-height: 1.7; }
.card-index {
    display: block; margin-bottom: 1.75rem;
    font: 700 0.8rem/1 var(--font); letter-spacing: 0.2em; color: var(--red);
}
.card-icon { display: none; }       /* ehemalige Emoji-Icons – nicht mehr verwendet */

.service-card { display: flex; flex-direction: column; }
.service-card .list { margin: 1.25rem 0 2rem; }
.service-card .link-arrow { margin-top: auto; }

/* Listen mit rotem Strich (Logo-Trennlinie) */
.list { list-style: none; }
.list li { position: relative; padding: 0.4rem 0 0.4rem 1.6rem; color: var(--text); }
.list li::before {
    content: ""; position: absolute; left: 0; top: 1.05em; width: 0.9rem; height: 2px; background: var(--red);
}
.section--dark .list li, .panel--dark .list li { color: #fff; }

/* ---------- Signalweg (Vom Signal zur Entscheidung) ---------- */
.chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; position: relative; }
.stage { position: relative; padding: 2.75rem 2rem 0 0; }
.stage::before {                      /* Schiene */
    content: ""; position: absolute; left: 0; right: 0; top: 0.4rem; height: 1px; background: rgba(255, 255, 255, 0.28);
}
.stage::after {                       /* Knoten */
    content: ""; position: absolute; left: 0; top: 0; width: 0.85rem; height: 0.85rem; background: var(--red);
}
.stage:last-child::before { right: auto; width: 100%; background: linear-gradient(to right, rgba(255,255,255,.28), rgba(255,255,255,0)); }
.stage-no { display: block; font: 700 0.75rem/1 var(--font); letter-spacing: 0.22em; color: var(--blue-soft); margin-bottom: 0.9rem; }
.stage h3 { font-size: 1.35rem; margin-bottom: 0.6rem; }
.stage p { font-size: 0.95rem; margin-bottom: 1.25rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips li {
    padding: 0.3rem 0.65rem; border: 1px solid var(--line-dark); border-radius: var(--radius);
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #fff;
}
@media (max-width: 960px) {
    .chain { grid-template-columns: 1fr; }
    .stage { padding: 0 0 2.5rem 2.25rem; }
    .stage::before { left: 0.4rem; right: auto; top: 0.9rem; bottom: -0.2rem; width: 1px; height: auto; }
    .stage:last-child::before { background: linear-gradient(to bottom, rgba(255,255,255,.28), rgba(255,255,255,0)); }
    .stage::after { top: 0.1rem; }
}

/* ---------- Zwei-Spalten-Argumente ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split--sticky > :first-child { position: sticky; top: calc(var(--header-h) + 2rem); }
@media (max-width: 960px) {
    .split { grid-template-columns: 1fr; gap: 2rem; }
    .split--sticky > :first-child { position: static; }
}
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.fact { padding: 1.75rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--line); }
.fact:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.fact h3 { margin-bottom: 0.8rem; }
@media (max-width: 640px) {
    .facts { grid-template-columns: 1fr; }
    .fact, .fact:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* Zielgruppen: Spalten mit Linie statt Karten */
.columns-rule { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.columns-rule > div { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.columns-rule h3 { margin-bottom: 0.75rem; }
@media (max-width: 760px) { .columns-rule { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Leistungs-Detailseite ---------- */
.service-row { padding: clamp(3rem, 6vw, 5rem) 0; border-top: 1px solid var(--line); }
.service-row:first-of-type { border-top: 0; }
.service-row .no { display: block; font: 700 0.8rem/1 var(--font); letter-spacing: 0.2em; color: var(--red); margin-bottom: 1.25rem; }
.service-row h2 { margin-bottom: 1rem; }
.panel { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.panel--dark { background: var(--ink); border-color: var(--ink); }
.panel--dark h4 { color: #fff; }
.panel h4 { margin-bottom: 1rem; color: var(--ink); }
.panel + .panel { margin-top: 1.5rem; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tile { padding: 2rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.tile h3 { margin-bottom: 1rem; }
@media (max-width: 640px) { .tile-grid { grid-template-columns: 1fr; } }

/* ---------- CTA-Band ---------- */
.cta-band { background: var(--red); color: #fff; padding: clamp(3rem, 6vw, 4.5rem) 0; }
.cta-band .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-band h2 { color: #fff; max-width: 24ch; }
.cta-band p { color: rgba(255, 255, 255, 0.88); margin-top: 0.6rem; }
.cta-band .btn { background: #fff; color: var(--ink); }
.cta-band .btn:hover { background: var(--ink); color: #fff; }

/* ==========================================================================
   Portfolio / News
   ========================================================================== */
.portfolio-item { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .2s ease; }
.portfolio-item:hover { border-color: var(--ink); }
.portfolio-image { width: 100%; height: 240px; object-fit: cover; }
.portfolio-placeholder {
    height: 240px; background: var(--ink) url("../img/v-mark.svg") no-repeat center / 70% auto;
}
.portfolio-content { padding: 1.75rem; }
.portfolio-content h3 { margin: 0.9rem 0 0.6rem; }
.portfolio-tag {
    display: inline-block; padding: 0.25rem 0.7rem; border: 1px solid var(--red); border-radius: var(--radius);
    color: var(--red); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}

.news-list { max-width: 820px; }
.news-item { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-date { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); margin-bottom: 0.75rem; }
.news-item h3 { font-size: 1.6rem; margin-bottom: 1rem; }
.news-item img { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 1.25rem; }

.empty-state { padding: 3rem 2rem; border: 1px dashed #c6c6cc; border-radius: var(--radius); text-align: left; max-width: 620px; }
.empty-state p { font-size: 1.05rem; }

/* ==========================================================================
   Kontakt / Formulare
   ========================================================================== */
.form-group { margin-bottom: 1.4rem; }
label { display: block; margin-bottom: 0.45rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="datetime-local"], input[type="url"], input[type="number"], input[type="password"], select, textarea {
    width: 100%; padding: 0.85rem 0.95rem; background: var(--paper);
    border: 1px solid #c4c4cb; border-radius: var(--radius);
    font: inherit; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 97, 168, 0.18); }
textarea { resize: vertical; min-height: 160px; }

.alert-success { padding: 1rem 1.25rem; margin-bottom: 1.5rem; border-left: 3px solid #1f7a3d; background: #eef7f1; color: #17562c; }

.contact-list { list-style: none; }
.contact-list li { padding: 1rem 0; border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: 0; padding-top: 0; }
.contact-list h4 { color: var(--muted); font-size: 0.7rem; margin-bottom: 0.35rem; }
.contact-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.contact-list a:hover { color: var(--red); }
.person { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 2px solid var(--ink); }
.person h3 { margin-bottom: 0.15rem; }
.person .role { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.person a { color: var(--ink); font-weight: 600; text-decoration: none; }
.person a:hover { color: var(--red); }

/* ---------- Rechtstexte ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.6rem; margin-bottom: 1.5rem; }
.prose h3 { font-size: 1.1rem; margin: 2.25rem 0 0.6rem; }
.prose h4 { margin: 1.5rem 0 0.4rem; color: var(--ink); }
.prose p, .prose li { color: var(--text); margin-bottom: 0.75rem; }
.prose ul { padding-left: 1.25rem; margin-bottom: 1rem; }
.prose .meta { margin-top: 3rem; color: var(--muted); font-size: 0.9rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink-deep); color: #fff; border-top: 3px solid var(--red); }
.footer-grid {
    display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 3rem;
    padding: clamp(3rem, 6vw, 4.5rem) 0 3rem;
}
.footer-brand img { width: 210px; height: auto; margin-bottom: 1.25rem; }
.footer-brand p { color: var(--muted-dark); font-size: 0.92rem; max-width: 34ch; }
.site-footer h4 { color: #fff; margin-bottom: 1.1rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--muted-dark); text-decoration: none; font-size: 0.92rem; transition: color .15s ease; }
.site-footer a:hover { color: #fff; }
.site-footer address { font-style: normal; color: var(--muted-dark); font-size: 0.92rem; line-height: 1.7; }
.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
    padding: 1.5rem 0; border-top: 1px solid var(--line-dark); font-size: 0.82rem; color: var(--muted-dark);
}
.footer-bottom p { color: inherit; }
.footer-bottom ul { display: flex; gap: 1.5rem; }
.footer-bottom li { margin: 0; }
.footer-bottom a { font-size: 0.82rem; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ==========================================================================
   Cookie-Hinweis
   ========================================================================== */
.cookie-banner {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1500;
    max-width: 760px; margin: 0 auto; padding: 1.25rem 1.5rem;
    background: var(--ink); color: #fff; border: 1px solid var(--line-dark); border-left: 3px solid var(--red);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { color: #d6d6dc; font-size: 0.9rem; flex: 1 1 320px; }
.cookie-banner a { color: #fff; }
.cookie-banner .actions { display: flex; gap: 0.6rem; }
.cookie-banner .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.cookie-banner .btn-outline:hover { background: #fff; color: var(--ink); }

/* ==========================================================================
   Admin-Bereich (nutzt dieselben Bausteine)
   ========================================================================== */
.admin-panel { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem; overflow-x: auto; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 2rem; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 0.92rem; }
.admin-table thead { background: var(--ink); color: #fff; }
.admin-table th { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-table th, .admin-table td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table tbody tr:hover { background: var(--mist); }
.action-buttons { display: flex; gap: 0.5rem; }
.admin-section { padding-top: 3rem; padding-bottom: 3rem; }
.admin-section h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.5rem; }
.admin-stats { margin: 2rem 0; }
.admin-stats .stat { font: 800 2.6rem/1 var(--font-display); color: var(--ink); margin: 0.5rem 0 1.5rem; }
.btn-block { display: flex; width: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* ==========================================================================
   Redaktionsbereich: Login, Admin-Layout, Bearbeitungsmodus
   ========================================================================== */
.news-item video { width: 100%; max-height: 420px; border-radius: var(--radius); margin-bottom: 1.25rem; background: #000; }

.auth-card { max-width: 480px; margin: 0 auto; }
.auth-card h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 1rem 0 1.5rem; }
.auth-card form { margin-top: 1.25rem; }
.auth-hint { margin-top: 2rem; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

.alert-error, .alert-info {
    padding: 0.9rem 1.15rem; margin: 0 0 1.25rem; border-left: 3px solid var(--red);
    background: #fdf0f0; color: #7d1117; font-size: 0.95rem;
}
.alert-info { border-left-color: var(--blue); background: #eef4fb; color: #144a80; }
.alert-success { margin-bottom: 1.25rem; }

/* Layout */
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-top: 2.5rem; padding-bottom: 4rem; align-items: start; }
.admin-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); border-top: 3px solid var(--red); padding-top: 1.25rem; }
.admin-user { font-size: 0.85rem; margin-bottom: 1.25rem; }
.admin-sidebar h4 { font-size: 0.7rem; color: var(--muted); margin: 1.5rem 0 0.5rem; }
.admin-sidebar nav a {
    display: block; padding: 0.55rem 0.75rem; margin: 0 -0.75rem; border-left: 2px solid transparent;
    color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500;
}
.admin-sidebar nav a:hover { background: var(--mist); }
.admin-sidebar nav a.active { border-left-color: var(--red); background: var(--mist); font-weight: 700; }
.admin-main { min-width: 0; }
.admin-main .container, .admin-main .admin-section { max-width: none; padding-left: 0; padding-right: 0; padding-top: 0; }
.admin-head { margin-bottom: 2rem; }
.admin-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.6rem; }
.admin-head p { max-width: 70ch; }
.admin-section h1 { margin-bottom: 1.5rem; }
@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { display: block; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .2s ease; }
.stat-card:hover { border-color: var(--ink); color: var(--ink); }
.stat-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat { display: block; font: 800 2.4rem/1.2 var(--font-display); margin-top: 0.4rem; }
.stat-note { display: inline-block; font-size: 0.8rem; color: var(--red); font-weight: 600; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.admin-cards .card form { margin-top: 1rem; display: grid; gap: 0.75rem; }
.admin-cards .card .link-arrow { margin-top: 1rem; }

/* Panels, Tabellen, Formulare */
.admin-panel h3 { margin-bottom: 1rem; }
.admin-panel + .admin-panel, .admin-panel + form, form + .admin-panel { margin-top: 1.5rem; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.panel-head h3 { margin: 0; }
fieldset.admin-panel { margin: 0 0 1.5rem; }
fieldset legend { padding: 0 0.5rem; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
@media (max-width: 700px) { .field-grid { grid-template-columns: 1fr; } }
.field-hint { display: block; margin-top: 0.4rem; font-size: 0.82rem; color: var(--muted); }
.check label, label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.check input[type="checkbox"], label.check input { width: auto; }
.edit-form { max-width: 820px; }
.thumb { max-width: 220px; max-height: 140px; object-fit: cover; border: 1px solid var(--line); margin: 0.5rem 0; }
.code-area { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85rem; line-height: 1.5; }
.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0; }
.inline-form input[type="text"] { width: 12rem; padding: 0.5rem 0.65rem; }
.stack-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.row-details summary { list-style: none; cursor: pointer; display: inline-flex; }
.row-details summary::-webkit-details-marker { display: none; }
.details-body { margin-top: 1rem; min-width: 260px; }
.nowrap { white-space: nowrap; }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.admin-table code { font-size: 0.85em; }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.badge-ok { border-color: #1f7a3d; color: #1f7a3d; }
.badge-off { border-color: var(--red); color: var(--red); }
.badge-blue { border-color: var(--blue); color: var(--blue); }
.badge-dark { border-color: var(--ink); background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tabs a { padding: 0.7rem 1.2rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--red); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: end; margin-bottom: 1.5rem; }
.filter-bar .form-group { margin-bottom: 0.75rem; }
.pager { display: flex; gap: 1.5rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
input[type="file"] { max-width: 100%; font-size: 0.85rem; padding: 0.5rem 0; }

/* Bearbeitungsmodus (Inline-CMS) */
[data-editable] { position: relative; }
.edit-overlay-btn {
    display: none; position: absolute; top: -0.9rem; right: 0; z-index: 20;
    padding: 0.35rem 0.8rem; background: var(--ink); color: #fff; border-radius: var(--radius);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
}
.edit-overlay-btn:hover { background: var(--red); color: #fff; }
.edit-mode .edit-overlay-btn { display: inline-flex; }
.edit-mode [data-editable] { outline: 1px dashed rgba(26, 97, 168, 0.55); outline-offset: 6px; }
.edit-mode [data-content-key] { cursor: text; transition: outline-color .15s ease; outline: 1px dashed transparent; outline-offset: 4px; }
.edit-mode [data-content-key]:hover { outline-color: var(--blue); }
.edit-mode [data-content-key]:focus { outline: 2px solid var(--blue); outline-offset: 4px; background: rgba(95, 163, 230, 0.08); }

#admin-edit-toolbar { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1600; display: flex; align-items: center; gap: 0.5rem; }
#admin-edit-toolbar button {
    border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: var(--radius);
    padding: 0.7rem 1.1rem; font: 700 0.78rem/1 var(--font); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
#admin-edit-toolbar button:hover { background: var(--red); border-color: var(--red); }
#admin-edit-toolbar #admin-edit-help { padding: 0.7rem 0.9rem; }
.edit-mode #admin-edit-toggle { background: var(--red); border-color: var(--red); }
#edit-status { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 0.55rem 0.9rem; font-size: 0.8rem; font-weight: 600; border-radius: var(--radius); }
#edit-status.ok { color: #1f7a3d; border-color: #1f7a3d; }
#edit-status.error { color: var(--red); border-color: var(--red); }
#edit-status[hidden], #edit-help-panel[hidden] { display: none; }
#edit-help-panel { position: fixed; right: 1.25rem; bottom: 4.5rem; z-index: 1600; width: min(380px, calc(100vw - 2.5rem)); background: #fff; border: 1px solid var(--ink); border-top: 3px solid var(--red); }
#edit-help-header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
#edit-help-header button { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; }
#edit-help-body { padding: 1rem; font-size: 0.9rem; }
#edit-help-body p { margin-bottom: 0.75rem; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 0.35rem; border-radius: 3px; font-size: 0.8em; background: var(--mist); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
