/*
Theme Name: Meckenheim hilft
Theme URI: https://meckenheim-hilft.org/
Author: Stefan Pohl
Author URI: https://meckenheim-hilft.org/
Description: Ein internationales, seriöses Theme für den gemeinnützigen Verein Meckenheim hilft e.V. Mit Missions-Galerien (ein Album pro Hilfstransport), WordPress-Menüsteuerung und Vorbereitung für Mehrsprachigkeit (DE/EN/UK).
Version: 1.4
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meckenheim-hilft
Tags: nonprofit, charity, gallery, translation-ready, custom-menu, featured-images
*/

/* =========================================================
   DESIGN-TOKENS
   Palette: Marineblau (Vertrauen) + warmes Sandbeige (Wärme)
   + dezente Solidaritäts-Akzente in Blau/Gelb (Ukraine)
   ========================================================= */
:root {
  --navy:        #0d2a4a;   /* Haupt-Marineblau */
  --navy-deep:   #081d34;   /* dunkler für Footer/Kontrast */
  --sky:         #1f6fb2;   /* sekundäres Blau, Links/Akzent */
  --solidarity:  #2b6cb0;   /* Solidaritätsblau */
  --gold:        #f0b429;   /* warmer Gelbakzent (sparsam!) */
  --sand:        #f6f2ea;   /* warmer heller Hintergrund */
  --paper:       #ffffff;
  --ink:         #1a2230;   /* Fließtext */
  --ink-soft:    #4a5568;   /* sekundärer Text */
  --line:        #e2ddd2;   /* Trennlinien auf Sand */

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(13,42,74,.10);
  --shadow-lg: 0 24px 60px rgba(13,42,74,.16);

  --ff-display: "Fraunces", Georgia, "Times New Roman", serif;
  --ff-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   RESET / BASIS
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--navy);
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
p { margin: 0 0 1.1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--ff-body);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--sky);
  margin: 0 0 .9rem;
}

/* Skip-Link für Barrierefreiheit */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: .8rem 1.2rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-body); font-weight: 700; font-size: .98rem;
  padding: .85rem 1.6rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { transform: translateY(-2px); background: #ffc94b; color: var(--navy-deep); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { transform: translateY(-2px); }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: .85rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--navy) 0%, var(--sky) 100%);
  display: grid; place-items: center; color: #fff;
  font-family: var(--ff-display); font-weight: 600; font-size: 1.35rem;
}
.brand-text { line-height: 1.1; }
.brand-text strong { display: block; font-family: var(--ff-display); color: var(--navy); font-size: 1.15rem; font-weight: 600; }
.brand-text span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }

.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; }

/* Umschalt-Button (Pfeil) bei Einträgen mit Unterpunkten */
.main-nav .submenu-toggle {
  background: none; border: 0; cursor: pointer; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s ease, color .2s ease;
}

