/* ==========================================================================
   ff_modern – Joomla Template für Feuerwehr-Homepages
   Mobile-First, modern, barrierearm
   ========================================================================== */

:root {
  --ff-primary: #c8102e;
  --ff-primary-dark: #9c0c23;
  --ff-dark: #0b1220;
  --ff-dark-2: #121b2e;
  --ff-gray-50: #f7f8fa;
  --ff-gray-100: #eef0f3;
  --ff-gray-300: #cbd2dc;
  --ff-gray-600: #5b6472;
  --ff-white: #ffffff;
  --ff-radius: 14px;
  --ff-shadow: 0 6px 24px rgba(11, 18, 32, 0.08);
  --ff-shadow-lg: 0 20px 50px rgba(11, 18, 32, 0.18);
  --ff-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --ff-font-head: 'Oswald', 'Inter', system-ui, sans-serif;
  --ff-header-h: 76px;
  --ff-transition: all .25s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.ff-body {
  margin: 0;
  font-family: var(--ff-font-body);
  color: #1c2431;
  background: var(--ff-gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ff-primary); text-decoration: none; transition: var(--ff-transition); }
a:hover { color: var(--ff-primary-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ff-dark);
  margin: 0 0 .6em;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.ff-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.ff-skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ff-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 10000;
  border-radius: 0 0 8px 0;
}
.ff-skip-link:focus { left: 0; }

/* ---------- Notruf-Balken ---------- */
.ff-notruf-bar {
  background: var(--ff-dark);
  color: #fff;
  font-size: .82rem;
}
.ff-notruf-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.ff-notruf-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ff-gray-300);
}
.ff-notruf-text strong { color: #ff5c72; letter-spacing: 1px; font-size: .95rem; }
.ff-icon { flex-shrink: 0; }

/* ---------- Header ---------- */
.ff-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(11,18,32,.06);
  transition: var(--ff-transition);
}
.ff-header.is-scrolled { box-shadow: var(--ff-shadow); }

.ff-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--ff-header-h);
  gap: 16px;
}

.ff-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ff-logo-img { height: 46px; width: auto; }
.ff-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--ff-primary);
  color: #fff;
}
.ff-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.ff-brand-name {
  font-family: var(--ff-font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ff-dark);
  text-transform: uppercase;
}
.ff-brand-ort { font-size: .78rem; color: var(--ff-gray-600); }

/* ---------- Hauptnavigation ---------- */
.ff-mainnav { flex: 1; display: flex; justify-content: center; }
.ff-mainnav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.ff-mainnav a {
  display: block;
  padding: 10px 16px;
  color: var(--ff-dark);
  font-weight: 600;
  font-size: .92rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ff-mainnav a:hover,
.ff-mainnav li.current > a,
.ff-mainnav li.active > a {
  background: var(--ff-primary);
  color: #fff;
}

/* Dropdowns (falls Joomla-Menümodul verschachtelte UL erzeugt) */
.ff-mainnav li { position: relative; }
.ff-mainnav ul ul {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  min-width: 220px;
  box-shadow: var(--ff-shadow-lg);
  border-radius: 10px;
  padding: 8px;
  flex-direction: column;
  z-index: 50;
}
.ff-mainnav li:hover > ul { display: flex; }
.ff-mainnav ul ul a { color: var(--ff-dark); padding: 8px 12px; }

.ff-header-actions { display: flex; align-items: center; gap: 10px; }
.ff-search input[type="text"],
.ff-search input[type="search"] {
  border: 1px solid var(--ff-gray-300);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: .85rem;
  width: 170px;
  transition: var(--ff-transition);
}
.ff-search input:focus { outline: none; border-color: var(--ff-primary); width: 210px; }

/* ---------- Alarmstatus-Badge ---------- */
.ff-alarm-wrap { display: flex; align-items: center; }
.ff-alarmbadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.ff-alarmbadge-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ff-alarmbadge.is-clear {
  background: rgba(23, 168, 90, .12);
  color: #128a48;
}
.ff-alarmbadge.is-clear .ff-alarmbadge-dot { background: #17a85a; }
.ff-alarmbadge.is-alarm {
  background: rgba(200, 16, 46, .12);
  color: var(--ff-primary);
}
.ff-alarmbadge.is-alarm .ff-alarmbadge-dot {
  background: var(--ff-primary);
  animation: ff-pulse 1.1s infinite;
}
@keyframes ff-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(200,16,46,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(200,16,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,16,46,0); }
}

/* Burger-Button (mobil) */
.ff-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.ff-burger span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--ff-dark);
  transition: var(--ff-transition);
}
.ff-burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ff-burger.is-open span:nth-child(2) { opacity: 0; }
.ff-burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.ff-hero {
  background: linear-gradient(180deg, rgba(11,18,32,.75), rgba(11,18,32,.92)), var(--ff-dark);
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 90px 0 70px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.ff-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--ff-primary), #ff8a3d, var(--ff-primary));
  z-index: 2;
}

