/* ══════════════════════════════════════════════════════════════
   MFC-Noris Website — Preview Theme (scoped under .theme-preview)
   ══════════════════════════════════════════════════════════════ */

/* ───────── 1. Base Tokens ───────── */
body.theme-preview {
  --preview-blue: #1e4d8c;
  --preview-blue-deep: #153a6b;
  --preview-blue-light: #3b7bc8;
  --preview-surface: #f4f7fb;
  --preview-card: #ffffff;
  --preview-border: #dde6f0;
  --preview-text: #1a2332;
  --preview-text-muted: #5a6373;
  --preview-shadow: rgba(20, 50, 90, 0.08);
  --preview-shadow-hover: rgba(20, 50, 90, 0.14);
  --preview-accent-orange: #ff8c42;
  --preview-accent-orange-warm: #ffb347;
  --preview-accent-orange-deep: #e86d1f;
  /* Default cat-accent falls back to primary blue */
  --cat-accent: var(--preview-blue-light);
  --cat-accent-deep: var(--preview-blue);
}

/* ───────── 2. Body + Shell ───────── */
body.theme-preview {
  background: var(--preview-surface);
  color: var(--preview-text);
}

body.theme-preview .site-header {
  background: linear-gradient(135deg, var(--preview-blue), var(--preview-blue-deep));
  box-shadow: 0 2px 12px var(--preview-shadow);
}

body.theme-preview .header-gradient-line {
  background: var(--preview-accent-orange);
}

body.theme-preview .logo,
body.theme-preview .logo:hover,
body.theme-preview .logo-name { color: #fff; }
body.theme-preview .logo-sub { color: rgba(255, 255, 255, 0.75); }

body.theme-preview .nav-item > a { color: rgba(255, 255, 255, 0.85); }
body.theme-preview .nav-item > a:hover,
body.theme-preview .nav-item.active > a {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.theme-preview .dropdown {
  background: var(--preview-card);
  box-shadow: 0 8px 32px rgba(20, 50, 90, 0.18);
}
body.theme-preview .dropdown li a { color: var(--preview-text-muted); }
body.theme-preview .dropdown li a:hover {
  background: rgba(30, 77, 140, 0.06);
  color: var(--preview-blue);
}

body.theme-preview .hamburger .material-icons { color: #fff; }
body.theme-preview .hamburger:hover { background: rgba(255, 255, 255, 0.12); }

/* ── Mobile Nav Overlay — category-colored section labels + top strip ── */
body.theme-preview .mobile-nav-content {
  background: var(--preview-card);
  padding-top: 0;
}

/* Thin multi-color strip at the top of the drawer, sharing the flow animation */
body.theme-preview .mobile-nav-content::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(
    90deg,
    #1e4d8c 0%, #5a9a6a 22%, #ff8c42 44%, #e07a9a 66%, #f5a524 84%, #3c4a5e 100%
  );
  background-size: 200% 100%;
  animation: preview-accent-flow 10s linear infinite;
}

body.theme-preview .mobile-nav-close { top: 16px; }
body.theme-preview .mobile-nav-list { padding-top: 52px; }

body.theme-preview .mobile-section {
  position: relative;
  padding-left: 36px;
  color: var(--section-accent, var(--preview-blue));
  font-weight: 800;
}
body.theme-preview .mobile-section::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--section-accent, var(--preview-blue));
}

