/* ===== Custom Properties ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f0f4ff;
  --color-bg-warm: #fef7f0;
  --color-surface: rgba(255, 255, 255, 0.8);
  --color-text: #1a1a2e;
  --color-text-muted: #5a6377;
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-light: #ede9fe;
  --color-secondary: #14b8a6;
  --color-accent: #0d9488;
  --color-accent-light: #ccfbf1;
  --color-green: #10b981;
  --color-green-light: #d1fae5;
  --color-orange: #f59e0b;
  --color-orange-light: #fef3c7;
  --color-pink: #ec4899;
  --color-pink-light: #fce7f3;
  --color-border: #e2e8f0;
  --color-card-shadow: rgba(124, 58, 237, 0.1);
  --color-focus: #7c3aed;
  --gradient-primary: linear-gradient(135deg, #2d1b69, #7c3aed, #14b8a6);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  --gradient-cool: linear-gradient(135deg, #14b8a6, #7c3aed, #4c1d95);
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --max-width: 64rem;
  --spacing: 1.5rem;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
}

/* ===== Animations ===== */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(2deg); }
  66% { transform: translateY(6px) rotate(-1deg); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3 {
  line-height: 1.25;
  margin-top: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.175rem; }

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

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

ul {
  padding-left: 1.25em;
}

/* ===== Focus Styles (A11y) ===== */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--spacing);
}

/* ===== Header (Glassmorphism) ===== */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #7c3aed, #14b8a6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-logo:hover {
  opacity: 0.8;
}

.site-logo .logo-icon {
  font-size: 1.5rem;
  -webkit-text-fill-color: initial;
}

.site-header nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.site-header nav a {
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 1.1rem;
  border-radius: 2rem;
  transition: all 0.2s ease;
  color: var(--color-text);
}

.site-header nav a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.site-header nav a[aria-current="page"] {
  background: var(--gradient-primary);
  color: #fff;
  -webkit-text-fill-color: #fff;
}

/* ===== Footer ===== */
#main-content {
  flex: 1;
}

