/*
Theme Name: KommunalKonzept BW
Theme URI: https://komko-test.eicar.eu/
Author: KommunalKonzept BW GmbH
Description: Individuelles Theme fuer die KommunalKonzept BW GmbH. Header mit Logo, bearbeitbarer WP-Navigation & grossem Banner, vierspaltiger dunkler Footer, Cookie-Consent. Markenfarben zentral ueber CSS-Variablen einstellbar.
Version: 1.9
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: kkbw
*/

/* Selbst gehostete Schriften (kein externer Google-Request → DSGVO-freundlich) */
@font-face{font-family:"Maven Pro";font-style:normal;font-weight:500 700;font-display:swap;src:url(fonts/mavenpro.woff2) format("woff2");}
@font-face{font-family:"Open Sans";font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/opensans.woff2) format("woff2");}

/* =========================================================================
   Design-Tokens  --  Markenfarben (KommunalKonzept BW = Gruen)
   ========================================================================= */
:root{
  --kk-primary:      #007a2f;
  --kk-primary-dark: #005c22;
  --kk-accent:       #76b81a;
  --kk-ink:          #2b2b2b;
  --kk-muted:        #6b7580;
  --kk-line:         #e2e6ea;
  --kk-bg:           #ffffff;
  --kk-bg-soft:      #f7f8f8;
  --kk-footer-bg:    #333333;
  --kk-footer-ink:   #cfd3cf;
  --kk-maxw:         1160px;
  --kk-radius:       10px;
  --kk-font:      "Open Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --kk-font-head: "Maven Pro", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================================
   Reset / Basis
   ========================================================================= */
*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; color:var(--kk-ink); background:var(--kk-bg);
  font-family:var(--kk-font); font-size:18px; line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; height:auto; display:block; }
a{ color:var(--kk-primary); text-decoration:none; }
a:hover{ text-decoration:underline; }
h1,h2,h3,h4{ font-family:var(--kk-font-head); color:var(--kk-primary); line-height:1.15; font-weight:700; }
h1{ font-size:2.7rem; margin:.1em 0 .5em; }
h2{ font-size:1.7rem; margin:1.6em 0 .5em; }
h3{ font-size:1.2rem; margin:1.3em 0 .4em; }
p{ margin:0 0 1em; }
ul{ padding-left:1.2em; }
.kk-wrap{ max-width:var(--kk-maxw); margin:0 auto; padding:0 24px; }
.screen-reader-text{ position:absolute; left:-9999px; }

/* =========================================================================
   Kopfzeile / Navigation
   ========================================================================= */
.kk-header{
  position:sticky; top:0; z-index:100; background:var(--kk-bg);
  border-bottom:3px solid var(--kk-primary);
}
.kk-header__inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:24px; min-height:92px;
}
.kk-logo img{ max-height:64px; width:auto; }
.kk-nav{ display:flex; }
.kk-menu{ list-style:none; margin:0; padding:0; display:flex; gap:4px; }
.kk-menu > li{ position:relative; }
.kk-menu > li > a{
  display:block; padding:14px 14px; color:var(--kk-ink);
  font-weight:600; font-size:.98rem; border-radius:6px;
}
.kk-menu > li > a:hover,
.kk-menu > li.current > a,
.kk-menu > li.current-menu-item > a,
.kk-menu > li.current-menu-ancestor > a,
.kk-menu > li.current-menu-parent > a{ color:var(--kk-primary); background:var(--kk-bg-soft); text-decoration:none; }
.kk-menu .sub,
.kk-menu .sub-menu{
  list-style:none; margin:0; padding:8px; position:absolute; top:100%; left:0;
  min-width:290px; background:var(--kk-bg); border:1px solid var(--kk-line);
  border-top:3px solid var(--kk-accent);
  border-radius:var(--kk-radius); box-shadow:0 14px 34px rgba(0,60,20,.14);
  opacity:0; visibility:hidden; transform:translateY(6px);
  transition:.16s ease; z-index:120;
}
.kk-menu > li:hover .sub,
.kk-menu > li:focus-within .sub,
.kk-menu > li:hover .sub-menu,
.kk-menu > li:focus-within .sub-menu{ opacity:1; visibility:visible; transform:translateY(0); }
.kk-menu .sub a,
.kk-menu .sub-menu a{
  display:block; padding:9px 12px; border-radius:6px; color:var(--kk-ink);
  font-size:.94rem;
}
.kk-menu .sub a:hover,
.kk-menu .sub-menu a:hover{ background:var(--kk-bg-soft); color:var(--kk-primary); text-decoration:none; }
.kk-burger{
  display:none; border:1px solid var(--kk-line); background:var(--kk-bg);
  border-radius:8px; padding:10px 12px; cursor:pointer; font-size:1.3rem; line-height:1;
  color:var(--kk-primary);
}

