/* ============================================================
   Cooper Base — Theme CSS
   Layout and component styles for .cb-* classes, block styles,
   and inline utility classes. All color / spacing / type values
   reference tokens from design-system.css.
   ============================================================ */

/* ---------------------------------------------------------------
   1. SHELL — outermost page wrapper
   --------------------------------------------------------------- */
/* Light-gray page canvas so the white content reads as a centered card. */
body {
  background: var(--navy-50);
}

.cb-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

/* ---------------------------------------------------------------
   2. IDENTITY BAR (header: logo + wordmark)
   --------------------------------------------------------------- */
.cb-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 48px;
  background: linear-gradient(180deg, #fbfbfd, #f4f5fa);
}

.cb-wordmark {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  color: var(--cooper-red);
}

.cb-identity .custom-logo,
.cb-identity .cb-logo-default img {
  height: 52px;
  width: auto;
  display: block;
}

/* ---------------------------------------------------------------
   3. PRIMARY NAVIGATION
   --------------------------------------------------------------- */
.cb-nav {
  background: var(--navy-500);
  padding: 0 48px;
  display: flex;
  align-items: center;
}

/* Menu list */
.cb-nav__menu {
  display: inline-flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 28px;
}

.cb-nav__menu a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 20px 4px;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  transition:
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

.cb-nav__menu a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.cb-nav__menu .current-menu-item a {
  border-bottom-color: var(--cooper-red);
}

/* CTA button — pushed to far right */
.cb-nav__cta {
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.cb-nav__cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--cooper-red);
  font-weight: 700;
  font-size: var(--fs-14);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  transition: opacity var(--dur-base) var(--ease-out);
}

/* Log-in icon before the nav CTA label (masked so it inherits the red text) */
.cb-nav__cta a::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E") no-repeat center / contain;
}

.cb-nav__cta a:hover {
  opacity: 0.9;
}

/* Hamburger — hidden on desktop, shown at mobile breakpoint */
.cb-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}

/* ---------------------------------------------------------------
   4. MAIN CONTENT AREA
   --------------------------------------------------------------- */
.cb-main {
  display: block;
}

/* Full-bleed main: hero + footer span edge-to-edge; body content is centered
   by .cb-body below. */
.cb-main--full {
  display: block;
}

/* Content column between the hero and footer. Left edge matches the nav /
   identity band (48px) so body copy lines up with the navigation. */
.cb-body {
  padding: 0 48px 72px;
}

/* Intro copy sits in a slightly narrower measure than the wider sections. */
.cb-intro {
  max-width: 820px;
  padding: 64px 0 8px;
}

.cb-intro > .eyebrow + p {
  font-size: var(--fs-18);
  color: var(--navy-800);
  margin-top: 16px;
}

/* Inner (non-home) pages align to the nav's left edge, like the home body. */
.cb-main--article {
  padding: 24px 48px 72px;
}

.cb-page-title {
  /* Match the home hero headline size (.cb-hero__inner h1). */
  font-size: clamp(var(--fs-36), 5vw, 52px);
  padding: 40px 0 4px;
}

/* ---------------------------------------------------------------
   5. HERO PATTERN BLOCK  (core/cover carrying .cb-hero)
   --------------------------------------------------------------- */
.cb-hero.wp-block-cover {
  min-height: 460px;
  /* Left-align the inner column instead of core/cover's centering. */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

/* Directional editorial scrim over the hero image — dark on the left,
   fading to near-transparent on the right (replaces core's flat dim). */
.cb-hero > .wp-block-cover__background {
  background: linear-gradient(
    90deg,
    rgba(18, 26, 48, 0.92) 0%,
    rgba(18, 26, 48, 0.72) 42%,
    rgba(18, 26, 48, 0.15) 100%
  );
  opacity: 1;
}

.cb-hero__inner {
  max-width: 640px;
  width: 100%;
  padding: 0 56px;
}

.cb-hero .eyebrow {
  color: #ffb3c2;
  margin-bottom: 14px;
}

.cb-hero__inner h1 {
  color: #fff;
  font-size: clamp(var(--fs-36), 5vw, 52px);
  line-height: 1.05;
  margin-bottom: 18px;
}

.cb-hero .lede {
  color: rgba(255, 255, 255, 0.92);
  font-size: 19px;
  line-height: 1.55;
  max-width: 520px;
}

.cb-hero .wp-block-buttons {
  gap: 14px;
  margin-top: 30px;
}

/* ---------------------------------------------------------------
   6. HELP ROWS
   --------------------------------------------------------------- */
.cb-help {
  padding: 44px 0 8px;
}

/* Divider above the first help row (below the "Get help" label). */
.cb-help__row:first-of-type {
  border-top: 1px solid var(--border-subtle);
}

.cb-help__row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.cb-help__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--red-50);
  color: var(--cooper-red);
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------
   7. CTA BANNER BLOCK
   --------------------------------------------------------------- */