/* -------- Untermenü: GRUNDZUSTAND (mobile-first) = geschlossen -------- */
.main-nav .sub-menu {
  list-style: none; margin: 0; padding: 0;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.main-nav .sub-menu.is-open { max-height: 70vh; }

/* ===================== DESKTOP-NAVIGATION (ab 901px) ===================== */
@media (min-width: 901px) {
  .main-nav > ul { display: flex; gap: 1.6rem; align-items: center; }
  .main-nav > ul > li > a { padding: .3rem 0; position: relative; display: inline-flex; align-items: center; }
  .main-nav > ul > li > a::after {
    content: ""; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0;
    background: var(--gold); transition: width .2s ease;
  }
  .main-nav > ul > li > a:hover::after,
  .main-nav .current-menu-item > a::after { width: 100%; }

  .main-nav .submenu-toggle { padding: .2rem; margin-left: .15rem; pointer-events: none; }

  /* Dropdown-Panel */
  .main-nav .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 220px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: .5rem;
    max-height: none; overflow: visible;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 120;
  }
  .main-nav .sub-menu li { width: 100%; }
  .main-nav .sub-menu a { display: block; padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
  .main-nav .sub-menu a:hover { background: var(--sand); color: var(--navy); }

  /* Aufklappen bei Hover oder Tastatur-Fokus – funktioniert auch ohne JS */
  .main-nav .menu-item-has-children:hover > .sub-menu,
  .main-nav .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
  .main-nav .menu-item-has-children:hover > .submenu-toggle { transform: rotate(180deg); }
}

.header-actions { display: flex; align-items: center; gap: 1rem; }

/* Mobile-Menü-Toggle */
.menu-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: .4rem;
  color: var(--navy);
}
.menu-toggle svg { width: 28px; height: 28px; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .main-nav.is-open { max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow); }
  .main-nav > ul { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1.5rem; }
  .main-nav > ul > li { border-bottom: 1px solid var(--line); }
  .main-nav > ul > li:last-child { border-bottom: 0; }
  .main-nav a { display: block; padding: .9rem 0; }

  /* Top-Level-Eintrag mit Kindern: Link + Pfeil-Button nebeneinander */
  .main-nav .menu-item-has-children {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  }
  .main-nav .menu-item-has-children > a { flex: 1; }
  .main-nav .submenu-toggle {
    padding: .9rem .4rem;
  }
  .main-nav .submenu-toggle[aria-expanded="true"] { transform: rotate(180deg); }

  /* Untermenü mobil: volle Breite, im Fluss, klappt per Button auf */
  .main-nav .sub-menu {
    flex-basis: 100%; width: 100%;
    background: var(--sand); border-radius: 10px;
  }
  .main-nav .sub-menu.is-open { max-height: 60vh; margin-bottom: .6rem; }
  .main-nav .sub-menu li { border-bottom: 1px solid var(--line); }
  .main-nav .sub-menu li:last-child { border-bottom: 0; }
  .main-nav .sub-menu a { padding: .75rem 1rem; font-size: .95rem; }
  /* Spenden-Button im Header auf Mobil ausblenden (im Inhalt mehrfach vorhanden) */
  .header-actions .btn-primary { display: none; }
  .header-actions { gap: .5rem; }
  /* Markenzusatz kürzen, damit Platz bleibt */
  .brand-text span { display: none; }
}

@media (max-width: 480px) {
  .brand-mark { width: 38px; height: 38px; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--navy-deep);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8,29,52,.55) 0%, rgba(8,29,52,.82) 100%),
    var(--hero-image, linear-gradient(135deg, #0d2a4a, #1f6fb2));
  background-size: cover; background-position: center;
}
.hero-inner { position: relative; padding-block: clamp(4rem, 12vw, 8rem); max-width: 720px; }
.hero h1 { color: #fff; }
.hero p { font-size: 1.2rem; color: rgba(255,255,255,.9); max-width: 38ch; }
.hero .eyebrow { color: var(--gold); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }

/* Statistik-Leiste */
.stats {
  position: relative; z-index: 2; margin-top: -2.5rem;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.stat { background: #fff; padding: 1.6rem 1.4rem; text-align: center; }
.stat .num { font-family: var(--ff-display); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--navy); font-weight: 600; }
.stat .label { font-size: .82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 680px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-head { max-width: 60ch; margin-bottom: 2.5rem; }
.section--sand { background: var(--sand); }
.section--paper { background: var(--paper); }
.section--navy { background: var(--navy); color: #fff; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }
.section--navy .eyebrow { color: var(--gold); }

/* =========================================================
   MISSIONEN / GALERIE (Albumkarten)
   ========================================================= */
.mission-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.6rem;
}
.mission-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.mission-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.mission-card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--navy); }
.mission-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.mission-card:hover .thumb img { transform: scale(1.05); }
.mission-card .body { padding: 1.3rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.mission-meta { display: flex; flex-wrap: wrap; gap: .6rem; font-size: .8rem; color: var(--ink-soft); margin-bottom: .6rem; }
.mission-meta .pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--sand); padding: .2rem .65rem; border-radius: 999px; font-weight: 600;
}
.mission-card h3 { margin-bottom: .4rem; }
.mission-card .excerpt { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.mission-card .count { margin-top: auto; padding-top: 1rem; font-weight: 700; color: var(--sky); font-size: .9rem; }

/* Bildergalerie innerhalb einer Mission */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .9rem;
}
.gallery-grid a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--navy); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-grid a:hover img { transform: scale(1.06); }

/* Lightbox */
.mh-lightbox {
  position: fixed; inset: 0; background: rgba(8,29,52,.94); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 2rem;
}
.mh-lightbox.is-open { display: flex; }
.mh-lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
.mh-lightbox button {
  position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff;
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer; font-size: 1.5rem;
  display: grid; place-items: center; transition: background .2s ease;
}
.mh-lightbox button:hover { background: rgba(255,255,255,.25); }
.mh-lb-close { top: 1.5rem; right: 1.5rem; }
.mh-lb-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.mh-lb-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* =========================================================
   SPENDEN-BANNER
   ========================================================= */
