/* ==========================================================================
   banks.com — financial brand directory page
   Ported from the "Banks Directory Page" design canvas. Static HTML + CSS:
   the canvas runtime (support.js, image-slot.js) is authoring tooling and is
   not carried over. The design's DCLogic component (category state, partner
   and column swapping) is reimplemented as a small inline script, and its
   inert `style-hover` attributes become real :hover rules. The <image-slot>
   placeholders render as labelled slots — partner brand marks are not
   reproduced here.
   ========================================================================== */

:root {
  --green:        #17c964;   /* brand green */
  --green-dark:   #0f9b4c;   /* connector CTA hover */
  --ink:          #2b3440;   /* body text */
  --heading:      #333c47;   /* display headings */
  --nav:          #3d4652;
  --body:         #57616d;   /* paragraph copy */
  --article:      #48525e;
  --wordmark:     #5c6470;
  --link:         #2f6bff;
  --link-hover:   #1b4fd1;
  --btn:          #4a6cf7;
  --btn-hover:    #3552d8;
  --band:         #f6f8f9;   /* category band */
  --arrow:        #d7dce1;
  --arrow-hover:  #c2c8cf;
  --slot:         #eef1f4;   /* image placeholder fill */
  --slot-line:    #dde3e9;
  --slot-text:    #97a1ad;

  --shadow-card:  0 6px 22px rgba(24, 39, 61, 0.10);
  --shadow-cat:   0 4px 14px rgba(24, 39, 61, 0.08);
  --shadow-on:    0 10px 26px rgba(24, 39, 61, 0.14);

  --radius: 10px;
  --gutter: 40px;
  --shell:  1400px;

  --font-display: Lato, 'Source Sans 3', system-ui, sans-serif;
  --font-body:    'Source Sans 3', system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

#cat-panel:focus { outline: none; }

/* ── Header ──────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px var(--gutter);
  background: #fff;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--wordmark);
}
.brand:hover { color: var(--wordmark); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border: 3px solid var(--green);
  border-radius: 5px;
}

.brand-door {
  width: 8px;
  height: 11px;
  background: var(--green);
  border-radius: 2px;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.5px;
}

.brand-dot { color: var(--green); }

.nav {
  display: flex;
  align-items: center;
  gap: 44px;
  flex-wrap: wrap;
}

.nav > a {
  font-size: 17px;
  color: var(--nav);
  font-weight: 400;
}
.nav > a:hover { color: var(--ink); }

.btn-credit {
  display: inline-block;
  padding: 14px 26px;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.btn-credit:hover {
  background: var(--green);
  color: #fff;
}

/* ── Category band ───────────────────────────────────────────────────────── */

.hero {
  background: var(--band);
  padding: 34px 0 44px;
}

.hero h1 {
  margin: 0 0 26px;
  padding: 0 var(--gutter);
  text-align: center;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--heading);
  text-wrap: pretty;
}

/* Connector call to action — routes through connector.spin-loans.dev/check,
   which sets the installationSource cookie before redirecting. */

.chatgpt-cta {
  max-width: var(--shell);
  margin: -6px auto 30px;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

.chatgpt-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 12px 14px 12px 30px;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  background: #fff;
}

.chatgpt-copy {
  font-size: 18px;
  color: var(--nav);
}

.btn-connect {
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.18s ease;
}
.btn-connect:hover { background: var(--green-dark); color: #fff; }

.cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

.cat-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--arrow);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.cat-arrow:hover { background: var(--arrow-hover); }

.cat-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
}

.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 236px;
  padding: 28px 18px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-cat);
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.cat-card:hover { box-shadow: var(--shadow-on); }

.cat-card.is-active {
  box-shadow: var(--shadow-on);
  transform: translateY(-2px);
}

/* Green caret marking the selected category */
.cat-card.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 26px solid var(--green);
}

.cat-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  color: var(--heading);
  line-height: 1.25;
  text-wrap: balance;
}

/* ── Partner cards ───────────────────────────────────────────────────────── */

