/*
  Styles for body blocks that did not exist on the legacy site.

  Kept out of public/css/style.css on purpose. That file is the legacy
  stylesheet shipped verbatim from the old build - 20,000 lines with a
  sourceMappingURL on the end - and the whole parity argument for this rebuild
  rests on it being byte-identical to what the old site served. Anything new
  goes here instead, where it can be read in one screen.

  Loaded after style.css by src/components/Head.astro, so these rules win on a
  tie without needing !important.
*/

/* ---------------------------------------------------------------------------
   Image row  -  src/lib/portable-text.ts, `imageRow`

   Two to four images side by side from the `sm` breakpoint up, stacked one per
   row below it. The arrangement itself is Bootstrap 3's grid, which is already
   in style.css; everything here is spacing and the lightbox affordance.
--------------------------------------------------------------------------- */

.image-row {
  margin-bottom: 10px;
}

.image-row-cell {
  margin-bottom: 20px;
}

.image-row-figure {
  margin: 0;
}

/*
  `.img-responsive` already caps the image at the cell width. The auto margins
  are for the other case - an asset narrower than its cell, which would
  otherwise sit hard against the left edge while its neighbour filled the full
  column. Nothing is stretched to fit: upscaling a small original to match its
  neighbour looks worse than the gap does.
*/
.image-row-img {
  margin-left: auto;
  margin-right: auto;
  border-radius: 4px;
}

/*
  Below 676px init-min.js disables Magnific Popup and the anchor falls through
  to opening the image directly, so the hover state is only meaningful where a
  pointer exists anyway.
*/
.image-row a.popup-image {
  display: block;
}

.image-row a.popup-image:hover .image-row-img,
.image-row a.popup-image:focus .image-row-img {
  opacity: 0.88;
}

/*
  The mat frame, drawn rather than baked into the JPEG.

  The colours are sampled from the composites this replaces: the mat measured
  #141511 across all six, and the inner line is pure white, 3px at the stored
  size. Drawing it means it stays a crisp 3px at every display size instead of
  being resampled with the photograph, and - because the frame wraps the image
  inside the anchor - the lightbox opens the photograph on its own.

  The quilted texture in the originals is not reproduced. It is a near-black
  pattern at about 4% contrast that is invisible at the size these display, and
  no seamless tile can be cut from a 35px border anyway.
*/
.image-row-frame {
  display: block;
  padding: 12px;
  background-color: #141511;
  border-radius: 3px;
}

/*
  `box-sizing` is set rather than assumed: `.img-responsive` caps the image at
  `max-width: 100%`, which under the legacy stylesheet's content-box sizing
  measures the content alone - so a full-width image plus its 3px border
  overflows the mat by 6px.
*/
.image-row-frame .image-row-img {
  box-sizing: border-box;
  border: 3px solid #ffffff;
  border-radius: 0;
}

@media (min-width: 768px) {
  .image-row-frame {
    padding: 16px;
  }
}

.image-row-caption {
  line-height: 20px;
  margin-top: 8px;
  color: #333333;
  font-weight: 500;
}

@media (min-width: 768px) {
  .image-row {
    margin-bottom: 20px;
  }

  .image-row-cell {
    margin-bottom: 30px;
  }
}

/* ---------------------------------------------------------------------------
   Mobile gutters in body copy

   Three separate ways content reached the edge of a phone screen. All three
   are inherited from the legacy markup and all three only show below the
   point where the layout stops being a grid, which is why they survived a
   desktop review.

   None of this changes a desktop. Every rule is either inert above 767px or
   scoped to something that only misbehaves when the column is narrower than
   the content inside it.
--------------------------------------------------------------------------- */

/*
  1. THE CAROUSEL CAPTION.

  `.galleryname` is an absolutely positioned overlay pinned `left: 0; right: 0`
  across the full width of the slider. On a desktop the titles are short and
  sit well inside, so nothing showed. On a phone "Small & Slimline Sheds" and
  "Pre-Painted Steel Gallery" wrap and fill the line, putting the first and
  last characters hard against the screen edge.

  Bootstrap sets `box-sizing: border-box` globally, so padding comes out of
  the 100% rather than adding to it and the overlay stays pinned.
*/
.galleryname {
  padding-left: 15px;
  padding-right: 15px;
}

