/*
Theme Name:        Kampfkunst Starter
Theme URI:         https://example.de/kampfkunst-starter
Author:            René Floitgraf
Author URI:        https://example.de
Description:        Klassisches PHP-Starter-Theme für eine Kampfkunst-/Kampfsportschule mit mehreren Standorten. Eigene Custom Post Types für Standorte und Events, lokal eingebundene Schriften (kein Google-CDN), privacy-by-design. Als Lern- und Ausbaubasis gedacht.
Version:           0.2.6
Requires at least: 6.4
Tested up to:      6.8
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       kampfkunst
*/

/* =========================================================================
   Lokale Schriften (self-hosted -> keine Datenübertragung an Google)
   ========================================================================= */
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/oswald-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/oswald-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/work-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/work-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/work-sans-latin-600-normal.woff2") format("woff2");
}

/* =========================================================================
   Design-Token
   ========================================================================= */
:root {
  color-scheme: light;    /* Design ist bewusst hell/dunkel gemischt –
                             verhindert automatisches Abdunkeln durch den Browser */
  --ink:        #15181d;   /* Anthrazit, Impact-Flächen (Hero, Footer)   */
  --ink-soft:   #21262e;   /* abgesetzte dunkle Fläche                   */
  --paper:      #f2f3f4;   /* neutraler heller Seitenhintergrund         */
  --card:       #ffffff;   /* Kartenfläche                               */
  --red:        #b4332a;   /* Dan-Rot, Akzent (sparsam!)                 */
  --red-deep:   #8e271f;   /* Hover/Tiefe                                */
  --gold:       #c6913e;   /* Gürtel-Gold, sehr sparsam                  */

  --text:       #1b1f24;   /* Fließtext                                  */
  --muted:      #5a626b;   /* Sekundärtext                               */
  --line:       rgba(21, 24, 29, .14); /* Trennlinien                    */
  --line-soft:  rgba(255, 255, 255, .16);

  --font-head:  "Oswald", "Arial Narrow", system-ui, sans-serif;
  --font-body:  "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap:       1180px;    /* max. Inhaltsbreite                          */
  --gap:        clamp(1rem, 3vw, 2rem);
  --radius:     4px;       /* bewusst kantig, „diszipliniert"            */
}

/* =========================================================================
   Reset / Grundlagen
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, .95rem + .2vw, 1.125rem);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-deep); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .5em;
  text-transform: none;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
p  { margin: 0 0 1em; max-width: 68ch; }

/* Tastatur-Fokus sichtbar lassen (Barrierefreiheit) */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* =========================================================================
   Layout-Helfer
   ========================================================================= */
