/* Public blog index (/blog/) - layout, filters, grid */

.blog-page-content {
  --blog-navy: #0a1628;
  --blog-navy-soft: #132a4a;
  --blog-blue: #2563eb;
  --blog-blue-hover: #1d4ed8;
  --blog-surface: #f4f7fc;
  --blog-card-border: rgba(15, 23, 42, 0.08);
  --blog-muted: #5c6b82;
  background: #fff;
  color: var(--blog-navy);
}

.blog-shell {
  width: min(1140px, calc(100% - 96px));
  margin: 0 auto;
}

/* Hero */
.blog-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 40px);
  padding-left: 20px;
  padding-right: 20px;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, #eef3fb 0%, #fff 100%);
}

.blog-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 70%);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.35),
    transparent
  );
}

.blog-hero__eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blog-blue);
}

.blog-page-content .blog-hero__title {
  margin: 0 auto;
  color: var(--blog-navy);
  /* Fits ~1 line on desktop; scales down so tablets rarely exceed 2 lines */
  font-size: 3rem;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.025em;
  max-width: 100%;
  padding-inline: 0;
  font-family: Work Sans, system-ui, sans-serif;
  text-wrap: balance;
}

/* Hard cap at 2 lines on narrow viewports where long titles still wrap 3+ */
@media (max-width: 640px) {
  .blog-page-content .blog-hero__title {
    font-size: 2rem;
    line-height: 1.25;
    display: block;
    overflow: visible;
    white-space: normal;
  }
}

.blog-hero__subtitle {
  margin: 16px auto 0;
  max-width: 52ch;
  color: var(--blog-muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.65;
  font-weight: 500;
}

/* Newsletter */
.blog-subscribe {
  padding: 0 0 8px;
}

.blog-subscribe__form {
  width: min(640px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.blog-subscribe__input {
  min-width: 0;
  height: 52px;
  border: 1px solid #d5deeb;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 1rem;
  color: var(--blog-navy);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.blog-subscribe__input::placeholder {
  color: #8b9bb5;
}

.blog-subscribe__button {
  height: 52px;
  border: 0;
  border-radius: 12px;
  padding: 0 26px;
  font-size: 0.98rem;
  font-weight: 500;
  color: #fff;
  background: var(--blog-blue);
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
  white-space: nowrap;
}

.blog-subscribe__button:hover {
  background: var(--blog-blue-hover);
  transform: translateY(-1px);
}

.blog-messages {
  width: min(640px, 100%);
  margin: 0 auto 14px;
}

.blog-message {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.blog-message.success {
  background: #ecfdf3;
  color: #166534;
}

.blog-message.error {
  background: #fef2f2;
  color: #991b1b;
}

/* Filter panel */
.blog-filters {
  margin: 32px 0 28px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--blog-card-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.blog-filters__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.blog-filters__search {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.blog-filters__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-filters__search input[type="search"] {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  border: 1px solid #d5deeb;
  border-radius: 10px;
  padding: 0 16px 0 44px;
  font-size: 0.97rem;
  color: var(--blog-navy);
  background: #f8fafc
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' viewBox='0 0 24 24' stroke='%235c6b82'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-4.35-4.35M11 18a7 7 0 100-14 7 7 0 000 14z'/%3E%3C/svg%3E")
    14px center no-repeat;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.blog-filters__search input[type="search"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.blog-filters__search button {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 0;
  font-weight: 500;
  font-size: 0.93rem;
  color: #fff;
  background: var(--blog-navy-soft);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.blog-filters__search button:hover {
  background: var(--blog-navy);
}

.blog-filters__submit {
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 0;
  font-weight: 500;
  font-size: 0.93rem;
  color: #fff;
  background: var(--blog-navy-soft);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.blog-filters__submit:hover {
  background: var(--blog-navy);
}

.blog-filters__dropdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: start;
}

.blog-filter-dd {
  position: relative;
}

.blog-filter-dd__toggle {
  width: 100%;
  height: 44px;
  border: 1px solid #c7d2e6;
  border-radius: 10px;
  background: #f3f6fb;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.blog-filter-dd__toggle:hover,
.blog-filter-dd.is-open .blog-filter-dd__toggle {
  border-color: #1e3a8a;
  background: #eef3fb;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.blog-filter-dd__label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.blog-filter-dd__value {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.blog-filter-dd__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  padding: 8px 8px 6px;
  max-height: 280px;
  overflow: auto;
  display: none;
}

.blog-filter-dd.is-open .blog-filter-dd__menu {
  display: block;
}

.blog-filter-dd__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1e293b;
  cursor: pointer;
}

.blog-filter-dd__item:hover {
  background: #edf2fa;
}

.blog-filter-dd__item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #1e3a8a;
  cursor: pointer;
}

.blog-filter-dd__item input[type="checkbox"]:checked + span {
  color: #1e3a8a;
}

/* Collapsible drawer toggle */
.blog-filters__drawer {
  flex-shrink: 0;
  justify-self: end;
}

.blog-filters__drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #d5deeb;
  background: #f8fafc;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--blog-navy-soft);
  cursor: pointer;
  user-select: none;
  list-style: none;
  white-space: nowrap;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.blog-filters__drawer-toggle::-webkit-details-marker {
  display: none;
}

.blog-filters__drawer[open] .blog-filters__drawer-toggle,
.blog-filters__drawer-toggle:hover {
  border-color: var(--blog-blue);
  background: rgba(37, 99, 235, 0.06);
  color: var(--blog-blue);
}

.blog-filters__active-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blog-blue);
  flex-shrink: 0;
}

.blog-filters__chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.blog-filters__drawer[open] .blog-filters__chevron {
  transform: rotate(180deg);
}

.blog-filters__panel {
  padding: 16px 0 2px;
  margin-top: 10px;
  border-top: 1px solid #eef2f7;
}

.blog-filters__row-title {
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.6875rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blog-muted);
  font-family: Work Sans, system-ui, sans-serif;
}

.blog-filters__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.blog-filters__pills:last-child {
  margin-bottom: 0;
}

.blog-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--blog-navy-soft);
  background: #f7f7f7;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.blog-pill:hover {
  background: #e2e8f0;
  color: var(--blog-navy);
}

.blog-pill.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blog-blue);
  border-color: rgba(37, 99, 235, 0.35);
}

.blog-pill__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blog-muted);
  background: #fff;
  border-radius: 999px;
  padding: 2px 7px;
}

