/* Planning page. Builds on MoonriseBlues.css (palette, hero sky, scenes, buttons). */

.mbp-page {
  --mbp-time: 76px;
  --mbp-gap: clamp(12px, 1.4vw, 16px);
  --mbp-cols: var(--mbp-time) minmax(0, 1fr) minmax(0, 1fr);
  /* clip instead of hidden, so the day titles and room headers can stay sticky. */
  overflow: clip;
}

/* ---------- Hero ---------- */

.mbp-hero {
  min-height: clamp(420px, 56svh, 580px);
}

.mbp-hero .mb-moon-track {
  right: 3vw;
  width: min(62vmin, 560px);
}

.mbp-star--high {
  top: 13%;
  right: 31%;
  width: clamp(28px, 3.6vw, 52px);
  aspect-ratio: 1;
  animation-delay: -2s;
}

.mbp-star--low {
  right: 9%;
  bottom: 14%;
  width: clamp(40px, 5vw, 72px);
  aspect-ratio: 1;
  animation-delay: -3.5s;
  animation-duration: 7s;
}

.mbp-hero-inner {
  z-index: 3;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 3.4vw, 40px) 0 clamp(64px, 7vw, 88px);
}

.mb-page a.mbp-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 12px;
  color: var(--mb-mist);
  font-family: var(--mb-text);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.35s ease;
  animation: mb-rise-in 1.2s var(--mb-ease) 0.1s both;
}

.mbp-back::before {
  content: "←" / "";
  font-size: 1rem;
  letter-spacing: 0;
  transition: translate 0.35s var(--mb-ease);
}

.mb-page a.mbp-back:hover,
.mb-page a.mbp-back:focus-visible {
  color: var(--mb-moon-bright);
}

.mbp-back:hover::before {
  translate: -4px 0;
}

.mb-page .mbp-title {
  width: fit-content;
  margin-top: clamp(24px, 4vw, 48px);
  font-family: var(--mb-display);
  font-size: clamp(3rem, 13vw, 7rem);
  font-weight: 400;
  line-height: 1;
}

.mbp-title-main {
  display: block;
  color: var(--mb-white);
  letter-spacing: 0.005em;
  -webkit-text-stroke: 0.014em currentColor;
  text-shadow: 0 0 38px rgba(220, 229, 186, 0.28);
  animation: mb-rise-in 1.6s var(--mb-ease) 0.3s both;
}

.mbp-title-sub {
  display: block;
  margin-top: 0.14em;
  color: var(--mb-white);
  font-size: 0.36em;
  letter-spacing: 0.05em;
  text-align: right;
  -webkit-text-stroke: 0.01em currentColor;
  animation: mb-rise-in 1.6s var(--mb-ease) 0.6s both;
}

.mb-page .mbp-hero-when {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: clamp(24px, 3.4vw, 36px);
  color: var(--mb-mist);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 300;
  line-height: 1.5;
  animation: mb-rise-in 1.6s var(--mb-ease) 0.9s both;
}

.mbp-hero-when span + span::before {
  margin-right: 0.7em;
  color: var(--mb-moon);
  content: "✦" / "";
  font-size: 0.8em;
}

