/* ==========================================================================
   Scene 5b — What awaits you (#programme)
   Programme highlights rendered by /js/invite/programme.js from /api/event.
   Phones: each card hangs from a gold thread, its medallion on the left.
   Wider screens: arched cards (an echo of the storefront's arched doors) with
   the medallion set in the arch, 2 then 4 per row (7 items → 4 + 3, centred).
   Hidden entrance states are set from JS only (motion mode), never here — so
   no-JS and reduced motion always show complete, static cards.
   ========================================================================== */
.programme {
  position: relative;
  padding: clamp(24px, 6vw, 64px) 0 clamp(8px, 3vw, 24px);
}

/* The ceremony note ({{timeNote}} / event.timeNote) under the heading. */
.programme__note {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px;
  max-width: 100%;
  margin-top: 20px;
  padding: 9px 20px 9px 14px;
  border: 1px solid rgba(198, 154, 67, 0.5);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.75);
  box-shadow: 0 10px 24px -18px rgba(138, 95, 31, 0.5);
  color: var(--ink-soft);
  font-size: 0.95rem; line-height: 1.4;
  text-align: left;
}
.programme__note .icon { width: 19px; height: 19px; color: var(--gold-600); }
.programme__note-text { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.note__lead { color: var(--ink); font-weight: 500; }
.note__rest::before { content: "·"; margin: 0 0.55em; color: var(--gold-600); font-weight: 600; }
/* A soft gold light passes over the note once the heading has arrived. */
.programme__note::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(105deg, rgba(241, 214, 140, 0) 30%, rgba(241, 214, 140, 0.42) 50%, rgba(241, 214, 140, 0) 70%);
  transform: translateX(-130%);
  pointer-events: none;
}
.motion .section-head.is-in .programme__note::after { animation: note-shine 1.8s var(--ease-out) 1s both; }
@keyframes note-shine { to { transform: translateX(130%); } }
@media (max-width: 520px) {
  .programme__note { border-radius: 20px; padding: 10px 18px 10px 14px; }
  .programme__note-text { display: grid; }
  /* No JS (one raw string): break after "…10:00 AM ·", as in the Time card. */
  html:not(.js) .programme__note-text { max-width: 15.6em; }
  .note__rest { font-size: 0.9rem; }
  .note__rest::before { content: none; }
}

/* ---- The list ----------------------------------------------------------- */
.programme__list {
  list-style: none;
  margin: clamp(30px, 6vw, 52px) auto 0;
  padding: 0;
  display: grid; gap: 16px;
  max-width: 34rem;
}
.prog {
  --medal: 70px;
  position: relative;
  display: grid; grid-template-columns: var(--medal) 1fr; align-items: start;
  column-gap: 16px;
  transition: translate 0.6s var(--ease-out), scale 0.3s var(--ease-out);
}
/* The gold thread from this medallion down to the next one. */
.prog:not(:last-child)::before {
  content: ""; position: absolute; z-index: 0;
  left: calc(var(--medal) / 2); top: var(--medal); bottom: -16px; width: 1px; margin-left: -0.5px;
  background: linear-gradient(180deg, var(--gold-500), rgba(198, 154, 67, 0.35));
  transform-origin: 50% 0;
  transition: transform 1.3s var(--ease-out) 0.35s;
}
.motion .prog:not(.is-in)::before { transform: scaleY(0); }

