/* =====================================================================
   Success story pages (25 of them)

   One layout serves every story: a deep blue strip under the header, the
   name and company, a short standfirst, then one "property" block per
   deal, each with a photo strip and sometimes a row of video stills.
   Written phone first, like site.css; the breakpoints are the same
   (768px and 1025px).

   The vocabulary, in the order it appears on a page:

     .story__band            the empty blue strip at the top
     .story                  the page body
     .story__intro             .story__title      the name (h1)
                               .story__meta       company, dates, city
                               .story__lead       the standfirst
     .story__rule            a divider between blocks
     .story__property          .story__property-title
                               a paragraph or two
                               .story__carousel   the photo strip
                                 .story__slides > .story__slide
                                 .story__arrow--prev / --next
                               .story__videos     a row of video stills
                                 .story__video > .story__video-link
                                   .story__video-btn
     .story__gap             an empty vertical spacer

   Sizes that change from page to page are custom properties set in the
   page's own markup, on the element they belong to, never new classes:

     --slide-hm   photo strip height on a phone          (250px)
     --slide-h    ... from tablet up                     (350px)
     --slide-mt   space above the strip on a phone       (14px)
     --slide-mt-lg  ... from tablet up                   (0)
     --rule-mt    space above a divider, from tablet up  (19px)
     --rule-mb    ... below it                           (10px)
     --gap-h      height of a .story__gap on a phone     (20px)
     --gap-h-lg   ... from tablet up                     (10px)
     --title-mt   space above a deal title, tablet up    (15px)

   Modifiers, for choices rather than sizes:

     .story__lead--left      keeps the standfirst at the left margin
     .story__carousel--fit   fits each picture inside the frame instead
                             of cropping it to fill
     .story__videos--2 / --3 how many stills sit side by side
   ===================================================================== */

/* the empty deep blue strip the stories open with, in place of a title
   banner. The live pages have no words in it. */
.story__band { height: 145px; background: var(--blue-dark); }

.story { padding-block: 30px; }

/* ------------------------------------------------------- the title block */

.story__title {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 28px;
  line-height: 1.5;
  text-align: left;
}

.story__meta {
  margin: 0;
  font: 300 18px/1.5 var(--font-head);
  color: var(--ink-strong);
  text-align: center;
}

.story__lead { margin: 14px 0 20px; text-align: center; }
.story__lead p { margin: 0; }
.story__lead--left { text-align: left; }

/* ------------------------------------------------------ one deal (block) */

.story__rule {
  border: 0;
  border-top: 2px solid grey;
  margin: 10px 0;
}

.story__property-title {
  margin: 27px 0 9px;
  color: var(--blue);
  font-size: 18px;
  line-height: 1.32;
}

.story__property { display: flow-root; }
.story__property p { margin: 0; }

/* fixed vertical gaps the live pages set between blocks */
.story__gap { height: var(--gap-h, 20px); }

/* ---------------------------------------------------------- the carousel */

/* A horizontal strip of photographs, one in view at a time. It scrolls
   with a swipe, a trackpad or the arrows. The arrows are links to the
   next and previous slide, so the strip works with no script at all;
   site.js upgrades them in place. */
.story__carousel { position: relative; margin-top: var(--slide-mt, 14px); }

.story__slides {
  display: flex;
  height: var(--slide-hm, 250px);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}
.story__slides::-webkit-scrollbar { display: none; }

.story__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
}
.story__slide img { width: 100%; height: 100%; object-fit: cover; }

/* pages whose photographs are wide before-and-after boards are set to sit
   inside the frame rather than fill it, the way the live pages do */
.story__carousel--fit .story__slide img { object-fit: contain; }

.story__arrow {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  color: var(--white);
  text-decoration: none;
}
.story__arrow::before {
  content: "";
  position: absolute;
  top: 13px;
  width: 17px;
  height: 17px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.story__arrow--prev { left: 3px; }
.story__arrow--prev::before { left: 17px; transform: rotate(-135deg); }
.story__arrow--next { right: 3px; }
.story__arrow--next::before { right: 17px; transform: rotate(45deg); }
.story__arrow:hover::before { border-color: var(--blue); }

/* ------------------------------------------- video stills under a deal */

.story__videos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 14px;
}
.story__video { position: relative; margin: 0; }
.story__video img { width: 100%; height: 184px; object-fit: cover; }
.story__video-link { display: block; position: relative; text-decoration: none; }

.story__video-btn {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 14px;
  border: 2px solid var(--blue-dark);
  border-radius: 50px;
  background: rgba(255, 255, 255, .15);
  color: var(--blue-dark);
  font: 700 16px/1.3 var(--font-body);
  text-align: center;
}
.story__video-link:hover .story__video-btn,
.story__video-link:focus-visible .story__video-btn {
  background: var(--blue-dark);
  color: var(--white);
}

/* ------------------------------------------- tablet and desktop sizes */

@media (min-width: 768px) {
  .story__band { height: 119px; }
  .story { padding: 100px 0 30px; }

  .story__title { margin-bottom: 0; font-size: 50px; line-height: .94; text-align: center; }
  .story__meta { font-size: 25px; }

  /* the standfirst sits in a narrower, centred column */
  .story__lead {
    width: 726px;
    max-width: calc(100% - 117px);
    margin: 26px auto 15px;
  }
  .story__lead p { text-align: center; }

  /* the live pages set the space around every divider separately, so the
     page carries the two margins and this is only the common default */
  .story__rule { margin: var(--rule-mt, 19px) 0 var(--rule-mb, 10px); }

  .story__property-title {
    margin: var(--title-mt, 15px) 0 0;
    padding-bottom: 2px;
    font-size: 25px;
    line-height: normal;
  }
  .story__property-title + p { margin-top: 17px; }

  .story__gap { height: var(--gap-h-lg, 10px); }

  .story__carousel { margin-top: var(--slide-mt-lg, 0px); }
  .story__slides { height: var(--slide-h, 350px); }

  .story__videos { gap: 6px; margin-top: 18px; padding-inline: 5px; }
  .story__videos--2 { grid-template-columns: repeat(2, 1fr); }
  .story__videos--3 { grid-template-columns: repeat(3, 1fr); }
  .story__video img { height: 280px; }
}

/* on a tablet the play button sits under its still, as it does today */
@media (min-width: 768px) and (max-width: 1024px) {
  .story__videos { margin-bottom: 30px; }
  .story__video-link { display: grid; }
  .story__video-btn {
    position: static;
    transform: none;
    justify-self: center;
    width: 100px;
    margin-top: 26px;
    padding: 11px 10px;
    background: transparent;
  }
}

@media (min-width: 1025px) {
  .story__band { height: 116px; }

  /* on a desktop the play button only shows when the still is pointed at
     or focused, the way the live pages behave */
  .story__video-btn { visibility: hidden; opacity: 0; transition: opacity .15s; }
  .story__video-link:hover .story__video-btn,
  .story__video-link:focus-visible .story__video-btn { visibility: visible; opacity: 1; }
}