body.theme-preview .mobile-section[data-section="verein"]    { --section-accent: #1e4d8c; }
body.theme-preview .mobile-section[data-section="flugplatz"] { --section-accent: #5a9a6a; }
body.theme-preview .mobile-section[data-section="mehr"]      { --section-accent: #3c4a5e; }

body.theme-preview .mobile-nav-list li a {
  transition: background 0.15s, color 0.15s, padding-left 0.15s, border-left-color 0.15s;
  border-left: 3px solid transparent;
}
body.theme-preview .mobile-nav-list li a:hover {
  background: rgba(30, 77, 140, 0.06);
  color: var(--preview-blue);
  border-left-color: var(--preview-blue-light);
  padding-left: 21px;
}

/* ───────── 3. Footer ───────── */
body.theme-preview .site-footer {
  background: var(--preview-blue-deep);
  color: rgba(255, 255, 255, 0.85);
}
body.theme-preview .site-footer h4 { color: #fff; }
body.theme-preview .site-footer a { color: rgba(255, 255, 255, 0.75); }
body.theme-preview .site-footer a:hover { color: var(--preview-accent-orange); }

/* ───────── 5. Category Tokens ─────────
   Each category class on <body> activates a --cat-accent and deep variant.
   Components (card accent bars, page-title bars, nav underline, breadcrumbs)
   consume var(--cat-accent).
*/

body.theme-preview.cat-news     { --cat-accent: #3b7bc8; --cat-accent-deep: #2e5fa0; }
body.theme-preview.cat-fotos    { --cat-accent: #e07a9a; --cat-accent-deep: #c35e80; }
body.theme-preview.cat-wetter   { --cat-accent: #4fa8d6; --cat-accent-deep: #3c8eb8; }
body.theme-preview.cat-events   { --cat-accent: #ff8c42; --cat-accent-deep: #e86d1f; }
body.theme-preview.cat-mitmachen{ --cat-accent: #f5a524; --cat-accent-deep: #d9890d; }
body.theme-preview.cat-verein   { --cat-accent: #1e4d8c; --cat-accent-deep: #153a6b; }
body.theme-preview.cat-flugplatz{ --cat-accent: #5a9a6a; --cat-accent-deep: #457a52; }
body.theme-preview.cat-kontakt  { --cat-accent: #3c4a5e; --cat-accent-deep: #2b3848; }

/* ───────── 6. Active Nav Underline (category-coloured) ─────────
   Replaces the default blue background/color on active items with a
   3 px bottom accent in the current category colour.
*/
body.theme-preview .nav-item.active > a {
  background: transparent;
  color: #fff;
  position: relative;
}
body.theme-preview .nav-item.active > a::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px;
  bottom: -2px;
  height: 3px;
  border-radius: 2px;
  background: var(--cat-accent);
}

/* Mobile nav active item: accent border-left instead of underline */
body.theme-preview .mobile-nav-list li a.active-mobile,
body.theme-preview .mobile-nav-list li a[aria-current="page"] {
  border-left: 4px solid var(--cat-accent);
  padding-left: 20px;
}

/* ───────── 7. Hero (small aesthetic tweak, no structural change) ─────────
   Slightly lighter overlay so the sky/plane footage stays dominant.
*/
body.theme-preview .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(21, 58, 107, 0.28) 0%,
    rgba(21, 58, 107, 0.10) 45%,
    rgba(21, 58, 107, 0.30) 100%
  );
}
body.theme-preview .hero-content {
  background: rgba(21, 58, 107, 0.42);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ───────── 8. Landing Card Grid ─────────
   Only applies on the landing page (no cat-* class on body).
   Desktop: 3 cols × 4 rows, Aktuelles + Bilder span 2×2.
   Tablet: 2 cols. Mobile: 1 col with priority order.
*/

body.theme-preview:not([class*="cat-"]) .card-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-auto-rows: minmax(160px, auto);
  gap: 20px;
}

body.theme-preview:not([class*="cat-"]) #cardNews {
  grid-column: span 2;
  grid-row: span 2;
  order: 1;
}
body.theme-preview:not([class*="cat-"]) #cardWetter  { order: 2; }
body.theme-preview:not([class*="cat-"]) #cardNextEvent { order: 3; }
body.theme-preview:not([class*="cat-"]) #cardFotos {
  grid-column: span 2;
  grid-row: span 2;
  order: 4;
}
body.theme-preview:not([class*="cat-"]) #cardTermine { order: 5; }
body.theme-preview:not([class*="cat-"]) #cardCTA     { order: 6; }

/* Tablet (640–1023 px): 2 cols, big cards span full width */
@media (max-width: 1023px) {
  body.theme-preview:not([class*="cat-"]) .card-grid {
    grid-template-columns: 1fr 1fr;
  }
  body.theme-preview:not([class*="cat-"]) #cardNews,
  body.theme-preview:not([class*="cat-"]) #cardFotos {
    grid-column: span 2;
    grid-row: auto;
  }
}

/* Mobile (<640 px): 1 col, priority order */
@media (max-width: 639px) {
  body.theme-preview:not([class*="cat-"]) .card-grid {
    grid-template-columns: 1fr;
  }
  body.theme-preview:not([class*="cat-"]) #cardNews,
  body.theme-preview:not([class*="cat-"]) #cardFotos {
    grid-column: auto;
  }
  body.theme-preview:not([class*="cat-"]) #cardNews      { order: 1; }
  body.theme-preview:not([class*="cat-"]) #cardWetter    { order: 2; }
  body.theme-preview:not([class*="cat-"]) #cardFotos     { order: 3; }
  body.theme-preview:not([class*="cat-"]) #cardNextEvent { order: 4; }
  body.theme-preview:not([class*="cat-"]) #cardTermine   { order: 5; }
  body.theme-preview:not([class*="cat-"]) #cardCTA       { order: 6; }
}

/* ───────── 9. Cards (general) ─────────
   White card body, rounded 14 px, cool soft shadow, hover lift.
*/
body.theme-preview .card {
  background: var(--preview-card);
  border-radius: 14px;
  box-shadow: 0 2px 10px var(--preview-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
body.theme-preview .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--preview-shadow-hover);
}

body.theme-preview .card-header {
  position: relative;
  border-bottom: 1px solid var(--preview-border);
}
body.theme-preview .card-header h3 { color: var(--preview-text); }

/* Top accent bar on the card header — each card gets its own color.
   Subtle horizontal flow: a lighter sheen travels across the accent color. */
@keyframes preview-accent-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

body.theme-preview .card-header::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--card-accent, var(--preview-blue-light)) 0%,
    color-mix(in srgb, var(--card-accent, var(--preview-blue-light)) 55%, #ffffff) 50%,
    var(--card-accent, var(--preview-blue-light)) 100%
  );
  background-size: 200% 100%;
  animation: preview-accent-flow 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.theme-preview .card-header::before { animation: none; }
}

body.theme-preview #cardNews       { --card-accent: #3b7bc8; }
body.theme-preview #cardFotos      { --card-accent: #e07a9a; }
body.theme-preview #cardWetter     { --card-accent: #4fa8d6; }
body.theme-preview #cardNextEvent  { --card-accent: #ff8c42; }
body.theme-preview #cardTermine    { --card-accent: #ff8c42; }
body.theme-preview #cardCTA        { --card-accent: #f5a524; }

/* Per-card icon color picks up --card-accent */
body.theme-preview .card-header .material-icons {
  color: var(--card-accent, var(--preview-blue-light));
}

/* Card body flex-grow so card fills its grid cell */
body.theme-preview .card-body { flex: 1; }

/* ───────── 10. Filled accent cards (Event + CTA) ─────────
   Orange-gradient fill with white text, no separate header block.
   The accent bar is hidden; the whole card IS the accent.
*/
body.theme-preview #cardNextEvent {
  background: linear-gradient(135deg, #ff8c42, #ffb347);
  color: #fff;
}
body.theme-preview #cardNextEvent .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
body.theme-preview #cardNextEvent .card-header::before { display: none; }
body.theme-preview #cardNextEvent .card-header h3,
body.theme-preview #cardNextEvent .card-header .material-icons { color: #fff; }
body.theme-preview #cardNextEvent .event-next-title,
body.theme-preview #cardNextEvent .event-next-location { color: #fff; }
body.theme-preview #cardNextEvent .event-next-date {
  background: rgba(255, 255, 255, 0.95);
  color: var(--preview-accent-orange-deep);
}
body.theme-preview #cardNextEvent .card-footer {
  border-top-color: rgba(255, 255, 255, 0.2);
}
body.theme-preview #cardNextEvent .card-footer a { color: #fff; }
body.theme-preview #cardNextEvent .card-footer a:hover { text-decoration: underline; }

/* CTA card — keeps its existing .cta-card inside */
body.theme-preview #cardCTA {
  background: linear-gradient(135deg, #f5a524, #ffb347);
}
body.theme-preview #cardCTA .cta-card {
  background: transparent;
  color: #fff;
}
body.theme-preview #cardCTA .cta-card h3 { color: #fff; }
body.theme-preview #cardCTA .btn-cta {
  background: #fff;
  color: var(--preview-accent-orange-deep);
}
body.theme-preview #cardCTA .btn-cta:hover {
  background: #fff;
  color: #c75416;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* ───────── 11. Termine card date chips (orange) ───────── */