.blog-pill.is-active .blog-pill__count {
  color: var(--blog-blue);
  background: rgba(255, 255, 255, 0.9);
}

.blog-filters__clear {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

.blog-filters__clear a {
  color: var(--blog-blue);
}

.blog-results-meta {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: var(--blog-muted);
}

.blog-results-meta strong {
  color: var(--blog-navy);
  font-weight: 700;
}

/* Grid */
.blog-grid-section {
  padding: 0 0 80px;
}

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

.blog-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(232, 237, 244, 0.98);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.blog-card:hover {
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  border-color: rgba(220, 229, 240, 1);
  transform: translateY(-3px);
}

.blog-card:focus-within {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 4px;
}

.blog-card__link-overlay {
  display: none;
}

.blog-card__thumb {
  display: block;
  line-height: 0;
  position: relative;
  overflow: hidden;
}

.blog-card__thumb img,
.blog-card__thumb--placeholder {
  width: 100%;
  aspect-ratio: 16 / 5.6;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #e8f0ff, #dbeafe);
  transition: transform 0.45s ease;
}

.blog-card:hover .blog-card__thumb img {
  transform: scale(1.03);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 14px 18px 14px;
  gap: 12px;
  flex: 1;
}

.blog-card__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 20px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: -2px 0 4px;
}

.blog-card__badge--blue {
  background: #2563eb;
}
.blog-card__badge--indigo {
  background: #4338ca;
}
.blog-card__badge--cobalt {
  background: #1d4ed8;
}
.blog-card__badge--green {
  background: #16a34a;
}
.blog-card__badge--olive {
  background: #65a30d;
}
.blog-card__badge--purple {
  background: #7c3aed;
}
.blog-card__badge--pink {
  background: #db2777;
}
.blog-card__badge--teal {
  background: #2b70e4;
}
.blog-card__badge--orange {
  background: #ea580c;
}
.blog-card__badge--amber {
  background: #d97706;
}

.blog-page-content .blog-card .blog-card__title {
  margin: 0;
  font-size: clamp(0.96rem, 1.15vw, 1.08rem);
  line-height: 1.24;
  font-weight: 700;

  font-family: Work Sans, system-ui, sans-serif;
  color: var(--blog-navy);
  transition: color 0.15s;
}

.blog-card:hover .blog-card__title {
  color: var(--blog-blue);
}

.blog-card__excerpt {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  margin-top: auto;
  padding: 2px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  color: #56698d;
  font-size: 0.84rem;
  font-weight: 500;
}

