/*
 * Rohrfast24 – ein Stylesheet, keine Webfonts, keine externen Aufrufe.
 * Die Farbvariablen werden von inc/performance.php in den <head> geschrieben.
 * Rot ist ausschließlich dem Notdienst vorbehalten.
 */

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

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

:root {
    --rf-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rf-wrap: 1180px;
    --rf-gap: clamp(1rem, 2.5vw, 2rem);
    --rf-radius: 6px;
    --rf-shadow: 0 1px 3px rgba(11, 37, 69, .12), 0 8px 24px rgba(11, 37, 69, .06);
    --rf-white: #fff;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* A single long word or a wide table must never widen the whole page. */
html, body { max-width: 100%; overflow-x: clip; }
h1, h2, h3, h4, p, li, td, th, summary { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
    margin: 0;
    font-family: var(--rf-font);
    font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
    line-height: 1.65;
    color: var(--rf-ink);
    background: var(--rf-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0 0 .6em;
    line-height: 1.2;
    color: var(--rf-blue-900);
    font-weight: 700;
    text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + .6vw, 1.45rem); }
h4 { font-size: 1.1rem; }

p, ul, ol, table, blockquote { margin: 0 0 1.15em; }
li { margin-bottom: .35em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rf-blue-500); text-underline-offset: .18em; }
a:hover { color: var(--rf-blue-900); }

:focus-visible {
    outline: 3px solid var(--rf-blue-500);
    outline-offset: 2px;
    border-radius: 2px;
}

.rf-wrap { width: min(100% - 2rem, var(--rf-wrap)); margin-inline: auto; }
.rf-skip {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--rf-blue-900); color: #fff; padding: .75rem 1.25rem;
}
.rf-skip:focus { left: 0; }
.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------- Schaltflächen ---------- */