/*
  2. `.row` USED AS A PLAIN WRAPPER IN BODY COPY.

  Bootstrap's `.row` carries `margin: 0 -15px` on the assumption that it sits
  inside a `.container` or a `.col-*`, whose 15px padding cancels it out. The
  migrated WYSIWYG copy uses `.row` as an ordinary block wrapper inside
  `.copy`, which has no padding of its own - so the negative margins have
  nothing to cancel against and drag the text 15px past the gutter on both
  sides. One heading on the steel page is itself `<h4 class="row">`.

  Only rows with no columns in them are corrected. A row that really is a
  grid still needs its negative margins, and `:has()` is what tells the two
  apart - without it this would re-indent every genuine grid in body copy.
*/
.copy .row:not(:has(> [class*="col-"])) {
  margin-left: 0;
  margin-right: 0;
}

/*
  3. BODY IMAGES WIDER THAN THE PHONE.

  style.css has no `img { max-width: 100% }` outside its `@media print` block,
  so a body image renders at whatever width the editor typed into the tag -
  402px for the maintenance photo on the timber page, 800px for the colour
  chart on the steel page. `html, body { overflow-x: hidden }` hides the
  consequence by clipping it, which is why this reads as "touches the left
  edge" rather than as a page that scrolls sideways.

  Left as `inline` rather than Bootstrap's `.img-responsive` block, so a
  floated image still wraps its text on a desktop.

  `.sub-content` is the same problem on /why-choose-us/, where the body is a
  tab panel rather than a `.copy` block - a 750px photograph in a 345px
  column. Named explicitly rather than widening this to `#wrapper img`: the
  Revolution Slider sizes its own slides and `.rev-slidebg` in particular,
  and capping those would break the carousels.
*/
.copy img,
.sub-content img {
  max-width: 100%;
  height: auto;
}

