/* ─────────────────────────────────────────────
   blog.css — Standalone Blog Listing Page Styles
   Matching exact Figma design, grid lines, and alignment.
───────────────────────────────────────────── */

/* Strict Mobile Overflow Prevention */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Page Container — aligns perfectly with sitewide .page-margins */
.blog-page-container {
  width: calc(100% - calc(var(--px, 64px) * 2));
  max-width: var(--max-w, 1376px);
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* ── HERO SECTION ── */
.blog-hero-section {
  position: relative;
  padding: 130px 48px 48px 48px;
  background: var(--bg-hero, #150F0F);
  overflow: hidden;
  box-sizing: border-box;
}

.blog-hero-glow {
  position: absolute;
  top: 40%;
  left: 15%;
  transform: translate(-50%, -50%);
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(167, 60, 38, 0.18) 0%, transparent 70%);
  filter: blur(85px);
  pointer-events: none;
  z-index: 0;
}

.blog-pill {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.8px;
  color: var(--text-white, #ffffff);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.blog-pill .chip-dot {
  background: var(--secondary, #FB1650);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.blog-hero-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-head, 'Sora', sans-serif);
  font-size: clamp(38px, 4.5vw, 52px);
  font-weight: 300;
  line-height: 1.25;
  color: var(--text-white, #ffffff);
  margin: 20px 0 0 0;
  letter-spacing: -0.5px;
}

/* Horizontal Line Separator directly below topic heading & above blog grid */
.hero-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: block;
}

/* ── MAIN BLOG GRID SECTION ── */
.blog-grid-section {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* 3-Column Grid Container */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Individual Grid Cell (Card Wrapper) */
.blog-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  width: 100%;
  text-decoration: none;
  box-sizing: border-box;
  margin: 0;
  padding: 36px 32px 32px 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.25s ease;
}

/* Remove right border on 3rd column to align with page margin */
.blog-card:nth-child(3n) {
  border-right: none;
}

.blog-card-clickable {
  cursor: pointer;
}

.blog-card-static {
  cursor: default;
}

.blog-card:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

/* White Card Container Box per Figma */
.blog-card-box {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 24px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  height: 290px;
  box-sizing: border-box;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.blog-card:hover .blog-card-box {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.blog-k-wrap {
  width: 52px;
  height: 44px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-k-mark {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: block;
}

.blog-box-title {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #000000;
  margin: 0 0 16px 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.blog-box-meta {
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 10px;
  font-weight: 400;
  color: #555555;
  text-align: center;
  margin-top: auto;
  line-height: 1.4;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Heading/Title Text Below White Box on Dark Background */
.blog-card-title {
  width: 100%;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  margin: 16px 0 0 0;
  padding: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* Pagination Bar */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 0 80px 0;
  width: 100%;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn,
.pagination-num {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 14px;
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled),
.pagination-num:hover:not(.active) {
  border-color: var(--primary, #FFCE1B);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.pagination-num.active {
  background: var(--primary, #FFCE1B);
  color: #000000;
  border-color: var(--primary, #FFCE1B);
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Empty State Message */
.no-posts-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  margin: 32px;
}

.no-posts-title {
  font-family: var(--font-head, sans-serif);
  font-size: 24px;
  font-weight: 300;
  color: #ffffff;
  margin-bottom: 8px;
}

.no-posts-sub {
  font-family: var(--font-body, sans-serif);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* ─────────────────────────────────────────────
   RESPONSIVE BREAKPOINTS (Desktop, Tablet, Mobile)
───────────────────────────────────────────── */

/* Tablet Breakpoint (601px to 1024px) */
@media (max-width: 1024px) {
  .blog-page-container {
    width: calc(100% - calc(var(--px, 24px) * 2));
  }

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

  .blog-card {
    padding: 28px 20px 24px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
  }

  .blog-card:nth-child(3n) {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
  }

  .blog-card:nth-child(2n) {
    border-right: none;
  }

  .blog-hero-section {
    padding: 105px 24px 40px 24px;
  }

  .blog-hero-title {
    font-size: 38px;
  }

  .blog-card-box {
    padding: 28px 18px 20px 18px;
    height: 270px;
  }
}

/* Mobile Breakpoint (<= 600px) */
@media (max-width: 600px) {
  .blog-page-container {
    width: calc(100% - 32px);
  }

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

  .blog-card {
    padding: 24px 20px;
    border-right: none;
  }

  .blog-hero-section {
    padding: 95px 20px 32px 20px;
  }

  .blog-hero-title {
    font-size: 28px;
  }

  .blog-card-box {
    padding: 24px 16px 18px 16px;
    height: 250px;
  }

  .blog-card-excerpt {
    font-size: 14px;
  }
}

/* Mobile Pagination: Hide number buttons, keep ONLY Left and Right arrows within borders */
@media (max-width: 768px) {
  .pagination-num {
    display: none !important;
  }

  .pagination-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
  }

  .pagination-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .pagination-mobile-info {
    display: inline-block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    padding: 0 4px;
  }
}

@media (min-width: 769px) {
  .pagination-mobile-info {
    display: none !important;
  }
}

/* Restore Footer Top Border on Mobile/Tablet */
@media (max-width: 1024px) {
  body .footer,
  body footer#footer {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
}
