/**
 * ==============================================================================
 * BLOG PAGE SPECIFIC STYLES & SCROLL-TRIGGERED CASCADE (blog.css)
 * Pixel-Matched to Reference UI & Token-Bound to global.css
 * ==============================================================================
 */

/* ==============================================================================
   1. HERO SECTION & ENTRANCE KEYFRAMES
   ============================================================================== */
@keyframes heroFadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.blog-hero-section {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: clamp(2rem, 5vw, 4.5rem);
  padding-bottom: clamp(1.25rem, 3vw, 2.5rem);
  box-sizing: border-box;
}

.blog-hero-container {
  width: 92%;
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Hero Stagger Delays on Load */
.blog-hero-section .hero-row-1 {
  animation: heroFadeInUp 0.55s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)) 0.05s backwards;
}

.blog-hero-section .hero-row-2 {
  animation: heroFadeInUp 0.65s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)) 0.12s backwards;
}

.blog-hero-section .hero-row-3 {
  animation: heroFadeInUp 0.60s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)) 0.20s backwards;
}

.blog-hero-section .hero-row-4 {
  animation: heroFadeInUp 0.65s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)) 0.28s backwards;
}

.blog-hero-section .hero-row-5 {
  animation: heroFadeInUp 0.55s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)) 0.35s backwards;
}

.blog-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, 0.8vw, 8px);
  background: var(--tag-bg);
  border: 1px solid var(--border-default);
  padding: clamp(4px, 0.6vw, 6px) clamp(12px, 1.6vw, 18px);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: clamp(0.65rem, 0.85vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: clamp(0.85rem, 1.8vw, 1.35rem);
}

.blog-eyebrow-pill svg {
  width: 14px;
  height: 14px;
}

.blog-hero-headline {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: clamp(1.85rem, 4.6vw, 3.6rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: clamp(10px, 1.6vw, 16px);
  max-width: 900px;
}

.blog-hero-subtext {
  font-family: var(--font-body), 'Lexend', sans-serif;
  font-size: clamp(0.84rem, 1.15vw, 1.025rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.55;
  margin-bottom: clamp(1.4rem, 2.8vw, 2.25rem);
}

/* Search Bar */
.blog-search-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.blog-search-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-search-bar:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.blog-search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.blog-search-input::placeholder {
  color: var(--text-tertiary);
}

.blog-search-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease;
}

.blog-search-icon-btn svg {
  width: 18px;
  height: 18px;
}

.blog-search-icon-btn:hover {
  color: var(--text-primary);
}

/* Filter Tags (Top Picks) */
.blog-filter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(1.8rem, 3.5vw, 3rem);
  width: 100%;
}

.blog-filter-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.blog-top-picks-grid {
  width: 100%;
  text-align: left;
}

/* ==============================================================================
   2. SCROLL-TRIGGERED CASCADE ANIMATIONS FOR CARDS
   ============================================================================== */

/* Blog Cards (Resting State -> Triggered by .in-view on Scroll) */
.blog-grid .blog-card {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 0.55s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)),
    transform 0.55s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color var(--transition-fast, 0.15s ease),
    box-shadow var(--transition-fast, 0.15s ease);
  backface-visibility: hidden;
}

.blog-grid.in-view .blog-card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.blog-grid.in-view .blog-card:nth-child(1) {
  transition-delay: 0.04s;
}

.blog-grid.in-view .blog-card:nth-child(2) {
  transition-delay: 0.10s;
}

.blog-grid.in-view .blog-card:nth-child(3) {
  transition-delay: 0.16s;
}

.blog-grid.in-view .blog-card:nth-child(4) {
  transition-delay: 0.22s;
}

.blog-grid.in-view .blog-card:nth-child(5) {
  transition-delay: 0.28s;
}

.blog-grid.in-view .blog-card:nth-child(6) {
  transition-delay: 0.34s;
}

/* Featured Bento Cards (Resting State -> Triggered by .in-view on Scroll) */
.featured-bento-grid .featured-card {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 0.6s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)),
    transform 0.6s var(--ease-lux, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  backface-visibility: hidden;
}

.featured-bento-grid.in-view .featured-card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.featured-bento-grid.in-view .featured-big-card {
  transition-delay: 0.04s;
}

.featured-bento-grid.in-view .featured-right-col .featured-card:nth-child(1) {
  transition-delay: 0.12s;
}

.featured-bento-grid.in-view .featured-right-col .featured-card:nth-child(2) {
  transition-delay: 0.20s;
}

.featured-bento-grid.in-view .featured-right-col .featured-card:nth-child(3) {
  transition-delay: 0.28s;
}

/* ==============================================================================
   3. FEATURED BLOGS SECTION (EXACT ASYMMETRICAL BENTO GRID)
   ============================================================================== */
.featured-blogs-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.featured-header {
  text-align: center;
  margin-bottom: clamp(24px, 3.8vw, 42px);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 620px;
}

.featured-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  border: 1px solid var(--border-default);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.featured-eyebrow-pill svg {
  width: 13px;
  height: 13px;
}

.featured-main-title {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
}

.featured-subtext {
  font-family: var(--font-body), 'Lexend', sans-serif;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}

