/* ============================================================
   PeakRoutine — Minimalist Blog Design (Bevel Inspired)
   ============================================================ */

/* ── Blog Hero Section ── */
.blog-hero {
  padding-top: calc(var(--section-y) + 4rem);
  padding-bottom: 4rem;
  background-color: #9ca3af; /* Minimalist cool gray */
  position: relative;
  text-align: left;
  border: none;
  animation: none;
}

.blog-hero-content {
  position: relative;
  z-index: 2;
}

.blog-hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  background: none;
  -webkit-text-fill-color: initial;
}

.blog-hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 500;
}

/* ── Blog Layout & Filters ── */
.blog-layout-container {
  background: #f9fafb;
  position: relative;
  min-height: 100vh;
}

.blog-filters-container {
  padding: 3.5rem 0 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-filter-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  font-family: var(--font-display);
}

.blog-filter-dropdown-wrap {
  position: relative;
}

.blog-filter-dropdown {
  font-size: 1rem;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-family: var(--font-body);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.blog-filter-dropdown:hover {
  background: #f3f4f6;
  color: #111827;
}

.blog-filter-dropdown i {
  font-size: 0.8rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.blog-filter-dropdown.active i {
  transform: rotate(180deg);
}

.blog-filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  list-style: none;
  padding: 0.5rem;
  min-width: 200px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.blog-filter-menu.show,
.blog-filter-dropdown-wrap:hover .blog-filter-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.blog-filter-menu li {
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  color: #4b5563;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.blog-filter-menu li:hover {
  background: #f3f4f6;
  color: #111827;
}

.blog-filter-menu li.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* ── Blog Grid ── */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-bottom: var(--section-y);
}

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

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

/* ── Blog Card ── */
.blog-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  height: 100%;
}

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

.blog-card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

/* Ensure featured card image text is never cropped on mobile view */
@media (max-width: 1023px) {
  .blog-card-featured .blog-card-img-wrap {
    aspect-ratio: 16 / 10; /* Restore normal, taller mobile card height */
  }
  
  .blog-card-featured .blog-card-img {
    object-fit: cover;
    object-position: left center; /* Pin to the left so text is never cropped */
  }
}

.blog-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.blog-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #111827;
  line-height: 1.4 !important;
  text-wrap: balance;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-card-footer {
  display: none; /* Hide footer for a cleaner look */
}

/* Featured Card (Spans 3 columns on desktop) */
@media (min-width: 1024px) {
  .blog-card-featured {
    grid-column: span 3;
    flex-direction: row;
    align-items: center; /* Center content vertically */
    aspect-ratio: 2.2 / 1;
  }

  .blog-card-featured .blog-card-img-wrap {
    width: 55%;
    height: 100%;
    aspect-ratio: auto;
  }
  
  .blog-card-featured .blog-card-img {
    object-fit: contain; /* Ensure the whole image is visible */
    background-color: #ffffff;
  }

  .blog-card-featured .blog-card-content {
    width: 45%;
    padding: 3.5rem;
    justify-content: center;
  }

  .blog-card-featured .blog-card-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
  }

  .blog-card-featured .blog-card-excerpt {
    font-size: 1.1rem;
    margin-bottom: 0;
  }
}

/* ── Individual Blog Post Page (Clean Hero) ── */
.blog-post-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6rem; /* Space for navbar */
  background-color: #ffffff;
  margin-bottom: 2rem;
}

.blog-post-hero-bg {
  width: 100%;
  max-width: 1000px;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.blog-post-hero::after {
  display: none; /* Remove the dark gradient overlay */
}

.blog-post-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  text-align: left;
}

.blog-post-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 1rem 0;
  color: #111827; /* Dark text since background is now white */
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #6b7280; /* Gray text for meta */
  font-size: 1rem;
}

/* ── Hero Background Modifier ── */
.blog-post-hero.hero-with-bg {
  min-height: 60vh;
  justify-content: flex-end;
  padding-bottom: 4rem;
  overflow: hidden;
}

.blog-post-hero.hero-with-bg .blog-post-hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 0;
  z-index: 0;
}

.blog-post-hero.hero-with-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.9) 0%, rgba(17, 24, 39, 0.5) 60%, rgba(17, 24, 39, 0.3) 100%);
  z-index: 1;
  display: block;
}

.blog-post-hero.hero-with-bg .blog-post-hero-inner {
  position: relative;
  z-index: 2;
}

.blog-post-hero.hero-with-bg .blog-post-title {
  color: white;
}

.blog-post-hero.hero-with-bg .blog-post-meta {
  color: rgba(255, 255, 255, 0.9);
}

.blog-post-meta-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post-meta-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* ── Individual Blog Content ── */
.blog-post-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1f2937;
  /* Use default site font (sans-serif) to match the first blog exactly */
}

.blog-post-content p {
  margin-bottom: 2rem;
}



.blog-post-content h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: #111827;
  line-height: 1.35 !important;
}

.blog-post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #111827;
  line-height: 1.4 !important;
}

.blog-post-content img {
  border-radius: 16px;
  margin: 3.5rem auto;
  display: block;
  width: 100%;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform 0.3s ease;
}

.blog-post-content img:hover {
  transform: translateY(-2px);
}

.blog-post-cta {
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  color: white;
  border-radius: 24px;
  padding: 4rem 3rem;
  text-align: center;
  margin-top: 5rem;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.2);
}

.blog-post-cta h3 {
  color: white;
  font-size: 2.25rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.blog-post-cta p {
  color: rgba(255,255,255,0.8);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

/* ── Related Articles Section ── */
.related-articles-section {
  background: transparent;
  padding: 1rem 0 3rem 0;
  margin-top: 1rem;
}

.related-articles-heading {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 2.5rem;
}

.related-blog-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border-radius: 20px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  height: 100%;
}

.related-blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .related-articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
