/*
Theme Name:   WKF Germany Modern
Description:  Modernes Child-Theme für wkfkickboxing.de (Admiral-Parent). Deutsche Flagge im Header bleibt. Ohne CDN, WCAG 2.2 AA, lokale Fonts.
Author:       Jarvis (Hermes) im Auftrag von Andreas Klauda
Template:     admiral
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  wkf-de-modern
*/

/* =========================================================
   0. Design-Tokens
   ========================================================= */
:root {
  --flag-black: #000000;
  --flag-red:   #DD0000;
  --flag-gold:  #FFCE00;

  --brand:      #DD0000;      /* Flag-Rot, AA auf Weiss ~5.1:1 */
  --brand-dark: #B00000;      /* Hover */
  --brand-tint: #FDECEC;      /* helle Flaeche / Pillen */

  --ink:        #1a1a1a;
  --muted:      #5a5a5a;
  --paper:      #ffffff;
  --bg:         #f7f7f5;
  --border:     #e6e6e6;

  --maxw: 1920px;
  --gutter: 20px;

  --nav-h: 52px;

  --font-display: 'Barlow Condensed', 'Open Sans', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 22px rgba(0,0,0,.05);
}

/* =========================================================
   1. Basis
   ========================================================= */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--bg) !important;
  background-image: none !important;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Links (Parent erbt #ee4444) -> Brand-Rot, AA, Unterstrich */
a { color: var(--brand); text-decoration: underline; }
a:link, a:visited { color: var(--brand); }
a:hover, a:focus, a:active { color: var(--brand-dark); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible),
input:focus:not(:focus-visible), textarea:focus:not(:focus-visible) { outline: none; }

.container { max-width: var(--maxw); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  line-height: 1.15;
}

/* =========================================================
   2. Layout (Admiral ist flex — niemals grid auf .site-content!)
   ========================================================= */
.site-content {
  display: flex !important;
  flex-flow: row wrap !important;
  gap: 2.5rem !important;
  align-items: flex-start !important;
  max-width: var(--maxw);
  padding: 0 var(--gutter) !important;
}
#content #primary,
.content-area {
  flex: 1 1 0 !important;
  order: 2 !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 2.2em 0 0 !important;
  border: none !important;
  background: transparent !important;
}
.main-sidebar,
#secondary {
  flex: 0 0 280px !important;
  order: 1 !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 2.2em 0 0 !important;
  border: none !important;
  background: transparent !important;
}
/* Sidebar klein (rechts) = so breit wie links (Owner-Wunsch), eigene Spalte */
.small-sidebar,
#tertiary {
  flex: 0 0 280px !important;
  order: 3 !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 2.2em 0 0 !important;
  border: none !important;
  background: transparent !important;
}

/* Einspaltig (Sidebars stapeln unter Content) ab 64em/1024px (Layout-Bruchpunkt = Nav-Bruchpunkt) */
@media (max-width: 64em) {
  #content #primary,
  .content-area,
  .main-sidebar,
  #secondary,
  .small-sidebar,
  #tertiary { flex: 1 1 100% !important; order: 1 !important; }
}

/* Rechte Sidebar: Admirals Widget-Spalten-Grid (widget-wrap width:25%/33%/50% ab 80em/65em/50em)
   NEUTRALISIEREN auf ALLEN Breiten -> Widgets sind IMMER 100% der Spalte (volle Breite), auch in der
   schmalen 280px-Spalte im 3-Spalten-Modus (sonst "hauchduenne Streifen"/Text bricht buchstabenweise um).
   Das INNERE .widget behaelt sein Basis-Padding (1em 1.5em) wie in der linken Sidebar. */
.small-sidebar { display: block !important; flex-wrap: nowrap !important; }
.small-sidebar .widget-wrap {
  display: block !important;
  float: none !important;
  width: 100% !important;
  padding: 0 !important;
  clear: both !important;
}
.small-sidebar .widget-wrap .widget {
  display: block !important;
  float: none !important;
  width: 100% !important;
  clear: both !important;
}

/* =========================================================
   3. Header (deutsche Flagge bleibt)
   ========================================================= */
.site-header {
  background: #fff !important;
  background-image: none !important;
  border-bottom: none !important;
}
/* Flagge VOLL BREIT; Inhalt liegt im (zentierten) Container.
   3 GLEICH hohe Streifen (je 33.33%): Schwarz 0–33.33%, Rot 33.33–66.67%, Gold 66.67–100%.
   Header per min-height auf ~132px = 3 Streifen à 44px (so hoch wie das Rot vorher) → Text mittig im Rot. */
