/* ============================================================================
   index.css — BNI Champions homepage
   Design source: BNI Champions Homepage.dc.html (Claude Design canvas mock).
   Tokens (--color-*, --font-*) come from base.css.
   ========================================================================== */

/* keep the page from stretching edge-to-edge on wide monitors - caps at the
   1440px width the design was authored at, centered, with the section's own
   60px side padding still applying inside that cap */
main {
  max-width: 1440px;
  margin-inline: auto;
}

/* shared hero-photo box (index/about/visitor-info hero-media all use this) -
   the class name is a holdover from when these ran a grayscale+red-tint
   filter; hero photos are shown in full colour now, but the positioned/
   cropped box underneath (needed as the .caption overlay's containing
   block) is still shared here. */
.duotone {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-ink);
}

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

/* ---------- Hero ------------------------------------------------------- */

.hero-section {
  border-bottom: 1px solid var(--color-line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.hero-main {
  padding: 40px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-title {
  margin: 0;
  font-size: 42px;
  line-height: .98;
  letter-spacing: -.03em;
  font-weight: 800;
  color: var(--color-ink);
  text-wrap: pretty;
}

.hero-title .tint {
  font-weight: 400;
  color: var(--color-text-tint);
}

.hero-sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text-body);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.hero-actions .action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
}

.stat-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-line-soft);
}

.stat-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-line-soft);
}

.stat-row .num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--color-ink);
  min-width: 66px;
}

.stat-row .label {
  font-size: 14px;
  color: var(--color-text-body);
}

.stat-row .leader {
  flex: 1;
  min-width: 12px;
  border-bottom: 1px dotted var(--color-text-tint);
}

.stat-row .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--color-text-faint);
  white-space: nowrap;
}

.hero-media {
  height: 250px;
  border-top: 1px solid var(--color-line);
}

.hero-media .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: rgba(20, 17, 14, .86);
}

.hero-media .caption .title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-on-dark);
}

.hero-media .caption .sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--color-line-soft);
  margin-top: 4px;
}

/* ---------- Section shells ------------------------------------------- */

.section-head {
  padding: 40px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head .section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -.025em;
  font-weight: 800;
  color: var(--color-ink);
}

.section-title .tint {
  font-weight: 400;
  color: var(--color-text-tint);
}

.section-head .showing {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ---------- Directory grid -------------------------------------------- */

.directory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1px;
  background: var(--color-line-soft);
  border-top: 1px solid var(--color-line-soft);
  border-bottom: 1px solid var(--color-line-soft);
  margin-top: 20px;
}

.directory-card {
  /* min-width:0 - without it, a grid item's automatic minimum width
     defaults to its min-content size, and a nowrap text run (the
     ellipsis truncation below) has a very wide min-content. Grid then
     grows that one 1fr column past the others to fit it, even though
     overflow:hidden means it never actually needs the room. */
  min-width: 0;
  background: var(--color-paper);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* always square, regardless of column width at any breakpoint - width is
   set by the grid column (100% of it), height just follows from that. */
.directory-card .photo {
  aspect-ratio: 1;
  background: var(--color-panel);   /* shows through for a member with no photo yet */
  overflow: hidden;
}

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

/* name/specialty/business are each capped to one line with an ellipsis -
   a long one (e.g. "Real Estate Consultant (New Launch)") truncates to
   "Real Estate Consultant (New..." instead of wrapping to a 2nd line.
   Photos are a fixed aspect-ratio regardless, but this still matters:
   CSS Grid sizes a whole row to its tallest card, so an unclamped 2-line
   wrap would still stretch every other card's row height and leave a gap
   below their shorter content. */
.directory-card > div:last-child {
  min-width: 0;
}

.directory-card .name,
.directory-card .specialty,
.directory-card .business {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.directory-card .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
}

.directory-card .specialty {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.directory-card .business {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  /* reserves its line's height even when a member has no business_name
     and the div renders empty - otherwise that card is one line shorter
     than its row-mates and the row-height-blowout problem is back. */
  min-height: 1.4em;
  letter-spacing: .08em;
  color: var(--color-text-faint);
  margin-top: 3px;
  text-transform: uppercase;
}

.directory-card.is-more {
  background: var(--color-panel);
  justify-content: flex-start;
  transition: background-color .15s;
}

/* the only clickable tile in the grid (the rest are plain info cards), so
   it gets hover/focus feedback the others don't. */
.directory-card.is-more:hover,
.directory-card.is-more:focus-visible {
  background: var(--color-line-soft);
  outline: none;
}

.directory-card.is-more .photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-panel);
  border: 1px solid var(--color-line-soft);
  transition: border-color .15s;
}

