:root {
  /* Palette per Pixel-Sampling aus dem Logo (Favicon.png/Logo-Lockup),
     nicht nach Augenmaß: dominante Farbe #fa5745 (HSL 6°, 95%, 63%,
     38k+ Treffer beim Rastersampling), Dark-Variante -10% Lightness,
     Tint-Variante ~96% Lightness bei reduzierter Sättigung. */
  --color-primary: #fa5745;
  --color-primary-dark: #f92a13;
  --color-primary-tint: #fbf0ef;
  --color-text: #2f3542;
  --color-text-muted: #6b7280;
  --color-border: #eceef1;
  --color-bg: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --max-width: 1180px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 700;
  background: var(--color-primary); color: #fff; border: none; cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--color-primary-dark); }
.btn-outline {
  background: transparent; color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 800; }
.logo .logo-mark { width: 36px; height: 36px; }
.logo .accent { color: var(--color-primary); }
.main-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-weight: 600; }
.main-nav a:hover { color: var(--color-primary); }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-mobile-actions { display: none; }

/* "Rechtliches"-Dropdown (Desktop: Hover, Mobile: Teil der aufgeklappten Nav) */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  /* margin-top:0 statt eines sichtbaren Abstands, sonst verliert der
     Hover-Status beim Durchqueren der Lücke zwischen Link und Menü
     (Maus verlässt .nav-dropdown, bevor sie das Menü erreicht). */
  display: none; position: absolute; top: 100%; left: 0; margin-top: 0; padding-top: 12px;
  z-index: 20;
}
.nav-dropdown-menu-inner {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; min-width: 200px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-dropdown-menu a { padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--color-primary-tint); }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 36px; padding: 0; border: none; background: transparent; cursor: pointer;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: #3d4451; border-radius: 2px; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .header-actions { display: none; }
  .main-nav {
    display: none; flex-direction: column; align-items: stretch; gap: 4px;
    width: 100%; order: 3; padding-top: 16px; margin-top: 12px;
    border-top: 1px solid var(--color-border);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px 4px; }
  /* Auf Mobil wird das Dropdown einfach flach mit ausgeklappt, kein
     zusätzliches Antippen für ein Untermenü nötig. */
  .nav-dropdown-menu {
    display: block; position: static; padding-top: 0; margin: 0 0 4px 12px;
  }
  .nav-dropdown-menu-inner {
    background: none; box-shadow: none; border: none; padding: 0; gap: 0;
  }
  .nav-mobile-actions {
    display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
    padding-top: 12px; border-top: 1px solid var(--color-border);
  }
}

