/* ==========================================================================
   Regionalfabrik – Design-Guide-Umsetzung
   Petrol/Ocker auf Weiß, Archivo, max. 1280 px, keine Verläufe/Schatten.
   ========================================================================== */

/* ---- Schrift (selbst gehostet, OFL-Lizenz in /fonts/OFL.txt) ---- */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/archivo-400.woff2") format("woff2");
}
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/archivo-600.woff2") format("woff2");
}
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/archivo-800.woff2") format("woff2");
}

/* ---- Design-Tokens ---- */
:root {
    --rf-petrol: #0D5350;
    --rf-ochre: #DFAF3E;
    --rf-ochre-dunkel: #C99B2F; /* Hover: ca. 9 % dunkler */
    --rf-white: #FFFFFF;
    --rf-warm-white: #F6F2E9;
    --rf-footer: #073F3E;
    --rf-map-green: #71866F;
    --rf-text: #202322;
    --rf-border: #E6E8E5;
    --rf-font: "Archivo", Arial, Helvetica, sans-serif;
    --rf-radius: 6px;
    --rf-content-width: 1200px;
    --rf-section-space: clamp(64px, 8vw, 112px);
    --rf-gap: 24px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--rf-font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--rf-text);
    background: var(--rf-white);
}

h1, h2, h3 {
    font-weight: 800;
    line-height: 1.15;
    color: var(--rf-petrol);
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(38px, 5vw, 56px); }
h2 { font-size: clamp(28px, 3.5vw, 36px); }
h3 { font-size: 22px; }

p { margin: 0 0 1em; max-width: 70ch; }

a { color: var(--rf-petrol); }
a:hover { color: var(--rf-footer); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
    outline: 3px solid var(--rf-ochre);
    outline-offset: 2px;
}

.rf-container {
    max-width: var(--rf-content-width);
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 48px);
}

.rf-section { padding-block: var(--rf-section-space); }
.rf-section--warm { background: var(--rf-warm-white); }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* Honeypot-Feld: für Menschen unsichtbar, Bots füllen es aus */
.rf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Buttons ---- */
.rf-button {
    display: inline-block;
    background: var(--rf-ochre);
    color: var(--rf-text);
    font-family: var(--rf-font);
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    padding: 15px 26px;
    cursor: pointer;
    transition: background-color 180ms ease;
}
.rf-button:hover { background: var(--rf-ochre-dunkel); color: var(--rf-text); }

.rf-button--sekundaer {
    background: transparent;
    color: var(--rf-petrol);
    border: 2px solid var(--rf-petrol);
    padding: 13px 24px;
    transition: background-color 180ms ease, color 180ms ease;
}
.rf-button--sekundaer:hover { background: var(--rf-petrol); color: var(--rf-white); }

.rf-button--klein { padding: 9px 16px; font-size: 15px; }

/* ---- Header ---- */
.rf-header {
    border-bottom: 1px solid var(--rf-border);
    background: var(--rf-white);
}
.rf-header__innen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rf-gap);
    min-height: 76px;
}
.rf-wortmarke {
    font-weight: 800;
    font-size: 24px;
    color: var(--rf-petrol);
    text-decoration: none;
    letter-spacing: 0;
}
.rf-wortmarke:hover { color: var(--rf-petrol); }

.rf-nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--rf-petrol);
    border-radius: 4px;
    color: var(--rf-petrol);
    font: inherit;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
}

.rf-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 36px);
    list-style: none;
    margin: 0; padding: 0;
}
.rf-nav a {
    display: inline-block;
    font-weight: 600;
    font-size: 17px;
    color: var(--rf-text);
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 3px solid transparent;
    transition: border-color 180ms ease, color 180ms ease;
}
.rf-nav a:hover { color: var(--rf-petrol); }
.rf-nav a.aktiv { border-bottom-color: var(--rf-ochre); color: var(--rf-petrol); }
.rf-nav a.rf-nav__cta {
    background: var(--rf-ochre);
    border-radius: 4px;
    border-bottom: none;
    padding: 10px 18px;
    color: var(--rf-text);
    transition: background-color 180ms ease;
}
.rf-nav a.rf-nav__cta:hover { background: var(--rf-ochre-dunkel); }

/* ---- Hero: vollflächiges Foto, Text-Overlay links über Verlauf ---- */
.rf-hero { position: relative; background: var(--rf-warm-white); overflow: hidden; }
.rf-hero__bild { position: absolute; inset: 0; }
.rf-hero__bild img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 62%; }
.rf-hero__bild::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        var(--rf-warm-white) 28%,
        rgba(246, 242, 233, 0.88) 44%,
        rgba(246, 242, 233, 0) 68%);
}
.rf-hero__innen { position: relative; z-index: 1; padding-block: var(--rf-section-space); }
.rf-hero__text { max-width: 580px; }
.rf-hero h1 { margin-bottom: 0.4em; }
.rf-hero p { font-size: 19px; }
.rf-hero__aktionen { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }

/* ---- Karte ---- */
.rf-karte-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
#karte {
    height: 480px;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    background: var(--rf-warm-white);
}
.rf-karte-fallback { padding: 24px; }