/* Hero-Bild-Slider mit Überblendung */
.ff-hero-slides {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.ff-hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.ff-hero-slide.is-active { opacity: 1; }

/* Slider-Punkte (optional, werden per JS erzeugt) */
.ff-hero-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}
.ff-hero-dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 0;
  transition: var(--ff-transition);
}
.ff-hero-dots button.is-active { background: var(--ff-primary); width: 22px; border-radius: 5px; }
.ff-hero-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.ff-hero h1, .ff-hero h2 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: .4em; }
.ff-hero p { color: var(--ff-gray-300); font-size: 1.1rem; margin-bottom: 1.6em; }
.ff-hero .ff-btn,
.ff-hero a.btn {
  display: inline-block;
  background: var(--ff-primary);
  color: #fff;
  padding: 14px 30px;
  border-radius: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 6px;
  box-shadow: 0 10px 25px rgba(200,16,46,.35);
}
.ff-hero .ff-btn:hover { background: var(--ff-primary-dark); transform: translateY(-2px); }
.ff-hero .ff-btn.ff-btn-outline {
  background: transparent;
  border: 2px solid #fff;
  box-shadow: none;
}

/* ---------- Statistik-Leiste ---------- */
.ff-stats { background: var(--ff-dark-2); color: #fff; }
.ff-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 36px 0;
  text-align: center;
}
.ff-stat-num {
  display: block;
  font-family: var(--ff-font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ff-primary);
}
.ff-stat-label {
  display: block;
  font-size: .82rem;
  color: var(--ff-gray-300);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ---------- Breadcrumbs ---------- */
.ff-breadcrumbs {
  background: var(--ff-gray-100);
  padding: 10px 0;
  font-size: .85rem;
  color: var(--ff-gray-600);
}
.ff-breadcrumbs ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }

/* ---------- Hauptbereich / Grid ---------- */
.ff-main { padding: 50px 0; }
.ff-main-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}
.ff-main-grid:has(.ff-sidebar-right):has(.ff-sidebar-left) {
  grid-template-columns: 240px 1fr 240px;
}
.ff-content-full { grid-column: 1 / -1; }
.ff-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Karten-Look für Module */
.ff-card {
  background: #fff;
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 22px;
}
.ff-card .moduletitle,
.ff-card h3.moduletitle {
  font-family: var(--ff-font-head);
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--ff-dark);
  border-bottom: 3px solid var(--ff-primary);
  padding-bottom: 10px;
  margin-bottom: 14px;
  display: inline-block;
}

/* ---------- Einsatz-/News-Feed ---------- */
.ff-feed-section { background: var(--ff-white); padding: 60px 0; border-top: 1px solid var(--ff-gray-100); }
.ff-feed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
@media (max-width: 860px) {
  .ff-feed-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.ff-footer { background: var(--ff-dark); color: var(--ff-gray-300); margin-top: 20px; }
.ff-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 56px 0 36px;
}
.ff-footer-col .ff-brand-name { color: #fff; font-size: 1.1rem; }
.ff-footer a { color: var(--ff-gray-300); }
.ff-footer a:hover { color: #fff; }
.ff-social { display: flex; gap: 10px; margin-top: 14px; }
.ff-footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.ff-footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  font-size: .8rem;
}

/* ---------- Zurück-nach-oben-Button ---------- */
.ff-back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ff-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ff-shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--ff-transition);
  z-index: 900;
}
.ff-back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ==========================================================================
   Responsive: Tablet & Mobile
   ========================================================================== */
@media (max-width: 991px) {
  .ff-main-grid,
  .ff-main-grid:has(.ff-sidebar-right):has(.ff-sidebar-left) {
    grid-template-columns: 1fr;
  }
  .ff-sidebar { order: 3; }
  .ff-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ff-footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --ff-header-h: 64px; }

  .ff-search { display: none; }
  .ff-burger { display: flex; }
  .ff-alarmbadge { padding: 6px 10px; font-size: .68rem; }

  .ff-mainnav {
    position: fixed;
    top: var(--ff-header-h);
    left: 0; right: 0; bottom: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform .3s ease;
    padding: 20px;
    overflow-y: auto;
    justify-content: flex-start;
    z-index: 998;
  }
  .ff-mainnav.is-open { transform: translateX(0); }
  .ff-mainnav ul { flex-direction: column; width: 100%; gap: 2px; }
  .ff-mainnav ul ul {
    position: static;
    box-shadow: none;
    padding-left: 14px;
    min-width: 0;
  }
  .ff-mainnav li:hover > ul { display: none; }
  .ff-mainnav li.js-open > ul { display: flex; }

  .ff-hero { padding: 60px 0 44px; }
  .ff-footer-grid { grid-template-columns: 1fr 1fr; padding: 40px 0 24px; }
  .ff-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .ff-stats-grid { grid-template-columns: 1fr 1fr; padding: 26px 0; gap: 14px; }
  .ff-stat-num { font-size: 1.7rem; }
  .ff-footer-grid { grid-template-columns: 1fr; }
  .ff-hero .ff-btn { display: block; margin: 8px auto; width: 100%; max-width: 280px; }
}

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