/* Digital signage page. Overrides and extends theme.css. */

/* Hero tint: warm amber and pink */
.page-digital-signage { --hero-a: var(--amber-wash); --hero-b: var(--pink-wash);  --ring-a: var(--ring-gold); --ring-b: var(--ring-coral); }

/* The TV picture under the hero text (a glow shows around it, so no fade) */
.page-visual { width: 100%; max-width: 62rem; height: auto; margin: var(--space-5) auto 0; }


/* Hero photo strip: venue photos laid out like prints in a photo album (white borders, each tilted a little),
   scrolling slowly from right to left in a loop. CSS only: the photos are listed twice and the track moves
   left by exactly one set (half its width), then repeats, so there is no jump.
   The second set is hidden from screen readers. With reduced motion it stays still and can be scrolled by hand.
   The old TV slideshow is kept (commented out) at the bottom of digital-signage.html. */
.photo-strip {
  --photo-w: clamp(18rem, 30vw, 25.5rem);
  --photo-gap: clamp(1rem, 2.2vw, 1.75rem);
  margin: var(--space-5) 0 0;
  padding: var(--space-2) 0 var(--space-4);   /* room below the prints so their shadows are not clipped by overflow: hidden */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, var(--ink) 6%, var(--ink) 94%, transparent);
  mask-image: linear-gradient(to right, transparent, var(--ink) 6%, var(--ink) 94%, transparent);
}
.photo-track { display: flex; width: max-content; }
.photo-set { display: flex; align-items: center; flex: none; }
.photo {
  flex: none;
  width: var(--photo-w);
  margin: 0 var(--photo-gap) 0 0;
  padding: 0.5rem 0.5rem 0;   /* a white print border; the caption fills the deeper strip at the bottom */
  box-sizing: border-box;
  background: var(--white);
  border-radius: 2px;
  box-shadow: 0 0.8rem 2rem -0.6rem color-mix(in srgb, var(--ink) 30%, transparent), 0 0.1rem 0.6rem color-mix(in srgb, var(--ink) 9%, transparent);   /* soft and wide; the strip's bottom padding leaves room for it */
}
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.photo figcaption {
  display: flex; align-items: center; justify-content: center;   /* centred both ways in the strip at the bottom of the print */
  min-height: 2.8rem;
  padding: 0 0.25rem;
  font-family: var(--font-display); font-weight: 400;   /* same font as the venue card headings */
  font-size: 1.05rem; line-height: 1.15; letter-spacing: -0.01em; text-align: center;
  color: var(--text-heading);
}
.photo:nth-child(7n+1) { transform: rotate(-2.5deg) translateY(0.3rem); }
.photo:nth-child(7n+2) { transform: rotate(1.5deg) translateY(-0.4rem); }
.photo:nth-child(7n+3) { transform: rotate(-1deg) translateY(0.2rem); }
.photo:nth-child(7n+4) { transform: rotate(2.5deg) translateY(-0.2rem); }
.photo:nth-child(7n+5) { transform: rotate(-2deg) translateY(0.4rem); }
.photo:nth-child(7n+6) { transform: rotate(1deg) translateY(-0.3rem); }
.photo:nth-child(7n+7) { transform: rotate(-1.5deg) translateY(0.1rem); }
@media (prefers-reduced-motion: no-preference) {
  .photo-track { animation: photo-scroll 105s linear infinite; }
  @keyframes photo-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) {
  .photo-strip { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .photo-set + .photo-set { display: none; }
}

/* The hero picture is a template shown on a thin-bezel display (a signage screen) with a warm glow.
   The bezel is drawn with box-shadow rings, not a border, so the picture area stays exactly 16:9 and nothing is cropped. */
.slideshow-wrap { --bezel: clamp(0.4rem, 0.9vw, 0.7rem); padding: var(--bezel); }
.tv {
  border-radius: 0.2rem;
  box-shadow:
    0 0 0 var(--bezel) var(--ink),
    0 0 0 calc(var(--bezel) + 1px) color-mix(in srgb, var(--white) 28%, transparent),
    0 2.5rem 6rem -1rem color-mix(in srgb, var(--hero-b) 90%, transparent),
    0 1rem 3rem -1rem color-mix(in srgb, var(--ink) 50%, transparent);
}

/* Slideshow in the TV: seven venue photos that cross-fade (CSS only, no JavaScript).
   Each slide shows for about 5 seconds and the whole loop takes 35 seconds (5 s x 7 slides).
   The new slide fades in on top while the old one stays solid underneath, so there is no dip in brightness.
   Without animation (reduced motion, or an older browser) it just shows the first slide.
   To change the number of slides: loop length = 5 s x slides, and re-work the percentages in slide-show. */
.slideshow { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.slideshow .slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 1; }
.slideshow .slide:first-child { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .slideshow .slide { animation: slide-show 35s linear infinite both; }
  .slideshow .slide:nth-child(1) { animation-delay: -0.75s; }
  .slideshow .slide:nth-child(2) { animation-delay: 4.25s; }
  .slideshow .slide:nth-child(3) { animation-delay: 9.25s; }
  .slideshow .slide:nth-child(4) { animation-delay: 14.25s; }
  .slideshow .slide:nth-child(5) { animation-delay: 19.25s; }
  .slideshow .slide:nth-child(6) { animation-delay: 24.25s; }
  .slideshow .slide:nth-child(7) { animation-delay: 29.25s; }
  /* Progress bar under the TV: fills over the 5 s each slide is shown, then restarts as the next slide lands */
  .slideshow-wrap { position: relative; padding-bottom: calc(var(--bezel) + 1.75rem); }
  .slideshow-wrap::before, .slideshow-wrap::after { content: ""; position: absolute; left: 37.5%; bottom: 0.5rem; height: 0.4rem; border-radius: 1rem; }
  .slideshow-wrap::before { right: 37.5%; background: color-mix(in srgb, var(--ink) 15%, transparent); }
  .slideshow-wrap::after { width: 25%; background: var(--ink); transform-origin: left; animation: slide-progress 5s linear infinite; }
  @keyframes slide-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes slide-show {
    0%      { opacity: 0; z-index: 2; }
    2.14%   { opacity: 1; z-index: 2; }
    2.15%   { opacity: 1; z-index: 1; }
    16.43%  { opacity: 1; z-index: 1; }
    16.44%  { opacity: 0; z-index: 1; }
    100%    { opacity: 0; z-index: 1; }
  }
}

/* "Don't see your venue?" panel: reuses the theme's .why and .split styles, with the same gap above it as between cards */
.cards + .why { margin-top: var(--gutter); }

/* Card videos (both 1280 x 720, so a fixed 16:9 box; Safari would otherwise size the box from the poster).
   Both sit inside the card with a gap left, right and bottom of half the card padding, and are used together with .card-image.
   .signage-video-inset  rounded corners (0.9rem)
   .signage-video-sharp  almost square corners (4px) */
.signage-video-inset, .signage-video-sharp {
  width: calc(100% + var(--pad));
  margin: auto calc(var(--pad) * -0.5) calc(var(--pad) * -0.5);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 0 1.1rem 0.15rem color-mix(in srgb, var(--ring-b) 55%, transparent), 0 0 0.25rem color-mix(in srgb, var(--ring-b) 30%, transparent);   /* an even glow in the page's warm ring colour, same distance on all sides; kept within the half-padding gap because the card clips anything past its edge */
}
.signage-video-inset { border-radius: 0.9rem; }
.signage-video-sharp { border-radius: 4px; }

/* The café and honours board cards share the row 50 / 50 on wide screens (the theme makes the first one wider) */
@container content (min-width: 52rem) {
  .page-digital-signage .cards-bento .card, .page-digital-signage .cards-bento .card-wide { grid-column: span 6; }
}

/* Four-up row of text cards: the theme makes every 4th small card dark, but this page keeps all its cards the page tint */
.page-digital-signage .cards-small .card:nth-child(4) {
  --text-heading: inherit;
  --text-body: inherit;
  background: linear-gradient(180deg, var(--tint-top), var(--tint-bottom));
  color: var(--text-body);
}

/* Last row of plain sector cards: five across on wide screens (the theme's default is four) */
@container content (min-width: 60rem) {
  .cards-small.cards-five { grid-template-columns: repeat(5, 1fr); }
  .cards-small.cards-five .card { --pad: var(--space-3); }   /* slimmer padding so the headings fit the narrower cards */
}

/* Phones and tablets: tighter cards so the "Who it's for" section is much shorter. The plain sector cards sit two across with smaller headings
   (the last one fills the row so there is no gap), and every card gets less padding and a smaller gap. Desktop goes back to the theme's sizes below:
   the big cards at 52rem (when they sit two across) and the plain cards at 60rem (when they sit four across). */
.page-digital-signage .cards { gap: var(--space-2); }
.page-digital-signage .cards + .cards { margin-top: var(--space-2); }
.page-digital-signage .cards .card { --pad: var(--space-3); }
.page-digital-signage .cards-bento h3 { font-size: calc(var(--step-1) * 1.2); margin-bottom: var(--space-2); }
.page-digital-signage .cards-small { grid-template-columns: 1fr 1fr; }
.page-digital-signage .cards-small .card { --pad: var(--space-2); }
.page-digital-signage .cards-small .card h4 { font-size: var(--step-1); }
.page-digital-signage .cards-small.cards-three .card:last-child { grid-column: 1 / -1; }
@container content (min-width: 52rem) {
  .page-digital-signage .cards-bento { gap: var(--gutter); }
  .page-digital-signage .cards-bento .card { --pad: var(--space-4); }
  .page-digital-signage .cards-bento h3 { font-size: var(--card-heading-size); margin-bottom: var(--space-3); }
}
@container content (min-width: 60rem) {
  .page-digital-signage .cards-small { grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
  .page-digital-signage .cards-small.cards-three { grid-template-columns: repeat(3, 1fr); }
  .page-digital-signage .cards-small .card { --pad: var(--space-4); }
  .page-digital-signage .cards-small .card h4 { font-size: var(--card-heading-size); }
  .page-digital-signage .cards-small.cards-three .card:last-child { grid-column: auto; }
  .page-digital-signage .cards + .cards { margin-top: var(--gutter); }
}
