/**
 * Blog listing — aligned with site heroes, cards, and brand tokens.
 */
.blog-index {
  background: linear-gradient(
    180deg,
    #fefbf6 0%,
    var(--color-bg-hero, #f5faff) 22%,
    var(--color-bg, #f9fafb) 55%
  );
  padding: var(--space-2xl, 2rem) var(--container-padding, 1rem)
    var(--space-3xl, 4rem);
}

.blog-index__inner {
  max-width: var(--container-max, 85rem);
  margin: 0 auto;
}

.blog-index__toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  min-width: 0;
}

.blog-index__toolbar-label {
  flex-shrink: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

/* Mobile: label on its own row + larger type; pills full-width scroll below */
@media (max-width: 639px) {
  .blog-index__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .blog-index__toolbar-label {
    font-size: var(--font-size-lg);
    letter-spacing: 0.05em;
    max-width: 100%;
  }

  .blog-index__tags {
    flex: none;
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 640px) {
  .blog-index__toolbar-label {
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }
}

.blog-index__tags {
  display: flex;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  gap: 0.5rem 0.65rem;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.15rem 0;
}

.blog-index__tags::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.blog-index__pill {
  flex-shrink: 0;
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-secondary);
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.3;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.blog-index__pill:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--color-secondary-dark, #1d4ed8);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.08));
}

.blog-index__pill--active {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
  box-shadow: none;
}

.blog-index__pill--active:hover {
  background: var(--color-secondary-dark, #1d4ed8);
  border-color: var(--color-secondary-dark, #1d4ed8);
  color: #fff;
  box-shadow: none;
}

.blog-index__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .blog-index__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1100px) {
  .blog-index__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  height: 100%;
  min-height: 100%;
}

.blog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--color-bg-header, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-2xl, 1.5rem);
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 8px 24px -8px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.blog-card__link:hover {
  transform: translateY(-4px);
  border-color: #c7d9fd;
  box-shadow:
    0 12px 40px -12px rgba(37, 99, 235, 0.18),
    0 4px 16px rgba(0, 0, 0, 0.06);
}

.blog-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--color-secondary-light, #3b82f6) 0%,
    var(--color-primary-light, #f5a942) 100%
  );
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.blog-card__link:hover .blog-card__media img {
  transform: scale(1.04);
}

.blog-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 12rem;
  background: linear-gradient(
    145deg,
    #1e293b 0%,
    var(--color-secondary, #2563eb) 42%,
    var(--color-primary, #f29318) 100%
  );
  opacity: 0.92;
}

.blog-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.5rem 1.5rem;
  gap: 0.65rem;
}

.blog-card__accent {
  width: 3rem;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--color-secondary) 0%,
    var(--color-primary) 55%,
    #a855f7 100%
  );
}

.blog-card__title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-title, #020817);
  letter-spacing: -0.02em;
}

.blog-card__subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  line-height: 1.4;
}

.blog-card__excerpt {
  margin: 0;
  flex: 1;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  transition: gap 0.2s ease, color 0.2s ease;
}

.blog-card__link:hover .blog-card__cta {
  gap: 0.55rem;
  color: var(--color-secondary-dark, #1d4ed8);
}

.blog-index__empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  max-width: 28rem;
  margin: 0 auto;
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  background: var(--color-bg-header, #fff);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-2xl, 1.5rem);
}

/* Infinite scroll */
.blog-index__load-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  min-height: 3rem;
}

.blog-index__sentinel {
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.blog-index__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem;
}

.blog-index__loader[hidden] {
  display: none !important;
}

.blog-index__loader-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-secondary, #2563eb);
  opacity: 0.35;
  animation: blog-index-loader-pulse 0.9s ease-in-out infinite;
}

.blog-index__loader-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.blog-index__loader-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blog-index-loader-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.blog-index .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Blog hero: orange-only accents (no blue orbs/line/bg tint) */
.hero--blog {
  background-color: #fdf6ed;
  background-image: linear-gradient(
    180deg,
    #fffaf5 0%,
    #fdf6ed 38%,
    #fcefd9 100%
  );
}

.hero--blog .hero__page-orb--1 {
  background: var(--color-primary);
}

.hero--blog .hero__page-orb--2 {
  background: var(--color-primary-dark);
}

.hero--blog .hero__page-orb--3 {
  background: #f5a942;
}

.hero--blog .hero__page-orb--4 {
  background: #fcd9b3;
}

.hero--blog .hero__page-line {
  background: linear-gradient(
    90deg,
    var(--color-primary-dark) 0%,
    var(--color-primary) 45%,
    var(--color-primary-light) 100%
  );
}

/* Solid orange: gradient + background-clip breaks inside .trans-editable (text goes transparent). */
.hero--blog .hero__title--page,
.hero--blog .hero__title--page .trans-editable {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--color-primary-dark);
  -webkit-text-fill-color: currentColor;
}

.hero--blog .hero__subtitle--page {
  color: #7c2d12;
  opacity: 0.92;
}
