/* DDGIP v6 sections (11-15): the journey as a sunrise in four cards, themes as coloured briefing
   cards, the itinerary as a lit route with Davos week as the peak. Loaded late (build.mjs). */

/* ---------- programme: Learn / Engage / Produce / Continue ---------- */
#programme .journey { counter-reset: j; gap: clamp(14px, 1.6vw, 22px); align-items: stretch; }
#programme .journey li {
  counter-increment: j;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 26px 24px 22px;
  border-radius: 26px;
  background: var(--card);
  color: #fff;
  box-shadow: 0 34px 60px -34px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: visible;
  isolation: isolate;
}
#programme .journey li:nth-child(1) { --card: linear-gradient(160deg, #0b1640 0%, #142cc0 120%); --glow: rgba(11, 22, 64, 0.8); }
#programme .journey li:nth-child(2) { --card: linear-gradient(160deg, #142cc0 0%, #4a3fe0 110%); --glow: rgba(20, 44, 192, 0.75); }
#programme .journey li:nth-child(3) { --card: linear-gradient(160deg, #3f34c9 0%, #8a5ad0 110%); --glow: rgba(90, 63, 214, 0.7); }
#programme .journey li:nth-child(4) { --card: linear-gradient(160deg, #ffe0b0 0%, #ffb35c 100%); --glow: rgba(255, 140, 60, 0.75); color: #0b1640; }
#programme .journey li::before {
  display: block;
  content: counter(j, decimal-leading-zero);
  position: absolute;
  inset: 14px 18px auto auto;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  font: 800 4.4rem/1 var(--font);
  letter-spacing: -0.06em;
  color: currentColor;
  opacity: 0.14;
  z-index: -1;
}
#programme .journey small {
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#programme .journey li:nth-child(4) small { background: rgba(255, 255, 255, 0.55); border-color: rgba(11, 22, 64, 0.12); }
#programme .journey h3 { margin-bottom: 10px; color: inherit; font-size: clamp(1.9rem, 2.6vw, 2.5rem); }
#programme .journey p { color: inherit; opacity: 0.86; }
#programme .journey em.meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid currentColor;
  border-image: linear-gradient(90deg, currentColor, transparent) 1;
  color: inherit;
}
/* the hand-off between chapters: a little arrow coin on the seam */
#programme .journey li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: calc(-1 * clamp(14px, 1.6vw, 22px) / 2 - 17px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #0b1640;
  font: 800 1rem/1 var(--font);
  box-shadow: 0 8px 20px -8px rgba(11, 22, 64, 0.5);
  translate: 0 -50%;
}
#programme .journey li { transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out); }
#programme .journey li:hover { transform: translateY(-8px); box-shadow: 0 44px 70px -34px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
@media (max-width: 900px) {
  #programme .journey { grid-template-columns: 1fr 1fr; padding: 0; }
  #programme .journey li { padding: 22px 20px 20px; min-height: 0; }
  #programme .journey li:not(:last-child)::after { display: none; }
}
@media (max-width: 560px) {
  #programme .journey { grid-template-columns: 1fr; }
  #programme .journey li:not(:last-child)::after { display: grid; content: "↓"; top: auto; bottom: -24px; right: 50%; translate: 50% 0; }
}

/* ---------- themes: coloured briefing cards ---------- */
#themes .topics__tab:nth-child(1), #themes .topics__panel:nth-child(1) { --h: #2340e8; --n: "01"; }
#themes .topics__tab:nth-child(2), #themes .topics__panel:nth-child(2) { --h: #6a3fd8; --n: "02"; }
#themes .topics__tab:nth-child(3), #themes .topics__panel:nth-child(3) { --h: #b8501c; --n: "03"; }
#themes .topics__tab:nth-child(4), #themes .topics__panel:nth-child(4) { --h: #b8326b; --n: "04"; }
#themes .topics__tab:nth-child(5), #themes .topics__panel:nth-child(5) { --h: #0d7480; --n: "05"; }
#themes .topics__tab {
  position: relative;
  padding-left: 40px;
  border: 1px solid rgba(11, 22, 64, 0.08);
  background: #fff;
  color: #0b1640;
  box-shadow: 0 10px 24px -20px rgba(11, 22, 64, 0.5);
  transition: background 0.4s, color 0.4s, transform 0.4s var(--ease-out), box-shadow 0.4s;
}
#themes .topics__tab::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--h);
  translate: 0 -50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--h) 18%, transparent);
}
#themes .topics__tab:hover { transform: translateX(4px); color: var(--h); }
#themes .topics__tab[aria-selected="true"] {
  background: linear-gradient(120deg, var(--h), color-mix(in srgb, var(--h) 55%, #0b1640));
  border-color: transparent;
  color: #fff;
  transform: translateX(8px);
  box-shadow: 0 18px 34px -18px var(--h);
}
#themes .topics__tab[aria-selected="true"]::before { background: #ffd29a; box-shadow: 0 0 0 4px rgba(255, 210, 154, 0.3); }
#themes .topics__tab i { color: inherit; opacity: 0.6; font-style: normal; }
#themes .topics__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 3vw, 40px);
  border: 0;
  border-radius: 28px;
  background:
    radial-gradient(60% 80% at 100% 110%, rgba(255, 179, 92, 0.45), transparent 60%),
    linear-gradient(150deg, var(--h), color-mix(in srgb, var(--h) 45%, #0b1640));
  color: #fff;
  box-shadow: 0 40px 70px -40px var(--h);
  isolation: isolate;
}
#themes .topics__panel:not([hidden]) { animation: topic-in 0.6s var(--ease-out) both; }
@keyframes topic-in { from { opacity: 0; translate: 0 14px; } }
#themes .topics__panel::after {
  content: var(--n);
  position: absolute;
  right: -6px;
  top: -18px;
  z-index: -1;
  font: 800 clamp(7rem, 12vw, 10rem)/1 var(--font);
  letter-spacing: -0.07em;
  color: rgba(255, 255, 255, 0.1);
}
#themes .topics__panel h3, #themes .topics__panel p { color: #fff; }
#themes .topics__panel p { opacity: 0.88; max-width: 42ch; }
#themes .topics__panel ul { display: grid; gap: 10px; margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: q; }
#themes .topics__panel li {
  counter-increment: q;
  position: relative;
  padding: 13px 16px 13px 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(6px);
  animation: topic-in 0.6s var(--ease-out) both;
  animation-delay: calc(var(--d, 1) * 0.08s + 0.1s);
}
#themes .topics__panel li:nth-child(2) { --d: 2; }
#themes .topics__panel li:nth-child(3) { --d: 3; }
#themes .topics__panel li::before {
  content: "Q" counter(q);
  position: absolute;
  left: 12px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #ffd29a;
  color: #0b1640;
  font: 800 0.66rem/1 var(--font);
}
#themes .topics__panel .btn { background: #fff; border-color: #fff; color: #0b1640; }
#themes .topics__panel .btn:hover { background: #ffd29a; border-color: #ffd29a; color: #0b1640; }
@media (max-width: 900px) {
  #themes .topics__tab, #themes .topics__tab:hover, #themes .topics__tab[aria-selected="true"] { transform: none; }
}