.blog-card__meta-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.blog-card__meta-item svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.blog-card__meta-separator {
  width: 1px;
  height: 16px;
  background: #dbe4f0;
  flex-shrink: 0;
}

.blog-card__arrow {
  position: relative;
  z-index: 1;
  margin-left: auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: rgba(255, 255, 255, 0.95);
  color: var(--blog-navy);
  box-shadow: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.blog-card:hover .blog-card__arrow {
  transform: translateX(2px);
  border-color: rgba(203, 213, 225, 1);
  background: #fff;
  color: var(--blog-blue);
}

.blog-card__arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.blog-card__author,
.blog-card__author-avatar,
.blog-card__author-initial,
.blog-card__author-name,
.blog-card__date {
  display: none;
}

.blog-empty {
  padding: 56px 28px;
  text-align: center;
  color: #64748b;
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  background: #fafbfc;
}

.blog-empty__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blog-navy-soft);
}

/* Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.blog-pagination__link,
.blog-pagination__status {
  height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.blog-pagination__link {
  min-width: 118px;
  gap: 8px;
  border: 1px solid #d7e1ee;
  text-decoration: none;
  color: var(--blog-navy-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  font-weight: 700;
  font-size: 0.9rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.blog-pagination__link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.blog-pagination__link:hover,
.blog-pagination__link:focus-visible {
  border-color: var(--blog-blue);
  color: var(--blog-blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.blog-pagination__status {
  min-width: 152px;
  gap: 8px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(37, 99, 235, 0.06);
  color: var(--blog-navy);
  font-weight: 600;
  font-size: 0.88rem;
}

.blog-pagination__status strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--blog-blue);
}

.blog-pagination__status-label,
.blog-pagination__status-separator {
  color: var(--blog-muted);
}

.blog-pagination__status-separator {
  font-size: 0.82rem;
}

.blog-newsletter-home {
  margin: 0;
  border-radius: 0;
  overflow: visible;
}

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Match feature-page gutters (members/finances): 16px sides */
  .blog-shell {
    width: min(1140px, calc(100% - 32px));
  }
}

@media (max-width: 767px) {
  .blog-shell {
    width: min(100%, calc(100% - 32px));
  }

  .blog-filters {
    padding: 12px 12px;
  }

  .blog-filters__top {
    grid-template-columns: 1fr;
  }

  .blog-filters__search {
    flex: 1 1 100%;
  }

  .blog-filters__submit {
    width: 100%;
  }

  .blog-filters__dropdown-row {
    grid-template-columns: 1fr;
  }

  .blog-filter-dd__toggle {
    height: 42px;
  }

  .blog-filters__drawer {
    width: 100%;
    justify-self: stretch;
  }

  .blog-filters__drawer-toggle {
    width: 100%;
    justify-content: space-between;
    padding: 0 14px;
  }

  .blog-filters__panel {
    margin-top: 8px;
    padding-top: 12px;
  }

  .blog-filters__row-title {
    margin-bottom: 7px;
  }

  .blog-filters__pills {
    gap: 7px;
    margin-bottom: 12px;
  }

  .blog-pill {
    font-size: 0.84rem;
    padding: 6px 10px;
  }

  .blog-subscribe__form {
    grid-template-columns: 1fr;
  }

  .blog-subscribe__button {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .blog-pagination {
    gap: 10px;
  }

  .blog-pagination__link,
  .blog-pagination__status {
    width: 100%;
    min-width: 0;
  }

  .blog-pagination__link--prev {
    order: 1;
  }

  .blog-pagination__status {
    order: 2;
  }

  .blog-pagination__link--next {
    order: 3;
  }

  .blog-card__body {
    padding: 13px 16px 12px;
    gap: 10px;
  }

  .blog-card__meta {
    padding: 0 16px 16px;
    gap: 10px;
  }

  .blog-page-content .blog-card .blog-card__title {
    font-size: 0.98rem;
    line-height: 1.26;
  }

  .blog-card__excerpt {
    font-size: 0.9rem;
    line-height: 1.54;
    -webkit-line-clamp: 3;
  }

  .blog-card__badge {
    max-width: 100%;
    font-size: 0.58rem;
    padding: 3px 7px;
    margin-top: 0;
  }

  .blog-card__arrow {
    width: 32px;
    height: 32px;
  }

  .blog-card__meta-item {
    font-size: 0.84rem;
  }
}
