/*
Theme Name: Klar & Deutlich (Material)
Theme URI: https://klur.media/
Author: Klur Media
Author URI: https://klur.media/
Description: Seniorenfreundliches WordPress-Theme im Material-Design, abgestimmt auf die Vereinsfarben der Prostatakrebs-Selbsthilfegruppe Siegen (Blau, Rot, Grau). Große Schrift, hoher Kontrast, Cards mit Elevation, große Bedienflächen.
Version: 2.0.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: klar-deutlich
*/

/* ==========================================================================
   1. Design-Tokens – exakt aus dem Vereinslogo abgeleitet
   ========================================================================== */

:root{
  /* Aus dem Logo extrahierte Originalfarben */
  --md-blue: #2577ba;        /* Logo-Blau (Fahne/Schriftzug) */
  --md-blue-dark: #184e78;   /* abgeleitet, für App-Bar-Schatten/Hover */
  --md-blue-tint: #e8f1f9;   /* helle Fläche für Hover/aktive Zustände */
  --md-red: #e7000e;         /* Logo-Rot (Kreis) – bewusst sparsam als Akzent */
  --md-red-tint: #fdeceb;
  --md-grey: #6e6e6e;        /* aus Logo-Grau abgeleitet, kontraststärker */
  --md-grey-light: #f1f1f1;

  /* Funktionale Farben */
  --color-text: #1a1a1a;             /* Fließtext: Schwarz, NICHT Blau */
  --color-text-soft: #4a4a4a;
  --color-heading: var(--md-blue-dark);
  --color-link: #141414;
  --color-link-hover: var(--md-blue-dark);
  --color-bg: #ffffff;
  --color-bg-app: #f3f5f7;           /* Material Grey-100 ähnliche Fläche */
  --color-border: #e2e5e8;
  --color-focus: #ffb400;

  /* Typografie – bewusst groß für Seniorinnen und Senioren */
  --font-base: "Roboto", "Segoe UI", Arial, sans-serif;
  --font-size-base: 20px;
  --line-height-base: 1.7;
  --max-width: 1200px;
  --content-max-width: 760px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;

  /* Material-Elevation (Schattentiefen) */
  --elevation-1: 0 1px 3px rgba(20,40,60,0.10), 0 1px 2px rgba(20,40,60,0.16);
  --elevation-2: 0 4px 10px rgba(20,40,60,0.12), 0 2px 4px rgba(20,40,60,0.10);
  --elevation-3: 0 10px 24px rgba(20,40,60,0.16), 0 4px 8px rgba(20,40,60,0.10);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-full: 999px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ font-size: var(--font-size-base); scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg-app);
}

img{ max-width: 100%; height: auto; display: block; }

a{ color: var(--color-link); }

/* Kräftiger, gut sichtbarer Fokusrahmen (Barrierefreiheit) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible{
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link{
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--md-blue-dark);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  z-index: 1000;
  font-size: 1.1rem;
  border-radius: 0 0 8px 0;
}
.skip-link:focus{ left: 0; }

/* ==========================================================================
   2. Layout
   ========================================================================== */

.site{ min-height: 100vh; display: flex; flex-direction: column; }

.wrap{ max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }

.site-content{ flex: 1; padding-block: var(--space-4); }

.content-layout{
  display: grid;
  grid-template-columns: minmax(0, var(--content-max-width)) minmax(300px, 400px);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px){ .content-layout{ grid-template-columns: 1fr; } }

/* ==========================================================================
   3. Top App Bar (Material)
   ========================================================================== */

.site-header{
  background: var(--md-blue);
  color: #fff;
  box-shadow: var(--elevation-2);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-block: var(--space-2);
}

.site-branding{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.brand-mark{
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--elevation-1);
  flex-shrink: 0;
}
.brand-mark span{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--md-red);
  display: inline-block;
  position: relative;
}
.brand-mark span::after{
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 4px;
  height: 26px;
  background: var(--md-blue);
  transform: translateX(-50%);
  border-radius: 2px;
}

.site-branding img.custom-logo{
  max-height: 96px;         /* größer gestellt, damit das Vereinslogo präsenter ist */
  width: auto;
  background: #fff;
  border-radius: var(--radius-s);
  padding: 6px;
  box-shadow: var(--elevation-1);
}