/* Header-Banner (grosses Bild zwischen Navigation und Inhalt – wie Original) */
.kk-banner{
  width:100%; height:400px;
  background-size:cover; background-position:center center; background-repeat:no-repeat;
  background-color:var(--kk-bg-soft);
}

/* =========================================================================
   Startseite: 2-spaltig (Intro links, Kontakt/Links rechts)
   ========================================================================= */
.kk-home .kk-content > h1:first-child{ font-size:3rem; margin-top:.2em; }
.kk-home-aside{ font-size:.96rem; }
.kk-home-aside figure,.kk-home-aside .wp-block-image{ margin:0 0 14px; }
.kk-home-aside p{ margin:0 0 .6em; }
.kk-home-aside ul{ list-style:none; padding:0; margin:0; }
.kk-home-aside li{ margin:.28em 0; }
.kk-home-aside a{ font-weight:600; }

/* Breadcrumb */
.kk-breadcrumb{ font-size:.85rem; color:var(--kk-muted); padding:16px 0 0; }
.kk-breadcrumb a{ color:var(--kk-muted); }
.kk-breadcrumb a:hover{ color:var(--kk-primary); }

/* =========================================================================
   Inhalt
   ========================================================================= */
.kk-main{ padding:28px 0 64px; }
.kk-content{ max-width:900px; }
.kk-content.kk-wide{ max-width:var(--kk-maxw); }
.kk-content img{ border-radius:8px; }
.kk-content figure{ margin:1.2em 0; }
.kk-content figcaption{ font-size:.85rem; color:var(--kk-muted); margin-top:.4em; }
.kk-content blockquote{
  border-left:4px solid var(--kk-accent); margin:1em 0; padding:.4em 0 .4em 1.1em;
  font-style:italic; color:var(--kk-primary-dark);
}
.kk-content blockquote cite{ display:block; font-style:normal; font-weight:700; margin-top:.5em; }
.kkbw-meta{ color:var(--kk-muted); font-size:.85rem; }

/* Eyebrow-Zeile (graue Ueberzeile ueber der H1 – wie Original, nicht kursiv) */
.kk-content > p:first-child{ color:var(--kk-muted); font-size:1.25rem; line-height:1.3; margin:0 0 .1em; }
.kk-content > p:first-child em{ font-style:normal; }
/* Trennlinien zwischen Abschnitten */
.kk-content hr{ border:0; border-top:1px solid var(--kk-line); margin:1.7em 0; }

/* Spalten (Gutenberg) */
.wp-block-columns{ display:flex; flex-wrap:wrap; gap:26px; margin:1.4em 0; }
.wp-block-column{ flex:1 1 0; min-width:220px; }

/* Info-Boxen */
.kkbw-box{
  background:var(--kk-bg-soft); border:1px solid var(--kk-line);
  border-top:4px solid var(--kk-accent); border-radius:var(--kk-radius);
  padding:20px 22px; height:100%;
}
.kkbw-box h3{ margin-top:0; }
.kkbw-box ul{ margin-bottom:0; }

/* Leistungs-Karten (Startseite) – flach wie Original */
.kkbw-cards{ align-items:flex-start; }
.kkbw-cards .wp-block-column{ background:transparent; border:0; padding:0 0 8px; }
.kkbw-cards figure{ margin:0 0 14px; }
.kkbw-cards img{ border-radius:6px; width:100%; aspect-ratio:4/3; object-fit:cover; }
.kkbw-cards h3{ padding:0; margin:.2em 0 .35em; font-size:1.16rem; }
.kkbw-cards h3 a{ color:var(--kk-primary); }
.kkbw-cards h3 a:hover{ color:var(--kk-primary-dark); text-decoration:none; }
.kkbw-cards p{ padding:0; }
.kkbw-cards a{ color:var(--kk-primary); font-weight:600; }