.rf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem 1.5rem; border: 2px solid transparent; border-radius: var(--rf-radius);
    font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.rf-btn--primary { background: var(--rf-blue-500); color: #fff; }
.rf-btn--primary:hover { background: var(--rf-blue-900); color: #fff; }
.rf-btn--ghost { border-color: currentColor; color: var(--rf-blue-900); background: transparent; }
.rf-btn--ghost:hover { background: var(--rf-blue-900); color: #fff; }
.rf-btn--onDark { border-color: #fff; color: #fff; }
.rf-btn--onDark:hover { background: #fff; color: var(--rf-blue-900); }

/* Rot: nur Notdienst. */
.rf-btn--emergency { background: var(--rf-red); color: #fff; }
.rf-btn--emergency:hover { background: var(--rf-red-dark); color: #fff; }

/* ---------- Kopfbereich ---------- */

.rf-topbar {
    background: var(--rf-blue-900); color: #dbe6f2;
    font-size: .875rem; padding: .5rem 0;
}
.rf-topbar .rf-wrap { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: center; }
.rf-topbar a { color: #dbe6f2; text-decoration: none; }
.rf-topbar a:hover { color: #fff; text-decoration: underline; }

.rf-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid var(--rf-line);
}
.rf-header.is-scrolled { box-shadow: var(--rf-shadow); }
.rf-header .rf-wrap {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; min-height: 72px;
}
.rf-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.rf-logo-text { font-size: 1.3rem; font-weight: 800; color: var(--rf-blue-900); letter-spacing: -.01em; }
.rf-logo-claim { display: block; font-size: .72rem; font-weight: 500; color: #5a6b7d; letter-spacing: .02em; }

.rf-nav ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.rf-nav a {
    color: var(--rf-blue-900); text-decoration: none; font-weight: 600; font-size: .97rem;
    padding: .4rem 0; border-bottom: 2px solid transparent; display: block;
}
.rf-nav a:hover, .rf-nav .current-menu-item > a { border-bottom-color: var(--rf-blue-500); }

.rf-header-cta { display: flex; align-items: center; gap: .75rem; flex: 0 0 auto; }
.rf-header-cta .rf-tel { white-space: nowrap; }
.rf-nav-toggle {
    display: none; background: none; border: 2px solid var(--rf-line);
    border-radius: var(--rf-radius); padding: .5rem .7rem; cursor: pointer;
}
.rf-nav-toggle span { display: block; width: 22px; height: 2px; background: var(--rf-blue-900); margin: 4px 0; }

@media (max-width: 1000px) {
    .rf-nav-toggle { display: block; }
    .rf-nav {
        position: absolute; inset: 100% 0 auto; background: #fff;
        border-bottom: 1px solid var(--rf-line); display: none; padding: 1rem;
        box-shadow: var(--rf-shadow);
    }
    .rf-nav.is-open { display: block; }
    .rf-nav ul { flex-direction: column; gap: 0; }
    .rf-nav li { border-bottom: 1px solid var(--rf-line); }
    .rf-nav a { padding: .85rem .25rem; }
    .rf-header-cta .rf-btn span { display: none; }
}
@media (max-width: 700px) {
    /* Give the header room: the phone number lives in the button and in the
       fixed bar at the bottom, so the separate link is redundant here. */
    .rf-header-cta .rf-tel { display: none; }
    .rf-topbar { font-size: .8rem; }
    .rf-topbar .rf-wrap { gap: .15rem .9rem; }
    .rf-topbar-hours { display: none; }
    .rf-header .rf-wrap { min-height: 60px; gap: .5rem; }
    .rf-logo-text { font-size: 1.1rem; }
    .rf-logo-claim { display: none; }
    .rf-header-cta .rf-btn { padding: .6rem .9rem; font-size: .95rem; }
    .rf-nav-toggle { padding: .45rem .6rem; }
}
@media (max-width: 380px) {
    .rf-header-cta .rf-btn { padding: .55rem .7rem; font-size: .9rem; }
    .rf-logo-text { font-size: 1rem; }
}

/* ---------- Kopfbild ---------- */

.rf-hero { position: relative; color: #fff; background: var(--rf-blue-900); isolation: isolate; }
.rf-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.rf-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg,
        rgba(11, 37, 69, calc(var(--rf-hero-overlay) * .85)) 0%,
        rgba(11, 37, 69, var(--rf-hero-overlay)) 55%,
        rgba(11, 37, 69, calc(var(--rf-hero-overlay) + .15)) 100%);
}
.rf-hero-inner { padding: clamp(3rem, 8vw, 6.5rem) 0; max-width: 46rem; }
.rf-hero h1 { color: #fff; margin-bottom: .5em; }
.rf-hero h1 em { font-style: normal; color: #ffd4da; }
.rf-hero-sub { font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem); color: #e3ecf5; margin-bottom: 1.6em; }
.rf-hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }
.rf-hero-badges { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 1.8rem; font-size: .93rem; color: #cfdcea; }
.rf-hero-badges li { list-style: none; }
.rf-hero-badges ul { display: contents; }

.rf-pagehead { background: var(--rf-blue-900); color: #fff; padding: clamp(2rem, 5vw, 3.5rem) 0; }
.rf-pagehead h1 { color: #fff; margin-bottom: .35em; }
.rf-pagehead p { color: #d7e3ef; max-width: 46rem; margin: 0; }

/* ---------- Abschnitte ---------- */

.rf-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.rf-section--sand { background: var(--rf-sand); }
.rf-section--dark { background: var(--rf-blue-900); color: #e3ecf5; }
.rf-section--dark h2, .rf-section--dark h3 { color: #fff; }
.rf-section-head { max-width: 46rem; margin-bottom: 2.2rem; }
.rf-section-head p { color: #4a5b6d; margin: 0; }
.rf-section--dark .rf-section-head p { color: #cbd9e7; }

.rf-grid { display: grid; gap: var(--rf-gap); }
.rf-grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.rf-grid--3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.rf-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.rf-grid--services, .rf-grid--posts { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ---------- Vorteile ---------- */

.rf-usp {
    background: #fff; border: 1px solid var(--rf-line); border-radius: var(--rf-radius);
    padding: 1.4rem; border-top: 3px solid var(--rf-blue-500);
}
.rf-usp h3 { font-size: 1.08rem; margin-bottom: .4em; }
.rf-usp p { margin: 0; font-size: .95rem; color: #4a5b6d; }

/* ---------- Notfall-Karten (rot) ---------- */


.rf-notruf {
    background: #fff5f6; border: 1px solid #f3c6cc; border-left: 4px solid var(--rf-red);
    border-radius: var(--rf-radius); padding: 1.25rem 1.4rem; margin: 1.6em 0;
}
.rf-notruf-title { font-weight: 800; color: var(--rf-red-dark); margin-bottom: .3em; }
.rf-notruf-text { margin-bottom: .9em; }
.rf-notruf-cta { margin: 0; }

/* ---------- Notdienst-Hinweis (nur Startseite) ---------- */

.rf-emergency-banner {
    background: #fff5f6;
    border-block: 1px solid #f3c6cc;
    border-left: 4px solid var(--rf-red);
    padding: 1.1rem 0;
}
.rf-emergency-banner .rf-wrap {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: .9rem 1.5rem;
}
.rf-emergency-banner-text { margin: 0; max-width: 46rem; }
.rf-emergency-banner-text strong {
    display: inline-block; color: var(--rf-red-dark);
    text-transform: uppercase; letter-spacing: .04em;
    font-size: .8rem; margin-right: .6rem;
}
.rf-emergency-banner-actions {
    margin: 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.rf-emergency-banner-link { font-weight: 600; white-space: nowrap; }

/* ---------- Karten ---------- */

.rf-card {
    background: #fff; border: 1px solid var(--rf-line); border-radius: var(--rf-radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .15s, transform .15s;
}
.rf-card:hover { box-shadow: var(--rf-shadow); transform: translateY(-2px); }
.rf-card-media { aspect-ratio: 3 / 2; background: var(--rf-sand); }
.rf-card-media img { width: 100%; height: 100%; object-fit: cover; }
.rf-card-body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.rf-card h3 { font-size: 1.1rem; margin-bottom: .4em; }
.rf-card h3 a { color: inherit; text-decoration: none; }
.rf-card h3 a:hover { color: var(--rf-blue-500); }
.rf-card p { font-size: .94rem; color: #4a5b6d; margin-bottom: 1em; }
.rf-card-meta { margin-top: auto; font-size: .85rem; color: #5f6f80; display: flex; gap: .9rem; flex-wrap: wrap; }
.rf-badge {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; padding: .2rem .55rem; border-radius: 3px;
    background: var(--rf-sand); color: var(--rf-blue-700);
}


.rf-section--dark .rf-usp p,
.rf-section--dark p { color: #cbd9e7; }
.rf-section--dark .rf-usp { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }





/* ---------- Artikel ---------- */

.rf-main { padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.rf-layout { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (min-width: 900px) { .rf-layout--sidebar { grid-template-columns: minmax(0, 1fr) 320px; } }

.rf-article { max-width: 46rem; }
.rf-article > h2 { margin-top: 1.8em; }
.rf-article > h3 { margin-top: 1.4em; }
.rf-article ul, .rf-article ol { padding-left: 1.35rem; }

.rf-answer {
    background: #eef4fa; border-left: 4px solid var(--rf-blue-500);
    border-radius: 0 var(--rf-radius) var(--rf-radius) 0;
    padding: 1.15rem 1.35rem; margin: 0 0 1.8em;
}
.rf-answer > *:last-child { margin-bottom: 0; }
.rf-answer-label {
    display: block; font-size: .78rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--rf-blue-500); margin-bottom: .4em;
}
.rf-note, .rf-tip, .rf-warn {
    padding: 1.05rem 1.25rem; border-radius: var(--rf-radius); margin: 1.6em 0;
    border-left: 4px solid;
}
.rf-note { background: #f2f6fa; border-color: var(--rf-blue-500); }
.rf-tip  { background: #f1f8f2; border-color: #2e7d4f; }
.rf-warn { background: #fdf6e8; border-color: #b8860b; }
.rf-note > *:last-child, .rf-tip > *:last-child, .rf-warn > *:last-child { margin-bottom: 0; }

.rf-checklist { list-style: none; padding-left: 0; }
.rf-checklist li { position: relative; padding-left: 1.75rem; }
.rf-checklist li::before {
    content: "✓"; position: absolute; left: 0; top: 0;
    color: #2e7d4f; font-weight: 800;
}
.rf-steps { counter-reset: rf-s; list-style: none; padding-left: 0; }
.rf-steps li { position: relative; padding-left: 2.4rem; margin-bottom: .9em; }
.rf-steps li::before {
    counter-increment: rf-s; content: counter(rf-s);
    position: absolute; left: 0; top: .1em;
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--rf-blue-500); color: #fff;
    display: grid; place-items: center; font-size: .85rem; font-weight: 800;
}


.rf-toc {
    background: var(--rf-sand); border: 1px solid var(--rf-line);
    border-radius: var(--rf-radius); padding: 1.1rem 1.35rem; margin: 0 0 1.8em;
}
.rf-toc h2 { font-size: 1rem; margin-bottom: .5em; }
.rf-toc ol { margin: 0; padding-left: 1.2rem; }
.rf-toc li { margin-bottom: .25em; }

table, .rf-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.rf-table-scroll { overflow-x: auto; margin: 0 0 1.5em; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--rf-line); vertical-align: top; }
th { background: var(--rf-sand); color: var(--rf-blue-900); font-weight: 700; }
.rf-table tbody tr:nth-child(even) { background: #fafbfc; }

blockquote {
    border-left: 4px solid var(--rf-line); padding-left: 1.1rem;
    margin-left: 0; color: #4a5b6d; font-style: italic;
}

.rf-facts { margin: 0 0 1.8em; }
.rf-facts th { width: 42%; }

.rf-faq { margin: 1.8em 0; }
.rf-faq-item { border: 1px solid var(--rf-line); border-radius: var(--rf-radius); margin-bottom: .6rem; background: #fff; }
.rf-faq-item summary {
    cursor: pointer; padding: .95rem 1.2rem; font-weight: 700; color: var(--rf-blue-900);
    list-style: none; position: relative; padding-right: 2.6rem;
}
.rf-faq-item summary::-webkit-details-marker { display: none; }
.rf-faq-item summary::after {
    content: "+"; position: absolute; right: 1.1rem; top: .8rem;
    font-size: 1.4rem; font-weight: 400; color: var(--rf-blue-500);
}
.rf-faq-item[open] summary::after { content: "–"; }
.rf-faq-answer { padding: 0 1.2rem 1.1rem; }
.rf-faq-answer > *:last-child { margin-bottom: 0; }

.rf-provenance {
    margin-top: 2.5em; padding-top: 1.2em; border-top: 1px solid var(--rf-line);
    font-size: .88rem; color: #5f6f80;
}
.rf-sources { font-size: .9rem; }
.rf-sources h2 { font-size: 1.05rem; }
.rf-missing {
    background: #fff3cd; color: #6b4f00; padding: .1em .4em;
    border-radius: 3px; font-weight: 600;
}

.rf-breadcrumbs { font-size: .87rem; padding: .9rem 0; color: #5f6f80; }
.rf-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.rf-breadcrumbs li + li::before { content: "›"; margin-right: .4rem; color: #9aa8b6; }
.rf-breadcrumbs a { color: #5f6f80; }

/* ---------- Seitenspalte ---------- */

.rf-sidebar { position: sticky; top: 96px; display: grid; gap: 1.2rem; }
.rf-widget {
    background: #fff; border: 1px solid var(--rf-line);
    border-radius: var(--rf-radius); padding: 1.2rem 1.35rem;
}
.rf-widget h2 { font-size: 1.02rem; margin-bottom: .7em; }
.rf-widget ul { list-style: none; padding: 0; margin: 0; font-size: .94rem; }
.rf-widget li { border-bottom: 1px solid var(--rf-line); }
.rf-widget li:last-child { border-bottom: 0; }
.rf-widget li a { display: block; padding: .5rem 0; text-decoration: none; color: var(--rf-blue-900); }
.rf-widget li a:hover { color: var(--rf-blue-500); }
.rf-widget--emergency { border-color: #f3c6cc; background: #fff5f6; }

/* ---------- Formular ---------- */

.rf-form-wrap { background: #fff; border: 1px solid var(--rf-line); border-radius: var(--rf-radius); padding: clamp(1.25rem, 3vw, 2rem); }
.rf-field { display: grid; gap: .35rem; margin-bottom: 1.1rem; }
.rf-field label { font-weight: 600; font-size: .94rem; }
.rf-field input, .rf-field textarea {
    font: inherit; padding: .7rem .85rem; border: 1px solid var(--rf-line);
    border-radius: var(--rf-radius); background: #fff; color: var(--rf-ink); width: 100%;
}
.rf-field input:focus, .rf-field textarea:focus { border-color: var(--rf-blue-500); }
.rf-field--check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.rf-field--check input { width: auto; margin-top: .25rem; }
.rf-field-error { color: var(--rf-red-dark); font-size: .87rem; font-weight: 600; }
.rf-form-error { background: #fff5f6; border-left: 4px solid var(--rf-red); padding: .8rem 1rem; border-radius: var(--rf-radius); }
.rf-form-success { background: #f1f8f2; border-left: 4px solid #2e7d4f; padding: 1rem 1.15rem; border-radius: var(--rf-radius); }
.rf-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.rf-form-hint { font-size: .9rem; color: #5f6f80; }
.rf-hp { position: absolute; left: -9999px; }

/* ---------- Fußbereich ---------- */

.rf-footer { background: var(--rf-blue-900); color: #c9d8e7; padding: clamp(2.5rem, 5vw, 3.5rem) 0 0; font-size: .93rem; }
.rf-footer h2 { color: #fff; font-size: 1rem; margin-bottom: .9em; }
.rf-footer a { color: #c9d8e7; text-decoration: none; }
.rf-footer a:hover { color: #fff; text-decoration: underline; }
.rf-footer ul { list-style: none; padding: 0; margin: 0; }
.rf-footer li { margin-bottom: .45em; }
.rf-footer-cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rf-footer address { font-style: normal; }
.rf-footer .rf-address strong { color: #fff; }
.rf-footer-bottom {
    margin-top: 2.5rem; border-top: 1px solid rgba(255, 255, 255, .14);
    padding: 1.1rem 0 5.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
    justify-content: space-between; font-size: .87rem;
}
.rf-footer-legal { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.rf-footer .rf-hours { color: #c9d8e7; }
.rf-footer .rf-hours th, .rf-footer .rf-hours td { border-color: rgba(255, 255, 255, .12); padding: .3rem 0; }
.rf-footer .rf-hours th { background: transparent; color: #fff; font-weight: 600; }

/* ---------- Feste Anrufleiste (mobil) ---------- */

.rf-callbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    display: none; background: var(--rf-blue-900);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .18);
}
.rf-callbar a {
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .95rem 1rem; color: #fff; font-weight: 800; font-size: 1.05rem;
    text-decoration: none; letter-spacing: .01em;
}
@media (max-width: 900px) {
    .rf-callbar { display: block; }
    body { padding-bottom: 3.6rem; }
    .rf-footer-bottom { padding-bottom: 1.5rem; }
    .rf-sidebar { position: static; }
}

/* ---------- Blätterung, Suche, 404 ---------- */

.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2.5rem; }
.page-numbers {
    display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .6rem;
    border: 1px solid var(--rf-line); border-radius: var(--rf-radius);
    text-decoration: none; color: var(--rf-blue-900); background: #fff;
}
.page-numbers.current, .page-numbers:hover { background: var(--rf-blue-900); color: #fff; border-color: var(--rf-blue-900); }

.rf-searchform { display: flex; gap: .5rem; }
.rf-searchform input[type="search"] {
    font: inherit; flex: 1; padding: .65rem .85rem;
    border: 1px solid var(--rf-line); border-radius: var(--rf-radius);
}

@media print {
    .rf-topbar, .rf-header, .rf-callbar, .rf-footer, .rf-form-wrap { display: none !important; }
    body { padding: 0; font-size: 11pt; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