.donate-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--sky) 100%);
  color: #fff; border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.5rem);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center;
  box-shadow: var(--shadow-lg);
}
.donate-band h2 { color: #fff; }
.donate-band p { color: rgba(255,255,255,.9); margin-bottom: 0; }
.iban-box {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px; padding: 1.2rem 1.4rem;
}
.iban-box .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.iban-box .iban { font-family: var(--ff-display); font-size: 1.15rem; letter-spacing: .02em; word-break: break-word; }
@media (max-width: 720px) { .donate-band { grid-template-columns: 1fr; } }

/* =========================================================
   ARTIKEL / CONTENT
   ========================================================= */
.entry-content { max-width: 70ch; }
.entry-content img { border-radius: var(--radius); margin-block: 1.5rem; }
.entry-content blockquote {
  border-left: 4px solid var(--gold); margin: 1.6rem 0; padding: .4rem 0 .4rem 1.4rem;
  font-family: var(--ff-display); font-size: 1.25rem; color: var(--navy);
}
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.6rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,.78); padding-block: 3.5rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .55rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* =========================================================
   HERO-SLIDER (Startseite)
   ========================================================= */
.hero-slider {
  position: relative; color: #fff; overflow: hidden;
  min-height: clamp(440px, 70vh, 680px);
  display: flex; align-items: center;
  background: var(--navy-deep);
}
.hero-slider .slides { position: absolute; inset: 0; }
.hero-slider .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.1s ease;
}
.hero-slider .slide.is-active { opacity: 1; }
.hero-slider .hero-inner { position: relative; z-index: 2; max-width: 720px; padding-block: clamp(3rem, 8vw, 5rem); }
.hero-slider h1 { color: #fff; }
.hero-slider p { font-size: 1.2rem; color: rgba(255,255,255,.92); max-width: 42ch; }
.hero-slider .eyebrow { color: var(--gold); }

.hero-dots {
  position: absolute; bottom: 1.6rem; left: 0; right: 0; z-index: 3;
  display: flex; gap: .55rem; justify-content: center;
}
.hero-dots button {
  width: 11px; height: 11px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.45); padding: 0; transition: background .2s ease, transform .2s ease;
}
.hero-dots button.is-active { background: var(--gold); transform: scale(1.25); }

/* =========================================================
   AKTUELLES (News-Grid 3×2)
   ========================================================= */
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem;
}
.news-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--navy); }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .thumb img { transform: scale(1.05); }
.news-card .thumb-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--navy), var(--sky)); }
.news-card .body { padding: 1.2rem 1.3rem 1.4rem; }
.news-card .date { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sky); font-weight: 700; }
.news-card h3 { margin: .35rem 0 .4rem; font-size: 1.2rem; }
.news-card .excerpt { color: var(--ink-soft); font-size: .92rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }

/* =========================================================
   ÜBER UNS – Team (4 Kacheln)
   ========================================================= */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.team-card { text-align: center; }
.team-photo {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, var(--navy), var(--sky));
  display: grid; place-items: center; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-initial { font-family: var(--ff-display); font-size: 3rem; color: rgba(255,255,255,.85); }
.team-meta strong { display: block; font-family: var(--ff-display); color: var(--navy); font-size: 1.15rem; }
.team-meta span { color: var(--ink-soft); font-size: .9rem; }
@media (max-width: 760px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   MITMACH-BEREICH
   ========================================================= */
.join-band {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--sky) 130%);
  color: #fff; text-align: center;
}
.join-inner { max-width: 640px; margin-inline: auto; }
.join-band h2 { color: #fff; }
.join-band p { color: rgba(255,255,255,.9); font-size: 1.15rem; margin-bottom: 1.6rem; }

/* Kleine Galerie-Variante (16 Bilder) */
.gallery-grid--small { grid-template-columns: repeat(8, 1fr); gap: .55rem; }
.gallery-grid--small a { border-radius: 8px; }
@media (max-width: 900px) { .gallery-grid--small { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .gallery-grid--small { grid-template-columns: repeat(3, 1fr); } }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px);
}