.site-title{ font-size: 1.7rem; line-height: 1.2; margin: 0; font-weight: 700; }
.site-title a{ color: #ffffff; text-decoration: none; }
.site-title a:hover{ text-decoration: underline; }

.site-description{ margin: 0.2rem 0 0; font-size: 1.1rem; color: #eaf3fb; }

.main-navigation{ margin-top: var(--space-2); }
.main-navigation ul{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.main-navigation a{
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  transition: background-color .15s ease;
}
.main-navigation a:hover,
.main-navigation a:focus-visible{ background: rgba(255,255,255,0.18); }
.main-navigation .current-menu-item > a{
  background: #ffffff;
  color: var(--md-blue-dark);
}

/* Schrift größer/kleiner (Material-Chip-Buttons) */
.font-size-toggle{
  display: flex; gap: 0.5rem; align-items: center; margin-left: auto;
}
.font-size-toggle button{
  font-size: 1.05rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--md-blue-dark);
  border: none;
  border-radius: var(--radius-full);
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
  box-shadow: var(--elevation-1);
  transition: box-shadow .15s ease, transform .1s ease;
}
.font-size-toggle button:hover{ box-shadow: var(--elevation-2); transform: translateY(-1px); }

/* Hamburger-Button: standardmäßig ausgeblendet, erscheint erst unter 1000px */
.hamburger-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 3rem;
  height: 3rem;
  background: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--elevation-1);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger-toggle span{
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--md-blue-dark);
}
.hamburger-toggle:hover{ box-shadow: var(--elevation-2); }

.header-image{ margin: 0; box-shadow: var(--elevation-2); position: relative; z-index: 1; }
.header-image img{ width: 100%; object-fit: cover; max-height: 320px; }

/* ==========================================================================
   3b. Ausklappbare Sidebar (Drawer) für Bildschirme < 1000px
   ========================================================================== */

.drawer-overlay{
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity .2s ease;
}
.drawer-overlay.is-open{ opacity: 1; }

.mobile-drawer{
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: #ffffff;
  z-index: 201;
  box-shadow: var(--elevation-3);
  transform: translateX(-100%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  overflow-y: auto;
}
.mobile-drawer.is-open{ transform: translateX(0); }

.mobile-drawer-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}
.mobile-drawer-header .site-title{ font-size: 1.3rem; margin: 0; }
.mobile-drawer-header .site-title a{ color: var(--md-blue-dark); text-decoration: none; }
.mobile-drawer-header .site-description{ font-size: 1rem; color: var(--color-text-soft); margin: 0.2rem 0 0; }

.drawer-close{
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg-app);
  color: var(--color-text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.drawer-close:hover{ background: var(--md-blue-tint); }

.drawer-navigation ul{
  list-style: none; margin: 0 0 var(--space-3); padding: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.drawer-navigation a{
  display: block;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-s);
}
.drawer-navigation a:hover, .drawer-navigation a:focus-visible{ background: var(--md-blue-tint); }
.drawer-navigation .current-menu-item > a{ background: var(--md-blue); color: #fff; }

.drawer-font-toggle{
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 2px solid var(--color-border);
  justify-content: flex-start;
}
.drawer-font-toggle .drawer-font-label{ font-weight: 600; margin-right: 0.3rem; }
.drawer-font-toggle button{ box-shadow: none; border: 1px solid var(--color-border); }

/* Ab hier: Umbruch bei 1000px – Titel, Menü und Schriftgröße wandern in die Sidebar */
@media (max-width: 1000px){
  .site-heading,
  .site-header > .wrap > .site-branding > .font-size-toggle,
  .main-navigation{ display: none; }

  .hamburger-toggle{ display: flex; }

  .site-branding{ justify-content: space-between; }
}

@media (min-width: 1001px){
  .mobile-drawer, .drawer-overlay, .hamburger-toggle{ display: none; }
}

/* ==========================================================================
   4. Material Cards – Beiträge & Seiten
   ========================================================================== */

.entry{
  background: var(--color-bg);
  border-radius: var(--radius-m);
  box-shadow: var(--elevation-1);
  padding: var(--space-4);
}

.entry-title{
  color: var(--color-heading);
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  font-weight: 700;
}

.entry-meta{ display: none; } /* keine Datum/Autor-Zeile */

.entry-content p{ margin: 0 0 1.1em; }
.entry-content p:last-child{ margin-bottom: 0; }

.entry-content h2, .entry-content h3, .entry-content h4{
  color: var(--color-heading);
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
  font-weight: 700;
}
.entry-content h2:first-child, .entry-content h3:first-child{ margin-top: 0; }

.entry-content ul, .entry-content ol{ margin: 0 0 1.1em; padding-left: 1.4em; }
.entry-content li{ margin-bottom: 0.4em; }

.entry-content a{
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--md-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.entry-content a:hover, .entry-content a:focus-visible{ color: var(--color-link-hover); }

.entry-content table{ width: 100%; border-collapse: collapse; margin-bottom: 1.1em; }
.entry-content th, .entry-content td{
  border: 1px solid var(--color-border); padding: 0.6em 0.8em; text-align: left;
}

.legal-note{
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: 0.95rem;
  color: var(--color-text-soft);
}
.legal-note h4{ font-size: 1.05rem; margin: 0 0 0.5em; color: var(--color-heading); }

/* ==========================================================================
   5. Seitenleiste – Material-Listen-Cards mit Vereinsfarben
   ========================================================================== */

.widget-area{ display: flex; flex-direction: column; gap: var(--space-3); }

.widget{
  background: var(--color-bg);
  border-radius: var(--radius-m);
  box-shadow: var(--elevation-1);
  padding: var(--space-3);
}

.widget-title{
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 var(--space-2);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--md-blue);
}

.widget ul{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.widget li{ margin: 0; }

.widget a{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--md-blue);
  border-radius: var(--radius-s);
  padding: 0.85rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: var(--elevation-1);
  transition: box-shadow .15s ease, transform .1s ease, background-color .15s ease;
}
.widget a:hover, .widget a:focus-visible{
  background: var(--md-blue-tint);
  box-shadow: var(--elevation-2);
  transform: translateY(-1px);
  color: var(--md-blue-dark);
}

.widget a .link-subtitle{
  display: inline-block;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: .02em;
  color: #ffffff;
  background: var(--md-red);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: auto;
  flex-shrink: 0;
  order: 1;
}

/* Beschreibungszeile innerhalb eines Link-Kästchens – erzwingt einen Zeilenumbruch
   in der Flex-Box, damit sie immer unter dem Titel steht (und nicht daneben) */
.widget a .link-desc{
  display: block;
  flex-basis: 100%;
  order: 2;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-top: 0.15rem;
}

.widget_text .textwidget a,
.widget_custom_html a{
  display: block;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--md-blue);
  border-radius: var(--radius-s);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--elevation-1);
}
.widget_text .textwidget a:hover, .widget_custom_html a:hover{
  background: var(--md-blue-tint); color: var(--md-blue-dark);
}