.wkf-header-flag {
  background-image: linear-gradient(to bottom,
      #000000 0, #000000 33.33%,
      #DD0000 33.33%, #DD0000 66.67%,
      #FFCE00 66.67%, #FFCE00 100%) !important;
  background-color: var(--flag-red) !important;
  min-height: 8.25rem; /* 132px → 3 Streifen à 44px */
}
.header-main {
  margin: 0;
  padding: 1.4em var(--gutter) 1.4em !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  min-height: inherit; /* füllt die Flaggen-Höhe → Text vertikal mittig (50% = Rot-Mitte) */
}
.header-main::before, .header-main::after { display: none !important; }

.site-branding {
  float: none !important;
  max-width: 100%;
}
.site-branding .custom-logo {
  max-height: 72px;
  width: auto;
  vertical-align: middle;
  margin-right: 1em;
}
.site-title {
  display: inline-block;
  margin: 0;
  padding: 0 !important;
  color: #fff !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: .04em;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.site-title a:link, .site-title a:visited { color: #fff !important; }
.site-title a:hover, .site-title a:active { color: #f3e6c0 !important; }

.site-description {
  float: none !important;
  margin: .35em 0 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-size: 1.02rem;
  line-height: 1.3;
  text-shadow: 0 1px 5px rgba(0,0,0,.35);
}
/* Header-Widgets (falls vorhanden) gegen die Flagge abheben */
.header-widgets, .header-widget { color: #fff; }

/* =========================================================
   4. Navigation (weiss, sticky, rote Oberkante)
   ========================================================= */
.main-navigation-wrap {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff !important;
  border-top: 3px solid var(--brand);
  box-shadow: 0 1px 0 var(--border);
}
#masthead .main-navigation-container { max-width: var(--maxw); }

#masthead .main-navigation-menu {
  display: flex;
  flex-wrap: wrap;
  float: none !important;
  list-style: none;
  margin: 0;
  padding: 0;
}
#masthead .main-navigation-menu > li { float: none !important; margin: 0; }
#masthead .main-navigation-menu > li > a {
  display: block;
  white-space: nowrap;
  padding: 1rem .85rem;
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
#masthead .main-navigation-menu > li > a:link,
#masthead .main-navigation-menu > li > a:visited { color: var(--ink) !important; }
#masthead .main-navigation-menu > li > a:hover,
#masthead .main-navigation-menu > li > a:active {
  color: var(--brand) !important;
  background: var(--brand-tint);
  border-bottom-color: var(--brand);
}
#masthead .main-navigation-menu > li.current-menu-item > a,
#masthead .main-navigation-menu > li.current_page_item > a,
#masthead .main-navigation-menu > li.current-menu-ancestor > a {
  color: var(--brand) !important;
  border-bottom-color: var(--brand);
  background: var(--brand-tint);
}

/* Dropdown-Submenu (weiss) */
#masthead .main-navigation-menu ul.sub-menu,
#masthead .main-navigation-menu ul ul {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}
#masthead .main-navigation-menu ul a {
  color: var(--ink) !important;
  background: #fff;
}
#masthead .main-navigation-menu ul a:hover { color: var(--brand) !important; background: var(--brand-tint); }

/* Mobile-Hamburger: dunkel sichtbar auf weiss (Fallstrick 27).
   Nav-Burger bei <=64em/1024px (Tablet/Handy) = gleicher Bruchpunkt wie Layout-Einbruch.
   Darueber (1280/1366 Laptop) volles horizontales Menue (Parent < 60em kollabiert nur unter 960). */
@media (max-width: 64em) {
  #masthead .main-navigation-toggle {
    display: inline-block !important;
    padding: 1.1rem 1rem;
    color: var(--ink) !important;
    background: none;
    border: none;
  }
  #main-navigation-toggle::before {
    content: '';
    display: inline-block;
    width: 22px; height: 3px;
    background: var(--ink);
    box-shadow: 0 -7px 0 var(--ink), 0 7px 0 var(--ink);
  }
  #main-navigation-toggle::after { content: '' !important; font-family: none !important; color: var(--ink) !important; }
  #masthead .main-navigation-menu-wrap { display: none !important; background: #fff; }
  #masthead .main-navigation-menu-wrap.toggled-on { display: block !important; }
  #masthead .main-navigation-menu { display: block; }
  #masthead .main-navigation-menu > li > a {
    border-bottom: 1px solid var(--border);
    color: var(--ink) !important;
  }
}

/* =========================================================
   5. Beitraege / Karten (einspaltige Vollbeitraege)
   ========================================================= */
.entry-content, .entry-summary { color: var(--ink); }
.entry-content a { color: var(--brand); text-decoration: underline; }
.entry-content a:hover { color: var(--brand-dark); }

.entry-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: .01em;
}
.entry-title a:link, .entry-title a:visited { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--brand); }

.entry-meta { color: var(--muted); font-size: .92rem; }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--brand); }

