/* ==========================================================================
   Block: Text Section
   File:   css/blocks/text-section.css
   Markup: includes/blocks/text-section.php

   Centred statement on the cream ground. The gold rule now introduces the
   heading from above rather than underlining it, which stops it reading as
   decoration hung off every title.
   ========================================================================== */

.text-section {
  --ts-heading-size: 38px;
  --ts-heading-max: 820px;
  --ts-text-size: 16px;
  --ts-text-max: 690px;

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

.text-section__inner {
  width: 100%;
  max-width: var(--vir-measure);
  margin: 0 auto;
}

/* --- Bands ---------------------------------------------------------------
   Gold runs full width with navy type on it - 5.6:1, so it carries text
   properly rather than being a hairline. */

.text-section--bg-gold,
.text-section--bg-navy {
  padding: 50px var(--vir-gutter);
}

.text-section--bg-gold {
  background-color: var(--vir-gold);
}

.text-section--bg-navy {
  background-color: var(--vir-navy);
}

.text-section--bg-gold .text-section__heading {
  color: var(--vir-navy);
}

.text-section--bg-gold .text-section__heading::before {
  background-color: var(--vir-navy);
}

.text-section--bg-gold .text-section__text p {
  color: var(--vir-navy-deep);
}

.text-section--bg-navy .text-section__heading {
  color: var(--vir-white);
}

.text-section--bg-navy .text-section__heading::before {
  background-color: var(--vir-gold);
}

.text-section--bg-navy .text-section__text p {
  color: rgba(255, 255, 255, 0.84);
}

.text-section .text-section__heading {
  max-width: var(--ts-heading-max);
  margin: 0 auto;
  color: var(--vir-heading);
  font-family: var(--vir-font-display);
  font-size: var(--ts-heading-size);
  line-height: 1.12em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.text-section__text {
  max-width: var(--ts-text-max);
  margin: 24px auto 0;
}

.text-section .text-section__text p {
  margin: 0 0 1.5em;
  color: var(--vir-body);
  font-family: var(--vir-font-body);
  font-size: var(--ts-text-size);
  line-height: 1.8em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.text-section .text-section__text p:last-child {
  margin-bottom: 0;
}

/* --- Left variant -------------------------------------------------------- */

.text-section--left {
  text-align: left;
}

/* Left variant sits against the left edge of the measure, matching the way
   every home page section is set. */
.text-section--left .text-section__heading,
.text-section--left .text-section__text {
  margin-left: 0;
  margin-right: 0;
}

.text-section--left .text-section__heading::before {
  margin-left: 0;
}

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

@media (max-width: 991px) {
  .text-section {
    --ts-heading-size: 32px;
  }
}

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

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

/* --- Band overrides ------------------------------------------------------
   These must come last: the base heading rule has equal specificity and
   would otherwise win, painting gold on gold. */

.text-section--bg-gold .text-section__heading {
  color: var(--vir-navy);
}

.text-section--bg-gold .text-section__heading::before {
  background-color: var(--vir-navy);
}

.text-section--bg-gold .text-section__text p {
  color: var(--vir-navy-deep);
}

.text-section--bg-navy .text-section__heading {
  color: var(--vir-gold);
}

.text-section--bg-navy .text-section__text p {
  color: var(--vir-body);
}

/* --- Statement -----------------------------------------------------------
   A page's closing thought. The heading is set large against the body in a
   second column rather than centred above it, held between two gold rules
   on the deep navy ground so it reads as a stated position.
   ========================================================================== */

.text-section--bg-statement {
  padding: 50px var(--vir-gutter);
  background-color: var(--vir-navy-deep);
  text-align: left;
}

.text-section--bg-statement .text-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 64px;
  padding: 44px 0;
  border-top: 1px solid rgba(201, 162, 39, 0.4);
  border-bottom: 1px solid rgba(201, 162, 39, 0.4);
}

.text-section--bg-statement .text-section__heading {
  max-width: none;
  margin: 0;
  color: var(--vir-gold);
  font-size: var(--ts-statement-size, 46px);
  line-height: 1.05em;
}

.text-section--bg-statement .text-section__heading::before {
  width: 88px;
  height: 5px;
  margin: 0 0 28px;
  background-color: var(--vir-gold);
}

.text-section--bg-statement .text-section__text {
  max-width: none;
  margin: 0;
}

.text-section--bg-statement .text-section__text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.9em;
}

/* The first line is lifted, so the paragraph opens rather than simply
   starting - the only place on the site that does this. */
.text-section--bg-statement .text-section__text p:first-child::first-line {
  color: var(--vir-white);
  letter-spacing: 0.06em;
}

@media (max-width: 1249px) {
  .text-section--bg-statement {
    --ts-statement-size: 38px;
  }

  .text-section--bg-statement .text-section__inner {
    gap: 44px;
  }
}

@media (max-width: 991px) {
  .text-section--bg-statement {
    --ts-statement-size: 32px;
  }

  .text-section--bg-statement .text-section__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
}

@media (max-width: 575px) {
  .text-section--bg-statement {
    --ts-statement-size: 25px;
  }

  .text-section--bg-statement .text-section__text p {
    font-size: 16px;
  }
}
