/* ─── Festival Marker — Aufklappbar (Collapsible) Edition ─────────────────── */

/* ── Collapsed pill (always visible) ──────────────────────────────────── */
.festival-marker {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 9500;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  width: min(1120px, calc(100vw - 24px));
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #1a102c;
  box-shadow: 0 14px 34px rgba(20, 8, 42, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 8px 14px 8px 10px;
  font-family: Poppins, Arial, sans-serif;
  text-decoration: none;
  transform: translateX(-50%);
  overflow: hidden;
  /* smooth border-radius when expanding */
  transition:
    border-radius 280ms ease,
    box-shadow 280ms ease,
    transform 180ms ease,
    border-color 180ms ease;
  /* don't intercept clicks on the drop-down panel */
  cursor: default;
}

/* pointer-events: none on children — individual buttons opt back in */
.festival-marker * {
  pointer-events: none;
}

/* ── Date badge ─────────────────────────────────────────────────────────── */
.festival-marker-date {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #008a78;
  color: #fff;
  padding: 5px 9px;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}

/* ── Title + subtitle + ticker row ─────────────────────────────────────── */
.festival-marker-text {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
}

.festival-marker-title {
  overflow: hidden;
  color: #130d25;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.festival-marker-subtitle {
  flex: 0 0 auto;
  color: #655a78;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Ticker ──────────────────────────────────────────────────────────────── */
.festival-marker-ticker {
  min-width: 0;
  overflow: hidden;
  color: #3b2b55;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.festival-marker-ticker-track {
  display: inline-block;
  min-width: max-content;
  padding-left: 100%;
  animation: festivalTicker 34s linear infinite;
}

.festival-marker:hover .festival-marker-ticker-track,
.festival-marker.is-open .festival-marker-ticker-track {
  animation-play-state: paused;
}

@keyframes festivalTicker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ── Hover state (pill, not open) ──────────────────────────────────────── */
.festival-marker:not(.is-open):hover {
  border-color: rgba(0, 138, 120, 0.42);
  box-shadow: 0 16px 38px rgba(0, 138, 120, 0.22);
  transform: translate(-50%, -1px);
}

/* ── Toggle chevron button ──────────────────────────────────────────────── */
.festival-marker-toggle {
  pointer-events: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(0, 138, 120, 0.32);
  border-radius: 999px;
  background: rgba(0, 138, 120, 0.08);
  color: #008a78;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 280ms ease, background 160ms ease;
  user-select: none;
}

.festival-marker-toggle:hover {
  background: rgba(0, 138, 120, 0.16);
}

/* rotate chevron when open */
.festival-marker.is-open .festival-marker-toggle {
  transform: rotate(180deg);
}

/* ── Action buttons (Full Calendar / Concepts Vault) ────────────────────── */
.festival-calendar-button {
  pointer-events: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1.5px solid rgba(0, 138, 120, 0.42);
  border-radius: 999px;
  background: #008a78;
  color: #fff;
  padding: 0 13px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(0, 138, 120, 0.2);
  cursor: pointer;
  transition: background 160ms ease;
}

.festival-calendar-button:hover {
  background: #5421ad;
}

.festival-vault-button {
  background: #fff;
  color: #5421ad;
}

.festival-vault-button:hover {
  background: #f2eaff;
}

/* ── Drop-down panel (aufklappbar) ──────────────────────────────────────── */
.festival-marker-panel {
  /* sits below the pill — appended as sibling in JS */
  position: fixed;
  top: 60px; /* pill height ~54px + gap */
  left: 50%;
  z-index: 9499;
  width: min(1120px, calc(100vw - 24px));
  transform: translateX(-50%);

  border: 1.5px solid rgba(0, 138, 120, 0.28);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 22px 54px rgba(20, 8, 42, 0.2);
  color: #1a102c;
  font-family: Poppins, Arial, sans-serif;
  overflow: hidden;

  /* collapsed state */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 340ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 260ms ease,
    top 280ms ease;
}

.festival-marker-panel.is-open {
  max-height: 440px;   /* enough for ~7 occasions */
  opacity: 1;
  pointer-events: auto;
}

/* panel inner scroll */
.festival-panel-inner {
  padding: 18px 20px 20px;
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 138, 120, 0.3) transparent;
}

/* ── Panel header ──────────────────────────────────────────────────────── */
.festival-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 138, 120, 0.14);
}