/* Team – Querformat-Fotos, zentriert (auch einzelne letzte Person mittig) */
.kkbw-team-grid{ display:flex; flex-wrap:wrap; justify-content:center; gap:34px 26px; margin:1.5em 0; }
.kkbw-person{ text-align:center; width:calc((100% - 52px)/3); max-width:340px; }
.kkbw-person img{ width:100%; aspect-ratio:8/5; object-fit:cover; border-radius:4px; }
.kkbw-person h3{ margin:.7em 0 .05em; font-size:1.15rem; }
.kkbw-person .role{ color:var(--kk-muted); margin:0 0 .7em; }
.kkbw-person .phone,.kkbw-person .mail{ font-size:.95rem; margin:.12em 0; }
.kkbw-person .mail a{ word-break:break-word; }
.kkbw-person .btn-kontakt{
  display:inline-block; margin-top:.8em; background:var(--kk-primary); color:#fff;
  font-weight:600; font-size:.9rem; padding:9px 18px; border-radius:22px; line-height:1;
}
.kkbw-person .btn-kontakt:hover{ background:var(--kk-primary-dark); color:#fff; text-decoration:none; }

/* Zahlen-Fakten – KPI-Kacheln (Text ueber Zahl, Einheit darunter – wie Original) */
.kkbw-kpi-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:26px; margin:1.6em 0 .5em; }
.kkbw-kpi{ text-align:center; }
.kkbw-kpi .kpi-top{ margin:0 0 .35em; }
.kkbw-kpi .kpi-num{ margin:0 auto .35em; max-height:118px; width:auto; border-radius:0; }
.kkbw-kpi .kpi-bot{ margin:.2em 0 0; }

/* Foerderprogramme – gruene Code-Boxen (wie Original), immer buendig ausgerichtet */
.kkbw-prog-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px 20px; margin:1.4em 0; align-items:start; }
.kkbw-prog{ font-size:.85rem; }
.kkbw-prog__code{ display:flex; align-items:center; justify-content:center; height:64px;
  background:var(--kk-primary); color:#fff; font-family:var(--kk-font-head); font-weight:700;
  font-size:1.7rem; letter-spacing:.06em; border-radius:2px; margin-bottom:10px; }
.kkbw-prog p{ margin:0; color:var(--kk-ink); }
.kkbw-prog img{ margin:0 auto 8px; max-height:110px; width:auto; }

/* Standorte */
.kkbw-orte{ columns:2; -webkit-columns:2; column-gap:32px; list-style:none; padding:0; }
.kkbw-orte li{ padding:3px 0; border-bottom:1px dotted var(--kk-line); }

/* Jahresberichte – grosses Cover + Raster (je Bericht ein Cover) wie Original */
.kkbw-jb-featured img{ max-width:400px; border:1px solid var(--kk-line); border-radius:0; }
.kkbw-jb-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:24px; margin:1.4em 0; }
.kkbw-jb img{ width:100%; border:1px solid var(--kk-line); border-radius:0; }
.kkbw-jb .jb-link{ display:block; margin-top:8px; font-weight:600; font-size:.95rem; }
.kkbw-jb-cover img{ max-width:340px; border:1px solid var(--kk-line); }