/* ---------- itinerary: a lit route, Davos week is the peak ---------- */
#itinerary .timeline ol { position: relative; display: grid; gap: 14px; }
#itinerary .timeline ol::before,
#itinerary .timeline ol::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 30px;
  bottom: 30px;
  width: 3px;
  border-radius: 3px;
  background: rgba(11, 22, 64, 0.1);
}
#itinerary .timeline ol::after {
  background: linear-gradient(180deg, #142cc0, #6a4fd8 55%, #ffb35c);
  transform-origin: top;
  transform: scaleY(var(--p, 0));
  box-shadow: 0 0 18px rgba(255, 179, 92, 0.5);
}
#itinerary .timeline li { grid-template-columns: 58px 1fr; gap: 18px; padding: 0; border: 0; align-items: start; }
#itinerary .timeline li::before {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-width: 0;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(11, 22, 64, 0.12);
  color: #0b1640;
  font: 800 1.05rem/1 var(--font);
  font-style: normal;
  transition: background 0.5s, color 0.5s, border-color 0.5s, box-shadow 0.5s;
}
#itinerary .timeline li.lit::before { background: var(--dot); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -8px var(--dot); }
#itinerary .timeline li:nth-child(1) { --dot: #142cc0; }
#itinerary .timeline li:nth-child(2) { --dot: #3f34c9; }
#itinerary .timeline li:nth-child(3) { --dot: #8a5ad0; }
#itinerary .timeline li:nth-child(4) { --dot: #d4652a; }
#itinerary .timeline li > div {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border: 1px solid rgba(11, 22, 64, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 44px -32px rgba(11, 22, 64, 0.45);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s;
}
#itinerary .timeline li > div:hover { transform: translateY(-4px); box-shadow: 0 30px 54px -30px rgba(11, 22, 64, 0.5); }
#itinerary .timeline small {
  order: -1;
  align-self: flex-start;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dot) 10%, #fff);
  color: var(--dot);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#itinerary .timeline li:nth-child(4) small { color: #9a4515; }
/* the peak */
#itinerary .timeline li:nth-child(3) > div {
  position: relative;
  overflow: hidden;
  padding-bottom: 58px;
  border: 0;
  background: var(--dawn);
  color: #fff;
  box-shadow: 0 34px 60px -30px rgba(74, 63, 224, 0.75);
}
#itinerary .timeline li:nth-child(3) > div::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #fff);
  clip-path: polygon(0 80%, 10% 52%, 18% 66%, 30% 24%, 40% 48%, 50% 34%, 62% 4%, 74% 40%, 84% 28%, 100% 56%, 100% 100%, 0 100%);
}
#itinerary .timeline li:nth-child(3) :is(h3, p) { color: #fff; }
#itinerary .timeline li:nth-child(3) p { opacity: 0.88; }
#itinerary .timeline li:nth-child(3) small { background: rgba(255, 255, 255, 0.16); color: #ffd29a; }
@media (max-width: 560px) {
  #itinerary .timeline li { grid-template-columns: 44px 1fr; gap: 12px; }
  #itinerary .timeline li::before { width: 44px; height: 44px; font-size: 0.9rem; }
  #itinerary .timeline ol::before, #itinerary .timeline ol::after { left: 20px; }
  #itinerary .timeline li > div { padding: 16px 16px; }
  #itinerary .timeline li:nth-child(3) > div { padding-bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  #themes .topics__panel:not([hidden]), #themes .topics__panel li { animation: none; }
  #itinerary .timeline ol::after { transform: none; }
}
