/* ==========================================================================
   Block: Media + Text
   File:   css/blocks/media-text.css
   Markup: includes/blocks/media-text.php

   The image is offset against a gold frame rather than sitting flush, and
   the copy column is inset from it, so the two halves read as composed
   rather than merely adjacent.
   ========================================================================== */

.media-text {
  --mt-min-height: 520px;
  --mt-heading-size: 38px;
  --mt-gap: 72px;

  width: 100%;
  margin: var(--vir-section-gap) 0 0;
  padding: 0 var(--vir-gutter);
  box-sizing: border-box;
}

.media-text__inner {
  display: flex;
  align-items: center;
  gap: var(--mt-gap);
  width: 100%;
  max-width: var(--vir-measure);
  min-height: var(--mt-min-height);
  margin: 0 auto;
}

.media-text--reverse .media-text__inner {
  flex-direction: row-reverse;
}

/* --- Media --------------------------------------------------------------- */

.media-text__media {
  position: relative;
  flex: 1 1 50%;
  align-self: stretch;
  min-width: 0;
  margin: 0;
}

/* Gold frame, offset behind the photograph. */
.media-text__media::before {
  content: "";
  position: absolute;
  top: 26px;
  left: -26px;
  width: 100%;
  height: 100%;
  border: 3px solid var(--vir-gold);
  pointer-events: none;
}

.media-text--reverse .media-text__media::before {
  left: auto;
  right: -26px;
}

.media-text__media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  object-position: 50% 50%;
}

/* --- Body ---------------------------------------------------------------- */

.media-text__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 50%;
  min-width: 0;
  padding: 50px 0;
  box-sizing: border-box;
}

.media-text .media-text__heading {
  max-width: 18ch;
  margin: 0;
  color: var(--vir-heading);
  font-family: var(--vir-font-display);
  font-size: var(--mt-heading-size);
  line-height: 1.12em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.media-text .media-text__heading::before {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 0 0 26px;
  background-color: var(--vir-gold);
}

/* Heading can be centred over the body column (About page). */
.media-text--heading-center .media-text__heading {
  max-width: none;
  text-align: center;
}

.media-text--heading-center .media-text__heading::before {
  margin-left: auto;
  margin-right: auto;
}

.media-text__text {
  margin: 26px 0 0;
}

.media-text .media-text__text p {
  margin: 0 0 1.4em;
  color: var(--vir-body);
  font-family: var(--vir-font-body);
  font-size: 16px;
  line-height: 1.85em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.media-text .media-text__text p:last-child {
  margin-bottom: 0;
}

/* --- List ---------------------------------------------------------------- */

.media-text .media-text__list {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.media-text .media-text__list li {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 14px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--vir-body);
  font-family: var(--vir-font-body);
  font-size: 16px;
  line-height: 1.6em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.media-text .media-text__list li:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

/* Marks variant: a small gold dash instead of a bullet. */
.media-text .media-text__list--marks li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 9px;
  height: 2px;
  background-color: var(--vir-gold);
}

/* Numbered variant: large gold numerals carrying the list. */
.media-text .media-text__list--numbered {
  counter-reset: vir-item;
}

.media-text .media-text__list--numbered li {
  padding-left: 62px;
  min-height: 40px;
  counter-increment: vir-item;
}

.media-text .media-text__list--numbered li::before {
  content: counter(vir-item, decimal-leading-zero);
  position: absolute;
  top: -0.1em;
  left: 0;
  color: var(--vir-gold);
  font-family: var(--vir-font-display);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1249px) {
  .media-text {
    --mt-gap: 48px;
    --mt-heading-size: 34px;
  }
}

@media (max-width: 991px) {
  .media-text {
    --mt-heading-size: 30px;
    --mt-gap: 36px;
    --mt-min-height: 0;
  }

  .media-text__media::before {
    top: 18px;
    left: -18px;
  }

  .media-text--reverse .media-text__media::before {
    right: -18px;
  }
}

@media (max-width: 767px) {
  .media-text {
    --mt-heading-size: 27px;
  }

  .media-text__inner,
  .media-text--reverse .media-text__inner {
    flex-direction: column;
    gap: 34px;
  }

  .media-text__media {
    flex: 0 0 auto;
    align-self: auto;
    width: 100%;
  }

  .media-text__media::before {
    top: 14px;
    left: 14px;
  }

  .media-text--reverse .media-text__media::before {
    right: auto;
    left: 14px;
  }

  .media-text__media img {
    min-height: 260px;
    height: 300px;
  }

  .media-text__body {
    flex: 0 0 auto;
    padding: 0;
  }

  .media-text .media-text__heading {
    max-width: none;
  }
}

@media (max-width: 575px) {
  .media-text {
    --mt-heading-size: 23px;
  }

  .media-text .media-text__list li,
  .media-text .media-text__text p {
    font-size: 15px;
  }
}

/* --- Multi-column list, used when the block runs without an image ------- */

.media-text .media-text__list {
  columns: var(--mt-list-columns, 1);
  column-gap: 48px;
}

.media-text .media-text__list li {
  break-inside: avoid;
}

.media-text--no-image .media-text__body {
  flex: 1 1 100%;
  padding: 0;
}

@media (max-width: 991px) {
  .media-text .media-text__list {
    columns: min(var(--mt-list-columns, 1), 2);
  }
}

@media (max-width: 767px) {
  .media-text .media-text__list {
    columns: 1;
  }
}

/* --- Portrait media -------------------------------------------------------
   The default fills its column, which crops a standing portrait badly when
   the copy beside it runs long. Portrait keeps the picture at its own
   proportions and holds it in view while the copy scrolls past.
   ========================================================================== */

.media-text--media-portrait .media-text__inner {
  align-items: start;
  min-height: 0;
}

.media-text--media-portrait .media-text__media {
  position: sticky;
  top: calc(var(--vir-header-height) + 28px);
  flex: 0 0 38%;
  align-self: start;
  margin-top: 8px;
}

/* Height follows the picture, so a standing portrait is never cropped. */
.media-text--media-portrait .media-text__media img {
  height: auto;
  min-height: 0;
}

.media-text--media-portrait .media-text__body {
  flex: 1 1 auto;
  justify-content: flex-start;
  padding: 0;
}

/* A long biography wants a measure, not the full column width. */
.media-text--media-portrait .media-text__text p {
  max-width: 62ch;
}

@media (max-width: 991px) {
  .media-text--media-portrait .media-text__media {
    position: static;
    flex-basis: 42%;
  }
}

@media (max-width: 767px) {
  .media-text--media-portrait .media-text__media {
    flex: 0 0 auto;
    margin-top: 0;
  }

  .media-text--media-portrait .media-text__media img {
    height: auto;
  }
}

/* --- Bullets -------------------------------------------------------------
   A plain round bullet, in gold, for lists where the order carries no
   meaning. No hairline under each item: the dots alone are enough. */

.media-text .media-text__list--bullets li {
  padding-left: 26px;
  border-bottom: 0;
}

.media-text .media-text__list--bullets li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--vir-gold);
}