.mb-page .mbp-notice {
  width: fit-content;
  margin-top: 24px;
  padding: 0.7em 1.4em;
  border: 1px solid rgba(226, 220, 147, 0.45);
  border-radius: 999px;
  background: rgba(30, 36, 66, 0.4);
  box-shadow: 0 0 28px rgba(226, 220, 147, 0.12);
  color: var(--mb-moon-bright);
  font-size: clamp(0.85rem, 1.3vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
  animation: mb-rise-in 1.6s var(--mb-ease) 1.2s both;
}

.mbp-notice::before {
  margin-right: 0.6em;
  content: "✦" / "";
}

/* ---------- Body & level filter ---------- */

.mbp-body {
  position: relative;
  padding: clamp(28px, 4vw, 44px) 0 var(--mb-gap);
  background:
    radial-gradient(50% 30% at 8% 40%, rgba(94, 125, 136, 0.18), transparent 70%),
    radial-gradient(45% 25% at 92% 72%, rgba(94, 125, 136, 0.16), transparent 70%),
    linear-gradient(180deg, #2d355a 0%, var(--mb-midnight) 18%, var(--mb-midnight) 75%, var(--mb-abyss) 100%);
}

.mbp-legend-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.mb-page .mbp-legend-hint {
  max-width: 30ch;
  color: var(--mb-mist);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.5;
}

html:not(.mb-js) .mbp-legend-hint {
  display: none;
}

.mbp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mbp-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 10px;
  border: 1px solid rgba(202, 205, 179, 0.3);
  border-radius: 999px;
  background: rgba(30, 36, 66, 0.35);
  color: var(--mb-white);
  font-family: var(--mb-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

.mbp-filter svg {
  width: 30px;
  height: 30px;
  color: var(--mb-moon-bright);
  filter: drop-shadow(0 0 6px rgba(226, 220, 147, 0.45));
}

.mbp-filter:hover {
  border-color: rgba(226, 220, 147, 0.7);
  background: rgba(202, 205, 179, 0.1);
}

.mbp-filter:focus-visible {
  outline: 2px solid var(--mb-moon-bright);
  outline-offset: 4px;
}

.mbp-filter[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(100deg, var(--mb-sage) 0%, var(--mb-moon-bright) 100%);
  box-shadow: 0 0 30px rgba(226, 220, 147, 0.4);
  color: var(--mb-abyss);
}

.mbp-filter[aria-pressed="true"] svg {
  color: var(--mb-abyss);
  filter: none;
}

/* ---------- Day: title column on the left, timeline on the right ---------- */

.mbp-day + .mbp-day {
  margin-top: clamp(56px, 7vw, 88px);
}

.mbp-day > .mb-shell {
  display: grid;
  grid-template-columns: clamp(180px, 19vw, 240px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(28px, 4vw, 56px);
}

.mbp-day-head {
  position: sticky;
  top: 24px;
  display: flex;
  grid-row: 1 / span 2;
  grid-column: 1;
  flex-direction: column;
  align-self: start;
  gap: 22px;
}

.mbp-day-copy .mb-kicker {
  margin-bottom: 12px !important;
}

.mb-page .mbp-day-head .mb-h2 {
  font-size: clamp(2.3rem, 3.4vw, 3rem);
}

.mbp-day-date {
  display: block;
  margin-top: 0.08em;
  font-size: 0.6em;
  color: var(--mb-moon-bright);
  background: linear-gradient(100deg, var(--mb-sage) 0%, var(--mb-moon-bright) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
}

.mb-page .mbp-day-intro {
  margin-top: 12px;
  color: var(--mb-mist);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.55;
}

.mbp-day-window {
  position: relative;
  height: 120px;
  overflow: hidden;
  border: 1px solid rgba(202, 205, 179, 0.14);
  border-radius: 22px;
  isolation: isolate;
}

.mbp-day-window .mb-scene-sky {
  height: 100%;
}

.mbp-day-window .mb-scene-orb {
  width: 52px;
}

.mbp-day-window.mb-scene--night .mb-scene-orb {
  top: 12%;
}

.mbp-day-window.mb-scene--dusk .mb-scene-orb {
  top: calc(70% - 26px);
}

.mbp-day-window .mb-scene-glint {
  width: 40px;
}

.mbp-day-window.mb-scene--dusk .mb-scene-glint {
  width: 64px;
}

/* Room names, pinned while the day scrolls by. */
.mbp-rooms {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-row: 1;
  grid-column: 2;
  grid-template-columns: var(--mbp-cols);
  column-gap: var(--mbp-gap);
  padding: 9px 0;
  border-radius: 0 0 14px 14px;
  background: rgba(40, 48, 82, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--mb-moon);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.mbp-rooms span + span {
  padding-left: 18px;
}

/* ---------- Timeline ---------- */

.mbp-timeline {
  position: relative;
  display: grid;
  grid-row: 2;
  grid-column: 2;
  align-content: start;
  gap: 10px;
  padding-top: 10px !important;
}

.mbp-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 0;
  left: calc(var(--mbp-time) - 10px);
  width: 1px;
  content: "";
  background: linear-gradient(180deg, rgba(202, 205, 179, 0.32) 0%, rgba(202, 205, 179, 0.32) 85%, rgba(202, 205, 179, 0));
}

.mbp-slot {
  display: grid;
  grid-template-columns: var(--mbp-cols);
  gap: 10px var(--mbp-gap);
}

.mb-page .mbp-time {
  position: relative;
  grid-row: 1;
  grid-column: 1;
  align-self: start;
  padding: 14px 26px 0 0;
  color: var(--mb-white);
  font-family: var(--mb-display);
  font-size: 1.25rem;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  -webkit-text-stroke: 0.01em currentColor;
}

/* A star on the timeline, centred on the vertical line. */
.mbp-time::after {
  position: absolute;
  top: 19px;
  right: 6px;
  width: 8px;
  height: 8px;
  content: "";
  rotate: 45deg;
  background: var(--mb-moon-bright);
  box-shadow: 0 0 10px rgba(226, 220, 147, 0.8);
}

/* Two lines: the title, then the hours and the teachers. */
.mbp-card {
  position: relative;
  display: flex;
  grid-row: 1;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  padding: 11px 16px 12px 60px;
  overflow: hidden;
  border: 1px solid rgba(202, 205, 179, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(60% 140% at 0% 50%, rgba(226, 220, 147, var(--mbp-glow, 0.1)), transparent 70%),
    linear-gradient(170deg, rgba(67, 87, 121, 0.5) 0%, rgba(40, 48, 82, 0.2) 80%);
}

.mb-js .mbp-card[data-reveal] {
  transition: opacity 0.8s ease, translate 1s var(--mb-ease), border-color 0.5s ease, box-shadow 0.5s ease, filter 0.5s ease;
}

.mbp-card--s1 {
  grid-column: 2;
}

.mbp-card--s2 {
  grid-column: 3;
}

.mbp-card--both {
  grid-column: 2 / -1;
}

.mbp-card[data-level="1"] {
  --mbp-glow: 0.07;
}

.mbp-card[data-level="2"] {
  --mbp-glow: 0.13;
}

.mbp-card[data-level="3"] {
  --mbp-glow: 0.22;
  border-color: rgba(226, 220, 147, 0.24);
}

.mbp-card-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 30px;
  height: 30px;
  overflow: visible;
  translate: 0 -50%;
  color: var(--mb-moon-bright);
  fill: var(--mb-moon-bright);
  filter: drop-shadow(0 0 8px rgba(226, 220, 147, 0.45));
}

.mbp-card[data-level="3"] .mbp-card-icon {
  filter: drop-shadow(0 0 14px rgba(226, 220, 147, 0.65));
}

.mbp-room {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mb-page .mbp-card h3 {
  flex-basis: 100%;
  order: 1;
  margin: 0 0 3px;
  color: var(--mb-white);
  font-family: var(--mb-display);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.15;
  -webkit-text-stroke: 0.012em currentColor;
}

.mb-page .mbp-when {
  order: 2;
  color: var(--mb-moon);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.mb-page .mbp-who {
  order: 3;
  color: var(--mb-mist);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.4;
}

.mbp-who::before {
  margin: 0 0.5em;
  color: var(--mb-moon);
  content: "·" / "";
}

/* Workshops and auditions: a dashed, star-marked card. */
.mbp-card--event {
  border-style: dashed;
  border-color: rgba(226, 220, 147, 0.42);
  background:
    radial-gradient(60% 140% at 0% 50%, rgba(226, 220, 147, 0.14), transparent 70%),
    linear-gradient(170deg, rgba(55, 64, 102, 0.6) 0%, rgba(30, 36, 66, 0.3) 80%);
}

.mbp-card--event .mbp-card-icon {
  padding: 4px;
  animation: mb-twinkle 5s ease-in-out infinite;
}

/* The two nights: little scenes, like on the festival page.
   Title and tag share the first line; ::after forces the line break. */
.mbp-card--party {
  padding: 14px clamp(96px, 14%, 150px) 15px 24px;
  border-color: rgba(226, 220, 147, 0.45);
}

.mbp-card--party::after {
  flex-basis: 100%;
  order: 3;
  content: "";
}

.mb-page .mbp-card--party h3 {
  flex-basis: auto;
  margin-bottom: 4px;
  font-size: clamp(1.7rem, 2.4vw, 2rem);
}

.mb-page .mbp-card--party .mb-tag {
  order: 2;
  align-self: center;
  margin: 0 0 0 18px !important;
  padding: 6px 12px 5px;
  font-size: 0.66rem;
}

.mbp-card--party .mbp-when {
  order: 4;
}

.mbp-card--party .mbp-who {
  order: 5;
}

.mbp-card--night {
  background:
    radial-gradient(1.2px 1.2px at 52% 22%, var(--mb-white), transparent),
    radial-gradient(1px 1px at 62% 70%, var(--mb-star), transparent),
    radial-gradient(1.4px 1.4px at 70% 16%, var(--mb-white), transparent),
    radial-gradient(1px 1px at 94% 80%, var(--mb-white), transparent),
    radial-gradient(1.2px 1.2px at 46% 84%, var(--mb-star), transparent),
    radial-gradient(40% 90% at 88% 40%, rgba(226, 220, 147, 0.16), transparent 70%),
    linear-gradient(100deg, var(--mb-abyss) 0%, #2b3460 55%, var(--mb-indigo) 100%);
}

.mbp-card--dusk {
  background:
    radial-gradient(40% 90% at 86% 100%, rgba(251, 246, 216, 0.45), transparent 70%),
    linear-gradient(100deg, #33406a 0%, rgba(94, 125, 136, 0.95) 45%, #8fae9d 80%, var(--mb-mist) 100%);
}

.mbp-card--dusk .mbp-when {
  color: var(--mb-moon-bright);
}

.mbp-card--dusk .mbp-who {
  color: var(--mb-white);
}

.mbp-party-orb {
  position: absolute;
  top: 50%;
  right: clamp(26px, 5%, 56px);
  width: 52px;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: 0 -50%;
}

.mbp-card--night .mbp-party-orb {
  background: radial-gradient(circle at 62% 40%, #f4efbd 0%, var(--mb-moon-bright) 55%, var(--mb-moon) 100%);
  box-shadow: 0 0 30px rgba(226, 220, 147, 0.55), 0 0 90px rgba(199, 194, 123, 0.3);
  animation: mbp-float 8s ease-in-out infinite;
}

/* The setting sun, half sunk below the bottom edge. */
.mbp-card--dusk .mbp-party-orb {
  top: auto;
  bottom: 0;
  width: 84px;
  translate: 0 50%;
  background: radial-gradient(circle, #fbf6d8 0%, #f1e8a8 60%, var(--mb-moon-bright) 100%);
  box-shadow: 0 0 40px rgba(251, 246, 216, 0.8), 0 0 110px rgba(226, 220, 147, 0.6);
}

/* Lunch break */
.mbp-slot--break .mbp-time {
  padding-top: 3px;
  color: var(--mb-sage);
  font-size: 1rem;
}

.mbp-slot--break .mbp-time::after {
  top: 7px;
  background: none;
  border: 1px solid var(--mb-sage);
  box-shadow: none;
}

.mb-page .mbp-break {
  display: flex;
  grid-column: 2 / -1;
  align-items: center;
  gap: 18px;
  color: var(--mb-sage);
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.4;
  white-space: nowrap;
}

.mbp-break::before,
.mbp-break::after {
  flex: 1;
  height: 1px;
  content: "";
  background: repeating-linear-gradient(90deg, rgba(202, 205, 179, 0.35) 0 6px, transparent 6px 12px);
}

/* ---------- Level highlight ---------- */

/* data-level can list several levels, e.g. the auditions ("2 3"). */
.mbp-page[data-level-active="1"] .mbp-card[data-level]:not([data-level~="1"]),
.mbp-page[data-level-active="2"] .mbp-card[data-level]:not([data-level~="2"]),
.mbp-page[data-level-active="3"] .mbp-card[data-level]:not([data-level~="3"]) {
  opacity: 0.22;
  filter: saturate(0.3);
}

.mbp-page[data-level-active="1"] .mbp-card[data-level~="1"],
.mbp-page[data-level-active="2"] .mbp-card[data-level~="2"],
.mbp-page[data-level-active="3"] .mbp-card[data-level~="3"] {
  border-color: rgba(226, 220, 147, 0.75);
  box-shadow: 0 0 0 1px rgba(226, 220, 147, 0.25), 0 0 36px rgba(226, 220, 147, 0.2);
}

/* ---------- Outro ---------- */

.mbp-outro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px clamp(32px, 5vw, 64px);
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: clamp(32px, 4vw, 44px);
  border-top: 1px solid rgba(202, 205, 179, 0.18);
}

.mb-page .mbp-outro-text {
  max-width: 52ch;
  color: var(--mb-mist);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.6;
}

.mbp-outro .mb-actions {
  margin-top: 0;
}

@keyframes mbp-float {
  0%, 100% { translate: 0 -50%; }
  50% { translate: 0 calc(-50% - 5px); }
}

/* ---------- Responsive ---------- */

/* Title back on top of the timeline, next to its little landscape. */
@media (max-width: 991px) {
  .mbp-day > .mb-shell {
    display: block;
  }

  .mbp-day-head {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
    align-items: end;
    gap: 20px 32px;
    margin-bottom: 24px;
  }

  .mbp-outro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .mbp-page {
    --mbp-time: 74px;
    --mbp-gap: 12px;
  }

  .mbp-hero {
    min-height: 420px;
  }

  .mbp-hero .mb-moon-track {
    top: 56%;
    right: -46vw;
    width: 108vw;
  }

  .mbp-star--high {
    top: 9%;
    right: 12%;
  }

  .mbp-legend-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .mbp-legend {
    gap: 6px;
  }

  .mbp-filter {
    flex: 1;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px 6px 6px;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .mbp-filter svg {
    width: 22px;
    height: 22px;
  }

  .mbp-day-head {
    grid-template-columns: 1fr;
  }

  .mbp-day-window {
    height: 110px;
  }

  .mbp-rooms {
    display: none;
  }

  .mbp-slot {
    grid-template-columns: var(--mbp-time) minmax(0, 1fr);
  }

  .mbp-card--s1,
  .mbp-card--s2,
  .mbp-card--both,
  .mb-page .mbp-break {
    grid-row: auto;
    grid-column: 2;
  }

  .mb-page .mbp-time {
    padding: 16px 22px 0 0;
    font-size: 1.05rem;
  }

  .mbp-time::after {
    top: 19px;
    width: 7px;
    height: 7px;
  }

  .mbp-slot--break .mbp-time {
    padding-top: 3px;
    font-size: 0.95rem;
  }

  .mbp-slot--break .mbp-time::after {
    top: 6px;
  }

  .mbp-card {
    padding: 13px 52px 14px 16px;
  }

  .mbp-room {
    position: static;
    flex-basis: 100%;
    width: auto;
    height: auto;
    margin-bottom: 4px !important;
    clip-path: none;
    color: var(--mb-sage);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .mbp-card-icon {
    top: 14px;
    right: 14px;
    left: auto;
    width: 26px;
    height: 26px;
    translate: none;
  }

  .mb-page .mbp-card h3 {
    font-size: 1.35rem;
  }

  .mb-page .mbp-when,
  .mb-page .mbp-who {
    flex-basis: 100%;
  }

  .mbp-who::before {
    content: none;
  }

  .mbp-card--party {
    padding: 16px 16px 18px;
  }

  .mb-page .mbp-card--party h3 {
    flex-basis: 100%;
    padding-right: 52px;
  }

  .mb-page .mbp-card--party .mb-tag {
    order: 6;
    margin: 12px 0 0 !important;
  }

  .mbp-card--night .mbp-party-orb {
    top: 16px;
    right: 16px;
    width: 40px;
    translate: none;
    animation: none;
  }

  .mbp-card--dusk .mbp-party-orb {
    width: 72px;
  }

  .mb-page .mbp-break {
    white-space: normal;
    font-size: 0.9rem;
  }
}
