/* ==========================================================================
   blog.css
   Styles for: page-blog.php (index), template-parts/single-blog.php (card),
   single-post.php (article page).
   Depends on the theme's global :root variables, .container, .section,
   .btn, .underline-title, .text-center already being loaded.
   Save as: assets/css/blog.css (auto-enqueued for the page slug "blog";
   also enqueued for single posts via the is_singular('post') check in
   functions.php).
   ========================================================================== */

/* ---------- Hover underline fix ----------
   The theme's global `a:hover { text-decoration: underline; }` propagates
   visually into ALL descendant text, not just the link itself. Since the
   featured post and cards are single big <a> wrappers, override it
   explicitly so only intended elements (the arrow) animate on hover. */
.featured-post,
.featured-post:hover,
.featured-post *,
.featured-post:hover *,
.blog-card,
.blog-card:hover,
.blog-card *,
.blog-card:hover * {
  text-decoration: none;
}

/* ---------- Shared: eyebrow label ---------- */

.blog-eyebrow-standalone {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.blog-eyebrow {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-block;
  padding: 6px 12px;
  background: var(--white);
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ---------- Blog index header ---------- */

.blog-header {
  padding: 70px 0 40px;
  background: var(--light-gray);
}

.blog-header-inner {
  max-width: 640px;
}

.blog-header-title {
  margin-bottom: 12px;
}

.blog-header-intro {
  font-size: 17px;
  margin-bottom: 0;
}

/* ---------- Featured post ---------- */

.featured-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
}

.featured-post-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
}

.featured-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.featured-post:hover .featured-post-img {
  transform: scale(1.04);
}

.featured-post-title {
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 14px;
}

.featured-post-excerpt {
  margin-bottom: 24px;
}

.featured-post-cta {
  pointer-events: none; /* the whole card is already a link */
}

/* ---------- Card grid ---------- */

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

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card-img {
  transform: scale(1.05);
}

.blog-card-title {
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 15px;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.blog-card-date {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--body-text);
}

.blog-card-cta {
  display: inline-flex;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading-color);
}
.blog-card-cta::after {
  content: "→";
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin-left: 0;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}
.blog-card:hover .blog-card-cta {
  color: var(--primary);
}
.blog-card:hover .blog-card-cta::after {
  opacity: 1;
  width: auto;
  margin-left: 8px;
  transform: translateX(0);
}

.blog-empty {
  text-align: center;
  padding: 60px 0;
}

/* ---------- Pagination ---------- */

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 60px;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 50%;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--heading-color);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.blog-pagination a.page-numbers:hover {
  background: var(--light-gray);
  text-decoration: none;
}
.blog-pagination .page-numbers.current {
  background: var(--primary);
  color: var(--white);
}
.blog-pagination .page-numbers.dots {
  min-width: auto;
  color: var(--body-text);
}
.blog-pagination a.prev.page-numbers,
.blog-pagination a.next.page-numbers {
  border: 1px solid var(--border);
}
.blog-pagination .prev.page-numbers svg path,
.blog-pagination .next.page-numbers svg path {
  fill: var(--heading-color);
  transition: fill 0.25s ease;
}
.blog-pagination a.prev.page-numbers:hover,
.blog-pagination a.next.page-numbers:hover {
  background: var(--primary);
  border-color: var(--primary);
}
.blog-pagination a.prev.page-numbers:hover svg path,
.blog-pagination a.next.page-numbers:hover svg path {
  fill: var(--white);
}

/* ---------- Single post ---------- */

#post-header.post-header {
  padding-top: 10px;
}

.post-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.post-back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--body-text);
  text-decoration: none;
  text-transform: none;
}
.post-back-link:hover {
  color: var(--primary);
  text-decoration: none;
}

#post-header .post-header-inner {
  width: 80%;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0 40px;
}

#post-header .post-title {
  color: var(--primary);
  margin-bottom: 0;
  text-transform: none !important;
}

.post-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--body-text);
}
.post-meta-cat {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.post-meta-dot {
  color: var(--border);
}

.post-header-image-wrap {
  padding-bottom: 30px;
}

.post-header-image {
  width: 50%;
  max-width: 600px;
  margin: 0 auto;
}

.post-header-img {
  width: 100%;
  border-radius: 10px;
}

.post-content-wrap {
  width: 80%;
  margin: 0 auto;
  padding: 10px 0 60px 0;
}

.blog-content {
  font-size: 18px;
}
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin: 1.6em 0 0.6em;
}
.blog-content p {
  margin-bottom: 1.3em;
}
.blog-content img {
  border-radius: 10px;
  margin: 1.6em 0;
}
.blog-content a {
  text-decoration: underline;
}
.blog-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 24px;
  margin: 1.8em 0;
  font-size: 21px;
  font-style: italic;
  color: var(--heading-color);
}
.blog-content ul,
.blog-content ol {
  margin: 0 0 1.3em 1.4em;
}

.post-footer-heading {
  margin-bottom: 40px;
}

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #post-footer .keep-reading-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 20px;
  }
}

@media (max-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .featured-post-title { font-size: 26px; }

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

  #post-footer .keep-reading-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  #post-footer .keep-reading-grid .blog-card-title {
    font-size: 14px;
    -webkit-line-clamp: 3;
  }
  #post-footer .keep-reading-grid .blog-card-excerpt,
  #post-footer .keep-reading-grid .blog-card-date,
  #post-footer .keep-reading-grid .blog-eyebrow {
    display: none; /* not enough room at 3-up on small screens */
  }
  #post-footer .keep-reading-grid .blog-card-cta {
    font-size: 12px;
  }

  .post-header-image { width: 100%; }

  #post-header .post-header-inner {
    width: 100%;
    padding: 20px 0;
  }

  .post-content-wrap {
    width: 100%;
  }

  .post-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px !important;
  }
  .post-meta {
    justify-content: flex-start;
  }
}