/*
 * Mehras Video Player
 * Responsive 16:9 click-to-play facade, in two placements:
 *   1. In the About hero, in place of the portrait (side by side with the text)
 *   2. As its own centred section below the hero
 * Selectors are deliberately two classes deep so they win over the theme's own
 * hero rules regardless of which stylesheet the browser loads first.
 */

/* ---------- the player itself (shared) ---------- */
.mf-video-frame {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0d0d0f;
}
/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16/9) {
  .mf-video-frame { height: 0; padding-bottom: 56.25%; }
}
.mf-video-frame iframe,
.mf-video-frame .mf-video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.mf-video-frame .mf-video-play {
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: #0d0d0f;
  appearance: none;
  -webkit-appearance: none;
}
.mf-video-frame .mf-video-play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease, opacity .3s ease;
}
.mf-video-frame .mf-video-play:hover img,
.mf-video-frame .mf-video-play:focus-visible img {
  transform: scale(1.03);
  opacity: .88;
}
/*
 * The theme gives hero images position:relative and z-index:1, which would
 * stack the thumbnail above the play button and hide it. The poster is pinned
 * back down and the button lifted above it.
 */
.mf-video-frame .mf-video-play img {
  position: static;
  z-index: auto;
}
.mf-video-frame .mf-video-play__button {
  z-index: 2;
}
.mf-video-play__button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .5));
  transition: transform .25s ease;
}
.mf-video-frame .mf-video-play:hover .mf-video-play__button {
  transform: translate(-50%, -50%) scale(1.09);
}
.mf-video-frame .mf-video-play:focus-visible {
  outline: 3px solid #ef163f;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .mf-video-frame .mf-video-play img,
  .mf-video-play__button { transition: none; }
  .mf-video-frame .mf-video-play:hover img { transform: none; }
}

/* ---------- placement 1: in the About hero, beside the text ---------- */
/*
 * The portrait column is narrow (0.7fr) because the photo is tall. A landscape
 * player needs more room, so the two columns are rebalanced to sit evenly
 * side by side.
 */
.mf-about-hero .mf-about-hero__grid--video {
  grid-template-columns: minmax(0, 1fr) minmax(min(100%, 420px), 1.08fr);
  align-items: center;
}
.mf-about-hero__image.mf-about-hero__video {
  position: relative;
  margin: 0;
  max-width: none;
}
/* Keep the theme's offset frame line. */
.mf-about-hero__image.mf-about-hero__video:before {
  inset: -16px 18px 16px -18px;
}
.mf-about-hero__image.mf-about-hero__video .mf-video-frame {
  z-index: 1;
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, .75);
}
/* The theme shapes hero photos as a tall 4:5 crop; the player is landscape. */
.mf-about-hero__image.mf-about-hero__video .mf-video-play img {
  aspect-ratio: auto;
  object-position: center;
}
/*
 * The portrait's caption was pinned over the bottom of the photo. Over a video
 * it would cover the picture and sit on the play target, so it moves below —
 * same red block, same lettering.
 */
.mf-about-hero__image.mf-about-hero__video figcaption {
  position: static;
  z-index: 2;
  display: inline-block;
  bottom: auto;
  left: auto;
  margin-top: 22px;
  background: #ba0c2f;
  padding: 14px 18px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 900;
}
@media (max-width: 1000px) {
  .mf-about-hero .mf-about-hero__grid--video {
    grid-template-columns: 1fr;
  }
  .mf-about-hero__image.mf-about-hero__video {
    max-width: 720px;
  }
}

/* ---------- placement 2: its own centred section ---------- */
.mf-video-section { padding: clamp(28px, 5vw, 56px) 0 0; }
.mf-video-box--standalone {
  max-width: var(--mf-video-width, 900px);
  margin-inline: auto;
  text-align: center;
}
.mf-video-heading {
  margin: 0 0 clamp(14px, 2vw, 22px);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
}
.mf-video-box--standalone .mf-video-frame {
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .55);
}
.mf-video-caption {
  margin: clamp(12px, 2vw, 18px) 0 0;
  font-size: .95rem;
  opacity: .78;
}
