/* motion.css - the things that answer back: the section rail down the right edge,
   hover behaviour on cards and photographs, the gallery filters, button ripples,
   the live marker on the daily timetable, and the news filters. */

/* ------------------------------------------------------------------ section rail */
.rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 100; display: none; flex-direction: column; gap: 14px; align-items: flex-end;
}
@media (min-width: 1240px) { .rail { display: flex; } }
.rail button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-2);
  font-family: var(--label); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.rail .tag {
  opacity: 0; transform: translateX(8px);
  transition: opacity .25s ease, transform .25s ease;
  background: var(--navy); color: var(--white); padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.rail button:hover .tag, .rail button.on .tag { opacity: 1; transform: none; }
.rail .pip {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--line); border: 2px solid transparent;
  transition: background .25s ease, transform .25s ease, border-color .25s ease;
}
.rail button:hover .pip { background: var(--navy-mid); transform: scale(1.3); }
.rail button.on .pip { background: var(--sun); transform: scale(1.5); }
/* on dark bands the dots need to be visible too */
.rail.on-dark .pip { background: rgba(255, 255, 255, .32); }
.rail.on-dark button.on .pip { background: var(--sun); }
.rail.on-dark .tag { background: var(--white); color: var(--navy); }

/* ------------------------------------------------------------------ hover behaviour */
.card { transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s ease, border-color .3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--sun); }

.photo-frame img, .shot img { transition: transform .9s cubic-bezier(.2, .8, .3, 1); }
.photo-frame { overflow: hidden; border-radius: var(--r-lg); }
.photo-frame:hover img, .shot:hover img { transform: scale(1.055); }

/* the four numbers under the hero react to the pointer. They sit inside a card that
   clips its corners, so the cell tints rather than lifting out of it. */
.fig { transition: background .3s ease; }
.fig:hover { background: var(--cream-2); }
.fig-card { transition: box-shadow .3s ease; }
.fig-card:hover { box-shadow: 0 24px 60px rgba(16, 27, 49, .2); }
.fig:hover b { color: var(--sun-ink); }
.fig b { transition: color .3s ease; }

/* the numbered promises on the home page */
.promise-list li { transition: transform .3s cubic-bezier(.2, .8, .3, 1); }
.promise-list li:hover { transform: translateX(6px); }
.promise-list .num { transition: background .3s ease, color .3s ease, transform .3s ease; }
.promise-list li:hover .num { background: var(--sun); color: #2B1E00; transform: rotate(-8deg) scale(1.08); }

/* every photograph says it can be opened */
.zoomable { position: relative; }
.shot { position: relative; }
.shot::after {
  content: "⤢"; position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: rgba(16, 27, 49, .72); color: var(--white);
  opacity: 0; transform: scale(.8); transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.shot:hover::after { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ gallery filters */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 26px; }
.chip {
  font-family: var(--label); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 17px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--navy); border: 1.5px solid var(--line);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.chip:hover { border-color: var(--sun); transform: translateY(-2px); }
.chip.on { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chip .n { opacity: .55; margin-left: 6px; font-weight: 600; }
.band.dark .chip, .band.deep .chip { color: rgba(255, 255, 255, .84); border-color: var(--line-dark); }
.band.dark .chip.on, .band.deep .chip.on { background: var(--sun); color: #2B1E00; border-color: var(--sun); }

/* a figure leaving or joining the grid */
.shot.out { opacity: 0; transform: scale(.94); pointer-events: none; }
.shot { transition: opacity .35s ease, transform .35s cubic-bezier(.2, .8, .3, 1); }
.gallery-empty { color: var(--ink-2); font-style: italic; margin: 0; }

/* ------------------------------------------------------------------ button ripple */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .45); transform: scale(0);
  animation: ripple .62s ease-out forwards;
}
.btn.dark .ripple { background: rgba(255, 255, 255, .3); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ------------------------------------------------------------------ the daily timetable */
.day-card { transition: background .3s ease, transform .3s ease, border-color .3s ease; cursor: default; }
.day-card:hover { background: rgba(255, 255, 255, .09); transform: translateY(-4px); }
/* whichever part of the day it is right now */
.day-card.now { border-color: var(--sun); background: rgba(232, 163, 58, .14); }
.day-card.now time { color: var(--sun); }
.day-card .now-flag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-family: var(--label); font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sun);
}
.day-card .now-flag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); animation: pulse 2.4s infinite; }

/* ------------------------------------------------------------------ news filters and search */
.news-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.finder { position: relative; flex: 0 1 280px; }
.finder input {
  width: 100%; font-family: var(--text); font-size: 15px; color: var(--ink);
  padding: 12px 16px 12px 42px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.finder input:focus { outline: 0; border-color: var(--sun); box-shadow: 0 0 0 4px rgba(232, 163, 58, .18); }
.finder svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-2); }
.news-card.out { display: none; }
.news-count { font-family: var(--label); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }

/* ------------------------------------------------------------------ the application form, as you fill it */
.form-progress { margin: 0 0 24px; }
.form-progress .track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.form-progress .track span { display: block; height: 100%; width: 0; background: var(--sun); border-radius: 999px; transition: width .4s cubic-bezier(.2, .8, .3, 1); }
.form-progress .said { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; font-family: var(--label); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.form-progress .said b { color: var(--sun-ink); }

/* a green tick beside a field once it has something sensible in it */
.field { position: relative; }
.field .mark-ok {
  position: absolute; right: 14px; top: 42px;
  width: 20px; height: 20px; border-radius: 50%; background: #1E7A4B; color: #fff;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .25s ease;
}
.field.ok .mark-ok { opacity: 1; transform: none; }
.field.ok input, .field.ok select { border-color: #8FC4A9; }
/* leave room so a long answer never runs under the tick */
.field input { padding-right: 44px; }

/* ------------------------------------------------------------------ the accordion */
.qa-item { transition: border-color .25s ease; }
.qa-item:hover { border-color: var(--sun); }
.qa-item .qa-mark { transition: transform .3s cubic-bezier(.2, .8, .3, 1), color .2s ease; }
.qa-item.open .qa-mark { transform: rotate(45deg); color: var(--sun-ink); }

/* ------------------------------------------------------------------ links that underline themselves */
.foot a, .sub-in a, .news-card h3 { position: relative; }
.foot ul a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--sun); transition: right .3s cubic-bezier(.2, .8, .3, 1);
}
.foot ul a:hover::after { right: 0; }

@media (prefers-reduced-motion: reduce) {
  .card, .photo-frame img, .shot img, .fig, .promise-list li, .day-card, .chip, .shot { transition: none; }
  .card:hover, .promise-list li:hover, .day-card:hover, .chip:hover { transform: none; }
  .photo-frame:hover img, .shot:hover img { transform: none; }
  .btn .ripple, .day-card .now-flag::before { animation: none; display: none; }
}

/* ------------------------------------------------------------------ the photo wall */
/* the filterable version of the gallery: as many across as will fit, all the same shape */
.gallery.wall { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); grid-template-rows: none; }
.gallery.wall .shot.tall { grid-row: auto; }
.gallery.wall .shot.tall img { aspect-ratio: 16 / 10; }
@media (max-width: 620px) { .gallery.wall { grid-template-columns: 1fr; } }

/* the caption sits over the photograph, so it must not catch the click meant for it */
.shot figcaption, .photo-stamp { pointer-events: none; }
.zoomable { cursor: zoom-in; }
