/* ==========================================================================
   Gymnasium am Sonnenberg – Stylesheet
   Farben, Typografie, Layout & Komponenten
   ========================================================================== */

:root {
  --color-primary: #d6336c;
  --color-primary-dark: #a61e4d;
  --color-accent: #f06595;
  --color-accent-dark: #c2255c;
  --color-tint: #ffe3ec;
  --color-bg: #ffffff;
  --color-text: #3b2b33;
  --color-text-soft: #6b5a63;
  --color-border: #f3d9e2;
  --color-danger: #c0392b;
  --color-success: #27ae60;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(163, 34, 88, 0.12);
  --shadow-md: 0 8px 24px rgba(163, 34, 88, 0.14);
  --shadow-lg: 0 16px 40px rgba(163, 34, 88, 0.18);

  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --header-height: 72px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1.0625rem;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  padding-left: 1.25rem;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: #d6336c;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

address {
  font-style: normal;
}

.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
}

.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;
}

/* ----- Header / Navigation ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-primary-dark);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
}

.brand-text span {
  font-size: 0.8rem;
  color: var(--color-text-soft);
}

.nav-list {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 600;
}

.nav-list a:hover {
  color: var(--color-primary);
  background: var(--color-tint);
  text-decoration: none;
}

.nav-list a.active {
  color: #fff;
  background: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

.nav-toggle-bar {
  width: 26px;
  height: 3px;
  border-radius: 3px;
  background: var(--color-primary-dark);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-secondary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* ----- Hero ----- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(240, 101, 149, 0.18), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(214, 51, 108, 0.14), transparent 50%),
    linear-gradient(160deg, var(--color-tint), #fff5f8);
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 0.75rem;
}

.hero h1 {
  margin-bottom: 0.4em;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.hero-visual img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ----- Sections ----- */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-tinted {
  background: var(--color-tint);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin-bottom: 0.25em;
}

.section-head p {
  color: var(--color-text-soft);
  font-size: 1.05rem;
}

/* ----- Stats ----- */
.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-text-soft);
  font-size: 0.9rem;
}

/* ----- Cards ----- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.4em;
}

.card p {
  margin-bottom: 0;
  color: var(--color-text-soft);
}

/* ----- News ----- */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-item {
  border-left: 4px solid var(--color-accent);
  background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.news-item time {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  margin-bottom: 0.25rem;
}

.news-item h3 {
  margin-bottom: 0.25em;
}

.news-item p {
  margin-bottom: 0;
  color: var(--color-text-soft);
}

/* ----- CTA ----- */
.cta-box {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-box h2 {
  color: #fff;
  margin-bottom: 0.25em;
}

.cta-box p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.cta-box .btn-primary {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}

.cta-box .btn-primary:hover {
  background: var(--color-accent-dark);
}

/* ----- Page hero ----- */
.page-hero {
  background: linear-gradient(160deg, var(--color-tint), #fff5f8);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  margin-bottom: 0.3em;
}

.page-hero p:not(.eyebrow) {
  color: var(--color-text-soft);
  max-width: 55ch;
}

/* ----- Split (Schule-Seite) ----- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.split-visual img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* ----- Timeline ----- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-border);
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding: 0 0 1.75rem 2.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-item time {
  display: block;
  font-weight: 800;
  color: var(--color-primary);
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--color-text-soft);
}

/* ----- Team ----- */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.team-member {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.team-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--color-tint);
  padding: 6px;
}

.team-member h3 {
  margin-bottom: 0.25em;
}

.team-member p {
  margin-bottom: 0;
  color: var(--color-text-soft);
}

.team-sub {
  font-size: 0.9rem;
}

/* ----- Tables (Termine) ----- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.termine-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  min-width: 520px;
}

.termine-table th,
.termine-table td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.termine-table thead th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.termine-table tbody tr:nth-child(even) {
  background: var(--color-tint);
}

.termine-table tbody tr:last-child td {
  border-bottom: 0;
}

.contact-hours {
  background: #fff;
}

.contact-hours th {
  text-align: left;
  padding: 0.5rem 1rem 0.5rem 0;
  font-weight: 600;
}

.contact-hours td {
  padding: 0.5rem 0;
}

.note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

/* ----- Kontaktseite ----- */
.split-contact {
  align-items: start;
}

.contact-info {
  background: var(--color-tint);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.contact-info h2,
.contact-info h3 {
  margin-top: 0;
}

.contact-info p {
  color: var(--color-text);
}

.contact-form {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.required {
  color: var(--color-danger);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 400;
  font-size: 0.95rem;
}

.checkbox-label input {
  margin-top: 0.25rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-primary);
}

.field-error {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
  min-height: 1em;
}

.form-group.invalid input,
.form-group.invalid select,
.form-group.invalid textarea {
  border-color: var(--color-danger);
}

.form-status {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 600;
  display: none;
}

.form-status.success {
  display: block;
  background: #e8f8ef;
  color: var(--color-success);
  border: 1px solid #a3e4b7;
}

.form-status.error {
  display: block;
  background: #fdecea;
  color: var(--color-danger);
  border: 1px solid #f5b7b1;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin: 1rem 0 0;
}

/* ----- Prose (Impressum/Datenschutz) ----- */
.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 1.75em;
}

/* ----- Footer ----- */
.site-footer {
  background: var(--color-primary-dark);
  color: #ffdceb;
  padding-top: 3rem;
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-heading {
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-links a,
.footer-col a {
  color: #ffdceb;
}

.footer-links a:hover,
.footer-col a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-bottom p {
  margin: 0;
}

.back-to-top {
  color: #fff;
  font-weight: 600;
}

.back-to-top:hover {
  color: var(--color-accent);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .hero-inner,
  .split {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    max-width: 520px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.open {
    max-height: 320px;
  }

  .nav-list {
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }

  .nav-list a {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ----- Zugänglichkeit: Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
