/* ==========================================================================
   Flexible page blocks
   --------------------------------------------------------------------------
   Component library for the "Flexible Page" template
   (template/information/flexible.twig).

   This file is loaded ONLY on pages using that template, and every selector
   is prefixed `qe-`. Nothing here can affect the pages still rendering
   through information.twig / stylesheet.css.

   Components are named for what they do, never for the page they first
   appeared on, so they can be reused across future pages. Layout variants
   are modifiers (--cols-2, --check) rather than new components.

   Contents
     1.  Tokens
     2.  Layout primitives  .qe-container .qe-band .qe-section
     3.  Typography
     4.  Buttons            .qe-btn
     5.  Split hero         .qe-hero-split
     6.  Logo strip         .qe-logo-strip
     7.  Card grid          .qe-card-grid .qe-card
     8.  Quote feature      .qe-quote-feature
     9.  Summary card       .qe-summary-card
     10. Accordion          .qe-accordion
     11. Icon card grid     .qe-icon-card-grid .qe-icon-card
     12. Post grid          .qe-post-grid .qe-post-card
     13. Bullet list        .qe-bullet-list
     14. CTA band           .qe-cta-band
     15. Responsive
   ========================================================================== */


/* 1. Tokens ---------------------------------------------------------------
   Scoped to .qe-page so they cannot leak into the rest of the site. */

.qe-page {
  --qe-green: #296957;
  --qe-green-dark: #1b3f31;
  --qe-green-mid: #187c5a;
  --qe-green-pale: #e4efeb;
  --qe-orange: #ff5a00;
  --qe-text: #333333;
  --qe-text-muted: #666666;
  --qe-white: #ffffff;

  --qe-container: 1148px;
  --qe-gutter: 24px;
  --qe-radius: 10px;

  --qe-band-gap: 72px;

  color: var(--qe-text);
}


/* 2. Layout primitives ---------------------------------------------------- */