.prog__body {
  position: relative;
  display: grid; align-content: start;
  padding: 16px 20px 19px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 253, 248, 0.72));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.6s var(--ease-out), border-color 0.5s;
}
.prog__body::before {
  content: ""; position: absolute; inset: 5px; border-radius: 13px; pointer-events: none;
  border: 1px solid rgba(198, 154, 67, 0.2);
}
/* The Lucky Draw card carries a little more gold. */
.prog[data-icon="draw"] .prog__body {
  background: linear-gradient(180deg, #fffaf0, rgba(250, 239, 214, 0.85));
  border-color: rgba(198, 154, 67, 0.55);
}

/* ---- Medallion ------------------------------------------------------------ */
.prog__medal {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: var(--medal); height: var(--medal);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #fffdf6 0%, var(--cream-100) 62%, var(--cream-200) 100%);
  box-shadow: 0 12px 24px -14px rgba(138, 95, 31, 0.6), inset 0 0 0 1px rgba(198, 154, 67, 0.16);
  transition: scale 0.6s var(--ease-out);
}
.prog__svg { position: relative; width: 100%; height: 100%; overflow: visible; }
.prog__ring { fill: none; stroke: var(--gold-500); stroke-width: 1.15; }
.prog__ring--inner { stroke-opacity: 0.42; stroke-width: 0.8; }
.prog__icon {
  fill: none; stroke: var(--gold-600); stroke-width: 1.38;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.4s;
}
/* A warm glow behind the medallion and a fine dashed orbit around it (hover). */
.prog__halo {
  position: absolute; inset: -16px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--glow), 0.5), rgba(var(--glow), 0.14) 60%, rgba(var(--glow), 0));
  opacity: 0; scale: 0.8;
  transition: opacity 0.6s, scale 0.9s var(--ease-out);
  pointer-events: none;
}
.prog__orbit {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 1px dashed rgba(198, 154, 67, 0.4);
  transition: rotate 1.6s var(--ease-out), border-color 0.5s;
  pointer-events: none;
}

/* ---- Copy ----------------------------------------------------------------- */
.prog__num {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 500; font-size: 0.7rem;
  letter-spacing: 0.26em; color: var(--gold-700);
  font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1;
}
.prog__num::after { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, var(--gold-500), rgba(198, 154, 67, 0)); }
.prog__title {
  margin-top: 5px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 5vw, 1.55rem); line-height: 1.15;
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
  color: var(--brown-800);
  text-wrap: balance;
}
.prog__text { margin-top: 6px; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; text-wrap: pretty; }

/* ---- Micro-interactions (the card lifts, the medallion glows and turns) ---- */
@media (hover: hover) {
  .prog:hover .prog__body { border-color: rgba(198, 154, 67, 0.6); box-shadow: var(--shadow-lift); }
  .prog:hover .prog__icon { stroke: var(--gold-700); }
  .prog:hover .prog__orbit { border-color: rgba(198, 154, 67, 0.7); }
  .motion .prog:hover { translate: 0 -5px; }
  .motion .prog:hover .prog__halo { opacity: 1; scale: 1.05; }
  .motion .prog:hover .prog__orbit { rotate: 150deg; }
  .motion .prog:hover .prog__medal { scale: 1.05; }
}
.motion .prog:active { scale: 0.99; transition-duration: 0.12s; }

/* ---- Wider screens: arched cards ------------------------------------------ */
@media (min-width: 600px) {
  .programme__list {
    max-width: none;
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 22px 18px;
  }
  .prog {
    --medal: 84px;
    flex: 0 1 calc((100% - 18px) / 2);
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
  }
  .prog:not(:last-child)::before { content: none; }
  .prog__medal { margin-bottom: calc(-1 * (var(--medal) + 22px)); margin-top: 22px; }
  .prog__body {
    flex: 1 1 auto; align-self: stretch;
    justify-items: center;
    padding: calc(var(--medal) + 42px) 24px 28px;
    border-radius: 50% 50% 20px 20px / 124px 124px 20px 20px;
  }
  .prog__body::before { border-radius: 50% 50% 15px 15px / 119px 119px 15px 15px; }
  .prog__num::before { content: ""; width: 22px; height: 1px; background: linear-gradient(270deg, var(--gold-500), rgba(198, 154, 67, 0)); }
  .prog__text { max-width: 30ch; }
}
@media (min-width: 960px) {
  .programme__list { gap: 26px 20px; }
  .prog { flex-basis: calc((100% - 3 * 20px) / 4); }
  .prog__title { font-size: 1.5rem; }
  .prog__text { font-size: 0.93rem; }
}

/* Reduced motion: colour changes only (the classes above that move are .motion-only). */
@media (prefers-reduced-motion: reduce) {
  .programme__note::after { animation: none !important; }
}