/*
  A floated image needs more than a width cap once it fills the column. The
  legacy float keeps a 30px margin on its inner side, and margin plus a full
  width column is wider than the column - so the float still hangs 30px off
  the edge, which is exactly the "touches the left edge, gap on the right"
  the timber page shows. Below the grid breakpoint it stops floating and
  centres instead, which is what the homepage feature images already do.
*/
@media (max-width: 767px) {
  .copy .image-left,
  .copy .image-right {
    float: none !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------------------------------------------------------------------------
   Section label and page title  -  the news, gallery and specification
   templates in src/templates/

   Those three templates used to put the SECTION word in the `h1` - "News" on
   all 21 articles, "Gallery" on all nine category pages, "Specification" on
   all six - and the page's own title in an `h2`. 36 pages whose top-level
   heading said nothing about them, and whose actual subject sat a level
   down. Weak for search, and worse for anyone navigating by headings.

   The tags are now the other way round. NOTHING ABOUT THE PAGE MOVES: every
   value below is copied from the style.css rule that used to apply to the
   tag being replaced, so the label still renders as that `h1` did and the
   title still renders as that `h2` did. The source rule is named above each
   block - if one of them is ever edited, edit its twin here.

   style.css itself is untouched, as with everything in this file.
--------------------------------------------------------------------------- */

/*
  THE LABEL. Was an `h1`; now a `p`, which inherits none of a heading's
  typography, so all of it is restated here.

  style.css: `h1, h2, ... { font-family: "proxima-nova", ... }`
             `h1 { color: #00A58C; font-weight: 300; font-size: 48px; line-height: 54px }`
             `h1, .h1, h2, ... { margin-top: 20px; margin-bottom: 10px }`
*/
.section-eyebrow {
  font-family: "proxima-nova", Helvetica, Arial, sans-serif;
  color: #00A58C;
  font-weight: 300;
  font-size: 48px;
  line-height: 54px;
  margin-top: 20px;
  margin-bottom: 10px;
}

/*
  News. The label sits in `.page-intro`, OUTSIDE `.copy`, so the `.copy h1`
  rules below never reached it - it keeps the plain 54px line-height at every
  width. That asymmetry with gallery and specification is legacy behaviour,
  not an oversight.

  style.css: `.page-intro h1 { margin-top: 11px !important; margin-bottom: 0 }`
*/
.page-intro .section-eyebrow {
  margin-top: 11px;
  margin-bottom: 0;
}

/* style.css: `@media (min-width: 768px) { .page-intro h1 { margin-bottom: 35px } }` */
@media (min-width: 768px) {
  .page-intro .section-eyebrow {
    margin-bottom: 35px;
  }
}

/*
  Gallery and specification, where the label IS inside `.copy`.

  style.css: `.copy h1 { line-height: 50px; margin-top: 11px; margin-bottom: 20px }`
*/
.copy .section-eyebrow {
  line-height: 50px;
  margin-top: 11px;
  margin-bottom: 20px;
}

/* style.css: `@media (min-width: 768px) { .copy h1 { margin-bottom: 35px } }` */
@media (min-width: 768px) {
  .copy .section-eyebrow {
    margin-bottom: 35px;
  }
}

/* style.css: `@media (max-width: 767px) { .copy h1 { font-size: 48px; line-height: 54px } }` */
@media (max-width: 767px) {
  .copy .section-eyebrow {
    line-height: 54px;
  }
}

/*
  THE TITLE. Was an `h2`; now an `h1`, so every `h1` rule in style.css is
  now pointed at it and has to be undone back to the h2 values.

  style.css: `h2 { color: #253746; font-size: 30px; line-height: 32px;
                   margin-top: 15px; margin-bottom: 15px }`
*/
.section-title {
  color: #253746;
  font-weight: 400;
  font-size: 30px;
  line-height: 32px;
  margin-top: 15px;
  margin-bottom: 15px;
}

/*
  Restated at `.copy .section-title` purely for weight: `.copy h1` scores one
  class and one tag, which outranks the single class above, so without this
  the title inside `.copy` would take the LABEL's 50px line-height and 11px
  top margin on all three templates.
*/
.copy .section-title {
  font-size: 30px;
  line-height: 32px;
  margin-top: 15px;
  margin-bottom: 15px;
}

/*
  style.css: `@media (max-width: 767px) { .copy h2 { font-size: 24px; line-height: 24px } }`

  Only the font-size is carried over. That rule's line-height never actually
  applied to anything: the `!important` below outranks it, so the old `h2`
  measured 42px on a phone, not 24px. Reproducing the rule as written would
  have been a visible change dressed up as parity.
*/
@media (max-width: 767px) {
  .copy .section-title {
    font-size: 24px;
  }
}

/*
  style.css: `@media (max-width: 992px) { h2, strong { line-height: 42px !important } }`
             `@media (max-width: 1200px) { h2, strong { line-height: 42px !important } }`

  Two rules, one effect: every `h2` on the site is 42px below 1200px. The
  title is no longer an `h2`, so it no longer collects this and has to be
  told. Last in this block deliberately - it has to outrank the
  `.copy .section-title` above at equal specificity.
*/
@media (max-width: 1200px) {
  .section-title,
  .copy .section-title {
    line-height: 42px;
  }
}

/*
  Gallery only - its title is a direct child of `.copy`. The specification
  title is nested inside `.specification-content`, so it never matched this
  and keeps the 15px above.

  style.css: `.copy > h2 { margin-bottom: 20px }`
*/
.copy > .section-title {
  margin-bottom: 20px;
}

/* style.css: `.news-article-detail .copy > h2 { margin-bottom: 10px }` */
.news-article-detail .copy > .section-title {
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------------
   Split section  -  src/lib/portable-text.ts, `splitSection`

   A picture beside a block of copy. Replaces the homepage's two `.hp-feature`
   divs, which were pasted HTML: a `<p><img class="image-left"></p>` floated
   out of the flow, with the copy flowing around it.

   Flex rather than a float, for one behaviour the float could not give. A
   float only holds a column while the copy is shorter than the picture; the
   moment an editor adds a paragraph, the text wraps underneath and the
   section silently stops being two columns. A flex row cannot do that.

   THE IMAGE IS ALWAYS FIRST IN THE DOM. `split-section-right` reverses the
   row, so choosing a side is a desktop-only decision and the stacked order on
   a phone is picture, heading, copy for every section on the page.

   457px is the width both homepage pictures were pasted in at, and holding it
   here means the copy column is the same 583px at `lg` and 383px at `md` that
   those sections have always rendered at. Mirrored by SPLIT_MEDIA_WIDTH in
   src/lib/portable-text.ts, which sizes the `srcset` - change both.
--------------------------------------------------------------------------- */

.split-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 50px;
  padding-left: 10px;
  padding-right: 10px;
  background: #fff;
  text-align: center;
}

.split-section-media {
  margin-top: 10px;
}

/*
  `.img-responsive` is `display: block` with auto margins missing, so a picture
  narrower than the column would sit hard left while the copy above it is
  centred.
*/
.split-section-media img {
  margin-left: auto;
  margin-right: auto;
}

.split-section-copy > :last-child {
  margin-bottom: 0;
}

@media (min-width: 550px) {
  .split-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .split-section-media {
    margin-top: 30px;
  }
}

/*
  Centred copy is the legacy look and is kept, but only where the measure is
  wide enough to carry it. On a phone a centred ragged-both paragraph is hard
  to read, and the old stylesheet already forced these two sections left below
  768px - see `.homepage-content .hp-feature h3` in style.css.
*/
@media (max-width: 767px) {
  .split-section {
    text-align: left;
  }
}

@media (min-width: 992px) {
  .split-section {
    flex-direction: row;
    align-items: flex-start;
    gap: 50px;
  }

  /*
    The gutter on the far side of the copy. Together with the 50px gap it is
    what makes the copy column 583px inside the 1170px container, matching the
    floated original - see `.homepage-content .hp-feature.hp-feature-left` in
    style.css, which did the same job with padding on one side and a 50px
    margin on the image.
  */
  .split-section-left {
    padding-left: 0;
    padding-right: 50px;
  }

  .split-section-right {
    flex-direction: row-reverse;
    padding-left: 50px;
    padding-right: 0;
  }

  /*
    `0 1 457px` rather than a percentage: the picture holds its pasted width
    at both desktop container sizes and only gives ground if the copy column
    cannot fit, which is what the floated version did.
  */
  .split-section-media {
    flex: 0 1 457px;
    margin-top: 0;
  }

  .split-section-copy {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ---------------------------------------------------------------------------
   Video embed  -  src/components/blocks/VideoEmbed.astro

   A ratio box with an absolutely positioned iframe inside it. The box's height
   comes from `padding-top` set inline from the stored ratio, which is the same
   technique as Bootstrap 3's `.embed-responsive` in style.css - except that one
   hard-codes 56.25% in a class, and this ratio is content.

   Not reusing `.embed-responsive-16by9` directly is deliberate: a 21:9 or a
   vertical video would need a Bootstrap class that does not exist, and adding
   ratio classes to the legacy stylesheet is exactly what blocks.css is here to
   avoid.
--------------------------------------------------------------------------- */

.video-embed {
  margin-bottom: 20px;
}

/*
  Full width means full width of the page, with no gutter and nothing stacked
  beside it. On the homepage this sits directly above the slider, which is
  itself edge to edge, so any margin here would read as a gap between the two
  rather than as spacing.
*/
.video-embed-full {
  margin-bottom: 0;
}

.video-embed-frame {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  overflow: hidden;
  /*
    Shown while the player loads, and behind a video whose stored ratio is
    taller than the file itself. Black rather than the page background because
    that is what the letterboxing inside the player is, so the seam does not
    show.
  */
  background-color: #000000;
}

.video-embed-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/*
  Background mode: the video started on its own, is muted and looping, and the
  player was asked for no controls. `controls=0` is the real fix and this is
  the belt to its braces - both Vimeo and YouTube still answer a click inside
  the frame (play/pause, and YouTube's logo opens a new tab), which on a video
  that is decoration rather than content is only ever an accident.

  Scoped to the modifier, so an ordinary embedded video stays fully operable.
*/
.video-embed-background .video-embed-frame iframe {
  pointer-events: none;
}

/*
  The homepage hero, cropped so the icon row below it is on screen.

  At 16:9 the hero is 801px tall on a 1440x900 laptop, which puts the
  Fully Customised / Premium Quality / Superior Style / Exceptional Value row
  227px below the fold - a visitor has to scroll before there is anything to
  read. So on desktop the hero is capped at the height left over once the
  header and that row are accounted for, and the video is cropped top and
  bottom to fill it.

  An iframe cannot be `object-fit: cover` - the player letterboxes inside
  whatever box it is given rather than overflowing it. So the frame keeps its
  `overflow: hidden` and the iframe is made large enough to cover the frame
  and centred, which crops it to the same effect.

  Both subtracted heights are measured, not guessed, and they are measured
  with the page at the top: the header shrinks from 216px to 168px once the
  visitor scrolls, and it is the unscrolled height that decides whether the
  row is visible without scrolling.

      >= 1200px   header 216 + row 110 = 326
      992-1199    header 220 + row 132 = 352

  Below 992px none of this applies: the nav collapses to a burger, the row
  becomes two rows of two, and a cropped hero on a phone would be a letterbox
  slot. The ratio box in VideoEmbed.astro governs there, as before.

  If the nav gains an item, or the icon row gains a fifth, re-measure these.
*/
@media (min-width: 992px) {
  .video-embed-full {
    --hero-chrome: 352px;
    --hero-height: calc(100vh - var(--hero-chrome));
  }

  /*
    `!important` because the ratio box is an inline style on the element, and
    an inline declaration outranks any selector here. It is the one thing in
    this file that cannot be done with specificity.
  */
  .video-embed-full .video-embed-frame {
    padding-top: 0 !important;
    height: var(--hero-height);
  }

  /*
    Whichever is bigger - the frame's own width, or the width this video needs
    in order to be as tall as the frame. `--video-ar` is the video's real
    width-over-height, so a 4:3 hero crops correctly too.
  */
  .video-embed-full .video-embed-frame iframe {
    top: 50%;
    left: 50%;
    width: max(100%, calc(var(--hero-height) * var(--video-ar, 1.7778)));
    height: auto;
    aspect-ratio: var(--video-ar, 1.7778);
    transform: translate(-50%, -50%);
  }
}

@media (min-width: 1200px) {
  .video-embed-full {
    --hero-chrome: 326px;
  }
}

/*
  Short viewports: let the bottom of the icon row run off the screen, so the
  hero keeps some height.

  The allowance above is a constant but the thing it is subtracted from is
  not, so the hero collapses as the screen gets shorter - 574px tall on a
  900px viewport, 274px on the 600px viewport a 1080p 13" laptop has at 150%
  scaling. At 1280 wide that last one is a 4.7:1 slot, and a centre crop that
  narrow takes the heads off the two men the video opens on.

  So below 850px of viewport height the row is allowed less than its full
  height. The offsets below are measured off a render, not computed from the
  stylesheet - "ink" is where the glyphs actually land, which is lower than
  the line box for a descender and higher for the uppercase link:

      row at >= 1200px, 110px tall     row at 992-1199, 132px tall
      0-24    padding                  0-24    padding
      24-34   h4 margin                24-34   h4 margin
      34-56   HEADING (ink to 60)      34-78   HEADING, two lines (ink to 82)
      56-71   gap        <- cut at 64  71-79   MORE INFO ink  } overlapping,
      71-79   MORE INFO ink            56-82   second line    } see below
      79-110  padding                  82-132  padding

  The two brackets need different answers because the headings wrap
  differently and the cells do not agree with each other. At 1100px
  "Fully Customised" and "Exceptional Value" take two lines while "Premium
  Quality" and "Superior Style" take one - the row is sized by the tall ones,
  so the short ones put MORE INFO exactly where the tall ones put their second
  line. There is no cut that keeps a two-line heading whole and still hides
  the link, so that bracket shows the lot and only drops the padding.

      >= 1200px   216 header + 64 of the row = 280   (was 326, +46px of video)
      992-1199    216 header + 88 of the row = 304   (was 352, +48px of video)

  At 64 the heading clears its descenders by 4px and the link is 7px below the
  fold; the 64px icon, vertically centred at 23-87, is sliced just past its
  widest point. It reads as a deliberate peek rather than a clipped line of
  type, and says there is more below. Giving up MORE INFO costs nothing - the
  whole promise block links to the same place.

  850px is above every 13" laptop and below a 1080p desktop (~940px of
  viewport), so a full-size screen - where the row already fits and the hero
  is tall enough - is untouched.

  The header measures 216px at both widths. The 220 in the table above is off
  by 4; it is left alone because correcting it would move the tall-screen hero
  that is already signed off.

  These must stay after the 1200px block: same specificity, so source order
  is what makes the narrower pair of rules win on a wide short screen.

  Re-measure if the headings change length, the nav gains an item, or the row
  gains a fifth promise.
*/
@media (min-width: 992px) and (max-height: 850px) {
  .video-embed-full {
    --hero-chrome: 304px;
  }
}

@media (min-width: 1200px) and (max-height: 850px) {
  .video-embed-full {
    --hero-chrome: 280px;
  }
}

/* ---------------------------------------------------------------------------
   Colour swatches  -  src/lib/portable-text.ts, `colourSwatches`

   CSS Grid rather than Bootstrap's row/column, which the image row above uses.
   The difference is the one the block exists for: Bootstrap can only express
   "n across at this breakpoint", so a chart set to four across is four across
   at 360px too, at 70px a cell. `auto-fill` + `minmax` asks for a minimum
   readable width instead and fits however many will go - three across on a
   large phone, two on a small one - with no breakpoint doing the deciding.

   The desktop rule below then pins an exact count, because at full width
   `auto-fill` would keep packing them in and a chart of ten is clearer as a
   deliberate 4 + 4 + 2 than as however many happen to fit.
--------------------------------------------------------------------------- */

.colour-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  grid-gap: 24px 20px;
  gap: 24px 20px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .colour-swatches-2 { grid-template-columns: repeat(2, 1fr); }
  .colour-swatches-3 { grid-template-columns: repeat(3, 1fr); }
  .colour-swatches-4 { grid-template-columns: repeat(4, 1fr); }
  .colour-swatches-5 { grid-template-columns: repeat(5, 1fr); }
}

/*
  style.css styles every list in a page body as prose:

    .copy > ul li        { padding-left: 1em; text-indent: -0.7em; margin-bottom: 12px }
    .copy > ul li:before { content: "• "; color: #00A58C }

  Both apply here, because this IS a `ul` inside `.copy`. Left alone they put
  a green bullet above every swatch and shunt each cell out of alignment with
  the one above it. Two classes beats the one in `.copy > ul li`, so these win
  without `!important`.
*/
.colour-swatches .colour-swatch {
  margin: 0;
  padding: 0;
  text-indent: 0;
  list-style: none;
}

.colour-swatches .colour-swatch::before {
  content: none;
}

.colour-swatch-chip {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  /*
    An inset shadow rather than a border, so the 1px does not come out of the
    swatch's own width and change the colour area between one chip and the
    next. It is doing real work: the palest colours in a steel range sit a
    hair off white, and without an edge they read as a gap in the grid rather
    than as a colour on offer.
  */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/*
  `aspect-ratio` has been everywhere for years, but a browser without it would
  collapse the chip to nothing - an invisible failure on the one element that
  carries the content. The padding box reserves the height the old way and is
  overridden above wherever the modern property works.
*/
@supports not (aspect-ratio: 1 / 1) {
  .colour-swatch-chip {
    height: 0;
    padding-top: 100%;
  }
}

.colour-swatch-name {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   Bold text in body copy

   style.css carries this, from an era when the only bold text on the site was
   a hero slider caption:

     @media (max-width: 992px)  { h2, strong { line-height: 42px !important } }
     @media (max-width: 1200px) { h2, strong { line-height: 42px !important } }

   The selector is a bare `strong`, so below 1200px EVERY bold word in every
   paragraph gets a 42px line box inside a 24px paragraph. The line holding it
   grows by 18px and the paragraph goes ragged - which is why a line carrying
   a bold product name, or a link whose label is bold, sits further from its
   neighbours than the lines around it do.

   1200px takes in most laptops, so this is the common case rather than an
   edge one, and it applies to every page with bold text in its copy.

   `inherit` puts the bold run back on whatever line-height its paragraph or
   heading is already using, so it stays correct wherever it appears.
   `!important` is here only because it has to beat one; among `!important`
   declarations the extra class outranks the bare element selector.

   Scoped to `.copy` - the prose container every template uses - so the slider
   captions that rule was written for keep their own line-height.
--------------------------------------------------------------------------- */

.copy strong {
  line-height: inherit !important;
}

/* ---------------------------------------------------------------------------
   Contact map  -  src/components/ContactMap.astro

   `.img-responsive` alone caps the map at the 360px it is drawn at, which
   leaves a gap down the right of the column on a phone wide enough to want
   more. Filling the column instead keeps the map square with the text block
   beneath it at every width.

   Safe to stretch: the image is fetched at `scale=2`, so there are 720 real
   pixels behind it and it stays sharp well past any width this column
   reaches - 750px at the widest, where the columns are still stacked.
--------------------------------------------------------------------------- */

.static-map {
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------------------
   Footer legal link  -  src/layouts/Base.astro

   Matched to `.copyright` and `.designer` beside it: 14px, and white rather
   than the site teal, which does not carry enough contrast against the dark
   navy footer to be comfortable at this size. Underlined because it is the
   only text link in a block of plain text and nothing else marks it as one.
--------------------------------------------------------------------------- */

.footer-legal {
  font-size: 14px;
  margin-top: 8px;
  margin-bottom: 0;
}

.footer-legal a,
.footer-legal a:hover,
.footer-legal a:focus {
  color: #ffffff;
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Centred images  -  src/lib/portable-text.ts (imageBlock align: center)

   `.image-left` and `.image-right` are in style.css (16710, 16714); the
   centred counterpart never was. The legacy copy used two spellings of the
   class - `image-center` in the importer's allow-list and `image-centre` in
   what the editors actually typed - and NEITHER had a rule, so an image
   marked as centred has never been centred on this site. Both are accepted
   here because both exist in the content.
--------------------------------------------------------------------------- */

.copy .image-center,
.copy .image-centre {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ---------------------------------------------------------------------------
   Centred copy has a reading measure  -  src/lib/portable-text.ts

   The legacy pages carried `max-width: 560px; margin-left: auto; margin-right:
   auto` as an inline style on the centred paragraphs long enough to need it.
   That is typography, not content, and it could not survive the move to a
   Portable Text style - so without this rule those paragraphs went from 560px
   to the full 750px column, which is a poor line length for centred text.

   Scoped away from two things it would be wrong for:

     .intro      the lead paragraph is deliberately full width - the contact
                 page's opening line ran the whole column on the legacy site
                 and still should.
     :has(img)   a centred IMAGE is also a `p.text-center`, and clamping that
                 to 560px would shrink every centred picture on the site.

   Short centred lines are unaffected: a line narrower than 560px sits in the
   same place whether its box is 560px or 750px.
--------------------------------------------------------------------------- */

.copy > p.text-center:not(.intro):not(:has(img)),
.copy > h4.text-center {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------------------------------------------------------------------------
   Icon cards  -  src/lib/portable-text.ts (iconCards)

   The glyph is decorative and fixed at the size the pasted markup drew it.
   Padding on the cell rather than margin on the children, so the gutter
   between two cards is the grid's own and does not double up.
--------------------------------------------------------------------------- */

.icon-cards {
  margin-top: 10px;
  margin-bottom: 10px;
}

.icon-card {
  margin-bottom: 20px;
}

.icon-card-glyph {
  width: 54px;
  height: 54px;
  margin-bottom: 10px;
}

.icon-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
}

.icon-card p {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Caption cards  -  src/lib/portable-text.ts (captionCards)

   The band itself is `.thumbnail.caption-over-img .caption` in style.css
   (19658), which positions it absolutely at the foot of the image but sets no
   width - it was sized by the 465px image it was pasted beside. A responsive
   image makes that assumption false at every other width, so the band is
   pinned to both edges here.
--------------------------------------------------------------------------- */

.caption-cards {
  margin-bottom: 20px;
}

.caption-cards .thumbnail {
  margin-bottom: 20px;
  border: none;
}

.caption-cards .thumbnail.caption-over-img .caption {
  left: 0;
  right: 0;
  width: auto;
}

.caption-cards .thumbnail.caption-over-img img {
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------------------
   Feature cards  -  src/lib/portable-text.ts (featureCards)

   The icon sits inside the `h3` as an inline image, so it needs its baseline
   pulling onto the heading's rather than the text's - otherwise a 50px glyph
   beside a 20px heading drags the line box down and the two rows of cards
   stop lining up with each other.
--------------------------------------------------------------------------- */

.feature-cards {
  margin-bottom: 10px;
}

.feature-card {
  margin-bottom: 30px;
}

.feature-card h3 {
  display: flex;
  align-items: center;
  margin-top: 0;
}

.feature-card h3 img {
  flex: 0 0 auto;
}

.feature-card img.img-responsive {
  width: 100%;
  height: auto;
}

.feature-card p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Spec table  -  src/lib/portable-text.ts (specTable)

   The label column is a `th scope="row"`, not a `td` holding a `<strong>` as
   the pasted version had: it is a row header, and saying so is what lets a
   screen reader announce "Colour" before reading the value instead of reading
   two unrelated cells. Bootstrap's `.table` styles `th` bold already, so the
   visible result is unchanged.
--------------------------------------------------------------------------- */

.spec-table {
  margin-bottom: 20px;
}

.spec-table th {
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
}

/* ---------------------------------------------------------------------------
   Video tabs  -  src/lib/portable-text.ts (videoTabs)

   Bootstrap 3 hides an inactive `.tab-pane` with `display: none`, which means
   an iframe inside one has no layout until its tab is selected. The reserved
   padding box still does its job on the active pane; the rule below just
   stops the hidden panes contributing a stray margin to the strip above.
--------------------------------------------------------------------------- */

.tab-content > .tab-pane > .video-embed {
  margin-top: 20px;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Contact details table  -  src/components/ContactDetails.astro

   Replaces a bare `<table>` that was typed into the contact page's body copy,
   with `<td><strong>label:</strong></td>` in the first column. The labels are
   row headers, so they are `<th scope="row">` now - which a screen reader
   announces before each value instead of reading two unrelated cells.

   `th` defaults to centred; the legacy cell was a left-aligned `td`.

   The padding and font-size below are not decoration - they put the labels
   back where the `td` version had them. The theme's table styling hangs off a
   `td`-only selector, `table > tbody > tr > td` in style.css, which gives
   every value cell `padding: 4px` and `font-size: 15px`. A `th` does not match
   it, so the labels fell through to Bootstrap's `td, th { padding: 0 }` reset
   and the inherited 14px body size. Both columns are `vertical-align: top`, so
   nothing absorbed the difference: every value sat 4px below its own label,
   and the whole label column sat 4px left of where it used to start. Restating
   the two values here is narrower than widening the theme's selector, which
   also carries `.table th { background: #F7F7F9 }` for other tables.

   The gap before the opening hours was three `&nbsp;` in the pasted markup.
   An inline-block with a width says the same thing without putting layout
   into the text, and it collapses to nothing when the row wraps on a phone.
--------------------------------------------------------------------------- */

.contact-details th {
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  padding: 4px 10px 4px 4px;
  font-size: 15px;
  font-weight: 700;
}

.contact-details td {
  vertical-align: top;
}

.contact-details-gap {
  display: inline-block;
  width: 18px;
}

.contact-details-hours {
  display: block;
}

/* ---------------------------------------------------------------------------
   Homepage slider scrim  -  src/templates/Homepage.astro (`#tint`)

   The slide photograph is full-bleed behind the quote, and `#tint` is the
   panel that darkens the half the words sit on. The legacy values were
   written for a 900px hero: 0.9 alpha, holding solid only to 30% of the band
   and gone by 60%. At the band's new height that fade starts under the text
   and the photograph reads as a busy smear behind it.

   The client's mockup resolves it by letting the photograph begin halfway
   across: solid colour under the quote, the image clear on the right. So the
   scrim is opaque to 42% of the band and fully gone by 60%, which puts the
   visible edge of the photograph on the half-way line.

   This changes WHERE the photograph starts, not how it is cropped - the
   image is still `cover` at the same zoom, which is what the mockup shows.

   `.homepage-slider #tint` rather than `#tint` so the specificity clears
   `div #tint` in style.css (15109) without `!important`, and so this cannot
   reach a slider on any other page. Below 767px style.css hides the scrim
   altogether and the caption carries a text-shadow instead; that is left
   alone - a half-width scrim on a phone would bury the subject.
--------------------------------------------------------------------------- */

.homepage-slider #tint {
  background-image: linear-gradient(
    to right,
    rgb(37, 55, 70) 0%,
    rgb(37, 55, 70) 70%,
    rgba(37, 55, 70, 0) 100%
  );
}