.rf-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    align-items: center;
    margin-block: 18px;
    font-size: 15px;
}
.rf-legende__eintrag { display: inline-flex; align-items: center; gap: 8px; }
.rf-legende__eintrag img { width: 20px; height: 27px; }
.rf-legende__eintrag img.rf-legende--station { width: 20px; height: 20px; }

.rf-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    margin-block: 18px;
    font-size: 15px;
}
.rf-filter label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; cursor: pointer; }
.rf-filter select {
    font: inherit;
    padding: 7px 10px;
    border: 1px solid var(--rf-border);
    border-radius: 4px;
    background: var(--rf-white);
    color: var(--rf-text);
}
.rf-filter input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--rf-petrol); }

/* Leaflet-Popups an das Design anpassen */
.leaflet-popup-content-wrapper { border-radius: var(--rf-radius); }
.leaflet-popup-content { font-family: var(--rf-font); font-size: 14px; line-height: 1.5; margin: 14px 18px; }
.rf-popup h3 { font-size: 16px; margin: 0 0 4px; color: var(--rf-petrol); }
.rf-popup .rf-popup__typ { color: var(--rf-map-green); font-weight: 600; margin: 0 0 6px; }
.rf-popup p { margin: 0 0 6px; }
.rf-popup__foto {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--rf-radius);
    margin: 0 0 8px;
}
.rf-chips--popup { margin: 2px 0 8px; }

/* ---- Kategorie-Chips ---- */
.rf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rf-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rf-petrol);
    background: var(--rf-warm-white);
    border: 1px solid var(--rf-border);
    border-radius: 999px;
    padding: 3px 11px 3px 8px;
    white-space: nowrap;
}
.rf-chip__icon { width: 15px; height: 15px; flex: none; }

/* ---- Betriebsliste ---- */
.rf-betriebe {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--rf-gap);
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
}
.rf-betrieb {
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--rf-white);
}
.rf-betrieb[hidden] { display: none; }
.rf-betrieb__kopf { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.rf-betrieb h3 { margin: 0; font-size: 19px; }
.rf-betrieb__typ { color: var(--rf-map-green); font-weight: 600; font-size: 14px; }
.rf-betrieb__ort { font-size: 15px; margin: 0; }
.rf-betrieb__beschreibung { font-size: 15px; margin: 0; }
.rf-betrieb__fuss { margin-top: auto; padding-top: 6px; }
.rf-betrieb__foto {
    width: calc(100% + 44px);
    max-width: none;
    height: 170px;
    object-fit: cover;
    margin: -22px -22px 0;
    border-radius: var(--rf-radius) var(--rf-radius) 0 0;
}

.rf-badge {
    display: inline-block;
    background: var(--rf-petrol);
    color: var(--rf-white);
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}

/* ---- Team-Sektion ---- */
.rf-team {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}
.rf-team img { border-radius: var(--rf-radius); width: 100%; object-fit: cover; }
.rf-team__aktionen { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }

/* ---- Veranstaltungen ---- */
.rf-termine { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.rf-termin {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    padding: 20px 22px;
    background: var(--rf-white);
}
.rf-termin__datum {
    color: var(--rf-petrol);
    font-weight: 800;
    text-align: center;
    border-right: 1px solid var(--rf-border);
    padding-right: 20px;
    align-self: center;
}
.rf-termin__datum .tag { font-size: 30px; display: block; line-height: 1.1; }
.rf-termin__datum .monat { font-size: 15px; text-transform: none; }
.rf-termin h3 { margin: 0 0 4px; font-size: 19px; }
.rf-termin p { margin: 0 0 4px; font-size: 15px; }
.rf-termin__meta { color: var(--rf-map-green); font-weight: 600; font-size: 14px; }

/* ---- Formulare ---- */
.rf-form { max-width: 560px; display: grid; gap: 18px; }
.rf-feld { display: grid; gap: 6px; }
.rf-feld label { font-weight: 600; font-size: 15px; }
.rf-feld input[type="text"],
.rf-feld input[type="email"],
.rf-feld input[type="password"],
.rf-feld input[type="url"],
.rf-feld input[type="number"],
.rf-feld input[type="date"],
.rf-feld input[type="datetime-local"],
.rf-feld select,
.rf-feld textarea {
    font: inherit;
    color: var(--rf-text);
    background: var(--rf-white);
    border: 1px solid var(--rf-border);
    border-radius: 4px;
    padding: 12px 14px;
    width: 100%;
}
.rf-feld textarea { min-height: 120px; resize: vertical; }
.rf-feld--checkbox { display: flex; align-items: start; gap: 10px; }
.rf-feld--checkbox input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--rf-petrol); }
.rf-feld--checkbox label { font-weight: 400; font-size: 15px; }

