/* ---------------------------------------------------------------
   Numbered Highlight Cards
   Custom properties prefixed --cnhc- are written inline in module.html.
   --------------------------------------------------------------- */

.cs-nhc {
  --cs-nhc-gutter: clamp(20px, 4vw, 40px);

  position: relative;
  width: 100%;
  padding-top: var(--cnhc-top-padding, 100px);
  padding-bottom: var(--cnhc-bottom-padding, 100px);
  background-color: var(--cnhc-background, #262626);
  color: var(--cnhc-content-color, #e6e6e6);
  overflow-x: clip;
}

.cs-nhc,
.cs-nhc *,
.cs-nhc *::before,
.cs-nhc *::after {
  box-sizing: border-box;
}

.cs-nhc__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--cnhc-max-width, 1200px) + (2 * var(--cs-nhc-gutter)));
  margin: 0 auto;
  padding-left: var(--cs-nhc-gutter);
  padding-right: var(--cs-nhc-gutter);
}

/* ------------------------------ Intro ------------------------------ */

.cs-nhc__intro {
  max-width: var(--cnhc-intro-max-width, 900px);
  margin-bottom: var(--cnhc-intro-spacing, 56px);
}

.cs-nhc--intro-center .cs-nhc__intro {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Doubled class on type rules: the theme colors and sizes every h1-h6 and
   p globally, and these need to win without !important. */
.cs-nhc .cs-nhc__eyebrow {
  /* 20px line box + 20px margin = 40px from eyebrow top to heading top. */
  margin: 0 0 20px;
  color: var(--cnhc-eyebrow-color, #ff7500);
  font-size: var(--cnhc-eyebrow-size, 17px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The heading tag is selectable and the theme sets h5/h6 in the body face,
   so the heading face is named here. */
.cs-nhc .cs-nhc__heading {
  margin: 0;
  color: var(--cnhc-heading-color, #ffffff);
  font-family: "gelica", Georgia, serif;
  font-size: clamp(
    calc(var(--cnhc-heading-size, 52px) * 0.62),
    calc(var(--cnhc-heading-size, 52px) * 0.35 + 2.2vw),
    var(--cnhc-heading-size, 52px)
  );
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-transform: none;
}

.cs-nhc .cs-nhc__content {
  margin-top: 18px;
  color: var(--cnhc-content-color, #e6e6e6);
  font-size: var(--cnhc-content-size, 20px);
  line-height: 1.6;
}

.cs-nhc .cs-nhc__eyebrow + .cs-nhc__content {
  margin-top: 0;
}

.cs-nhc .cs-nhc__content p,
.cs-nhc .cs-nhc__content li {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.cs-nhc .cs-nhc__content p {
  margin: 0 0 20px;
}

.cs-nhc .cs-nhc__content > :last-child {
  margin-bottom: 0;
}

.cs-nhc .cs-nhc__content a,
.cs-nhc .cs-nhc__content a:visited,
.cs-nhc .cs-nhc__content a:hover,
.cs-nhc .cs-nhc__content a:focus,
.cs-nhc .cs-nhc__content a:active {
  color: var(--cnhc-content-link-color, #ff7500);
}

/* ------------------------------ Cards ------------------------------ */

.cs-nhc .cs-nhc__grid {
  display: grid;
  grid-template-columns: repeat(var(--cnhc-columns, 4), minmax(0, 1fr));
  gap: var(--cnhc-column-gap, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Fallback (no subgrid): cards are still equal height per row and the body
   stretches; only the head heights can differ. */
.cs-nhc .cs-nhc__card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-nhc .cs-nhc__card::marker {
  content: none;
}

.cs-nhc__body {
  flex: 1 1 auto;
}

/* Each card spans two rows of the parent grid and adopts them, so every head
   in a row shares one track height and every body shares the next. row-gap 0
   closes the parent's gap between a card's own head and body. */
@supports (grid-template-rows: subgrid) {
  .cs-nhc .cs-nhc__card {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
}

.cs-nhc__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--cnhc-card-padding, 28px);
  background-color: var(--cnhc-head-bg, #ff7500);
}

.cs-nhc .cs-nhc__number {
  display: block;
  color: var(--cnhc-number-color, #171715);
  font-family: "gelica", Georgia, serif;
  font-size: var(--cnhc-number-size, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

/* Sans bold in the design: inherit the body face even on an h-tag. */
.cs-nhc .cs-nhc__card-title {
  margin: 0;
  color: var(--cnhc-card-title-color, #171715);
  font-family: inherit;
  font-size: var(--cnhc-card-title-size, 21px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.cs-nhc__body {
  padding: calc(var(--cnhc-card-padding, 28px) - 2px) var(--cnhc-card-padding, 28px) calc(var(--cnhc-card-padding, 28px) + 4px);
  background-color: var(--cnhc-body-bg, #1e1e1e);
}

.cs-nhc .cs-nhc__card-content {
  color: var(--cnhc-card-content-color, #d9d9d9);
  font-size: var(--cnhc-card-content-size, 17px);
  line-height: 1.55;
}

.cs-nhc .cs-nhc__card-content p,
.cs-nhc .cs-nhc__card-content li {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.cs-nhc .cs-nhc__card-content p {
  margin: 0 0 14px;
}

.cs-nhc .cs-nhc__card-content > :last-child {
  margin-bottom: 0;
}

.cs-nhc .cs-nhc__card-content a,
.cs-nhc .cs-nhc__card-content a:visited,
.cs-nhc .cs-nhc__card-content a:hover,
.cs-nhc .cs-nhc__card-content a:focus,
.cs-nhc .cs-nhc__card-content a:active {
  color: var(--cnhc-card-link-color, #ff7500);
}

/* ------------------------------ Button ------------------------------ */

.cs-nhc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: var(--cnhc-button-spacing, 56px);
}

.cs-nhc__actions--center {
  justify-content: center;
}

/* Gelica is named here rather than inherited: every button on the site is
   set in the heading face. */
.cs-nhc .cs-nhc__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 15px 24px;
  border: 1px solid var(--cnhc-button-border, #ff7500);
  border-radius: 0;
  background-color: var(--cnhc-button-bg, #171715);
  color: var(--cnhc-button-color, #ffffff);
  font-family: "gelica", Georgia, serif;
  font-size: var(--cnhc-button-size, 18px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* The theme recolors visited/focused/active links orange; pin every state
   to the fields so the button never changes color on its own. */
.cs-nhc a.cs-nhc__button,
.cs-nhc a.cs-nhc__button:visited,
.cs-nhc a.cs-nhc__button:focus,
.cs-nhc a.cs-nhc__button:active {
  border-color: var(--cnhc-button-border, #ff7500) !important;
  background-color: var(--cnhc-button-bg, #171715) !important;
  color: var(--cnhc-button-color, #ffffff) !important;
  text-decoration: none !important;
}

.cs-nhc a.cs-nhc__button:hover,
.cs-nhc a.cs-nhc__button:focus-visible {
  border-color: var(--cnhc-button-hover-border, #ff7500) !important;
  background-color: var(--cnhc-button-hover-bg, #ff7500) !important;
  color: var(--cnhc-button-hover-color, #171715) !important;
}

.cs-nhc a.cs-nhc__button * {
  color: inherit !important;
}

.cs-nhc .cs-nhc__button .cs-nhc__button-arrow {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--cnhc-button-arrow, #ff7500) !important;
  transition: transform 0.2s ease, color 0.2s ease;
}

.cs-nhc a.cs-nhc__button:hover .cs-nhc__button-arrow,
.cs-nhc a.cs-nhc__button:focus-visible .cs-nhc__button-arrow {
  color: var(--cnhc-button-hover-color, #171715) !important;
  transform: translateX(3px);
}

.cs-nhc .cs-nhc__button:focus-visible {
  outline: 2px solid #ff7500;
  outline-offset: 3px;
}

.cs-nhc .cs-nhc__button--no-link {
  cursor: default;
}

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

@media (min-width: 640px) and (max-width: 1023px) {
  .cs-nhc:not(.cs-nhc--cols-1) .cs-nhc__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* An odd card out on the last row spans both columns rather than
     leaving a hole beside it. */
  .cs-nhc:not(.cs-nhc--cols-1) .cs-nhc__card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 639px) {
  .cs-nhc .cs-nhc__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  .cs-nhc {
    padding-top: var(--cnhc-top-padding-mobile, 72px);
    padding-bottom: var(--cnhc-bottom-padding-mobile, 72px);
  }

  .cs-nhc .cs-nhc__content {
    font-size: min(var(--cnhc-content-size, 20px), 18px);
  }

  .cs-nhc__intro {
    margin-bottom: min(var(--cnhc-intro-spacing, 56px), 40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-nhc .cs-nhc__button,
  .cs-nhc .cs-nhc__button .cs-nhc__button-arrow {
    transition: none;
  }
}