.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section--ink { background: var(--ink); color: #eef0f2; }
.section--ink h2, .section--ink h3 { color: #fff; }

/* Gürtel-Streifen: strukturelles Motiv statt Deko-Linie */
.belt {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.belt::before {
  content: "";
  width: 2.5rem; height: 6px;
  background: var(--red);
  border-radius: 1px;
}
.section--ink .belt { color: #aeb6bf; }

/* Buttons */
.btn {
  --btn-bg: var(--red);
  --btn-fg: #fff;
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .85rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 2px solid var(--btn-bg);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { --btn-bg: var(--red-deep); color: #fff; }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: #fff;
  border-color: rgba(255,255,255,.55);
}
.btn--ghost:hover { --btn-bg: rgba(255,255,255,.1); border-color:#fff; color:#fff; }

/* =========================================================================
   Kopfzeile / Navigation
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  min-height: 68px;
}
/* Logo: umbruchsicher – auch lange Vereinsnamen bleiben kompakt */
.site-logo {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1rem, .9rem + .45vw, 1.3rem);
  line-height: 1.05; letter-spacing: .02em;
  color: #fff; text-decoration: none;
  max-width: 22rem; flex: 0 1 auto; min-width: 0;
}
.site-logo__img { height: 44px; width: auto; flex: 0 0 auto; }
@media (max-width: 480px) {
  .site-logo { gap: .5rem; }
  .site-logo__img { height: 36px; }
}

/* Navigation nimmt den restlichen Platz und richtet sich rechts aus */
.main-nav { flex: 1 1 auto; min-width: 0; }
.main-nav > ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: .2rem 1.05rem;
}
.main-nav li { position: relative; }
.main-nav a {
  display: block; color: #dfe3e7; text-decoration: none; font-weight: 500;
  font-size: .95rem; padding: .5rem 0; white-space: nowrap;
  transition: color .18s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { color: #fff; }

/* Animierter Unterstrich – nur oberste Ebene, per background statt Pseudo-Element,
   damit ::after für das Dropdown-Caret frei bleibt */
.main-nav > ul > li > a {
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 0% 2px; background-position: left bottom; background-repeat: no-repeat;
  transition: background-size .18s ease, color .18s ease;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.current-menu-item > a,
.main-nav > ul > li.current-menu-parent > a { background-size: 100% 2px; color: #fff; }

/* Caret für Einträge mit Untermenü */
.main-nav .menu-item-has-children > a::after {
  content: ""; display: inline-block; width: .42em; height: .42em;
  margin-left: .4em; vertical-align: middle;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: .6;
  transition: transform .18s ease, opacity .18s ease;
}
.main-nav .menu-item-has-children:hover > a::after,
.main-nav .menu-item-has-children:focus-within > a::after {
  transform: translateY(0) rotate(45deg); opacity: 1;
}

/* Dropdown (Desktop) */
.main-nav .sub-menu {
  list-style: none; margin: 0; padding: .4rem 0;
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--ink-soft);
  border: 1px solid var(--line-soft); border-top: 2px solid var(--red);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 18px 34px -18px rgba(0, 0, 0, .75);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s .16s;
  z-index: 60;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .16s ease, transform .16s ease, visibility 0s;
}
.main-nav .sub-menu a {
  padding: .6rem 1.1rem; font-size: .92rem; color: #cdd3d9; white-space: nowrap;
}
.main-nav .sub-menu a:hover, .main-nav .sub-menu a:focus-visible {
  color: #fff; background: rgba(255, 255, 255, .06);
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-soft);
  color: #fff; border-radius: var(--radius); padding: .5rem .7rem; cursor: pointer;
  font-family: var(--font-head); letter-spacing: .05em; text-transform: uppercase;
}

/* Umschaltpunkt hochgesetzt: bei vielen Menüpunkten früher aufs Burger-Menü */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink-soft); border-bottom: 1px solid var(--line-soft);
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .main-nav.is-open { display: block; }
  .main-nav > ul {
    flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    justify-content: flex-start; gap: 0; padding: .5rem var(--gap);
  }
  .main-nav li { border-top: 1px solid var(--line-soft); }
  .main-nav > ul > li:first-child { border-top: none; }
  .main-nav a { padding: .9rem 0; white-space: normal; }
  .main-nav > ul > li > a { background: none; }               /* Unterstrich-Trick aus */
  .main-nav .menu-item-has-children > a::after { display: none; } /* Caret aus (alles offen) */

  /* Untermenüs eingerückt und dauerhaft sichtbar statt Dropdown */
  .main-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; padding: 0; border: none; border-radius: 0; box-shadow: none;
    background: rgba(0, 0, 0, .22);
  }
  .main-nav .sub-menu a { padding: .7rem 0 .7rem 1.2rem; font-size: .95rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative; color: #fff; background: var(--ink);
  min-height: min(78vh, 640px);
  display: grid; align-items: center;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(21,24,29,.92) 0%, rgba(21,24,29,.72) 45%, rgba(21,24,29,.35) 100%);
}
/* Platzhalter, solange kein Bild/Video gesetzt ist */
.hero__media--placeholder {
  background:
    repeating-linear-gradient(135deg, #1b1f26 0 22px, #191d24 22px 44px);
}
/* Zwei-Spalten-Layout: Logo links, Text rechts (ab 860px) */
.hero__grid {
  position: relative;
  padding-block: clamp(3rem, 10vw, 6rem);
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
@media (min-width: 860px) {
  .hero__grid.has-logo { grid-template-columns: minmax(200px, 360px) 1fr; }
}
.hero__logo { display: flex; justify-content: center; }
.hero__logo img { width: 100%; max-width: 340px; height: auto; }
.hero__content { max-width: 42rem; }

.hero h1 { margin-bottom: .35em; }
.hero p { font-size: 1.2rem; color: #d6dade; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }

/* Mobil: Logo etwas kleiner und oben zentriert */
@media (max-width: 859px) {
  .hero__logo img { max-width: 200px; }
}

/* =========================================================================
   Zielgruppen (bewusst NICHT vier identische Karten)
   ========================================================================= */
.zielgruppen { display: grid; gap: 1.25rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .zielgruppen { grid-template-columns: repeat(4, 1fr); } }

.zg-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--zg-accent, var(--red));
  padding: 1.6rem 1.4rem; min-height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.zg-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(21,24,29,.5); }
.zg-card h3 { margin-bottom: .4rem; }
.zg-card p { font-size: .98rem; color: var(--muted); flex: 1; }
.zg-card a {
  margin-top: 1rem; font-family: var(--font-head); font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; font-size: .9rem;
  text-decoration: none; color: var(--text);
}
.zg-card a:hover { color: var(--red); }
/* Gürtelfarben als Herkunfts-Code der Zielgruppen */
.zg-card:nth-child(1) { --zg-accent: #d8b53a; } /* Kinder  – gelb   */
.zg-card:nth-child(2) { --zg-accent: #3f7d4f; } /* F/M     – grün   */
.zg-card:nth-child(3) { --zg-accent: #2f5aa6; } /* Erwachs.– blau   */
.zg-card:nth-child(4) { --zg-accent: #b4332a; } /* Senioren– rot    */

/* =========================================================================
   Events
   ========================================================================= */
.event-list { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px)  { .event-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .event-list { grid-template-columns: repeat(3, 1fr); } }

.event-card {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--ink-soft); border: 1px solid var(--line-soft);
  padding: 1.4rem; border-radius: var(--radius);
}
.event__date {
  font-family: var(--font-head); font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; font-size: .85rem; color: var(--gold);
}
.event__ort { font-size: .9rem; color: #aeb6bf; }
.event-card h3 { font-size: 1.25rem; }
.event__link { margin-top: auto; color: #fff; font-weight: 600; text-decoration: none; }
.event__link:hover { color: var(--gold); }

/* =========================================================================
   Standorte
   ========================================================================= */
.standorte { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 780px) { .standorte { grid-template-columns: repeat(3, 1fr); } }

.standort-card {
  position: relative; display: block; text-decoration: none; color: #fff;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  background: var(--ink-soft);
}
.standort-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.standort-card:hover img { transform: scale(1.05); }
.standort__label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.2rem 1rem .9rem;
  background: linear-gradient(transparent, rgba(21,24,29,.85));
  font-family: var(--font-head); font-weight: 700; font-size: 1.3rem;
}
.standort__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #4a525c;
  background: repeating-linear-gradient(135deg,#22272f 0 18px,#1e232a 18px 36px);
}

/* =========================================================================
   Archiv (Kategorie/Schlagwort …): Beiträge als Karten mit Foto
   ========================================================================= */
.archive-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.archive-desc { color: var(--muted); max-width: 65ch; }

.post-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -18px rgba(21,24,29,.5); }
.post-card__media { display: block; aspect-ratio: 4 / 3; background: #e9ebee; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: contain; }
.post-card__placeholder {
  display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(135deg, #22272f 0 18px, #1e232a 18px 36px);
}
.post-card__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem 1.2rem; flex: 1; }
.post-card__body h2 { font-size: 1.25rem; margin: 0; }
.post-card__body h2 a { color: var(--text); text-decoration: none; }
.post-card__body h2 a:hover { color: var(--red); }
.post-card__body p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.post-card__link {
  margin-top: .4rem; font-family: var(--font-head); font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
  color: var(--text); text-decoration: none;
}
.post-card__link:hover { color: var(--red); }

/* =========================================================================
   Kontakt-CTA
   ========================================================================= */
.cta-band {
  display: grid; gap: 1.5rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) { .cta-band { grid-template-columns: 1.4fr auto; } }
.cta-band h2 { margin: 0; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: var(--ink); color: #c4cad0; padding-block: clamp(2.5rem, 6vw, 4rem); }
.site-footer a { color: #dfe3e7; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-grid h4 { color: #fff; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

/* Unterer Footer-Block: Trennlinie trennt die Spalten vom Menü + Rechtszeile */
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }

/* Zentrierte Menüposition „Footer – Mitte" (z. B. für Login/Logout) */
.footer-account { margin: 0 0 1.5rem; text-align: center; }
.footer-account ul {
  list-style: none; margin: 0; padding: 0;
  display: inline-flex; flex-wrap: wrap; gap: .6rem 1rem; justify-content: center;
}
.footer-account a {
  display: inline-block;
  font-family: var(--font-head); font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
  color: #dfe3e7; text-decoration: none;
  padding: .5rem 1.3rem;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  transition: color .18s ease, border-color .18s ease;
}
.footer-account a:hover, .footer-account a:focus-visible {
  color: #fff; border-color: var(--red);
}

.footer-legal {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: space-between;
  font-size: .9rem; color: #8a929b;
}
.footer-legal nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Skip-Link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--red); color:#fff;
  padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* WordPress-Pflichtklassen */
.screen-reader-text { position:absolute!important; clip:rect(1px,1px,1px,1px); width:1px; height:1px; overflow:hidden; }
.alignwide { width: min(100%, 1180px); }