.site-footer {
  margin-top: auto;
  padding: 2.5rem 0;
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.site-footer nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer nav a:hover {
  color: #fff;
}

.site-footer p {
  margin: 0;
}

/* ===== Hero (Landing Page) ===== */
.hero {
  background: url("/img/header.jpeg") top center / cover no-repeat;
  padding: 0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 21 / 9;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.audience-intro {
  text-align: center;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 38rem;
  margin: 0 auto 1.5rem;
}

/* Wave divider */
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ===== Audience Selection (Landing Page) ===== */
.audience-selection {
  padding: 3rem 0 5rem;
  position: relative;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.audience-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  border: 3px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.audience-card,
.audience-card:visited,
.audience-card:hover,
.audience-card:active {
  color: var(--color-text);
}

.audience-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.audience-card--eltern:hover {
  border-color: #ef4444;
  box-shadow: 0 20px 40px rgba(239, 68, 68, 0.15);
}

.audience-card--schueler:hover {
  border-color: #6366f1;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.audience-card .card-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.audience-card:hover .card-icon {
  transform: scale(1.15);
}

.audience-card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.audience-card--eltern h2,
.audience-card--eltern:hover h2 {
  background: var(--gradient-warm);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.audience-card--schueler h2,
.audience-card--schueler:hover h2 {
  background: var(--gradient-cool);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.audience-card p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.audience-card .card-arrow {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.75rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.audience-card--eltern .card-arrow {
  background: linear-gradient(135deg, #fef3c7, #fce7f3);
  color: #b45309;
}

.audience-card--eltern:hover .card-arrow {
  background: var(--gradient-warm);
  color: #fff;
}

.audience-card--schueler .card-arrow {
  background: linear-gradient(135deg, #cffafe, #e0e7ff);
  color: #0e7490;
}

.audience-card--schueler:hover .card-arrow {
  background: var(--gradient-cool);
  color: #fff;
}

/* ===== Link Categories ===== */
.link-category {
  margin-bottom: 3.5rem;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.category-icon {
  font-size: 1.3rem;
}

.category-description {
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}

.link-card {
  display: block;
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
}

.link-card:hover,
.link-card:visited {
  color: var(--color-text);
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width 0.2s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-card-shadow);
}

.link-card:hover::before {
  width: 6px;
}

/* Category color variants — left accent bar */
.link-category:nth-child(3n+1) .link-card::before { background: var(--gradient-primary); }
.link-category:nth-child(3n+2) .link-card::before { background: linear-gradient(180deg, var(--color-green), var(--color-accent)); }
.link-category:nth-child(3n+3) .link-card::before { background: var(--gradient-warm); }

.link-card h3 {
  margin-bottom: 0.25rem;
}

.link-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.link-card h3::after {
  content: "\2197";
  font-size: 0.85em;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.link-card:hover h3::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

.link-card:hover h3 {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.link-card p {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.link-url {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  word-break: break-all;
  font-weight: 500;
}

/* ===== Page List ===== */
.page-list {
  list-style: none;
  padding: 0;
}

.page-list li {
  margin-bottom: 1.25rem;
}

.page-list-link {
  display: block;
  position: relative;
  padding: 1.5rem 1.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-list-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px 0 0 4px;
  transition: width 0.2s ease;
}

.page-list-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-card-shadow);
}

.page-list-link:hover::before {
  width: 6px;
}

.page-list-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-list-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-list-header time {
  margin-left: auto;
  flex-shrink: 0;
}

.page-list-header::after {
  content: "\2192";
  color: var(--color-primary);
  opacity: 0;
  flex-shrink: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-list-link:hover .page-list-header::after {
  opacity: 1;
  transform: translateX(0);
}

.page-list-desc {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ===== Article ===== */
.article-description {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-top: -0.5rem;
}

time {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.article-content {
  margin-top: 2.5rem;
}

.article-content h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid;
  border-image: var(--gradient-primary) 1;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
}

.article-content strong {
  color: var(--color-text);
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-content thead {
  background: var(--color-primary);
  color: #fff;
}

.article-content th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.article-content td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}

.article-content tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

.article-content tbody tr:hover {
  background: var(--color-primary-light);
}

/* ===== Page Heading ===== */
.page-heading {
  padding: 2.5rem 0 2rem;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg-warm) 50%, var(--color-bg-alt) 100%);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.page-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.page-heading h1 {
  margin-bottom: 0.25rem;
}

.page-heading p {
  margin: 0;
  color: var(--color-text-muted);
}

/* ===== Decorative Background ===== */
#main-content {
  position: relative;
}

#main-content::before,
#main-content::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.07;
  pointer-events: none;
  z-index: -1;
}

#main-content::before {
  width: 600px;
  height: 600px;
  background: var(--color-primary);
  top: 10%;
  right: -200px;
}

#main-content::after {
  width: 500px;
  height: 500px;
  background: var(--color-secondary);
  bottom: 10%;
  left: -200px;
}

/* ===== Best Practices Page ===== */

/* Hero */
.bp-hero {
  background: linear-gradient(135deg, #10b981, #06b6d4, #6366f1);
  background-size: 200% 200%;
  animation: gradient-shift 10s ease infinite;
  color: #fff;
  padding: 4rem 0 5.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bp-hero-icon {
  display: block;
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  animation: pulse-soft 3s ease-in-out infinite;
}

.bp-hero h1 {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.bp-hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 36rem;
  margin-inline: auto;
}

.bp-hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
}

.bp-hero-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* Section wave dividers */
.bp-wave {
  line-height: 0;
}

.bp-wave svg {
  display: block;
  width: 100%;
  height: 50px;
}

.bp-wave--into-alt {
  background: var(--color-bg);
}

.bp-wave--into-white {
  background: var(--color-bg-alt);
}

/* Sections */
.bp-section {
  padding: 3rem 0;
  background: var(--color-bg);
}

.bp-section--alt {
  background: var(--color-bg-alt);
}

.bp-section-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: center;
}

.bp-section--alt .bp-section-inner {
  direction: rtl;
}

.bp-section--alt .bp-section-inner > * {
  direction: ltr;
}

/* Visual / image placeholder */
.bp-visual-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.bp-visual-placeholder--indigo {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe, #a5b4fc);
}

.bp-visual-placeholder--pink {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8, #f9a8d4);
}

.bp-visual-placeholder--cyan {
  background: linear-gradient(135deg, #cffafe, #a5f3fc, #67e8f9);
}

.bp-visual-placeholder--orange {
  background: linear-gradient(135deg, #fef3c7, #fde68a, #fcd34d);
}

.bp-visual-placeholder--red {
  background: linear-gradient(135deg, #fee2e2, #fecaca, #fca5a5);
}

.bp-visual-placeholder--emerald {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0, #6ee7b7);
}

.bp-visual-icon {
  font-size: 5rem;
}

.bp-visual img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

/* Content */
.bp-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bp-section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.bp-section--indigo .bp-section-number {
  background: #e0e7ff;
  color: #4f46e5;
}

.bp-section--pink .bp-section-number {
  background: #fce7f3;
  color: #db2777;
}

.bp-section--cyan .bp-section-number {
  background: #cffafe;
  color: #0891b2;
}

.bp-section--orange .bp-section-number {
  background: #fef3c7;
  color: #d97706;
}

.bp-section--red .bp-section-number {
  background: #fee2e2;
  color: #dc2626;
}

.bp-section--emerald .bp-section-number {
  background: #d1fae5;
  color: #059669;
}

/* Tips list */
.bp-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bp-tips li {
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: relative;
  line-height: 1.5;
  border: 1px solid var(--color-border);
}

.bp-tips li::before {
  content: "\2713";
  position: absolute;
  left: 1rem;
  top: 0.85rem;
  font-weight: 700;
}

.bp-section--indigo .bp-tips li::before { color: #6366f1; }
.bp-section--pink .bp-tips li::before { color: #ec4899; }
.bp-section--cyan .bp-tips li::before { color: #06b6d4; }
.bp-section--orange .bp-tips li::before { color: #f59e0b; }
.bp-section--red .bp-tips li::before { color: #dc2626; }
.bp-section--emerald .bp-tips li::before { color: #059669; }

/* Alt background: tips cards should be white */
.bp-section--alt .bp-tips li {
  background: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 40rem) {
  .hero {
    aspect-ratio: 16 / 9;
  }

  .hero-wave svg {
    height: 30px;
  }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; }

  .audience-card {
    padding: 2rem 1.5rem;
  }

  .audience-card .card-icon {
    font-size: 2.5rem;
  }

  .bp-hero h1 {
    font-size: 2rem;
  }

  .bp-section {
    padding: 2.5rem 0;
  }

  .bp-section-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bp-section--alt .bp-section-inner {
    direction: ltr;
  }

  .bp-visual-placeholder {
    aspect-ratio: 16 / 9;
    max-width: 280px;
    margin-inline: auto;
  }

  .bp-visual-icon {
    font-size: 3.5rem;
  }

  .bp-content h2 {
    font-size: 1.4rem;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
