/* =========================================================================
   Ferienprogramm – Tanzschule
   Palette: modernisierter maxxdance-Look
   orange #E5007D auf Anthrazit #1A171F, heller aufgeräumter Grund
   ========================================================================= */

:root {
  --ink:          #1a171f;   /* Anthrazit: Header, Hero, Footer */
  --ink-soft:     #2a2630;
  --orange:      #e38818;   /* Markenfarbe */
  --orange-deep: #88520e;
  --blush:        #fbedf5;   /* orange-Tint für Chips/Badges */
  --paper:        #faf9fb;   /* Seitenhintergrund */
  --card:         #ffffff;
  --text:         #2a2630;
  --muted:        #756f7e;
  --line:         #e9e5ee;
  --amber:        #b96a00;   /* "Wenige Plätze" */
  --amber-bg:     #fdf3e3;
  --green:        #0d7a4f;   /* "Plätze frei" */
  --green-bg:     #e8f6ef;
  --red:          #b3213b;   /* "Ausgebucht" */
  --red-bg:       #fdecef;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 23, 31, .05), 0 8px 24px rgba(26, 23, 31, .07);
  --shadow-lift: 0 2px 4px rgba(26, 23, 31, .06), 0 16px 40px #88520e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-deep); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease,
              transform .15s ease;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-reset {
  background: none; border: none; color: var(--muted);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  padding: .5rem 0; align-self: end;
}
.btn-reset:hover { color: var(--orange); }

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: #fff;
}
.header-inner {
  display: flex; align-items: center; gap: 2rem;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: .6rem; color: #fff; }
.logo-mark {
  width: 14px; height: 26px;
  background: var(--orange);
  transform: skewX(-14deg);
  border-radius: 2px;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.05rem; letter-spacing: .12em;
}
.logo-text b { font-weight: 800; color: var(--orange); }

.main-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.main-nav a {
  color: rgba(255,255,255,.75);
  font-size: .92rem; font-weight: 500;
  transition: color .15s ease;
}
.main-nav a:hover { color: #fff; }
.btn-header { padding: .5rem 1.1rem; font-size: .88rem; }

/* =========================================================================
   Hero – Signatur: diagonales "Tanzflächen-Tape" in orange
   ========================================================================= */
.hero {
  position: relative;
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  padding: 5rem 0 5.5rem;
}
.hero-tape {
  position: absolute;
  top: -20%; right: -12%;
  width: 42%; height: 150%;
  background: linear-gradient(180deg, var(--orange), var(--orange-deep));
  transform: skewX(-14deg);
  opacity: .92;
}
.hero-tape::before {
  content: "";
  position: absolute; inset: 0 auto 0 -34px;
  width: 12px;
  background: rgba(255,255,255,.25);
}
.hero-inner { position: relative; max-width: 720px; margin-left: 0; }
.hero-eyebrow {
  font-size: .85rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--orange);
  background: #88520e;
  display: inline-block;
  padding: .35rem .9rem; border-radius: 999px;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.hero-accent { color: var(--orange); display: block; }
.hero-sub {
  margin: 1.4rem 0 2rem;
  max-width: 52ch;
  color: rgba(255,255,255,.78);
  font-size: 1.06rem;
}
.hero-actions { display: flex; gap: .9rem; flex-wrap: wrap; }

/* =========================================================================
   Filterleiste (sticky unter dem Header)
   ========================================================================= */
.filterbar {
  position: sticky; top: 64px; z-index: 40;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0 .9rem;
  box-shadow: 0 4px 16px rgba(26,23,31,.04);
}
.filter-chips {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: .9rem;
}
.chip {
  font-family: var(--font-body);
  font-size: .88rem; font-weight: 600;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--orange); color: var(--orange); }
.chip.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.filter-row {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: end;
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-grow { flex: 1; min-width: 200px; }
.field-label {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}
.field select, .field input {
  font-family: var(--font-body);
  font-size: .92rem;
  padding: .55rem .8rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  min-width: 170px;
}
.field input { width: 100%; }
.field select:focus, .field input:focus {
  border-color: var(--orange); outline: none;
}

.filter-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: .9rem; flex-wrap: wrap;
}
.result-count { font-size: .88rem; color: var(--muted); }
.result-count b { color: var(--text); }

.view-toggle {
  display: inline-flex;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.toggle-btn {
  font-family: var(--font-body);
  font-size: .85rem; font-weight: 600;
  border: none; background: transparent; color: var(--muted);
  padding: .4rem 1.05rem; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.toggle-btn.is-active { background: var(--ink); color: #fff; }

/* =========================================================================
   Kursliste (nach Tagen gruppiert)
   ========================================================================= */
.course-list { padding: 2.4rem 0 4rem; }

.day-group { margin-bottom: 2.6rem; }
.day-heading {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem;
  display: flex; align-items: baseline; gap: .7rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--ink);
}
.day-heading .day-date {
  font-family: var(--font-body);
  font-weight: 500; font-size: .9rem; color: var(--muted);
}

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

.course-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-align: left;
  font-family: var(--font-body);
  padding: 0;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(229, 0, 125, .35);
}

/* Zeit-Schiene links – Zeiten als primäre Info */
.time-rail {
  flex: 0 0 86px;
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .1rem;
  padding: 1rem .4rem;
}
.time-rail .t-start {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}
.time-rail .t-end {
  font-size: .8rem; color: rgba(255,255,255,.6);
  font-variant-numeric: tabular-nums;
}
.time-rail .t-room {
  margin-top: .5rem;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--orange);
  text-align: center;
}

.card-body { padding: 1rem 1.1rem 1.05rem; flex: 1; min-width: 0; }
.card-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .45rem; }
.tag {
  font-size: .7rem; font-weight: 600;
  letter-spacing: .04em;
  padding: .18rem .6rem; border-radius: 999px;
}
.tag-cat   { background: var(--blush); color: var(--orange-deep); }
.tag-age   { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }

.card-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.02rem; line-height: 1.3;
  margin-bottom: .3rem;
}
.card-desc {
  font-size: .86rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: .65rem;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem;
}
.card-trainer { font-size: .8rem; color: var(--muted); }

.badge {
  font-size: .74rem; font-weight: 600;
  padding: .22rem .65rem; border-radius: 999px;
  white-space: nowrap;
}
.badge-free   { background: var(--green-bg); color: var(--green); }
.badge-few    { background: var(--amber-bg); color: var(--amber); }
.badge-full   { background: var(--red-bg);   color: var(--red); }

/* Termin-Zusatz: "+2 weitere Termine" */
.more-dates { font-size: .74rem; color: var(--orange); font-weight: 600; }

/* =========================================================================
   Wochenplan
   ========================================================================= */
.week-plan { padding: 2.4rem 0 4rem; overflow-x: auto; }
.week-nav {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.week-nav h2 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
}
.week-nav button {
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 10px; width: 36px; height: 36px;
  font-size: 1rem; cursor: pointer; color: var(--text);
}
.week-nav button:hover { border-color: var(--orange); color: var(--orange); }
.week-nav button:disabled { opacity: .35; cursor: default; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: .8rem;
  min-width: 940px;
}
.week-col-head {
  font-family: var(--font-display);
  font-weight: 700; font-size: .92rem;
  padding: .55rem .75rem;
  background: var(--ink); color: #fff;
  border-radius: 10px;
  text-align: center;
}
.week-col-head span { display: block; font-family: var(--font-body); font-weight: 500; font-size: .75rem; color: rgba(255,255,255,.6); }
.week-cell { display: flex; flex-direction: column; gap: .55rem; }
.week-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  padding: .6rem .7rem;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: box-shadow .15s ease, transform .15s ease;
}
.week-item:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.week-item.is-full { border-left-color: var(--line); opacity: .6; }
.week-item .w-time {
  font-weight: 700; font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.week-item .w-title { font-size: .82rem; line-height: 1.3; margin-top: .1rem; }
.week-item .w-room { font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.week-empty { font-size: .8rem; color: var(--muted); padding: .5rem .2rem; }

/* =========================================================================
   Empty State & Skeleton
   ========================================================================= */
.empty-state {
  text-align: center; color: var(--muted);
  padding: 4rem 1rem; font-size: 1rem;
}
.skeleton {
  height: 132px; border-radius: var(--radius);
  background: linear-gradient(90deg, #f1eef4 25%, #faf9fb 50%, #f1eef4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(26, 23, 31, .55);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  padding: 1.2rem;
  display: none;              /* Default: unsichtbar, unabhängig vom [hidden]-Attribut */
}
.modal-backdrop:not([hidden]) {
  display: flex;              /* Nur aktiv, wenn [hidden] tatsächlich entfernt wurde */
}
.modal {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 24px 64px rgba(26,23,31,.35);
}
.modal-close {
  position: absolute; top: .9rem; right: .9rem;
  width: 36px; height: 36px;
  border: none; border-radius: 50%;
  background: var(--paper); color: var(--muted);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--blush); color: var(--orange); }

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  margin: .6rem 0 .4rem;
}
.modal .card-tags { margin-bottom: 0; }
.modal-desc { color: var(--muted); font-size: .95rem; margin: .6rem 0 1.2rem; }

.modal-facts {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .8rem 1.2rem;
  margin-bottom: 1.3rem;
}
.fact .f-label {
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted);
}
.fact .f-value { font-size: .95rem; font-weight: 600; }