/* Formular */
.kkbw-form{ display:grid; gap:12px; max-width:520px; }
.kkbw-form label{ font-weight:600; font-size:.9rem; }
.kkbw-form input,.kkbw-form textarea{
  width:100%; padding:11px 12px; border:1px solid var(--kk-line);
  border-radius:8px; font:inherit; background:#fff;
}
.kkbw-form textarea{ min-height:130px; resize:vertical; }
.kkbw-btn{
  display:inline-block; background:var(--kk-primary); color:#fff; border:0;
  padding:12px 22px; border-radius:8px; font-weight:600; cursor:pointer; font-size:1rem;
  font-family:inherit; text-align:center;
}
.kkbw-btn:hover{ background:var(--kk-primary-dark); color:#fff; text-decoration:none; }
.kkbw-btn--ghost{ background:#fff; color:var(--kk-primary); border:1px solid var(--kk-primary); }
.kkbw-btn--ghost:hover{ background:var(--kk-bg-soft); color:var(--kk-primary-dark); }
.kkbw-notice{ padding:12px 16px; border-radius:8px; background:#e8f3ec; border:1px solid #bcdcc9; }
.kkbw-hp{ position:absolute; left:-9999px; }

/* =========================================================================
   Cookie-Consent
   ========================================================================= */
.kkbw-cc{ position:fixed; left:0; right:0; bottom:0; z-index:9999; display:flex; justify-content:center;
  background:rgba(20,30,20,.45); padding:16px; }
.kkbw-cc[hidden]{ display:none; }
.kkbw-cc__box{ background:#fff; width:100%; max-width:620px; padding:24px 26px; border-radius:12px;
  border-top:5px solid var(--kk-primary); box-shadow:0 24px 60px rgba(0,0,0,.35); max-height:90vh; overflow:auto; }
.kkbw-cc__box h3{ margin:0 0 .35em; }
.kkbw-cc__box p{ font-size:.92rem; margin:0 0 .8em; }
.kkbw-cc__cats{ display:grid; grid-template-columns:1fr 1fr; gap:9px 22px; margin:0 0 1.1em; font-size:.92rem; }
.kkbw-cc__cats label{ display:flex; align-items:center; gap:8px; }
.kkbw-cc__btns{ display:flex; flex-wrap:wrap; gap:10px; }
.kk-footer__legal{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.kk-footer__legal .sep{ opacity:.4; }
.kk-revoke{ background:none; border:1px solid rgba(255,255,255,.45); color:rgba(255,255,255,.85);
  border-radius:6px; padding:4px 12px; font-size:.8rem; cursor:pointer; font-family:inherit; margin-left:6px;
  display:inline-block; text-decoration:none; line-height:1.4; }
.kk-revoke:hover{ border-color:var(--kk-accent); color:var(--kk-accent); }

/* Einwilligungspflichtige Einbettung (z. B. OpenStreetMap-Karte) */
.kkbw-consent-embed{ position:relative; min-height:320px; background:var(--kk-bg-soft);
  border:1px solid var(--kk-line); border-radius:10px; display:flex; align-items:center;
  justify-content:center; text-align:center; padding:24px; }
.kkbw-consent-embed__inner{ max-width:460px; }
.kkbw-consent-embed__note{ font-size:.82rem; color:var(--kk-muted); margin:.7em 0 0; }
.kkbw-consent-embed.is-loaded{ display:block; padding:0; min-height:0; background:none; border:0; }
.kkbw-consent-embed iframe{ width:100%; height:400px; border:0; border-radius:10px; display:block; }

/* =========================================================================
   Fusszeile  (dunkel – wie Original)
   ========================================================================= */
.kk-footer{ background:var(--kk-footer-bg); color:var(--kk-footer-ink); margin-top:48px;
  border-top:4px solid var(--kk-accent); }
.kk-footer a{ color:#e6e9e2; }
.kk-footer a:hover{ color:var(--kk-accent); }
.kk-footer__grid{
  display:grid; grid-template-columns:1.15fr 1fr 1.3fr 1fr; gap:30px; padding:48px 0 36px;
}
.kk-footer h4{ color:var(--kk-accent); font-family:var(--kk-font-head); font-size:.98rem; margin:0 0 14px; letter-spacing:.01em; }
.kk-footer ul{ list-style:none; padding:0; margin:0; }
.kk-footer li{ margin:0 0 7px; font-size:.82rem; line-height:1.4; }
.kk-footer__bottom{
  border-top:1px solid rgba(255,255,255,.16); padding:16px 0;
  display:flex; flex-wrap:wrap; gap:14px; justify-content:space-between; align-items:center;
  font-size:.85rem; color:rgba(255,255,255,.55);
}
.kk-footer__bottom a{ color:rgba(255,255,255,.8); }
.kk-footer__bottom a:hover{ color:var(--kk-accent); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 960px){
  .kkbw-person{ width:calc((100% - 26px)/2); max-width:none; }
  .kkbw-prog-grid{ grid-template-columns:repeat(3,1fr); }
  .kkbw-jb-grid{ grid-template-columns:repeat(2,1fr); }
  .kk-footer__grid{ grid-template-columns:1fr 1fr; }
  .kk-banner{ height:300px; }
}
@media (max-width: 780px){
  body{ font-size:17px; }
  h1{ font-size:2.1rem; }
  .kk-home .kk-content > h1:first-child{ font-size:2.2rem; }
  .kkbw-kpi-grid{ grid-template-columns:1fr; }
  .kk-banner{ height:230px; }
  .kk-burger{ display:block; }
  .kk-nav{
    position:absolute; top:100%; left:0; right:0; background:var(--kk-bg);
    border-bottom:1px solid var(--kk-line); display:none; padding:8px 16px 18px;
    box-shadow:0 18px 30px rgba(0,60,20,.12);
  }
  .kk-nav.open{ display:block; }
  .kk-menu{ flex-direction:column; gap:0; }
  .kk-menu > li > a{ padding:12px 6px; border-bottom:1px solid var(--kk-line); }
  .kk-menu .sub,
  .kk-menu .sub-menu{
    position:static; opacity:1; visibility:visible; transform:none; box-shadow:none;
    border:0; border-top:0; padding:0 0 8px 14px; min-width:0;
  }
  .wp-block-column{ flex-basis:100%; }
}
@media (max-width: 560px){
  .kkbw-person{ width:100%; }
  .kkbw-prog-grid,.kkbw-jb-grid{ grid-template-columns:1fr 1fr; }
  .kkbw-orte{ columns:1; }
  .kk-footer__grid{ grid-template-columns:1fr; }
  .kk-banner{ height:165px; }
  .kkbw-cc__cats{ grid-template-columns:1fr; }
}

/* Zugaenglichkeit */
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{
  outline:3px solid var(--kk-accent); outline-offset:2px;
}
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; scroll-behavior:auto !important; } }