body.theme-preview #cardTermine .event-compact-date {
  background: linear-gradient(135deg, #ff8c42, #ffb347);
  color: #fff;
}
body.theme-preview #cardTermine .event-compact-day,
body.theme-preview #cardTermine .event-compact-mon { color: #fff; }

/* ───────── 12. Wetter card icon + temp color accent ───────── */
body.theme-preview #cardWetter .weather-icon-large { color: var(--card-accent); }
body.theme-preview #cardWetter .weather-temp { color: var(--preview-text); }

/* ───────── 13. Subpage — Page Title with Category Accent Bar ───────── */
body.theme-preview .page-title {
  position: relative;
  padding-left: 18px;
  color: var(--preview-text);
  font-size: 2rem;
  margin-bottom: 6px;
}
body.theme-preview .page-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0.25em; bottom: 0.25em;
  width: 5px;
  border-radius: 3px;
  background: var(--cat-accent);
}
body.theme-preview .page-subtitle {
  color: var(--preview-text-muted);
  margin-bottom: 24px;
}

/* ───────── 14. Breadcrumb chips ───────── */
body.theme-preview .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
}
body.theme-preview .breadcrumb a {
  color: var(--preview-text-muted);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 50, 90, 0.05);
  transition: background 0.15s, color 0.15s;
}
body.theme-preview .breadcrumb a:hover {
  background: var(--cat-accent);
  color: #fff;
}
body.theme-preview .breadcrumb-sep { color: var(--preview-text-muted); }
body.theme-preview .breadcrumb-current {
  color: var(--cat-accent-deep);
  font-weight: 600;
}

