/*
 * Deliberate departures from the PHP theme's CSS, kept out of style.css so that file stays byte-identical.
 * Linked right after style.css in index.html.
 *
 * Hero video: the theme gives `.slider-video` a fixed `height: 500px` (its `aspect-ratio` never applies once a
 * height is set), while the banner images that share the carousel scale with the window (1920 x 680). The video
 * was cropped top and bottom on wide screens and left and right on narrow ones, and the carousel came out taller
 * or shorter than its images. Give the video box the images' proportions instead; `object-fit: cover` (from the
 * theme) then trims about 1% of the picture.
 */
.slider-video {
  height: auto;
  aspect-ratio: 1920 / 680;
}

/*
 * Product cards: the pictures come from Admin Portal -> Products in whatever shape they were uploaded (square,
 * portrait, wide), and the theme sizes a card to its picture, so a row of cards came out ragged. Every card
 * picture gets the same square box instead; `contain` shows the whole picture (some carry text) on white.
 */
.product-item .product-img img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

/*
 * The theme points two decorative overlays (the service strip and the testimonials band) at images,
 * shape/02.html and shape/03.html, that were never shipped with it: they only ever produced two 404s per page.
 */
.feature-wrap::before,
.ts-bg::before {
  background-image: none;
}

/*
 * Instagram strip: the theme shows a tile's link (the round Instagram button) only while the pointer hovers over it. A phone
 * or tablet has no pointer to hover with, so the links were invisible and could not be found, let alone tapped. Where there is
 * no hover the button is simply always shown (and a little larger, for a thumb); a keyboard user gets it on focus.
 */
@media (hover: none) {
  .instagram-item a {
    visibility: visible;
    opacity: 0.92;
    width: 48px;
    height: 48px;
    line-height: 48px;
  }
}
.instagram-item a:focus-visible {
  visibility: visible;
  opacity: 1;
}

/*
 * Hero slider under a height cap (Admin Portal -> Banners -> "Max height"): the wrapper keeps the slider's shape but is never
 * taller than the cap; the picture (or its link) fills it, cropped or letterboxed by its object-fit.
 */
.hero-capped {
  display: flex;
  overflow: hidden;
}
.hero-capped > a,
.hero-capped > picture {
  display: block;
  flex: 1 1 100%;
  min-width: 0;
}

/*
 * Instagram caption (Admin Portal -> Landing Page -> Instagram -> Caption): a short line laid over the bottom of the tile, on a
 * soft dark fade so it reads on any picture. At most two lines; it ignores the pointer so the tile's link button stays clickable.
 */
.instagram-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 36px 22px 22px;
  border-radius: 0 0 50px 50px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.68));
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}
.instagram-caption span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/*
 * Product videos (Admin Portal -> Products -> Photos & videos): the gallery shows a video in the big box with its own player
 * controls (no hover-zoom), and a still frame with a small play badge as its thumbnail.
 */
.main-image.is-video {
  cursor: default;
}
.main-image video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.thumb {
  position: relative;
}
.thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.thumb.is-video .fa-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  line-height: 26px;
  padding-left: 2px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 11px;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