.qe-container {
  max-width: var(--qe-container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Full-bleed colour band. Blocks sit directly in the page flow (the template
   deliberately does NOT wrap the body in a container) so no negative-margin
   breakout hack is needed - unlike the older .full-width class. */
.qe-band {
  padding: var(--qe-band-gap) 0;
}

.qe-band--green {
  background: var(--qe-green);
  color: var(--qe-white);
}

.qe-page .qe-band--green h1,
.qe-page .qe-band--green h2,
.qe-page .qe-band--green h3,
.qe-page .qe-band--green h4 {
  color: var(--qe-white);
}

.qe-band--pale {
  background: var(--qe-green-pale);
}

.qe-band--orange {
  background: var(--qe-orange);
  color: var(--qe-white);
}

/* Standard white section between bands. */
.qe-section {
  padding: var(--qe-band-gap) 0;
}

.qe-section--tight {
  padding: 40px 0;
}


/* 3. Typography ----------------------------------------------------------- */

.qe-page h2 {
  font-family: "Gotham Black", sans-serif;
  font-size: 34px;
  line-height: 1.15;
  color: var(--qe-green);
  margin: 0 0 28px;
}

.qe-page h3 {
  font-family: "Gotham Black", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  color: var(--qe-green);
  margin: 0 0 16px;
}

.qe-page p {
  font-family: "Gotham Book", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.qe-page__body > *:last-child {
  margin-bottom: 0;
}

/* Lead paragraph under a section heading. */
.qe-page .qe-lead {
  max-width: 760px;
  margin-bottom: 36px;
}


/* 4. Buttons -------------------------------------------------------------- */

.qe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 8px 20px;
  border-radius: var(--qe-radius);
  border: 1px solid transparent;
  font-family: "Gotham Black", sans-serif;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.qe-btn--solid {
  background: var(--qe-orange);
  color: var(--qe-white);
}

.qe-btn--solid:hover,
.qe-btn--solid:focus {
  background: #e65100;
  color: var(--qe-white);
}

.qe-btn--outline {
  background: transparent;
  border-color: var(--qe-green);
  color: var(--qe-green);
}

.qe-btn--outline:hover,
.qe-btn--outline:focus {
  background: var(--qe-green);
  color: var(--qe-white);
}

.qe-btn--green {
  background: var(--qe-green);
  color: var(--qe-white);
}

.qe-btn--green:hover,
.qe-btn--green:focus {
  background: var(--qe-green-dark);
  color: var(--qe-white);
}

/* For use on dark/orange bands. */
.qe-btn--light {
  background: var(--qe-white);
  color: var(--qe-orange);
}

.qe-btn--light:hover,
.qe-btn--light:focus {
  background: var(--qe-green-pale);
  color: var(--qe-orange);
}

.qe-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

/* Centred single action below a block. */
.qe-btn-centred {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}


/* 5. Split hero ----------------------------------------------------------- */

.qe-hero-split {
  padding: 56px 0 48px;
}

.qe-hero-split .qe-container {
  display: grid;
  grid-template-columns: 1fr 489px;
  gap: var(--qe-gutter);
  align-items: start;
}

.qe-page .qe-hero-split__copy h1 {
  font-family: "Gotham Black", sans-serif;
  font-size: 40px;
  line-height: 1.1;
  color: var(--qe-green);
  margin: 0 0 14px;
}

/* Standfirst - the bold green line under the H1. */
.qe-page .qe-hero-split__copy > p:first-of-type,
.qe-page .qe-hero-split__standfirst {
  font-family: "Gotham Black", sans-serif;
  font-size: 15px;
  color: var(--qe-green);
  margin-bottom: 22px;
}

.qe-hero-split__media img {
  display: block;
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: var(--qe-radius);
}


/* 6. Logo strip ----------------------------------------------------------- */

.qe-logo-strip {
  background: var(--qe-green);
  padding: 28px 0;
}

.qe-logo-strip .qe-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.qe-logo-strip__item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0 24px;
  border-left: 1px solid rgba(255, 255, 255, .35);
  text-align: center;
}

.qe-logo-strip__item:first-child {
  border-left: 0;
}

.qe-logo-strip__item img {
  max-width: 133px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Text-only item, e.g. a years-of-experience stat. */
.qe-logo-strip__stat {
  font-family: "Gotham Black", sans-serif;
  font-size: 13px;
  color: var(--qe-white);
}


/* 7. Card grid ------------------------------------------------------------
   Image card with a caption bar overlaid on the bottom edge. Default is
   3-up; use --cols-2 for the wider pair. */

.qe-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--qe-gutter);
  margin-bottom: var(--qe-gutter);
}

.qe-card-grid--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.qe-card-grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.qe-card-grid:last-child {
  margin-bottom: 0;
}

.qe-card {
  position: relative;
  display: block;
  height: 180px;
  border-radius: var(--qe-radius);
  overflow: hidden;
  background: var(--qe-text-muted);
  text-decoration: none;
}

.qe-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qe-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  background: var(--qe-green-pale);
  font-family: "Gotham Black", sans-serif;
  font-size: 14px;
  color: var(--qe-green-dark);
}

/* Chevron, drawn in CSS so no icon font dependency. Cards only get one when
   the card itself is a link — a non-linking .qe-card renders a plain caption. */
a.qe-card .qe-card__caption::after,
.qe-summary-card__link::after,
.qe-post-card__link::after,
.qe-icon-card__link::after,
.qe-quote-feature__link::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

a.qe-card:hover .qe-card__caption,
a.qe-card:focus .qe-card__caption {
  background: var(--qe-green);
  color: var(--qe-white);
}


/* 8. Quote feature --------------------------------------------------------
   Large panel: image on the left, pull quote and attribution on the right. */

.qe-quote-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--qe-radius);
  overflow: hidden;
  background: var(--qe-green);
  color: var(--qe-white);
  min-height: 380px;
}

.qe-quote-feature__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qe-quote-feature__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 32px;
}

.qe-page .qe-quote-feature__quote {
  font-family: "Gotham Book", sans-serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.qe-quote-feature__attribution {
  border-top: 1px solid rgba(255, 255, 255, .4);
  padding-top: 16px;
}

.qe-page .qe-quote-feature__name {
  font-family: "Gotham Black", sans-serif;
  font-size: 17px;
  color: var(--qe-white);
  margin: 0 0 4px;
}

.qe-page .qe-quote-feature__detail {
  font-family: "Gotham Book", sans-serif;
  font-size: 14px;
  margin: 0 0 10px;
}

.qe-quote-feature__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Gotham Black", sans-serif;
  font-size: 13px;
  color: var(--qe-orange);
  text-decoration: none;
}


/* 9. Summary card ---------------------------------------------------------
   Compact stacked card, typically beside a quote feature. */

.qe-summary-card {
  background: var(--qe-green-pale);
  border-radius: var(--qe-radius);
  padding: 20px 22px;
}