.partners {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
  transform: translateY(-16px);
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.partner-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 44px 44px 40px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.partner-logo {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-blurb {
  margin: 22px 0 0;
  font-size: 18.5px;
  line-height: 1.55;
  color: var(--body);
  text-wrap: pretty;
}

.learn-more {
  margin-top: auto;
  padding-top: 28px;
  font-size: 16.5px;
  letter-spacing: 0.4px;
}

/* Stand-ins for the design's <image-slot> elements. */
.logo-slot,
.thumb-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px dashed var(--slot-line);
  background: var(--slot);
  color: var(--slot-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: center;
}

.logo-slot {
  width: 260px;
  height: 110px;
  border-radius: 6px;
}

.thumb-slot {
  width: 118px;
  height: 82px;
  flex: 0 0 auto;
  font-size: 12px;
}

/* ── Three-column detail ─────────────────────────────────────────────────── */

.detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 46px 24px 80px;
}

.detail-col { display: flex; flex-direction: column; align-items: flex-start; }

.detail h2 {
  margin: 0 0 34px;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--heading);
}

.detail p {
  margin: 0;
  font-size: 20px;
  line-height: 1.65;
  color: var(--body);
  text-wrap: pretty;
}

.btn-solid {
  display: inline-block;
  margin-top: 44px;
  padding: 17px 34px;
  border-radius: 5px;
  background: var(--btn);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background-color 0.18s ease;
}
.btn-solid:hover { background: var(--btn-hover); color: #fff; }

.articles {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.article {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.article-title {
  margin: 0;
  font-size: 19.5px;
  line-height: 1.4;
  color: var(--article);
  text-wrap: pretty;
}

.read-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 16px;
  letter-spacing: 0.4px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  :root { --gutter: 28px; }

  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-card { min-height: 150px; }

  /* The grid wraps to more than one row here, so the caret can no longer hang
     below the active card — it would land on the card in the next row. Become
     an underline seated inside the card's own bottom edge instead. */
  .cat-card.is-active::after {
    left: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    height: 4px;
    border: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--green);
  }
  .partner-card { padding: 32px 32px 28px; min-height: 0; }
  .detail { gap: 36px; }
  .detail h2 { font-size: 30px; }
  .detail p { font-size: 18px; }
}

@media (max-width: 960px) {
  .header { gap: 18px; }
  .nav { gap: 24px; width: 100%; }

  .hero h1 { font-size: 26px; }

  .partner-grid { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; gap: 48px; }

  .logo-slot { width: 100%; max-width: 260px; }
}

/* The CTA copy and button stop fitting on one line around here. Once they
   wrap, a 999px radius reads as a blob rather than a pill — square it off into
   a rounded card and centre the two rows. */
@media (max-width: 820px) {
  .chatgpt-pill {
    gap: 14px;
    padding: 16px 20px;
    border-radius: 20px;
    text-align: center;
  }
}

@media (max-width: 620px) {
  :root { --gutter: 18px; }

  .brand-word { font-size: 25px; }
  .nav { gap: 16px; }
  .nav > a { font-size: 15px; }
  .btn-credit { padding: 11px 18px; font-size: 12px; }

  .hero { padding: 26px 0 34px; }
  .hero h1 { font-size: 22px; margin-bottom: 20px; }

  .chatgpt-cta { margin: 0 auto 22px; padding: 0 14px; }
  .chatgpt-copy { font-size: 16px; }
  .btn-connect { padding: 11px 20px; font-size: 12px; }

  .cat-row { gap: 8px; padding: 0 14px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .cat-card { min-height: 108px; padding: 18px 12px; }
  .cat-name { font-size: 17px; }

  .partners { padding: 0 14px; }
  .partner-card { padding: 26px 22px 24px; }
  .partner-logo { height: 110px; }
  .partner-blurb { font-size: 17px; }

  .detail { padding: 34px 14px 56px; }
  .detail h2 { font-size: 26px; margin-bottom: 22px; }
  .detail p { font-size: 17px; }
  .btn-solid { margin-top: 30px; padding: 14px 26px; }

  .article { grid-template-columns: 92px minmax(0, 1fr); gap: 16px; }
  .thumb-slot { width: 92px; height: 66px; }
  .article-title { font-size: 17.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .cat-card.is-active { transform: none; }
}