.festival-panel-title {
  margin: 0;
  color: #008a78;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.festival-panel-nav {
  display: flex;
  gap: 8px;
}

.festival-panel-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1.5px solid rgba(0, 138, 120, 0.4);
  border-radius: 999px;
  padding: 0 11px;
  background: #008a78;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 160ms ease;
}

.festival-panel-nav a:last-child {
  background: #fff;
  color: #5421ad;
  border-color: rgba(0, 138, 120, 0.32);
}

.festival-panel-nav a:hover { background: #5421ad; color: #fff; }
.festival-panel-nav a:last-child:hover { background: #f2eaff; color: #5421ad; }

/* ── Occasion list ──────────────────────────────────────────────────────── */
.festival-occasion-list {
  display: grid;
  gap: 8px;
}

.festival-occasion-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 138, 120, 0.12);
  border-radius: 12px;
  background: rgba(244, 255, 252, 0.72);
  transition: background 160ms ease;
}

.festival-occasion-item:hover {
  background: rgba(233, 255, 251, 0.88);
}

.festival-occasion-item.is-today {
  border-color: rgba(0, 138, 120, 0.42);
  background: rgba(0, 138, 120, 0.06);
}

.festival-occasion-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #008a78;
  color: #fff;
  padding: 6px 4px;
  text-align: center;
}

.festival-occasion-badge-date {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.festival-occasion-badge-day {
  margin-top: 3px;
  font-size: 0.5rem;
  font-weight: 700;
  opacity: 0.82;
  text-transform: uppercase;
  line-height: 1;
}

.festival-occasion-info {}

.festival-occasion-title {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  color: #130d25;
  line-height: 1.2;
}

.festival-occasion-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #655a78;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.festival-occasion-today-tag {
  display: inline-block;
  margin-top: 4px;
  border-radius: 999px;
  background: #008a78;
  color: #fff;
  padding: 1px 7px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Body offset (pill + panel safe space) ──────────────────────────────── */
body.has-festival-marker .project-shell,
body.has-festival-marker .calendar-shell,
body.has-festival-marker .app-shell {
  padding-top: calc(clamp(18px, 2.2vw, 32px) + 56px);
}

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .festival-marker {
    top: 8px;
    width: calc(100vw - 18px);
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    border-radius: 18px;
    padding: 8px;
  }

  .festival-marker-text {
    display: grid;
    gap: 4px;
  }

  .festival-marker-subtitle {
    display: none;
  }

  .festival-marker-ticker {
    font-size: 0.62rem;
  }

  .festival-calendar-button {
    display: none; /* hidden in pill on mobile; accessible via panel */
  }

  .festival-marker-panel {
    top: 62px;
    width: calc(100vw - 18px);
    border-radius: 16px;
  }

  .festival-panel-inner {
    padding: 14px 14px 16px;
  }

  .festival-occasion-item {
    grid-template-columns: 48px 1fr;
    gap: 10px;
  }

  body.has-festival-marker .project-shell,
  body.has-festival-marker .calendar-shell,
  body.has-festival-marker .app-shell {
    padding-top: 82px;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .festival-marker-ticker-track {
    animation: none;
  }
  .festival-marker-panel {
    transition: opacity 160ms ease;
  }
}

/* Global MusicGen button capitalization */
button,
[role="button"],
.primary-button,
.outline-button,
.compact-button,
.cta-button,
.ghost-button,
.idea-button,
.nav-link,
.dashboard-link-button,
.calendar-toggle,
.calendar-details-button,
.calendar-start-button,
.calendar-asset-button,
.calendar-video-link,
.calendar-song-link,
.festival-calendar-button,
.festival-vault-button {
  text-transform: uppercase !important;
}