.post-navigation { border-top: 1px solid var(--border); margin-top: 2em; padding-top: 1em; }
.post-navigation .nav-links a { color: var(--brand); text-decoration: underline; }
.post-navigation .nav-links a:hover { color: var(--brand-dark); }

/* Pagination -> Brand-Pillen */
.pagination .page-numbers,
.pagination a.page-numbers,
a.page-numbers:link,
a.page-numbers:visited {
  display: inline-block;
  min-width: 40px;
  padding: .45em .8em;
  margin: .2em;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink) !important;
  text-decoration: none;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--brand); color: #fff !important; border-color: var(--brand); }

/* Kategorie-Pillen am Beitragsende */
.entry-categories .meta-categories a {
  display: inline-block;
  padding: .3em .8em;
  margin: .15em;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark) !important;
  text-decoration: none;
  font-size: .85rem;
}
.entry-categories .meta-categories a:hover { background: var(--brand); color: #fff !important; }

/* Beitrags-Image und Captions: kein Overflow, Vollbreiten-Block statt Float */
.post-wrapper .type-post .wp-post-image,
.post-layout-one-column .post-wrapper .type-post .wp-post-image {
  float: none;
  margin: 0 0 1.1em;
  max-width: 100%;
}
.entry-content figure, .entry-content .wp-caption { max-width: 100%; }
.entry-content img, .entry-summary img { max-width: 100%; height: auto; }
.entry-content .wp-caption img { max-width: 100%; height: auto; }
.wp-caption .wp-caption-text { color: var(--muted); font-size: .88rem; }

/* =========================================================
   6. Sidebar / Widgets (runde Karten, ISKA-Rezept)
   ========================================================= */
.widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.3rem;
  margin: 0 0 1.5rem;
}
.widget .widget { background: none; border: none; box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
.widget-header { background: none !important; }   /* zeeDynamic-Balken uebersteuern — hier Admiral */
.widget-title {
  margin: 0 0 .9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px solid var(--brand);
  padding-bottom: .4rem;
}
.widget-title a:link, .widget-title a:visited { color: var(--ink); }
.widget-title a:hover { color: var(--brand); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: .4em 0; border-bottom: 1px dashed var(--border); }
.widget ul li:last-child { border-bottom: none; }
.widget a:link, .widget a:visited { color: var(--brand); }
.widget a:hover { color: var(--brand-dark); }

/* Such-Widget: Feld + Button korrekt ausgelegt (Fallstrick 50) */
.search-form { display: flex; gap: .4em; }
.search-form label { flex: 1 1 auto !important; min-width: 0 !important; }
.search-form .search-field { width: 100% !important; min-width: 0 !important; }
.search-form .search-submit { flex: 0 0 auto; width: auto !important; height: auto !important; background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: .5em 1em; cursor: pointer; }
.search-form .search-submit:hover { background: var(--brand-dark); }

/* =========================================================
   7. Tabellen — Events (dunkler Kopf bleibt) + Ranglisten
      (Ranglisten-Design = austria-boxing.at / abu-modern)
   ========================================================= */
.event-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
  table-layout: fixed;
}
.event-table tbody tr { border-bottom: 1px solid var(--border); }
.event-table tbody tr:nth-child(even) { background: #fafafa; }
.event-table tbody tr:hover { background: var(--brand-tint); }
.event-table thead th {
  background: #1B1B1B;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .85rem;
  padding: .75rem 1.1rem;
  text-align: left;
  border-bottom: 3px solid var(--brand);
}
.event-table .event-text { text-align: left; }
/* Spaltenbreiten: bei table-layout:fixed sind die thead-Zellen massgeblich
   (Datum/Land schmaler -> mehr Platz fuer EVENT); widerspiegelt auf td. */
.event-table thead th:nth-child(2), .event-table .event-date { width: 200px; white-space: nowrap; }
.event-table thead th:nth-child(3), .event-table .event-flag { width: 64px; text-align: center; }
.event-table .flag { max-width: 24px; height: auto; vertical-align: middle; }

/* ---- Ranglisten (Design aus abu-modern / austria-boxing.at) ---- */
.ranking-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ranking-nav a {
  padding: .5rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: all .18s ease;
}
.ranking-nav a:hover { border-color: var(--brand); color: var(--brand); }
.ranking-nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.ranking-title { text-align: center; margin: 1.5rem 0; font-family: var(--font-display); }
.ranking-title span { color: var(--brand); font-weight: 700; }
.ranking-info { text-align: center; margin: 1rem 0; color: var(--muted); font-size: .95rem; }

.gallery-controls { text-align: center; margin: 1rem 0; font-weight: 600; }
.gallery-controls a { color: var(--brand); text-decoration: none; }
.gallery-controls a:hover { text-decoration: underline; }

.weight-class-nav { text-align: center; margin: 1rem 0; }
.weight-class-nav a {
  display: inline-block;
  margin: .25rem .4rem;
  padding: .45rem .9rem;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.weight-class-nav a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.weight-class-nav hr { margin: 1.5rem 0; border: none; border-top: 2px solid var(--border); }
.weight-class-title { color: var(--brand); margin: 1.5rem 0 1rem; font-size: 1.25rem; font-family: var(--font-display); }

.ranking-table, .champion-table, .fighter-gallery {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1.5rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* Kopfzeile hell (brand-tint), wie Vorlage */
.ranking-table thead th {
  background-color: var(--brand-tint);
  padding: .75rem .7rem;
  text-align: left;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: .03em;
  border-bottom: 2px solid var(--border);
}
.ranking-table thead th:first-child { border-top-left-radius: var(--radius); }
.ranking-table thead th:last-child { border-top-right-radius: var(--radius); }
/* Zebra + Hover */
.ranking-table tbody tr.ranking-row { border-bottom: 1px solid var(--border); }
.ranking-table tbody tr.ranking-row.even { background-color: #fafbfc; }
.ranking-table tbody tr.ranking-row.odd { background-color: #fff; }
.ranking-table tbody tr.ranking-row:hover { background-color: var(--brand-tint); }
.ranking-table td, .champion-table td { padding: .7rem; vertical-align: middle; }
.ranking-table .ranking-platz { white-space: nowrap; width: 4%; font-weight: 700; color: var(--ink); }
.ranking-table .flag { max-width: 24px; height: auto; vertical-align: middle; }
/* Champion-Tabelle: Ecken mitrunden */
.champion-table tr:first-child td:first-child { border-top-left-radius: var(--radius); }
.champion-table tr:first-child td:last-child { border-top-right-radius: var(--radius); }

/* Thumbnail-Hover-Popup -> oeffnet NACH RECHTS, NUR Hover (nicht klickbar) */
.ranking-table .thumbnail { display: inline-block; position: relative; cursor: default; }
.ranking-table .thumbnail span {
  display: none;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: .6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem;
  box-shadow: var(--shadow);
  z-index: 30;
  white-space: nowrap;
}
.ranking-table .thumbnail:hover span { display: block; }
.ranking-table .thumbnail span img { display: block; margin: 0 auto .25rem; max-width: 160px; height: auto; }
.ranking-table .thumbnail span strong { display: block; text-align: center; font-size: .85rem; color: var(--ink); }

.fighter-gallery td { border: 1px solid var(--border); padding: 1rem; text-align: center; vertical-align: bottom; }
.fighter-gallery .fighter-card img { max-width: 120px; height: auto; display: block; margin: 0 auto .5rem; border-radius: 8px; }
.fighter-gallery .fighter-card strong { display: block; font-size: .9rem; line-height: 1.3; }

/* =========================================================
   8. Footer (dunkel, gebrandet)
   ========================================================= */
.footer-wrap, #footer {
  background: #1a1a1a;
  border-top: 4px solid var(--brand);
}
.site-footer .site-info {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  color: #cfcfcf;
  font-size: .9rem;
}
.site-footer .site-info a { color: var(--flag-gold); }
.site-footer .site-info .credit-link { color: #cfcfcf; }

/* =========================================================
   9. Scroll-Reveal (fail-safe: nur via html.js-reveal)
   ========================================================= */
html.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
html.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* =========================================================
   10. Responsive-Feinschliff
   ========================================================= */
@media (max-width: 64em) {
  .header-main { padding: 1.1em var(--gutter) !important; }
  .site-title { font-size: 2rem; }
  .site-description { font-size: .95rem; }
  .entry-title { font-size: 1.6rem; }
  /* Ranglisten: Menue-Tabs stapeln, Gewichtsklassen umbrechen */
  .ranking-nav { flex-direction: column; gap: .5rem; }
  .weight-class-nav { line-height: 1.9; }
}
@media (max-width: 480px) {
  .ranking-table, .event-table { font-size: .85rem; }
  .ranking-table thead th, .ranking-table td { padding: .5rem .3rem; }
  .event-table .event-flag, .event-table thead th:nth-child(3) { display: none; }
  .event-table .event-date { width: auto; }
  .fighter-gallery .fighter-card img { max-width: 80px; }
  .site-title { font-size: 1.65rem; }
}

/* =========================================================
   11. Print
   ========================================================= */
@media print {
  .main-navigation-wrap, .main-navigation-toggle, .widget, .sidebar, .footer-wrap { display: none !important; }
  body, .site-content, #content, .content-area { background: #fff !important; padding: 0 !important; }
  a[href]::after { content: " (" attr(href) ")"; }
}