/* Klassisches WordPress "Links"-Widget (Blogroll, wp_list_bookmarks):
   Beschreibung + Bewertungszahl liegen als nackter Text NEBEN dem <a>,
   deshalb bekommt hier das <li> die Karte und der Link nur die Typografie. */
.widget_links ul{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.widget_links li{
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--md-blue);
  border-radius: var(--radius-s);
  padding: 0.85rem 1rem;
  box-shadow: var(--elevation-1);
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--color-text-soft);
  transition: box-shadow .15s ease, transform .1s ease, background-color .15s ease;
}
.widget_links li:hover{
  background: var(--md-blue-tint);
  box-shadow: var(--elevation-2);
  transform: translateY(-1px);
}
.widget_links li a{
  display: block;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0.3rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
.widget_links li a:hover, .widget_links li a:focus-visible{
  color: var(--md-blue-dark);
  text-decoration: underline;
}
.widget_links li img{ display: none; } /* Favicons/Link-Bilder ausblenden, wirkt aufgeräumter */
/* Doppelte Leerzeilen durch mehrere <br> im Kern-Markup einsammeln */
.widget_links li br + br{ display: none; }

/* ==========================================================================
   6. Formulare / Material-Buttons
   ========================================================================== */

.search-form{ display: flex; gap: 0.5rem; }
.search-form input[type="search"]{
  flex: 1;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-bg);
}
.search-form button, .btn{
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--md-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  box-shadow: var(--elevation-1);
  transition: box-shadow .15s ease, background-color .15s ease;
}
.search-form button:hover, .btn:hover{
  background: var(--md-blue-dark);
  box-shadow: var(--elevation-2);
}

/* ==========================================================================
   7. Fußbereich
   ========================================================================== */

.site-footer{
  background: var(--md-blue-dark);
  color: #eaf3fb;
  padding: var(--space-3) 0;
  margin-top: var(--space-4);
  font-size: 1rem;
  text-align: center;
}
.site-footer a{ color: #ffffff; }

/* Größerer Schriftmodus (per JS auf <html> gesetzt) */
html.font-size-large{ font-size: 24px; }

@media (max-width: 600px){
  :root{ --font-size-base: 19px; }
  .entry{ padding: var(--space-3); }
  .entry-title{ font-size: 1.6rem; }
  .site-header{ position: static; }
}