/* Hero / search */
.hero { text-align: center; padding: 64px 0 40px; }
.hero h1 { font-size: 2.4rem; color: #3d4451; margin-bottom: 14px; }
.hero p.lead { color: var(--color-text-muted); max-width: 720px; margin: 0 auto 36px; font-size: 1.1rem; }

.search-form {
  display: grid; grid-template-columns: 1.4fr 1.4fr 1.2fr auto;
  gap: 0; max-width: 900px; margin: 0 auto;
  border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden;
  box-shadow: var(--shadow); background: #fff;
}
.search-form input, .search-form select {
  border: none; padding: 16px 20px; font-size: 1rem; outline: none;
  border-right: 1px solid var(--color-border); background: transparent; width: 100%;
}
.search-form button {
  border-radius: 0; padding: 16px 30px;
}
@media (max-width: 780px) {
  .search-form { grid-template-columns: 1fr; border-radius: var(--radius); }
  .search-form input, .search-form select { border-right: none; border-bottom: 1px solid var(--color-border); }
  .search-form button { border-radius: 0 0 var(--radius) var(--radius); }
}

/* AdSense — einheitliche Anzeige am Ende von <main>, auf jeder Seite
   (Kirchen-Detailseite: direkt unter dem Listing; alle anderen Seiten:
   unter dem Inhalt, über dem Footer). Bewusst groß/responsive statt
   eines festen kleinen Formats (Kundenwunsch). */
.adsense-slot { max-width: var(--max-width); margin: 40px auto; padding: 0 20px; min-height: 100px; }

/* Sections */
.section { padding: 48px 0; }
.section h2 { text-align: center; font-size: 1.7rem; color: #3d4451; margin-bottom: 8px; }
.section .subtitle { text-align: center; color: var(--color-text-muted); margin-bottom: 34px; }

.tile-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
@media (max-width: 900px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tile-grid { grid-template-columns: 1fr; } }

.tile-grid-denominations {
  grid-template-columns: repeat(3, 1fr); max-width: 820px; margin: 0 auto;
}
@media (max-width: 700px) { .tile-grid-denominations { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .tile-grid-denominations { grid-template-columns: 1fr; } }

.tile {
  background: var(--color-primary-tint); border-radius: var(--radius);
  padding: 22px; display: flex; align-items: center; gap: 14px;
  font-weight: 800; color: var(--color-primary-dark); font-size: 1.05rem;
  box-shadow: var(--shadow);
}
.tile .tile-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary);
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.tile .tile-count { display: block; font-weight: 600; color: var(--color-text-muted); font-size: 0.85rem; }

.church-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .church-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .church-grid { grid-template-columns: 1fr; } }

.church-card {
  border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.church-card .thumb { height: 160px; background: #fff center/cover no-repeat; display:flex; align-items:center; justify-content:center; border-bottom: 1px solid var(--color-border); }

/* Standardbild für Einträge ohne eigenes Foto: Logo der Seite,
   weißer Hintergrund (Kundenwunsch statt generischem Icon). */
.brand-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.brand-placeholder-icon { width: 56px; height: 56px; flex-shrink: 0; }
.brand-placeholder-text { font-weight: 800; font-size: 0.95rem; color: #3d4451; text-align: center; }
.brand-placeholder-text .accent { color: var(--color-primary); }
.brand-placeholder-large { padding: 48px 16px; background: #fff; border-radius: 12px; margin-bottom: 20px; border: 1px solid var(--color-border); }
.brand-placeholder-large .brand-placeholder-icon { width: 88px; height: 88px; }
.brand-placeholder-large .brand-placeholder-text { font-size: 1.3rem; }
.church-card .body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.church-card h3 { margin: 0; font-size: 1.05rem; }
.church-card .meta { color: var(--color-text-muted); font-size: 0.9rem; }
.church-card .badge { display: inline-block; background: var(--color-primary-tint); color: var(--color-primary-dark); font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; align-self: flex-start; }
.featured-flag { background: #ffd54f; color: #6b4b00; font-size: 0.7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; align-self: flex-start; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 8px; }
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.faq-list { max-width: 780px; margin: 0 auto; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { padding: 18px 22px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--color-primary); font-size: 1.3rem; }
.faq-item[open] summary::after { content: '–'; }
.faq-item .answer { padding: 0 22px 18px; color: var(--color-text-muted); }

.partner-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.partner-links a {
  padding: 12px 26px; border: 1px solid var(--color-border); border-radius: 999px;
  font-weight: 700; color: var(--color-primary-dark); background: var(--color-primary-tint);
}
.partner-links a:hover { background: var(--color-primary); color: #fff; }

.church-detail-header { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 800px) { .church-detail-header { grid-template-columns: 1fr; } }
.info-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.info-card dt { font-weight: 700; margin-top: 12px; font-size: 0.85rem; color: var(--color-text-muted); text-transform: uppercase; }
.info-card dd { margin: 2px 0 0; }
.category-pill { display: inline-block; background: var(--color-primary-tint); color: var(--color-primary-dark); font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin: 0 6px 6px 0; }

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-bar select, .filter-bar input {
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--color-border);
  flex: 1 1 180px; min-width: 0;
}
.filter-bar button { flex: 0 0 auto; }
@media (max-width: 480px) {
  .filter-bar select, .filter-bar input { flex-basis: 100%; }
}

/* Footer */
.site-footer { background: #f8f8f9; padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--color-border); }

.prose h2, .prose h3 { color: #3d4451; }
.prose { max-width: 820px; margin: 0 auto; }
.page-header { text-align: center; padding: 48px 0 20px; }
.page-header h1 { font-size: 2rem; color: #3d4451; }

.alert { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; }
.alert-success { background: #e8f8ee; color: #1c6b3b; }
.alert-error { background: #fdecea; color: #b3261e; }

/* Admin-Bereich: eigene, schlichte Chrome statt Public-Header */
.admin-header { background: #232833; color: #fff; padding: 14px 0; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.admin-header a { color: #fff; }
.admin-brand { font-weight: 800; }
.admin-brand .accent { color: var(--color-primary); }
.admin-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.92rem; }
.admin-nav a { opacity: 0.85; }
.admin-nav a:hover, .admin-nav a.active { opacity: 1; color: var(--color-primary); }
.admin-main { padding: 32px 0 60px; }
.admin-main h1 { margin-top: 0; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

.admin-table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.admin-table th { background: #fafafa; font-size: 0.78rem; text-transform: uppercase; color: var(--color-text-muted); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.wrap { white-space: normal; }

.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.status-published { background: #e8f8ee; color: #1c6b3b; }
.status-draft { background: #f1f2f4; color: #55606e; }
.status-pending { background: #fff6e0; color: #93690a; }

.admin-form .field { margin-bottom: 16px; }
.admin-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.admin-form input[type=text], .admin-form input[type=email], .admin-form input[type=url],
.admin-form input[type=date], .admin-form input[type=password], .admin-form input[type=number],
.admin-form select, .admin-form textarea {
  width: 100%; padding: 10px; border: 1px solid var(--color-border); border-radius: 8px; font-family: inherit; font-size: 1rem;
}
.admin-form .field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.admin-form .field-row .field { flex: 1; min-width: 180px; }
.admin-form .checkbox-field { display: flex; align-items: center; gap: 8px; }
.admin-form .checkbox-field label { margin-bottom: 0; }
.admin-form .category-checks { max-height: 220px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 8px; padding: 10px; columns: 2; }
.admin-form .category-checks label { display: block; font-weight: 400; margin-bottom: 4px; }
.btn-danger { background: #b3261e; }
.btn-danger:hover { background: #8f1e18; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.admin-stat { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px; }
.admin-stat .num { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); }
.admin-stat .label { color: var(--color-text-muted); font-size: 0.85rem; }

.ad-banner { display: block; text-align: center; padding: 14px; border: 1px solid var(--color-border); border-radius: var(--radius); font-weight: 700; color: var(--color-primary-dark); background: var(--color-primary-tint); }
.ad-banner img { max-width: 100%; border-radius: var(--radius); }

.hero-banner { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-banner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.page-hero-content { margin-bottom: 24px; }
.page-hero-content .hero-banner { margin-bottom: 20px; }

/* Cookie-Consent — zentriertes Modal, kein Bottom-Bar-Banner.
   WICHTIG (siehe PROMPT2 Pitfall 1): display NIE unbedingt auf die
   Basisklasse, sondern auf :not([hidden]) — sonst gewinnt eine
   Autoren-Regel gegen den [hidden]-Browserstandard und das Overlay
   bleibt unsichtbar-aber-anwesend und fängt Klicks ab. */
.cookie-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 22, 28, 0.55);
  padding: 20px;
  align-items: center; justify-content: center;
}
.cookie-overlay:not([hidden]) { display: flex; }

.cookie-modal {
  background: #fff; border-radius: 18px; max-width: 480px; width: 100%;
  padding: 32px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-height: 90vh; overflow-y: auto;
}
.cookie-welcome { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; margin: 0 0 10px; }
.cookie-title { text-align: center; font-size: 1.1rem; font-weight: 800; color: var(--color-text); margin: 0 0 22px; line-height: 1.4; }

.cookie-row { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; }
.cookie-row .cookie-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  background: var(--color-primary-tint); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.cookie-row .cookie-text { font-size: 0.92rem; line-height: 1.45; padding-top: 4px; }
.cookie-row .cookie-toggle { margin-left: auto; flex: 0 0 auto; padding-top: 6px; }

/* Toggle-Switch, nur im "Optionen verwalten"-Zustand sichtbar */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #d7dae0; border-radius: 999px; cursor: pointer; transition: background .15s ease;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s ease;
}
.switch input:checked + .slider { background: var(--color-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: 0.6; cursor: not-allowed; }

.cookie-divider { border: none; border-top: 1px solid var(--color-border); margin: 14px 0; }

.cookie-details { font-size: 0.85rem; color: var(--color-text-muted); }
.cookie-details summary { cursor: pointer; color: var(--color-primary-dark); font-weight: 700; list-style: none; }
.cookie-details summary::-webkit-details-marker { display: none; }
.cookie-details summary::before { content: "▶ "; font-size: 0.7em; }
.cookie-details[open] summary::before { content: "▼ "; }
.cookie-details table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.8rem; }
.cookie-details th, .cookie-details td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; }

.cookie-actions { display: flex; gap: 12px; margin-top: 22px; }
.cookie-actions .btn, .cookie-actions .btn-outline { flex: 1; justify-content: center; padding: 13px 18px; }
.cookie-necessary-only { display: block; text-align: center; margin-top: 16px; background: none; border: none; color: var(--color-text-muted); text-decoration: underline; cursor: pointer; font-size: 0.85rem; font-family: inherit; }
.cookie-necessary-only:hover { color: var(--color-text); }

.cookie-modal[data-mode="simple"] .cookie-options-only { display: none; }
.cookie-modal[data-mode="options"] .cookie-simple-only { display: none; }
.cookie-settings-link { background: none; border: none; padding: 0; color: inherit; text-decoration: none; cursor: pointer; font: inherit; }
.cookie-settings-link:hover { color: var(--color-primary); }