.directory-card.is-more:hover .photo,
.directory-card.is-more:focus-visible .photo {
  border-color: var(--color-red);
}

.directory-card.is-more .count {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-red);
  letter-spacing: -.03em;
}

.directory-card.is-more .business {
  transition: color .15s;
}

.directory-card.is-more:hover .business,
.directory-card.is-more:focus-visible .business {
  color: var(--color-red);
}

/* mobile shows the first 6 members + a "full directory" link below the grid;
   tablet/desktop show the whole 12-tile grid (last tile is the "+N" link)
   instead. Scoped to .is-teaser (the homepage's fixed-12 grid only) - the
   standalone /directory page reuses .directory-grid/.directory-card too,
   but paginates instead of hiding, so it must not be affected by this. */
.directory-grid.is-teaser .directory-card:nth-child(n+7) {
  display: none;
}

.directory-foot {
  padding: 16px 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Categories (dark section) ---------------------------------- */

.categories-section {
  background: var(--color-ink);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.categories-section .kicker {
  color: var(--color-on-dark-muted);
}

.categories-section .section-title {
  color: var(--color-on-dark);
}

.categories-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-on-dark-body);
  max-width: 520px;
}

.category-list {
  display: flex;
  flex-direction: column;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line-dark);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-on-dark);
}

.category-row::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--color-red);
  display: block;
  flex: none;
}


/* ---------- Visitor info ------------------------------------------------ */

.visitor-section {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-bottom: 1px solid var(--color-line);
}

.visitor-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.checklist {
  display: flex;
  flex-direction: column;
}

.checklist-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--color-line-soft);
}

.checklist-item:last-child {
  border-bottom: 1px solid var(--color-line-soft);
}

.checklist-item .check {
  color: var(--color-red);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.checklist-item .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink);
}

.checklist-item .detail {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 3px;
  line-height: 1.5;
}

/* ---------- Footer CTA -------------------------------------------------- */

.footer-cta-section {
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-cta-section .cta-title {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.03em;
  font-weight: 800;
  color: var(--color-ink);
  max-width: 760px;
}

.footer-cta-section .cta-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.footer-cta-section .contact-line {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--color-text-muted);
}

/* ---------- Desktop (1024px+) ------------------------------------------- */

@media screen and (min-width: 1024px) {

  .hero-grid {
    grid-template-columns: 1fr 520px;
  }

  .hero-main {
    padding: 66px 60px 54px;
    border-right: 1px solid var(--color-line);
  }

  .hero-title {
    font-size: 72px;
  }

  .hero-sub {
    font-size: 19px;
  }

  .hero-media {
    height: 100%;
    border-top: none;
  }

  .hero-media .caption {
    padding: 22px 24px;
  }

  .hero-media .caption .title {
    font-size: 16px;
  }

  .hero-media .caption .sub {
    font-size: 11px;
  }

  .section-head {
    padding: 76px 60px 0;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 60px;
  }

  .section-head .section-title {
    font-size: 48px;
  }

  .directory-grid {
    grid-template-columns: repeat(6, 1fr);
    margin: 32px 60px 76px;
    border: 1px solid var(--color-line-soft);
  }

  .categories-section,
  .visitor-section {
    padding: 76px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
  }

  .categories-section .section-title,
  .visitor-section .section-title {
    font-size: 48px;
  }

  .category-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 36px;
  }

  .footer-cta-section {
    padding: 66px 60px;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 60px;
  }

  .footer-cta-section .cta-title {
    font-size: 56px;
  }
}

@media screen and (min-width: 620px) {
  .directory-grid.is-teaser .directory-card:nth-child(n+7) {
    display: flex;
  }

  .directory-foot {
    display: none;
  }
}

@media screen and (min-width: 620px) and (max-width: 1023px) {
  .directory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