.qe-summary-card + .qe-summary-card {
  margin-top: var(--qe-gutter);
}

.qe-page .qe-summary-card__title {
  font-family: "Gotham Black", sans-serif;
  font-size: 16px;
  color: var(--qe-green-dark);
  margin: 0 0 4px;
}

.qe-page .qe-summary-card p {
  font-size: 14px;
  margin: 0 0 12px;
}

/* Qualified with the element because the generic `.qe-summary-card p` rule
   above carries an element selector too, so a bare modifier class would
   lose to it regardless of source order. */
.qe-page .qe-summary-card p.qe-summary-card__meta {
  font-family: "Gotham Black", sans-serif;
  font-size: 12px;
  color: var(--qe-green);
  margin: 0 0 8px;
}

.qe-summary-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Gotham Black", sans-serif;
  font-size: 13px;
  color: var(--qe-green-dark);
  text-decoration: none;
}

/* Two-column arrangement: feature panel beside a stack of summary cards. */
.qe-feature-split {
  display: grid;
  grid-template-columns: 757fr 366fr;
  gap: var(--qe-gutter);
  align-items: start;
}


/* 10. Accordion -----------------------------------------------------------
   Self-contained; does not rely on the Bootstrap accordion JS used by the
   older template. Behaviour comes from <details>/<summary>. */

.qe-accordion__item {
  background: var(--qe-green-pale);
  border-radius: var(--qe-radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.qe-accordion__item[open] {
  background: var(--qe-white);
  box-shadow: 0 0 0 1px var(--qe-green-pale) inset;
}

.qe-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-family: "Gotham Black", sans-serif;
  font-size: 15px;
  color: var(--qe-green-dark);
}

.qe-accordion__header::-webkit-details-marker {
  display: none;
}

/* Caret, rotates when the item opens. */
.qe-accordion__header::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}

.qe-accordion__item[open] .qe-accordion__header::after {
  transform: rotate(-135deg);
}

.qe-page .qe-accordion__body {
  padding: 0 20px 18px;
}

.qe-accordion__body p:last-child {
  margin-bottom: 0;
}


/* 11. Icon card grid ------------------------------------------------------ */

.qe-icon-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--qe-gutter);
}

.qe-icon-card {
  border: 1px solid #d9dede;
  border-radius: var(--qe-radius);
  padding: 18px 18px 16px;
  background: var(--qe-white);
}

.qe-icon-card__icon {
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  color: var(--qe-green-dark);
}

.qe-page .qe-icon-card__title {
  font-family: "Gotham Black", sans-serif;
  font-size: 14px;
  color: var(--qe-orange);
  margin: 0 0 6px;
}

.qe-page .qe-icon-card p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 10px;
}

.qe-icon-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Gotham Black", sans-serif;
  font-size: 12px;
  color: var(--qe-orange);
  text-decoration: none;
}

/* Two-column arrangement: wide main column + narrower aside with a rule. */
.qe-main-aside {
  display: grid;
  grid-template-columns: 684fr 390fr;
  gap: var(--qe-band-gap);
  align-items: start;
}

.qe-main-aside__aside {
  position: relative;
}

.qe-main-aside__aside::before {
  content: "";
  position: absolute;
  left: calc(var(--qe-band-gap) / -2);
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d9dede;
}


/* 12. Post grid ----------------------------------------------------------- */

.qe-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--qe-gutter);
}

.qe-post-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--qe-radius);
  overflow: hidden;
  background: var(--qe-green-pale);
  text-decoration: none;
}

.qe-post-card__media {
  height: 150px;
}

.qe-post-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qe-post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 18px;
}

.qe-page .qe-post-card__title {
  font-family: "Gotham Black", sans-serif;
  font-size: 15px;
  line-height: 1.25;
  color: var(--qe-green);
  margin: 0 0 8px;
}

.qe-page .qe-post-card__excerpt {
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;

  /* Clamp so cards in a row stay level regardless of copy length. The
     max-height is the deterministic part (3 lines x 1.5); the webkit clamp
     is the enhancement that adds the ellipsis. */
  max-height: 4.5em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qe-post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-family: "Gotham Black", sans-serif;
  font-size: 13px;
  color: var(--qe-green-dark);
  text-decoration: none;
}