.modal h3 {
  font-family: var(--font-display);
  font-size: .95rem; font-weight: 700;
  margin-bottom: .6rem;
}
.session-list { list-style: none; margin-bottom: 1.4rem; }
.session-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .2rem;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.session-list .s-time {
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.modal-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.modal-note {
  font-size: .88rem; color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: .7rem .9rem;
}
.modal .btn-secondary {
  background: var(--paper); color: var(--text);
  border: 1.5px solid var(--line);
}
.modal .btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.75);
  margin-top: 2rem;
  padding: 3rem 0 0;
  font-size: .92rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem; padding-bottom: 2.5rem;
}
.footer-brand {
  font-family: var(--font-display);
  color: #fff; font-weight: 600; letter-spacing: .12em;
  margin-bottom: .6rem;
}
.footer-brand b { color: var(--orange); font-weight: 800; }
.footer-label {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.45);
  margin-bottom: .4rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--orange); }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 1.2rem 20px;
  font-size: .82rem; color: rgba(255,255,255,.5);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 760px) {
  .main-nav { display: none; }
  .header-inner { justify-content: space-between; }

  .hero { padding: 3.2rem 0 3.8rem; }
  .hero-tape { width: 58%; right: -28%; }

  .filterbar { top: 64px; }

  /* Interessen-Chips: eine Zeile, horizontal wischbar statt umbrechend.
     Spart ~2 Zeilenhöhen und bleibt der sichtbare Primärfilter.
     Negative Ränder = Edge-to-Edge-Bleed, Chips scrollen unter die Kanten. */
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;                 /* Firefox */
    scroll-snap-type: x proximity;
    margin-left: -20px; margin-right: -20px;
    padding-left: 20px; padding-right: 20px;
  }
  .filter-chips::-webkit-scrollbar { display: none; }   /* WebKit/Blink */
  .chip { flex: 0 0 auto; scroll-snap-align: start; padding: .6rem 1.05rem; }

  /* Alter + Tag nebeneinander (2 Spalten), Suche volle Breite darunter.
     Halbiert die Höhe dieses Blocks, ohne Filter zu verstecken. */
  .filter-row { gap: .6rem .5rem; }
  .field { flex: 1 1 calc(50% - .25rem); min-width: 0; }
  .field select { min-width: 0; width: 100%; }
  .field-grow { flex: 1 1 100%; }
  .btn-reset { flex: 0 0 auto; margin-left: auto; text-align: right; padding: .4rem 0; }

  .filter-meta { flex-wrap: nowrap; gap: .5rem; margin-top: .7rem; }
  .result-count { font-size: .82rem; }
  .toggle-btn { padding: .5rem 1rem; }     /* Touch-Ziel ~44px */

  .card-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.4rem; }
  .modal-facts { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ---- Reine Smartphone-Ansicht: UI konsequent auf Inhalt reduzieren ---- */
@media (max-width: 480px) {
  /* Header schlanker; redundanten "Kurs finden"-Button ausblenden
     (Filter steht direkt darunter). Sticky-Offset MUSS mitziehen,
     sonst entsteht eine Lücke oder Überlappung unter dem Header. */
  .header-inner { height: 52px; }
  .btn-header { display: none; }
  .logo-text { font-size: .95rem; }
  .filterbar { top: 52px; padding: .8rem 0 .7rem; }

  /* Hero auf Marken-Minimum: Eyebrow + Titel. Fließtext und die beiden
     Buttons (scrollen nur zum direkt folgenden Filter) entfallen
     -> der erste Kurs wird deutlich früher sichtbar. */
  .hero { padding: 1.8rem 0 2rem; }
  .hero-eyebrow { margin-bottom: .8rem; font-size: .8rem; }
  .hero-sub, .hero-actions { display: none; }
  .hero-tape { width: 62%; right: -34%; opacity: .8; }

  /* Karten: Zeit-Schiene etwas schmaler -> mehr Platz für Titel/Text */
  .time-rail { flex-basis: 72px; padding: .8rem .3rem; }
  .time-rail .t-start { font-size: 1.05rem; }
  .card-body { padding: .85rem .9rem .9rem; }
  .day-heading { font-size: 1.05rem; }

  /* Detail-Dialog als Bottom-Sheet: von unten eingeschoben, oben
     abgerundet, volle Breite -> native Anmutung, bessere Daumenreichweite.
     env(safe-area-inset-bottom) hält Abstand zur Home-Indicator-Leiste. */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none; width: 100%;
    max-height: 90vh;
    border-radius: 18px 18px 0 0;
    padding: 1.5rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    animation: sheet-up .28s ease;
  }
  .modal-close { top: .7rem; right: .7rem; width: 40px; height: 40px; }

  .site-footer { padding-top: 2rem; }
  .footer-grid { gap: 1.1rem; padding-bottom: 1.6rem; }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================================================
   Demo-Banner (nur statische Präsentations-Version)
   ========================================================================= */
.demo-banner {
  background: var(--orange);
  color: #fff;
  font-size: .85rem;
  text-align: center;
  padding: .5rem 2.5rem .5rem 1rem;
  position: relative;
}
.demo-banner button {
  position: absolute; top: 50%; right: .6rem; transform: translateY(-50%);
  background: rgba(255,255,255,.2); color: #fff;
  border: none; border-radius: 50%;
  width: 24px; height: 24px; font-size: 1rem; line-height: 1;
  cursor: pointer;
}
.demo-banner button:hover { background: rgba(255,255,255,.35); }
