
/* =========================================
   1. Grundeinstellungen und Farben
   ========================================= */

:root {
  /* Dark Olive Variante */

  --bg: #3b4e1f;
  --bg-shadow: #2f3d18;
  --bg-sub: #4e6611;
  --hover: #6b8e23;
  --focus: #a2c14b;
  --bg-trans: rgba(59, 78, 31, 0.95);

  /* Zauberwürfel-Farben */

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;

  --color-text: #1f2937;
  --color-text-muted: #64748b;
  --color-background: #f3f6fb;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;

  /* Abstände und Rundungen */

  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 18px;

  /* Schatten */

  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 6px 24px rgba(15, 23, 42, 0.10);

  --content-width: 900px;
}


/* =========================================
   2. Hero-Bereich
   ========================================= */

.hero {
  background-image: url('../images/zauberwuerfel/bg_wuerfel.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  height: 300px;
  height: 45vh;

  width: 100%;
  margin-top: 0;
}


/* =========================================
   3. Grundeinstellungen
   ========================================= */

/* Sanftes Scrollen nur bei unterstützenden Browsern */

html {
  scroll-behavior: smooth;
}


/* =========================================
   4. Abschnitte und Trennlinien
   ========================================= */

article > hr {
  height: 1px;
  margin: 44px 0;
  border: 0;

  background: #e2e8f0;
  background: var(--color-border, #e2e8f0);
}

section > hr {
  margin: 32px 0;
  border: 0;

  border-top: 1px solid #e2e8f0;
  border-top: 1px solid var(--color-border, #e2e8f0);
}


/* =========================================
   5. Bilder und Würfel-GIFs
   ========================================= */

article img {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
}

/* Ersatz für max-inline-size */

img {
  max-width: 100%;
}


/* =========================================
   6. Aufklappbereiche
   ========================================= */

main details {
  margin: 24px 0;
  overflow: hidden;

  border: 1px solid #e2e8f0;
  border: 1px solid var(--color-border, #e2e8f0);

  border-radius: 12px;
  border-radius: var(--radius-medium, 12px);

  background: #f8fafc;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

main details:hover {
  border-color: #cbd5e1;
}

main details[open] {
  border-color: #bfdbfe;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.06);
}


/* =========================================
   7. Klickbare Kopfzeile
   ========================================= */

main summary {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 17px 20px;

  color: #1e40af;
  font-weight: 600;
  line-height: 1.5;

  cursor: pointer;
  list-style: none;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}


/* Browser-Markierung entfernen */

main summary::-webkit-details-marker {
  display: none;
}


/* Plus-Zeichen */

main summary::after {
  content: "+";

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 28px;
  height: 28px;

  margin-left: 16px;

  flex: 0 0 28px;

  border-radius: 50%;

  color: #2563eb;
  color: var(--color-primary, #2563eb);

  background: #dbeafe;

  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}


/* Geöffneter Bereich */

main details[open] > summary {
  background: #eff6ff;
  background: var(--color-primary-light, #eff6ff);

  border-bottom: 1px solid #dbeafe;
}


/* Minus-Zeichen */

main details[open] > summary::after {
  content: "−";
}


/* Hover-Effekt */

main summary:hover {
  background: #eff6ff;
}


/* =========================================
   8. Inhalt der Aufklappbereiche
   ========================================= */

main .details-content {
  padding: 24px;
  background: #fff;
}

main .details-content h4:first-child {
  margin-top: 0;
}

main .details-content p:last-child {
  margin-bottom: 0;
}


/* =========================================
   9. Navigation zur nächsten Seite
   ========================================= */

.page-navigation {
  display: flex;
  justify-content: flex-start;

  margin-top: 48px;
  padding-top: 28px;

  border-top: 1px solid #e2e8f0;
}


/* =========================================
   10. Schaltflächen
   ========================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 48px;
  padding: 12px 22px;

  border: 1px solid transparent;
  border-radius: 8px;
  border-radius: var(--radius-small, 8px);

  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Ersatz für Flexbox-gap */

.button > * + * {
  margin-left: 10px;
}


/* Primäre Schaltfläche */

.button-primary {
  color: #fff;

  background: #2563eb;
  background: var(--color-primary, #2563eb);

  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}


/* Hover */

.button-primary:hover {
  color: #fff;

  background: #1d4ed8;
  background: var(--color-primary-hover, #1d4ed8);

  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.24);

  transform: translateY(-1px);
}


/* Tastatur-Fokus als Ersatz für :focus-visible */

.button:focus {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}


/* =========================================
   11. Responsive: Tablets
   ========================================= */

@media (max-width: 768px) {

  article > hr {
    margin: 34px 0;
  }

  .details-content {
    padding: 20px;
  }
}


/* =========================================
   12. Responsive: Smartphones
   ========================================= */

@media (max-width: 480px) {

  article > hr {
    margin: 30px 0;
  }

  article img {
    margin-bottom: 24px;
  }

  main details {
    margin: 20px 0;
  }

  main summary {
    padding: 15px;
    font-size: 0.95rem;
  }

  .details-content {
    padding: 18px 15px;
  }

  .page-navigation {
    margin-top: 36px;
    padding-top: 24px;
  }

  .button {
    display: flex;
    width: 100%;
    box-sizing: border-box;

    padding: 13px 16px;
  }
}


/* =========================================
   13. Barrierefreiheit und Animationen
   ========================================= */

/* Wird von älteren Browsern einfach ignoriert */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
