/* DanceX Kursportal */

:root {
  --page-w: 1440px;
  --bg: #eceef2;
  --surface: #ffffff;
  --ink: #141820;
  --muted: #4d5566;
  --muted-light: #727b8c;
  --accent: #1a5fbf;
  --accent-hover: #124a99;
  --accent-soft: #e8f0fc;
  --line: #d8dde6;
  --shadow: 0 8px 28px rgba(20, 24, 32, 0.08);
  --shadow-sm: 0 1px 4px rgba(20, 24, 32, 0.06);
  --font: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --sidebar-w: 300px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.is-loading {
  overflow: hidden;
}

/* Splash loader: X spin → DanceX → site */

.dx-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--surface);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.dx-loader.is-exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dx-loader-stage {
  position: relative;
  width: 7rem;
  height: 7rem;
  display: grid;
  place-items: center;
}

.dx-spin-x {
  position: absolute;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  transform-origin: center center;
  animation: dx-spin 1.1s cubic-bezier(0.45, 0.05, 0.2, 1) forwards;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.dx-loader.is-brand .dx-spin-x {
  opacity: 0;
  transform: scale(0.4) rotate(180deg);
  animation: none;
}

.dx-brand {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.dx-loader.is-brand .dx-brand {
  opacity: 1;
  transform: scale(1);
}

.dx-brand-dance {
  color: var(--ink);
}

.dx-brand-x {
  color: var(--accent);
}

.site-shell {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.05s, transform 0.55s ease 0.05s;
}

body.is-ready .site-shell {
  opacity: 1;
  transform: translateY(0);
}

@keyframes dx-spin {
  0% {
    transform: rotate(0deg) scale(0.85);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: rotate(720deg) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dx-spin-x {
    animation: none;
    opacity: 1;
  }

  .dx-loader.is-brand .dx-spin-x {
    opacity: 0;
  }

  .dx-loader,
  .site-shell {
    transition: none;
  }
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.wrap {
  width: min(var(--page-w), 100% - 2rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.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 */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}

.logo:hover {
  color: var(--ink);
}

.logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #2a7ae8 0%, #1a5fbf 100%);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
}

.logo-text {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.logo-sub {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-light);
  letter-spacing: 0.02em;
}

.header-nav {
  display: flex;
  gap: 1.75rem;
}

.header-nav a {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.header-nav a:hover {
  color: var(--accent);
}

/* Hero */

.hero {
  padding: 2.75rem 0 2.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.hero-copy {
  max-width: 42rem;
}

.hero-eyebrow {
  margin: 0 0 0.35rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0;
  font-size: var(--text-md);
  color: var(--muted);
  max-width: 32ch;
}

/* Angebot layout */

.angebot-section {
  padding: 2.5rem 0 3.5rem;
}

.layout-sidebar {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 2.25rem;
  align-items: start;
}

/* Sidebar */

.sidebar {
  position: sticky;
  top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.sidebar-title {
  margin: 0;
  padding: 1.1rem 1.15rem 0.85rem;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0 0.5rem;
}

.sidebar-nav .sidebar-link {
  display: block;
  padding: 0.7rem 1.15rem;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-nav .sidebar-link:hover {
  background: var(--bg);
  color: var(--accent);
}

.sidebar-nav .sidebar-link.is-active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent-hover);
}

.sidebar-count {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted-light);
}

.sidebar-loading,
.loading-text {
  margin: 0;
  padding: 1rem 1.15rem;
  color: var(--muted-light);
  font-size: var(--text-base);
  font-style: italic;
}

/* Main content */

.content-main {
  min-width: 0;
}

.content-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.content-main h2 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
}

.rubrik-count {
  margin: 0.35rem 0 0;
  font-size: var(--text-base);
  color: var(--muted);
}

.search-wrap {
  display: block;
  margin-bottom: 1.35rem;
}

.search {
  width: 100%;
  max-width: 380px;
  padding: 0.7rem 0.95rem;
  font: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.search::placeholder {
  color: var(--muted-light);
}

.search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}

.search:disabled {
  opacity: 0.55;
}

/* Course cards */

.courses {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.course-card a {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.15rem 1.2rem 1.2rem;
  text-decoration: none;
  color: inherit;
}

.course-card .card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.course-card .card-rubrik {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.course-card .card-nr {
  font-size: var(--text-xs);
  color: var(--muted-light);
  white-space: nowrap;
}

.course-card h3 {
  margin: 0 0 0.4rem;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.course-card .meta {
  margin: 0;
  font-size: var(--text-base);
  color: var(--muted);
  flex: 1;
}

.course-card .card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.course-card .price {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
}

.course-card .spots {
  font-size: var(--text-sm);
  color: var(--muted);
}

.course-card .spots.is-low {
  color: var(--accent);
  font-weight: 600;
}

/* Messages */

.msg {
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: var(--text-base);
  background: #faf6e8;
  border-left: 3px solid #c4a035;
  color: var(--ink);
}

.msg.error {
  background: #faf0f0;
  border-left-color: #b54a4a;
}

/* Footer */

.site-footer {
  background: var(--ink);
  color: rgba(255, 252, 247, 0.75);
  padding: 2.25rem 0;
  font-size: var(--text-base);
}

.footer-inner {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 1fr;
}

.footer-brand {
  margin: 0 0 0.5rem;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--surface);
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.site-footer a {
  color: rgba(255, 252, 247, 0.9);
}

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

.footer-note {
  max-width: 28ch;
  line-height: 1.5;
}

/* Detail page */

.page-detail .detail-page {
  padding: 1.5rem 0 3rem;
}

.breadcrumb {
  margin: 0 0 1.5rem;
  font-size: var(--text-sm);
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-hidden] {
  margin: 0 0.35rem;
  color: var(--muted-light);
}

.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 2.25rem;
}

.detail-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.detail .detail-rubrik {
  margin: 0 0 0.35rem;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
  font-weight: 700;
  line-height: 1.15;
}

.detail .detail-nr {
  margin: 0;
  font-size: var(--text-base);
  color: var(--muted-light);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.detail-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

.detail h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: var(--text-lg);
  font-weight: 700;
}

.facts {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-size: var(--text-base);
}

.facts dt {
  margin: 0;
  font-weight: 500;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--ink);
}

.dates-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
}

table.dates {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--surface);
}

table.dates th,
table.dates td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

table.dates th {
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}

table.dates tr:last-child td {
  border-bottom: none;
}

table.dates tbody tr:nth-child(even) td {
  background: rgba(243, 239, 232, 0.45);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--surface);
}

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

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Responsive */

@media (max-width: 800px) {
  .layout-sidebar {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 0.85rem 0.85rem;
  }

  .sidebar-nav .sidebar-link {
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.45rem 0.8rem;
    background: var(--bg);
  }

  .sidebar-nav .sidebar-link.is-active {
    border-color: var(--accent);
  }

  .sidebar-count {
    display: inline;
    margin-left: 0.2rem;
  }

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

  .detail {
    padding: 1.35rem 1.25rem 1.5rem;
  }
}

@media (max-width: 520px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .courses {
    grid-template-columns: 1fr;
  }
}
