/* Lernwerk Bayer — Custom CSS Overrides */
.logo-lern { font-weight: 900; }
.logo-werk { font-weight: 300; }

/* Sichtbarer Tastatur-Fokus (Tailwind-Preflight entfernt keine Outlines,
   aber viele Elemente haben sonst nur den Browser-Default) */
:focus-visible {
  outline: 2px solid var(--color-lw-blue, #0091CD);
  outline-offset: 2px;
}

/* Cookie Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

/* CMS Rich-Text Content */
.cms-content {
  font-size: 1rem;
  line-height: 1.7;
  color: #2C3E50;
}
.cms-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #005A6E;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid #F9B000;
  display: inline-block;
}
.cms-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #005A6E;
}
.cms-content p { margin-bottom: 1rem; }
.cms-content ul,
.cms-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  padding-left: 0.5rem;
}
.cms-content ul { list-style-type: disc; }
.cms-content ol { list-style-type: decimal; }
.cms-content li { margin-bottom: 0.4rem; }
.cms-content a {
  color: #005A6E;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  transition: border-bottom-style 0.15s ease;
}
.cms-content a:hover {
  border-bottom-style: solid;
}
.cms-content strong { font-weight: 700; }
.cms-content blockquote {
  border-left: 4px solid #F9B000;
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #4A5566;
  background: rgba(249, 176, 0, 0.06);
  padding: 0.75rem 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Formularfelder ohne eigene Klassen (Django-Standard-Widgets, z. B. Login/Registrierung):
   Tailwind-v4-Preflight entfernt alle Rahmen, ohne diese Regel wären die Felder unsichtbar. */
main input:not([class]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
main select:not([class]),
main textarea:not([class]) {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}
main input:not([class]):focus,
main select:not([class]):focus,
main textarea:not([class]):focus {
  outline: 2px solid rgba(0, 90, 110, 0.25);
  border-color: #005A6E;
}

/* Personen-Raster (CMS-Seiten Team/Vorstand): Tabelle mit Fotos als Karten */
.cms-content table:has(img) {
  width: calc(100% + 2.5rem);
  margin: 0 -1.25rem 1rem;
  border-collapse: separate;
  border-spacing: 1.25rem;
}
.cms-content table:has(img) td {
  width: 33.33%;
  vertical-align: top;
  text-align: center;
  line-height: 1.5;
  color: #4A5566;
}
.cms-content table:has(img) td img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}
.cms-content table:has(img) td strong { color: #005A6E; font-size: 1.05rem; }
@media (max-width: 640px) {
  .cms-content table:has(img),
  .cms-content table:has(img) tbody,
  .cms-content table:has(img) tr,
  .cms-content table:has(img) td { display: block; width: 100%; margin: 0; }
  .cms-content table:has(img) td { margin-bottom: 1.5rem; }
}

/* Card hover lift — subtle Y-translation on group hover */
.lw-card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lw-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(0, 90, 110, 0.15);
}

/* Card image fade — softer line-clamp using mask-image */
.lw-text-fade {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
          mask-image: linear-gradient(180deg, #000 70%, transparent);
}

/* Pattern-Overlay for gradient placeholder cards (when no Bild present) */
.lw-pattern-overlay {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.10) 0%, transparent 40%);
}

/* Public nav live-search widget — collapsed to a magnifier icon at rest,
   expands to an input on click. These utilities are not part of the precompiled
   Tailwind build, so define them here instead of relying on JIT. */
.lw-suche { margin-right: 0.5rem; }
.lw-suche-input {
  width: 14rem;
  display: none;          /* hidden at rest — only the toggle icon shows */
}
.lw-suche.is-open .lw-suche-input { display: inline-block; }
.lw-suche.is-open .lw-suche-toggle { display: none; }
.lw-suche-dropdown { right: 0; }
.lw-suche-dropdown:empty { display: none; }
.lw-suche:not(.is-open) .lw-suche-dropdown { display: none; }

/* Hero CTA gradient — Petrol -> Mittelblau (Marken-Leitfaden) */
.lw-cta-gradient {
  background: linear-gradient(135deg, #005A6E 0%, #0091CD 100%);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lw-cta-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px -4px rgba(0, 90, 110, 0.4);
}

/* ------------------------------------------------------------------
   Motion-Sprache: Bewegung nur bei Zustandswechseln (Öffnen, Laden,
   Erscheinen). Ein gemeinsames fade-up für Overlays/Messages, grow-x/-y
   für Balken, ein orchestrierter Hero-Einstieg. Alles respektiert
   prefers-reduced-motion.
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes lw-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes lw-grow-y { from { transform: scaleY(0); } }
  @keyframes lw-grow-x { from { transform: scaleX(0); } }

  /* Dropdowns (Nav, Suche) und Dialoge treten weich ein */
  .lw-dropdown { animation: lw-fade-up 0.16s ease-out; }
  dialog[open]  { animation: lw-fade-up 0.18s ease-out; }

  /* Django-Messages gleiten herein (Auto-Dismiss blendet separat aus) */
  .lw-message { animation: lw-fade-up 0.25s ease-out; }

  /* Balken in Charts und Listen wachsen einmalig aus der Basislinie */
  .lw-bar-y { transform-origin: bottom; animation: lw-grow-y 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
  .lw-bar-x { transform-origin: left;  animation: lw-grow-x 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

  /* Hero-Einstieg: Eyebrow → Headline → Copy → CTAs, ein ruhiger Stagger */
  .lw-hero-stagger > * {
    opacity: 0;
    animation: lw-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .lw-hero-stagger > :nth-child(1) { animation-delay: 0.05s; }
  .lw-hero-stagger > :nth-child(2) { animation-delay: 0.15s; }
  .lw-hero-stagger > :nth-child(3) { animation-delay: 0.25s; }
  .lw-hero-stagger > :nth-child(4) { animation-delay: 0.35s; }
  .lw-hero-stagger > :nth-child(5) { animation-delay: 0.45s; }
}

/* htmx-Ladeindikator — kleiner Spinner, sichtbar während laufender Requests */
.lw-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 90, 110, 0.2);
  border-top-color: #005A6E;
  border-radius: 50%;
  animation: lw-spin 0.7s linear infinite;
}
@keyframes lw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .lw-spinner { animation-duration: 2s; }
}
