/* Home page: "A Day (Any Day) at North Bridge Academy" slideshow (Karen, Oct 2026).
   It sits in the right-hand column of the "What we do" section, in place of the old About card. */

.day { position: relative; }

/* The stage keeps a 4:3 shape beside the text; slides change inside it. */
.day__stage { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #0d1626; box-shadow: var(--shadow); container-type: inline-size; }
/* The change from one photo to the next takes 0.4 seconds (sped up from 0.55 at Karen's request, 21 Nov 2026). */
.day__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease, transform .4s ease, clip-path .4s ease; }
.day__slide[data-active="true"] { opacity: 1; z-index: 1; }
.day__slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1); transition: transform 4.5s linear; }
.day__slide[data-active="true"] img { transform: scale(1.06); }
.day__caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 20px 16px; margin: 0;
  font-size: clamp(15px, 1.4vw, 18px); font-weight: 700; letter-spacing: -.01em; color: #fff;
  background: linear-gradient(to top, rgba(13,22,38,.85), rgba(13,22,38,0)); text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* Five transition styles, assigned in turn to the slides. */
.day__slide--wipe { opacity: 1; clip-path: inset(0 100% 0 0); }
.day__slide--wipe[data-active="true"] { clip-path: inset(0 0 0 0); }
.day__slide--rise { transform: translateY(40px); }
.day__slide--rise[data-active="true"] { transform: translateY(0); }
.day__slide--zoom { transform: scale(1.12); }
.day__slide--zoom[data-active="true"] { transform: scale(1); }
.day__slide--slide { transform: translateX(60px); }
.day__slide--slide[data-active="true"] { transform: translateX(0); }
/* The slide being left holds still underneath the new one until it is covered, so the dark
   background never flashes between photos. */
.day__slide[data-prev="true"] { opacity: 1; transform: none; clip-path: inset(0 0 0 0); z-index: 0; transition: none; }
.day__slide[data-prev="true"] img { transform: scale(1.06); transition: none; }
/* One unbroken line under the word: it does not skip around the tail of the y. */
.day__caption u { text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
/* A caption marked "oneLine" in dayslides.json stays on a single line (Karen, 21 Nov 2026). The text
   is sized to the width of the slideshow so it always fits, and never goes below 14px: where the
   slideshow is too narrow for that (small phones), the caption wraps at its normal size instead.
   25.5 is the width of the last slide's caption measured in ems; re-measure if that caption changes. */
@container (min-width: 380px) {
  .day__caption--oneline {
    white-space: nowrap; padding-left: 12px; padding-right: 12px; letter-spacing: -.02em;
    font-size: min(clamp(15px, 1.4vw, 18px), calc((100cqw - 24px) / 25.5));
  }
}

/* Title and closing cards. The title fades in a little more slowly, as an opening should. */
.day__card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; background: var(--navy); }
.day__card[data-kind="title"] { transition-duration: 1s; }
/* The title card is the school building with the title laid over it. */
.day__card--photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
/* The building is shown bright (Karen, 21 Nov 2026): the dark shade sits only along the bottom,
   and the title sits on that shade so the white words stay easy to read. */
.day__card--photo { justify-content: flex-end; padding-bottom: clamp(18px, 6%, 28px); }
.day__card--photo img { filter: brightness(1.1) saturate(1.05); }
.day__card--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(13,22,38,.92) 0%, rgba(13,22,38,.74) 26%, rgba(13,22,38,0) 60%); }
.day__card__text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.day__card--photo h3 { text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.day__card .eyebrow { color: var(--tan); margin: 0 0 12px; }
.day__card h3 { margin: 0; color: #fff; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -.03em; max-width: 14em; }
.day__card p { margin: 12px 0 0; color: rgba(255,255,255,.78); font-size: clamp(14px, 1.2vw, 16px); max-width: 30em; }
.day__card .btn { margin-top: 18px; }
/* A dashed "Placeholder" card holds a slide's place until its photo is chosen (Karen, Nov 2026). */
.day__placeholder { background: var(--cream); display: flex; align-items: center; justify-content: center; padding: 28px; }
.day__placeholder__box { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--sand-deep); border-radius: 10px; color: var(--warm-400); font-size: clamp(18px, 2vw, 26px); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Controls under the stage. */
/* Everything stays on one line: the progress bar shrinks to make room for the buttons (Karen, Oct 2026). */
.day__bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin-top: 14px; }
.day__btn {
  appearance: none; border: 1.5px solid var(--navy); background: transparent; color: var(--navy); border-radius: 999px;
  flex: 0 0 auto; white-space: nowrap; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 38px;
}
.day__btn:hover, .day__btn:focus-visible { background: var(--navy); color: #fff; outline: none; }
/* The Play button stays filled in while the show is running. */
#day-play[aria-pressed="true"] { background: var(--navy); color: #fff; }
.day__btn[hidden] { display: none; }
.day__progress { flex: 1 1 24px; min-width: 24px; height: 4px; background: var(--sand-deep); border-radius: 2px; overflow: hidden; }
.day__progress span { display: block; height: 100%; width: 0; background: var(--brick); transition: width .4s linear; }

@media (max-width: 700px) {
  .day__stage { aspect-ratio: 1 / 1; border-radius: 8px; }
  .day__card { padding: 18px; }
  .day__card h3 { font-size: 24px; }
  .day__card p { font-size: 14px; margin-top: 10px; }
  .day__card .btn { margin-top: 16px; }
  .day__caption { padding: 36px 16px 14px; }
  .day__btn { padding: 7px 11px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .day__slide, .day__card[data-kind="title"] { transition: opacity .3s ease; transform: none; clip-path: none; }
  .day__slide--wipe { opacity: 0; }
  .day__slide img, .day__slide[data-active="true"] img { transform: none; transition: none; }
}
