
/* ===== THE VIDEO RAIL (videorail.py) ===================================
   The rail itself is services_page.py's, copied rather than reinterpreted,
   because Matt asked whether there was a precedent and there was. Only the
   things a video card needs that a link card does not are written here. */
section.vr{padding:clamp(84px,9vh,124px) 0 clamp(88px,10vh,132px);}

/* the rail component, as the services index sets it */
.vr .op-top{margin-bottom:48px;display:flex;align-items:flex-end;
  justify-content:space-between;gap:32px;}
.vr .rl-bar{display:flex;gap:14px;flex:0 0 auto;}
.vr .rl-btn{width:60px;height:60px;border-radius:50%;border:0;cursor:pointer;
  display:grid;place-items:center;background:rgba(255,255,255,.07);color:#fff;
  transition:background .25s,color .25s,opacity .25s;}
.vr .rl-btn svg{width:26px;height:26px;}
.vr .rl-next svg{transform:scaleX(-1);}
.vr .rl-btn:hover{background:var(--aqua,#00eac8);color:#0b0f2e;}
.vr .rl-btn[disabled]{opacity:.3;cursor:default;
  background:rgba(255,255,255,.07);color:#fff;}
/* the 23 September trackpad fix comes with it: a horizontal scroller with
   mandatory snapping eats part of a sideways gesture, so the rail keeps its
   scrolling to itself and snapping is left to touch */
.vr .rl{display:grid;grid-auto-flow:column;
  grid-auto-columns:calc((100% - 3 * 28px) / 4);gap:28px;overflow-x:auto;
  scroll-behavior:smooth;overscroll-behavior-x:contain;scroll-snap-type:none;
  scrollbar-width:none;outline:none;}
@media (hover:none){.vr .rl{scroll-snap-type:x proximity;}}
.vr .rl::-webkit-scrollbar{display:none;}
.vr .rl-card{scroll-snap-align:start;display:flex;flex-direction:column;
  color:#fff;text-align:left;background:none;border:0;padding:0;
  cursor:pointer;font:inherit;}
/* NINE BY SIXTEEN. Matt, 24 September: "more portrait shaped, as close to
   widescreen tall but vertical as possible." Widescreen stood on its end is
   9:16, so that is the frame, and every poster is now cut to it rather than
   being letterboxed or cropped by the browser. */
.vr .rl-ph{position:relative;display:block;overflow:hidden;border-radius:26px;
  aspect-ratio:9/16;background:#12173d;}
.vr .rl-ph i{position:absolute;inset:0;background-size:cover;
  background-position:center;
  transition:transform 1.2s cubic-bezier(.22,1,.36,1);}
.vr .rl-card:hover .rl-ph i{transform:scale(1.07);}
.vr .rl-cat{margin-top:24px;font-size:14px;color:rgba(255,255,255,.55);
  letter-spacing:.2px;text-transform:uppercase;}
/* THE TITLE IS THE SITE'S STANDARD TEXT, NOT A HEADING. Matt, 19
   October, with a shot of the icon tier's label beside the rail: "Video
   titles in the standard text (like the Quality testing one attached)."

   It was 24px at 600 in solid white with -0.4px of tracking, which is
   heading weight on a line that is not a heading: a video's own title,
   written by whoever uploaded it, sitting under a thumbnail that
   already carries a play disc and a duration. Four of them in a row
   read as four headings and out-shouted the section head above them.

   .wy-i's label is what Matt pointed at and these are its numbers,
   measured off the page: 16px at 400 in 82 per cent white, normal
   tracking, 1.45 line height. Left aligned rather than centred, because
   the rail is a left aligned row and centring is a change he did not
   ask for. */
.vr .vp-ttl{display:block;margin-top:14px;font-size:16px;font-weight:400;
  letter-spacing:normal;color:rgba(255,255,255,.82);line-height:1.45;}

/* THE PLAY DISC. Matt, 24 September: "white, partially transparent, with
   that blue triangle arrow." It was the other way round, a solid aqua disc
   with a navy triangle, which put the brand colour on the photograph as a
   blob rather than using it as the mark.

   THEN THE TRIANGLE WENT DARK BLUE AND THE DISC GOT AN AURA: "can the
   triangle arrows in the play buttons be dark blue please. I wonder if we
   could add an aura around the circle to make it look more attractive to
   press too?"

   The triangle is #0b0f2e, which is the page's own ground rather than a new
   blue, so the mark is the site's darkest colour on the site's lightest
   surface and nothing new enters the palette.

   THE AURA IS ON BY DEFAULT, NOT ON HOVER. A hover effect does nothing on a
   phone, and these cards get looked at on a phone. So the glow sits behind
   the disc at all times and breathes slowly, which is what draws the eye to
   a thing worth pressing; hover brightens it rather than creating it. It is
   the aqua, and it is the same language as the Ask us bubble in the corner,
   which already glows, so this is the site's existing idea applied again
   rather than a new effect invented for one component. */
/* 76px rather than the prototype's 58. The card is half as wide again here,
   three across a 1332px measure instead of five in a 290px rail, and a disc
   sized for the old card reads as a dot on this one. */
.vr .vp-play{position:absolute;left:50%;top:50%;width:76px;height:76px;
  margin:-38px 0 0 -38px;border-radius:999px;
  background:rgba(255,255,255,.93);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  box-shadow:0 10px 30px -10px rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;z-index:2;
  transition:transform .35s cubic-bezier(.22,1,.36,1),background .25s;}
.vr .rl-card:hover .vp-play,
.vr .rl-card:focus-visible .vp-play{transform:scale(1.08);
  background:rgba(255,255,255,.96);}
.vr .vp-tri{width:29px;height:29px;fill:#0b0f2e;margin-left:4px;}

/* NO AURA. Matt, 24 September: "the glow on the video play buttons doesn't
   really work, let's remove that idea for now."

   It went through three versions and none of them was right. A filled
   radial sat under a disc that is not fully opaque and turned the whole
   button mint. A ring cleared the disc and read as a hard green smear over
   the pale photographs. Blurring it made it look emitted rather than drawn,
   which was better and still not good: on a card that is already a
   photograph with a white disc on it, a coloured bloom is one more thing
   competing for the same small area.

   The disc on its own is enough of a button. Leaving the note here because
   the idea was reasonable and someone will have it again. */

.vr .rl-card.live .vp-play,.vr .rl-card.live .rl-ph i{display:none;}
.vr .rl-card.live{cursor:default;}
.vr .rl-card.live .rl-ph{background:#000;}
.vr .rl-card video{position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;border:0;border-radius:26px;background:#000;}
/* AND cover HAS TO STOP AT THE EDGE OF THE CARD. Matt, 27 October:
   "They are phone portrait format - so if a user hits 'full screen
   view' icon - how do we contain that? Currently it fills the screen
   on my macbook losing top and bottom thirds."

   object-fit:cover is right for the card, where a 9:16 film has to
   fill a frame that is not 9:16 and cropping is the point. It is
   wrong the moment the element is the whole screen: the browser hands
   the video a 16:9 box, cover scales the film until it covers that,
   and two thirds of a portrait frame goes past the top and bottom
   edges. The film is not letterboxed, it is cropped, and the viewer
   has no way to get the rest back.

   contain is the fullscreen answer: same film, scaled to fit, black
   either side. The radius goes too, because a 26px corner on a
   fullscreen video leaves four lit notches on a black screen.

   TWO RULES AND NOT ONE SELECTOR LIST. Safari understands only
   :-webkit-full-screen and Chrome and Firefox only :fullscreen, and a
   selector list containing one the browser cannot parse is a rule
   that browser drops entirely. Separately, each lands where it can. */
.vr .rl-card video:fullscreen{object-fit:contain;border-radius:0;}
.vr .rl-card video:-webkit-full-screen{object-fit:contain;border-radius:0;}
.vr-note{margin:34px 0 0;font-size:14px;line-height:1.7;
  color:rgba(255,255,255,.5);max-width:58em;}
@media (max-width:900px){
  .vr .op-top{flex-direction:column;align-items:flex-start;gap:14px;}
  .vr .rl-bar{display:none;}
  .vr .rl{grid-auto-columns:82%;gap:18px;}
  .vr .rl-btn{width:48px;height:48px;}
}
@media (prefers-reduced-motion:reduce){
  .vr .rl{scroll-behavior:auto;}
  .vr .rl-card,.vr .vp-play,.vr .rl-btn,.vr .rl-ph i{transition:none;}
}
