/* Shared pieces for every page: photo headers, photo cards, the photo ribbon and
   sideways "rails". Loaded after styles.css on all pages. */

/* ---------- Page header with a photo ---------- */
.page-hero.has-photo > .wrap { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.hero-photo { margin: 0; position: relative; justify-self: center; max-width: 520px; }
.hero-photo img {
  display: block; width: auto; max-width: 100%; height: auto; max-height: 52vh;
  border-radius: 22px; border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.hero-photo::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1; border-radius: 22px;
  border: 1.5px dashed rgba(var(--accent-2-rgb), .55);
}
.js .hero-photo { animation: heroWipe 1.1s var(--ease) .15s both; }
@keyframes heroWipe {
  from { clip-path: polygon(0 0, 0 0, -30% 100%, 0 100%); transform: rotate(0deg) translateY(18px); }
  to   { clip-path: polygon(-10% -10%, 150% -10%, 120% 115%, -10% 115%); transform: rotate(1.6deg) translateY(0); }
}
.hero-photo { transform: rotate(1.6deg); }
@media (min-width: 900px) {
  .page-hero.has-photo > .wrap { grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 72px); }
  .hero-photo { justify-self: end; }
}

/* ---------- Photo on top of a card ---------- */
.card > .card-photo {
  display: block; width: calc(100% + 60px); max-width: none; margin: -34px -30px 22px;
  height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .8s var(--ease);
}
.card:hover > .card-photo { transform: scale(1.04); }
.card:has(> .card-photo) > .icon { display: none; }

/* ---------- Photo beside or above a panel ---------- */
.side-stack { display: grid; gap: 16px; align-content: center; }
.side-photo { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); }

/* ---------- Photo ribbon: a slow-moving strip of event photos ---------- */
.photo-ribbon { overflow: hidden; padding: 44px 0 8px; }
.photo-ribbon-track { display: flex; width: max-content; animation: ribbon 60s linear infinite; }
.photo-ribbon:hover .photo-ribbon-track { animation-play-state: paused; }
.photo-ribbon-set { display: flex; align-items: center; gap: 18px; padding-right: 18px; }
.photo-ribbon img {
  height: clamp(150px, 24vw, 250px); width: auto; border-radius: var(--radius); border: 1px solid var(--line);
  transition: transform .5s var(--ease);
}
.photo-ribbon img:nth-child(odd) { transform: translateY(-10px) rotate(-1.2deg); }
.photo-ribbon img:nth-child(even) { transform: translateY(10px) rotate(1deg); }
.photo-ribbon img:hover { transform: scale(1.04); }
@keyframes ribbon { to { transform: translateX(-50%); } }

/* ---------- Rail: a row you scroll, drag or arrow through sideways ---------- */
.rail { position: relative; margin-top: 44px; }
.rail-head { display: flex; align-items: center; gap: 16px; width: min(var(--maxw), 100% - var(--gutter) * 2); margin: 0 auto 18px; }
.rail-bar { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rail-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rail-arrows { display: flex; gap: 8px; }
.rail-arrows button {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--ink); font-size: 1.1rem; cursor: pointer; transition: border-color .3s, color .3s, opacity .3s;
}
.rail-arrows button:hover { border-color: var(--accent); color: var(--accent); }
.rail-arrows button:disabled { opacity: .3; cursor: default; }
.rail-track {
  list-style: none; margin: 0; display: flex; gap: 18px; overflow-x: auto;
  scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 6px max(var(--gutter), calc((100vw - var(--maxw)) / 2)) 16px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2));
  cursor: grab;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.rail-track > * { flex: 0 0 min(340px, 80vw); scroll-snap-align: start; }

/* Year cards for the About timeline */
.yearline > li {
  position: relative; padding: 26px 26px 28px; border-radius: 20px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
}
.yearline > li::before {
  content: ""; position: absolute; left: 26px; top: -1px; width: 56px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.yearline .yr { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1 var(--display); letter-spacing: -0.02em; }
.yearline h3 { margin: 12px 0 8px; font-size: 1.2rem; }
.yearline p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .hero-photo { animation: none; }
  .photo-ribbon { overflow-x: auto; }
  .photo-ribbon-track { animation: none; }
  .photo-ribbon-set[aria-hidden="true"] { display: none; }
  .card > .card-photo { transition: none; }
}

/* Programs page: "Program 01 of 04" labels, and a stand-in where a photo is still to come */
.program-num { display: block; font: 600 .75rem/1 var(--display); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-2); }
.radio-band .program-num { margin-bottom: 8px; }
.photo-placeholder {
  display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%;
  border-radius: 22px; border: 2px dashed rgba(var(--accent-2-rgb), .5); background: rgba(var(--accent-2-rgb), .06);
  color: var(--accent-2); font: 600 1rem/1.3 var(--display); text-align: center; padding: 24px;
}