.cb-cta {
  background: var(--cooper-red);
  color: #fff;
  border-radius: var(--radius-md);
  margin: 56px 0 0;
  padding: 44px 48px;
  display: flex;
  gap: 32px;
  justify-content: space-between;
  align-items: center;
}

.cb-cta h2,
.cb-cta h3 {
  color: #fff;
  font-size: clamp(28px, 3.4vw, 40px);
  margin-bottom: 8px;
}

.cb-cta p {
  color: rgba(255, 255, 255, 0.9);
}

/* White button inside the red CTA banner */
.cb-cta .wp-block-button__link,
.cb-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--cooper-red);
  border-radius: var(--radius-sm);
  padding: 16px 30px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

/* Arrow after the CTA button label (masked so it inherits the red text) */
.cb-cta .wp-block-button__link::after {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------------------------------------------------------------
   8. FAQ ACCORDION BLOCK
   --------------------------------------------------------------- */
.cb-faq {
  padding: 64px 0 20px;
}

.cb-faq details {
  border-bottom: 1px solid var(--border-subtle);
}

.cb-faq summary {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
  list-style: none;
}

/* Remove default disclosure marker across browsers */
.cb-faq summary::-webkit-details-marker {
  display: none;
}

.cb-faq__chev {
  color: var(--cooper-red);
  transition: transform var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}

.cb-faq details[open] .cb-faq__chev {
  transform: rotate(90deg);
}

.cb-faq details > p,
.cb-faq__answer {
  padding: 0 0 22px 34px;
  color: var(--neutral-600);
}

/* The chevron sits at a fixed size so the answer's 34px indent lines up. */
.cb-faq__chev {
  flex: none;
  display: inline-flex;
  width: 18px;
}

/* ---------------------------------------------------------------
   9. FOOTER
   --------------------------------------------------------------- */
.cb-footer {
  background: var(--navy-700);
  color: var(--navy-100);
  padding: 44px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cb-footer__logo img {
  height: 46px;
  width: auto;
  display: block;
  /* Recolor any Customizer logo to white on the dark navy footer */
  filter: brightness(0) invert(1);
}

.cb-footer__wordmark {
  color: #fff;
  font-weight: 700;
}

.cb-footer__meta {
  font-size: var(--fs-14);
  color: var(--navy-100);
}

.cb-footer__note {
  font-size: var(--fs-12);
  opacity: 0.7;
}

/* ---------------------------------------------------------------
   10. GUTENBERG BLOCK STYLES
   --------------------------------------------------------------- */

/* Primary — solid red fill */
.wp-block-button.is-style-cooper-primary .wp-block-button__link {
  background: var(--cooper-red);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 15px 28px;
  font-weight: 700;
}

/* Secondary — transparent / outlined (for use on dark backgrounds) */
.wp-block-button.is-style-cooper-secondary .wp-block-button__link {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  font-weight: 700;
}

/* Inline link component */
.cc-link {
  color: var(--cooper-red);
  text-decoration: none;
  border-bottom: 1px solid rgba(191, 13, 62, 0.35);
  transition: border-bottom-color var(--dur-base) var(--ease-out);
}

.cc-link:hover {
  border-bottom-color: var(--cooper-red);
}

/* ---------------------------------------------------------------
   11. RESPONSIVE — mobile breakpoint (≤ 781px, WP canonical)
   --------------------------------------------------------------- */
@media (max-width: 781px) {

  /* Identity + nav get tighter horizontal padding */
  .cb-identity,
  .cb-nav {
    padding-left: 22px;
    padding-right: 22px;
  }

  /* Nav becomes a vertical stack, hidden until .is-open toggled */
  .cb-nav {
    flex-wrap: wrap;
  }

  .cb-nav__menu {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .cb-nav.is-open .cb-nav__menu {
    display: flex;
  }

  .cb-nav__menu a {
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .cb-nav__cta {
    margin-left: auto;
  }

  /* Hamburger visible on mobile */
  .cb-hamburger {
    display: inline-flex;
  }

  /* Hero compresses */
  .cb-hero.wp-block-cover {
    min-height: 380px;
  }

  .cb-hero__inner {
    padding: 0 22px;
  }

  /* Tighter body gutters on mobile */
  .cb-body {
    padding-left: 22px;
    padding-right: 22px;
  }

  /* Keep help rows icon-beside-text on mobile (WP stacks columns by default) */
  .cb-help__row.wp-block-columns {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 14px;
    align-items: flex-start;
  }

  .cb-help__row .cb-help__icon {
    flex: 0 0 44px;
    width: 44px;
  }

  .cb-help__row .wp-block-column {
    margin-left: 0;
  }

  /* CTA banner stacks vertically */
  .cb-cta {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 28px 24px;
  }

  /* Footer stacks vertically */
  .cb-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