/* 13. Bullet list ---------------------------------------------------------
   Multi-column marked list. Used for service lists, capability lists and
   reasons-to-choose blocks - the marker and column count are modifiers, so
   one component covers all of them.

     .qe-bullet-list                     single column, chevron marker
     .qe-bullet-list--cols-2 / --cols-3  column count
     .qe-bullet-list--check              tick marker instead of chevron   */

.qe-bullet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  column-gap: var(--qe-gutter);
}

.qe-bullet-list--cols-2 {
  columns: 2;
}

.qe-bullet-list--cols-3 {
  columns: 3;
}

.qe-page .qe-bullet-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 18px;
  font-family: "Gotham Book", sans-serif;
  font-size: 14px;
  line-height: 1.45;

  /* Keep an item from being split across a column break. */
  -webkit-column-break-inside: avoid;
  break-inside: avoid;
}

.qe-page .qe-bullet-list li:last-child {
  margin-bottom: 0;
}

/* Chevron marker (default). */
.qe-bullet-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--qe-orange);
  border-right: 2px solid var(--qe-orange);
  transform: rotate(45deg);
}

/* Tick marker. */
.qe-bullet-list--check li::before {
  left: 4px;
  top: 3px;
  width: 6px;
  height: 11px;
  border-top: 0;
  border-right: 2px solid var(--qe-green);
  border-bottom: 2px solid var(--qe-green);
  transform: rotate(45deg);
}

/* On a green band the chevrons stay orange but text goes white. */
.qe-band--green .qe-bullet-list li {
  color: var(--qe-white);
}


/* 14. CTA band ------------------------------------------------------------
   Full-bleed call to action. Optional background image sits behind the
   colour, faded on the right-hand side. */

.qe-cta-band {
  position: relative;
  background: var(--qe-orange);
  color: var(--qe-white);
  padding: 44px 0;
  overflow: hidden;
}

.qe-cta-band__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.qe-cta-band__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Fades the photo out towards the left so the copy stays legible. */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 42%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 42%, #000 100%);
}

.qe-cta-band .qe-container {
  position: relative;
  z-index: 1;
}

.qe-page .qe-cta-band__title {
  font-family: "Gotham Black", sans-serif;
  font-size: 30px;
  line-height: 1.15;
  color: var(--qe-white);
  margin: 0 0 10px;
}

.qe-page .qe-cta-band p {
  max-width: 480px;
  margin-bottom: 18px;
}


/* 15. Responsive ---------------------------------------------------------- */

@media (max-width: 1199px) {
  .qe-page {
    --qe-band-gap: 56px;
  }

  .qe-hero-split .qe-container {
    grid-template-columns: 1fr 40%;
  }

  .qe-hero-split__media img {
    height: 100%;
    min-height: 320px;
  }

  .qe-main-aside {
    gap: 40px;
  }
}

@media (max-width: 991px) {
  .qe-page {
    --qe-band-gap: 44px;
  }

  .qe-page h2 {
    font-size: 28px;
  }

  .qe-hero-split .qe-container,
  .qe-feature-split,
  .qe-main-aside,
  .qe-quote-feature {
    grid-template-columns: 1fr;
  }

  .qe-hero-split__copy h1 {
    font-size: 32px;
  }

  .qe-hero-split__media img {
    min-height: 260px;
  }

  /* The vertical rule only makes sense while the columns sit side by side. */
  .qe-main-aside__aside::before {
    display: none;
  }

  .qe-quote-feature__media {
    height: 220px;
  }

  .qe-card-grid,
  .qe-post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .qe-bullet-list--cols-3 {
    columns: 2;
  }

  .qe-summary-card:first-of-type {
    margin-top: var(--qe-gutter);
  }
}

@media (max-width: 767px) {
  .qe-page {
    --qe-band-gap: 36px;
  }

  .qe-card-grid,
  .qe-card-grid--cols-2,
  .qe-card-grid--cols-4,
  .qe-post-grid,
  .qe-icon-card-grid {
    grid-template-columns: 1fr;
  }

  .qe-bullet-list--cols-2,
  .qe-bullet-list--cols-3 {
    columns: 1;
  }

  .qe-logo-strip .qe-container {
    gap: 20px 0;
  }

  .qe-logo-strip__item {
    flex: 0 0 50%;
    border-left: 0;
  }

  .qe-btn-row .qe-btn {
    flex: 1 1 100%;
  }

  .qe-cta-band__bg img {
    -webkit-mask-image: none;
    mask-image: none;
    opacity: .25;
  }
}
