/**
 * chapters.css
 *
 * Page-specific styles for template-chapters.php (Our Chapters directory).
 * Enqueued only on this template via inc/enqueue.php.
 *
 * Global elements excluded (already in main.css):
 *   :root tokens, reset, body, headings, a, img
 *   .container, .eyebrow, .seo-h1, .hero-headline
 *   .hero (base), .hero-content, .hero p
 *   .btn-primary, .btn-secondary, .btn-arrow
 *   .breadcrumb*, header/nav, .top-bar*, footer*
 *   .hamburger*, .mobile-menu*, .mobile-nav*
 *   .stats-strip, .stat-item, .stat-num, .stat-label (shared component)
 *
 * File location in theme: assets/css/chapters.css
 */

/* ── HERO — page-specific overrides ─────────────────────────────────────────
   The base .hero shell (position, display, align-items, overflow) lives in
   main.css. These rules apply the chapters background image, gradient, and
   grayscale treatment specific to this page.
   ──────────────────────────────────────────────────────────────────────────── */
.hero {
  background-image:
    linear-gradient(100deg, rgba(10, 10, 10, 0.92) 0%, rgba(10, 10, 10, 0.55) 50%, rgba(10, 10, 10, 0.85) 100%),
    var(--hero-bg-image, none); /* set inline via ACF background image field if used */
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) contrast(1.05);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 70%, var(--black) 100%);
  pointer-events: none;
}

/* Lead paragraph inside the chapters hero */
.hero .lead {
  font-size: 19px;
  color: var(--silver-light);
  max-width: 600px;
  margin-bottom: 44px;
  line-height: 1.65;
  font-weight: 300;
}


/* ── STICKY FILTER BAR ───────────────────────────────────────────────────── */

.filter-bar {
  position: sticky;
  top: 96px; /* matches header min-height */
  z-index: 50;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(184, 184, 184, 0.1);
}

.filter-bar-inner {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  height: 64px;
}

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(184, 184, 184, 0.1);
}

.search-icon {
  position: absolute;
  left: 0;
  color: var(--silver-dark);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 0 16px 0 28px;
  caret-color: var(--white);
}

.search-input::placeholder {
  color: var(--silver-dark);
}

/* Hide the native clear button that browsers add to type="search" */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.filter-tab {
  height: 64px;
  padding: 0 22px;
  border: none;
  background: transparent;
  color: var(--silver-dark);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border-left: 1px solid rgba(184, 184, 184, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}

.filter-tab.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.filter-count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
  /* default (inactive) */
  background: rgba(255, 255, 255, 0.15);
  color: var(--silver);
}

.filter-tab.active .filter-count {
  background: var(--silver);
  color: var(--black);
}

/* NJ-specific accent badge (highest-count state gets a slightly brighter treatment) */
.nj-badge {
  background: rgba(255, 255, 255, 0.22) !important;
  outline: 1px solid rgba(255, 255, 255, 0.25);
}

.filter-tab.active .nj-badge {
  background: var(--white) !important;
  outline: none;
}


/* ── CHAPTERS SECTION ────────────────────────────────────────────────────── */

.chapters-section {
  padding: 80px 0 120px;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(184, 184, 184, 0.2);
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
}

.results-count {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  font-weight: 500;
}

.results-count strong {
  color: var(--black);
  font-weight: 600;
}


/* ── CHAPTER GRID ────────────────────────────────────────────────────────── */

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #d8d8d8;
}


/* ── CHAPTER CARD ────────────────────────────────────────────────────────── */

.chapter-card {
  background: var(--white);
  display: flex;
  flex-direction: column;
  transition: background 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.chapter-card:hover {
  background: #f8f8f8;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

/* Left-edge accent bar that animates in on hover */
.chapter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--black);
  transition: height 0.3s ease;
}

.chapter-card:hover::before {
  height: 100%;
}

/* Inactive / suspended state — muted treatment */
.chapter-card.is-inactive {
  opacity: 0.65;
}

.chapter-card.is-inactive:hover {
  opacity: 0.8;
}


/* ── CARD HEADER ─────────────────────────────────────────────────────────── */

.card-header {
  padding: 30px 28px 22px;
  border-bottom: 1px solid #e8e8e8;
  position: relative;
}

.card-greek-letter {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--black);
  margin-bottom: 10px;
  display: inline-block;
}