.featured-bento-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.featured-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translate3d(0, -2px, 0);
}

[data-theme="dark"] .featured-card:hover {
  border-color: rgba(168, 255, 26, 0.35);
}

.featured-pill {
  background: var(--badge-bg);
  border: 1px solid var(--border-default);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.featured-arrow-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  align-self: center;
  transition: all var(--transition-fast, 0.15s ease);
}

.featured-arrow-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.featured-card:hover .featured-arrow-btn {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

[data-theme="dark"] .featured-card:hover .featured-arrow-btn {
  background: var(--lime-500);
  border-color: var(--lime-500);
  color: #000000;
}

.featured-card:hover .featured-arrow-btn svg {
  transform: translate3d(2px, 0, 0);
}

.featured-link-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}

/* Left Feature Card */
.featured-big-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  text-align: left;
  box-sizing: border-box;
}

.featured-big-card h2 {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0 0 8px;
  transition: color 0.2s ease;
}

.featured-big-card:hover h2 {
  color: #16a34a;
}

[data-theme="dark"] .featured-big-card:hover h2 {
  color: var(--lime-500);
}

.featured-big-card p.desc {
  font-family: var(--font-body), 'Lexend', sans-serif;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 96%;
}

.featured-big-card .img {
  width: 100%;
  flex: 1 1 0;
  min-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--bg-tertiary);
}

.featured-big-card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-big-card:hover .img img {
  transform: scale(1.03);
}

.feature-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.feature-footer .author {
  display: flex;
  align-items: center;
  gap: 9px;
}

.feature-footer .author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.feature-footer .author span {
  font-family: var(--font-body), 'Lexend', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-footer .pills {
  display: flex;
  gap: 6px;
}

/* Right Column */
.featured-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.small-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  text-align: left;
}

.small-card .thumb {
  width: 100px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.small-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.small-card:hover .thumb img {
  transform: scale(1.05);
}

.small-card .body {
  flex: 1;
  min-width: 0;
}

.small-card .tags {
  display: flex;
  gap: 6px;
  margin-bottom: 7px;
}

.small-card h3 {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  transition: color 0.18s ease;
}

.small-card:hover h3 {
  color: #16a34a;
}

[data-theme="dark"] .small-card:hover h3 {
  color: var(--lime-500);
}

/* Right Card 3: Banner Card */
.big-banner-card {
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.big-banner-card .img {
  width: 100%;
  height: 148px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.big-banner-card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.big-banner-card:hover .img img {
  transform: scale(1.03);
}

.big-banner-card .content {
  padding: 16px 18px 18px;
}

.big-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.big-banner-card .tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.big-banner-card h3 {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.35;
  color: var(--text-primary);
  transition: color 0.18s ease;
}

.big-banner-card:hover h3 {
  color: #16a34a;
}

[data-theme="dark"] .big-banner-card:hover h3 {
  color: var(--lime-500);
}

.big-banner-card p.desc {
  font-family: var(--font-body), 'Lexend', sans-serif;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* ==============================================================================
   4. LATEST INSIGHTS SECTION
   ============================================================================== */
.latest-insights-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.latest-header {
  text-align: center;
  margin-bottom: clamp(1.75rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 720px;
}

.latest-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tag-bg);
  border: 1px solid var(--border-default);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.latest-eyebrow-pill svg {
  width: 13px;
  height: 13px;
}

.latest-main-title {
  font-family: var(--font-heading), 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3.6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.latest-subtext {
  font-family: var(--font-body), 'Lexend', sans-serif;
  font-size: clamp(0.82rem, 1.1vw, 0.975rem);
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 580px;
}

/* ==============================================================================
   5. RESPONSIVE BREAKPOINTS (TABLET & MOBILE)
   ============================================================================== */

@media (max-width: 1024px) and (min-width: 601px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .blog-top-picks-grid .blog-card:nth-child(n+3) {
    display: none;
  }

  .featured-bento-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .featured-big-card {
    min-height: auto;
    padding: 20px;
  }

  .featured-big-card .img {
    min-height: 220px;
    max-height: 300px;
  }

  .small-card .thumb {
    width: 90px;
    height: 78px;
  }
}

@media (max-width: 600px) {
  .blog-hero-section {
    padding-top: 1.5rem;
    padding-bottom: 1.25rem;
  }

  .blog-hero-headline {
    font-size: 1.75rem;
  }

  .blog-hero-subtext {
    font-size: 0.84rem;
    margin-bottom: 1.5rem;
  }

  .blog-search-wrap {
    max-width: 100%;
    margin-bottom: 1.5rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .blog-top-picks-grid .blog-card:nth-child(n+3) {
    display: none;
  }

  .featured-bento-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .featured-big-card {
    min-height: auto;
    padding: 16px;
  }

  .featured-big-card .img {
    min-height: 180px;
  }

  .small-card {
    padding: 12px 14px;
    gap: 12px;
  }

  .small-card .thumb {
    width: 76px;
    height: 68px;
  }

  .small-card h3 {
    font-size: 13.5px;
  }

  .big-banner-card .img {
    height: 120px;
  }

  .big-banner-card .content {
    padding: 14px;
  }
}