/* ==========================================================================
   Block: Hero
   File:   css/blocks/hero.css
   Markup: includes/blocks/hero.php

   Split layout: a solid navy column carrying the type, with the photograph
   held at full strength beside it. The photo is no longer buried at 15%
   behind text, so it does actual work.
   ========================================================================== */

.hero {
  --hero-tint: var(--vir-navy);
  --hero-min-height: 560px;
  --hero-heading-size: 46px;
  --hero-text-size: 16px;
  --hero-split: 52%;

  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--vir-navy);
  box-sizing: border-box;
}

.hero__panel {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: var(--hero-min-height);
}

/* --- Copy side ----------------------------------------------------------- */

.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 0 var(--hero-split);
  max-width: var(--hero-split);
  padding: 50px clamp(35px, 6vw, 96px);
  background-color: var(--hero-tint);
  box-sizing: border-box;
}

.hero .hero__heading {
  max-width: 15ch;
  margin: 0;
  color: var(--vir-white);
  font-family: var(--vir-font-display);
  font-size: var(--hero-heading-size);
  line-height: 1.08em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .hero__heading::before {
  content: "";
  display: block;
  width: 72px;
  height: 5px;
  margin: 0 0 28px;
  background-color: var(--vir-gold);
}

.hero__text {
  max-width: 46ch;
  margin: 24px 0 0;
}

/* The theme sets a global `p` rule, which beats anything inherited from the
   wrapper - these values have to sit on the paragraph itself. */
.hero .hero__text p {
  margin: 0 0 1em;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--vir-font-body);
  font-size: var(--hero-text-size);
  line-height: 1.75em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.hero .hero__text p:last-child {
  margin-bottom: 0;
}

/* --- Image side ---------------------------------------------------------- */

.hero__media {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

/* A narrow gold seam between the copy and the photograph. */
.hero__media::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 10px;
  height: 100%;
  background-color: var(--vir-gold);
}

/* --- Alignment modifiers ------------------------------------------------- */

.hero--align-center .hero__inner,
.hero--align-right .hero__inner {
  /* The split hero is always left-set; the stored alignment only decides
     which side the photograph falls on. */
  order: 0;
}

.hero--align-right .hero__panel {
  flex-direction: row-reverse;
}

.hero--align-right .hero__media::before {
  left: auto;
  right: 0;
}

/* --- No image ------------------------------------------------------------ */

.hero--no-image .hero__inner {
  flex: 1 1 100%;
  max-width: 100%;
  align-items: center;
  text-align: center;
}

.hero--no-image .hero__heading,
.hero--no-image .hero__text {
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.hero--no-image .hero__heading::before {
  margin-left: auto;
  margin-right: auto;
}

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

@media (max-width: 1249px) {
  .hero {
    --hero-heading-size: 40px;
    --hero-min-height: 500px;
    --hero-split: 55%;
  }
}

@media (max-width: 991px) {
  .hero {
    --hero-heading-size: 34px;
    --hero-min-height: 440px;
    --hero-split: 58%;
  }

  .hero__inner {
    padding: 50px 40px;
  }
}

@media (max-width: 767px) {
  .hero {
    --hero-heading-size: 30px;
    --hero-min-height: 0;
  }

  .hero__panel,
  .hero--align-right .hero__panel {
    flex-direction: column;
  }

  .hero__inner {
    flex: 0 0 auto;
    max-width: 100%;
    padding: 50px var(--vir-gutter);
  }

  .hero__media {
    flex: 0 0 auto;
    height: 300px;
    order: -1;
  }

  .hero__media::before,
  .hero--align-right .hero__media::before {
    top: auto;
    bottom: 0;
    left: 0;
    right: auto;
    width: 100%;
    height: 8px;
  }

  .hero .hero__heading {
    max-width: none;
  }
}

@media (max-width: 575px) {
  .hero {
    --hero-heading-size: 26px;
    --hero-text-size: 15px;
  }

  .hero__media {
    height: 220px;
  }

  .hero__inner {
    padding: 50px var(--vir-gutter);
  }
}

/* --- Calls to action (virq.com.au places them under the hero copy) ------- */

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px 0 0;
}

.hero .hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 30px;
  text-align: center;
  border: 1px solid var(--vir-gold);
  border-radius: 50px;
  background-color: var(--vir-gold);
  color: var(--vir-navy);
  font-family: var(--vir-font-body);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
  box-sizing: border-box;
}

.hero .hero__button:hover {
  border-color: var(--vir-white);
  background-color: transparent;
  color: var(--vir-white);
  text-decoration: none;
}

.hero .hero__button--ghost {
  border-color: rgba(255, 255, 255, 0.5);
  background-color: transparent;
  color: var(--vir-white);
}

.hero .hero__button--ghost:hover {
  border-color: var(--vir-gold);
  background-color: var(--vir-gold);
  color: var(--vir-navy);
}

@media (max-width: 575px) {
  .hero__actions {
    flex-direction: column;
  }

  .hero .hero__button {
    width: 100%;
  }
}