.card-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--black);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card-greek {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: #666;
  font-weight: 400;
}
.founding-tag{
  font-weight: 600;
  color: var(--silver-dark);
}

/* ── STATUS BADGE ────────────────────────────────────────────────────────── */

.status-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  background: #f0f0f0;
  color: #444;
  border: 1px solid #d8d8d8;
}

.status-badge.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.status-badge.colony {
  background: var(--white);
  color: #888;
  border: 1px dashed #bbb;
}


/* ── CARD BODY ───────────────────────────────────────────────────────────── */

.card-body {
  padding: 22px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-info-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
}

.info-value {
  font-size: 13.5px;
  color: #333;
  line-height: 1.45;
  font-weight: 400;
}

.info-value.institution {
  font-weight: 600;
  color: var(--black);
  font-size: 14px;
}

.address-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.address-line svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #999;
}

.card-divider {
  margin: 0 28px;
  height: 1px;
  background: #e8e8e8;
}


/* ── CARD CONTACT ────────────────────────────────────────────────────────── */

.card-contact {
  padding: 18px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-person {
  font-size: 13px;
  color: var(--black);
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #555;
  transition: color 0.2s;
  text-decoration: none;
}

.contact-link:hover {
  color: var(--black);
}

.contact-link svg {
  flex-shrink: 0;
  color: #aaa;
  transition: color 0.2s;
}

.contact-link:hover svg {
  color: #555;
}


/* ── CARD FOOTER LINK ────────────────────────────────────────────────────── */

.card-footer-link {
  padding: 14px 28px;
  border-top: 1px solid #e8e8e8;
}

.card-footer-link a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, gap 0.2s;
}

.card-footer-link a:hover {
  color: var(--black);
  gap: 10px;
}


/* ── CARD BOTTOM TAB (animated hover accent) ─────────────────────────────── */

.card-tab {
  height: 3px;
  background: var(--black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.chapter-card:hover .card-tab {
  transform: scaleX(1);
}


/* ── NO-RESULTS STATE ────────────────────────────────────────────────────── */

.no-results {
  grid-column: 1 / -1;
  padding: 96px 0;
  text-align: center;
  display: none;
  background: var(--white);
}

.no-results.visible {
  display: block;
}

.no-results p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #888;
  margin-bottom: 12px;
}

.no-results small {
  font-size: 13px;
  color: #aaa;
  letter-spacing: 0.08em;
}


/* ── START A CHAPTER CTA ─────────────────────────────────────────────────── */

.start-chapter {
  background: var(--black-2);
  border: 1px solid rgba(184, 184, 184, 0.1);
  padding: 72px 80px;
  margin-top: 1px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.start-chapter-text .eyebrow {
  margin-bottom: 16px;
}

.start-chapter-text h2 {
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 16px;
  color: var(--white);
}

.start-chapter-text h2 .italic {
  font-style: italic;
  font-weight: 500;
  background: var(--silver-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-chapter-text p {
  font-size: 16px;
  color: var(--silver);
  line-height: 1.65;
  max-width: 520px;
  font-weight: 300;
}

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


/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1100px) {
  .chapters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .start-chapter {
    padding: 48px 40px;
  }

  .filter-tabs {
    overflow-x: auto;
  }

  .filter-bar-inner {
    padding: 0 28px;
  }
}

/* Large mobile */
@media (max-width: 900px) {

  .hero .lead {
    font-size: 16px;
  }

  .chapters-grid {
    grid-template-columns: 1fr;
  }

  .start-chapter {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .start-chapter-actions {
    align-items: flex-start;
  }

  .filter-bar-inner {
    padding: 0 24px;
  }

  .filter-bar {
    top: 72px; /* matches reduced header height on mobile */
  }
}

/* Small mobile */
@media (max-width: 640px) {
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hide filter tab text labels — show icon/count only */
  .filter-tab span:first-child {
    display: none;
  }

  .filter-tab {
    padding: 0 16px;
  }

  .start-chapter {
    padding: 40px 24px;
  }

  .card-header {
    padding: 24px 20px 18px;
  }

  .card-body {
    padding: 18px 20px;
  }

  .card-contact {
    padding: 14px 20px 20px;
  }

  .card-footer-link {
    padding: 12px 20px;
  }

  .card-divider {
    margin: 0 20px;
  }
}

/* Very small phones */
@media (max-width: 420px) {
  .stats-strip {
    grid-template-columns: 1fr;
  }
}