/* ───────── 15. Content Card + Form Card ───────── */
body.theme-preview .content-card,
body.theme-preview .form-card {
  background: var(--preview-card);
  border-radius: 14px;
  box-shadow: 0 2px 10px var(--preview-shadow);
  padding: 28px;
  border: 1px solid var(--preview-border);
}

body.theme-preview .content-card h2 {
  color: var(--preview-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cat-accent);
  display: inline-block;
}

body.theme-preview .content-card h3 {
  color: var(--preview-text);
  margin-top: 18px;
  margin-bottom: 8px;
}

body.theme-preview .content-card p { color: var(--preview-text); }
body.theme-preview .content-card ul li,
body.theme-preview .content-card ol li { color: var(--preview-text); }

/* Vorstand cards + vorstand grid keep structure, just new accent */
body.theme-preview .vorstand-card {
  background: var(--preview-card);
  border-radius: 14px;
  box-shadow: 0 2px 10px var(--preview-shadow);
  border-top: 3px solid var(--cat-accent);
  transition: transform 0.2s, box-shadow 0.2s;
}
body.theme-preview .vorstand-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--preview-shadow-hover);
}

/* Gradient heroes on Flugplatz/Kontakt/Satzung pages — recolor to cat */
body.theme-preview [class*="-hero"],
body.theme-preview .page-hero {
  background: linear-gradient(135deg, var(--cat-accent), var(--cat-accent-deep));
  color: #fff;
}

/* ───────── 16. Buttons ───────── */
body.theme-preview .btn-primary {
  background: linear-gradient(135deg, var(--cat-accent), var(--cat-accent-deep));
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 22px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  box-shadow: 0 2px 8px var(--preview-shadow);
}
body.theme-preview .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--preview-shadow-hover);
  filter: brightness(1.05);
}

body.theme-preview .btn-secondary {
  background: var(--preview-card);
  color: var(--preview-text);
  border: 1px solid var(--preview-border);
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
body.theme-preview .btn-secondary:hover {
  background: rgba(20, 50, 90, 0.04);
  border-color: var(--cat-accent);
}

/* Standalone CTA buttons outside cardCTA (e.g. in Mitmachen page) —
   always orange regardless of category */
body.theme-preview .btn-cta {
  background: linear-gradient(135deg, var(--preview-accent-orange), var(--preview-accent-orange-warm));
  color: #fff;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
body.theme-preview .btn-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 140, 66, 0.35);
}

/* ───────── 17. Hero — Organic Frame (nur Landing) ───────── */

body.theme-preview .hero-banner {
  height: 420px;
  border-radius: 16px;
  padding-top: 0;
  margin-bottom: 40px;
}

body.theme-preview .hero-overlay {
  background: linear-gradient(135deg, #152849 0%, #0c1a35 100%);
  clip-path: ellipse(28% 58% at 10% 50%);
  opacity: 0.94;
}

body.theme-preview .hero-content {
  position: absolute;
  left: 3%;
  top: 50%;
  transform: translateY(calc(-50% - 20px));
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  text-align: left;
  max-width: 32%;
  padding: 0;
}

body.theme-preview .hero-logo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
}

body.theme-preview .hero-banner h1 {
  font-size: 2.6rem;
  line-height: 1.15;
  margin-bottom: 14px;
  text-align: left;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

body.theme-preview .hero-video-toggle {
  right: 22px;
  bottom: 28px;
}

@media (max-width: 1024px) {
  body.theme-preview .hero-banner { height: 340px; }
  body.theme-preview .hero-overlay { clip-path: ellipse(38% 70% at 14% 50%); }
  body.theme-preview .hero-content { max-width: 42%; }
  body.theme-preview .hero-logo { width: 180px; margin-bottom: 10px; }
  body.theme-preview .hero-banner h1 { font-size: 2.1rem; }
}

@media (max-width: 768px) {
  body.theme-preview .hero-banner {
    height: 260px;
    border-radius: 12px;
  }
  body.theme-preview .hero-overlay {
    clip-path: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.50) 100%);
    opacity: 1;
  }
  body.theme-preview .hero-content {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
    max-width: calc(100% - 32px);
    margin: 20px auto 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
  body.theme-preview .hero-logo {
    width: 160px;
    margin: 0 auto 10px;
  }
  body.theme-preview .hero-banner h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  }
}