.rf-fehler { color: #A33A2A; font-size: 14px; margin: 0; }
.rf-validierung { color: #A33A2A; }
.rf-validierung ul { margin: 0; padding-left: 20px; }

.rf-hinweis {
    border: 1px solid var(--rf-border);
    border-left: 4px solid var(--rf-ochre);
    border-radius: var(--rf-radius);
    background: var(--rf-warm-white);
    padding: 18px 22px;
    margin-block: 18px;
    max-width: 70ch;
}
.rf-hinweis--erfolg { border-left-color: var(--rf-petrol); }

/* ---- Footer ---- */
.rf-footer {
    background: var(--rf-footer);
    color: var(--rf-white);
    margin-top: var(--rf-section-space);
    padding-block: 56px 28px;
    font-size: 15px;
}
.rf-footer a { color: var(--rf-white); }
.rf-footer a:hover { color: var(--rf-ochre); }
.rf-footer h2 { color: var(--rf-white); font-size: 17px; margin-bottom: 14px; }
.rf-footer__spalten {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(24px, 4vw, 48px);
}
.rf-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rf-footer p { max-width: none; }
.rf-footer__form { display: grid; gap: 10px; }
.rf-footer__form input[type="text"],
.rf-footer__form input[type="email"] {
    font: inherit;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 10px 12px;
    width: 100%;
    background: var(--rf-white);
    color: var(--rf-text);
}
.rf-footer__form .rf-feld--checkbox { font-size: 13px; }
.rf-footer__form .rf-feld--checkbox label { font-size: 13px; }
.rf-footer__unten {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 44px;
    padding-top: 22px;
}
.rf-footer__unten ul { display: flex; gap: 20px; }

/* ---- Admin ---- */
.rf-admin-header { background: var(--rf-petrol); }
.rf-admin-header .rf-header__innen { min-height: 64px; }
.rf-admin-header .rf-wortmarke { color: var(--rf-white); font-size: 19px; }
.rf-admin-header .rf-nav a { color: var(--rf-white); font-size: 15px; }
.rf-admin-header .rf-nav a.aktiv { border-bottom-color: var(--rf-ochre); color: var(--rf-white); }
.rf-admin-header .rf-nav button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    color: var(--rf-white);
    font: inherit;
    font-size: 14px;
    padding: 6px 12px;
    cursor: pointer;
}
.rf-admin-header .rf-nav button:hover { border-color: var(--rf-ochre); color: var(--rf-ochre); }
.rf-admin-main { padding-block: 40px; }

.rf-tabelle-umbruch { overflow-x: auto; }
.rf-tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.rf-tabelle th, .rf-tabelle td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--rf-border);
    vertical-align: top;
}
.rf-tabelle th { color: var(--rf-petrol); font-weight: 600; white-space: nowrap; }
.rf-tabelle .rf-aktionen { display: flex; gap: 10px; white-space: nowrap; }

.rf-admin-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--rf-gap);
    list-style: none;
    margin: 24px 0;
    padding: 0;
}
.rf-admin-kachel {
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    padding: 20px;
}
.rf-admin-kachel .zahl { font-size: 34px; font-weight: 800; color: var(--rf-petrol); display: block; }
.rf-admin-kachel a { font-weight: 600; font-size: 15px; }

.rf-checkboxliste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 20px;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius);
    padding: 14px 16px;
}
.rf-checkboxliste label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 400; }
.rf-checkboxliste input { width: 16px; height: 16px; accent-color: var(--rf-petrol); }

.rf-form--breit { max-width: 760px; }
.rf-form__zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.rf-seitenkopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.rf-seitenkopf h1 { font-size: 30px; margin: 0; }

/* ---- Fließtext-Seiten ---- */
.rf-prosa { max-width: 760px; }
.rf-prosa h2 { margin-top: 1.6em; }
.rf-prosa ul { max-width: 70ch; }
.rf-prosa figure { margin: 32px 0; }
.rf-prosa figure img { display: block; width: 100%; height: auto; border-radius: var(--rf-radius); }
.rf-prosa figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--rf-map-green); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    /* Hero: Foto nicht mehr als Hintergrund, sondern unter dem Text */
    .rf-hero__bild { position: static; }
    .rf-hero__bild img { height: 300px; object-position: center 62%; }
    .rf-hero__bild::after { display: none; }
    .rf-hero__innen { padding-block: clamp(40px, 8vw, 64px); }
    .rf-hero__text { max-width: none; }

    .rf-team { grid-template-columns: 1fr; }
    .rf-footer__spalten { grid-template-columns: 1fr 1fr; }
    .rf-form__zeile { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .rf-nav-toggle { display: inline-block; }
    .rf-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 76px;
        background: var(--rf-white);
        border-bottom: 1px solid var(--rf-border);
        padding: 12px 20px 20px;
        z-index: 1100;
    }
    .rf-nav.offen { display: block; }
    .rf-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
    .rf-nav a { display: block; padding: 12px 4px; font-size: 18px; }
    .rf-header { position: relative; }
    #karte { height: 380px; }
    .rf-termin { grid-template-columns: 1fr; }
    .rf-termin__datum { border-right: none; border-bottom: 1px solid var(--rf-border); padding: 0 0 10px; text-align: left; }
    .rf-termin__datum .tag { display: inline; font-size: 22px; }
    .rf-footer__spalten { grid-template-columns: 1fr; }
}
