/*
 * Blog Feed Styles – 4D King Results
 *
 * Grid layout for blog post cards used on the Blog page template.
 * Uses the .blog-card component from template-parts/content-blog.php.
 */

/* -------------------------------------------------------------------------- */
/*  1. Blog Grid Container                                                    */
/* -------------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

/* -------------------------------------------------------------------------- */
/*  2. Blog Card (Individual Post)                                            */
/* -------------------------------------------------------------------------- */
.blog-card {
  background: var(--white);
  border: 1px solid var(--border-color, var(--light-grey));
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

/* -------------------------------------------------------------------------- */
/*  3. Thumbnail                                                              */
/* -------------------------------------------------------------------------- */
.blog-card-thumbnail {
  display: block;
  height: 200px;
  overflow: hidden;
}

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

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

/* -------------------------------------------------------------------------- */
/*  4. Content Area                                                           */
/* -------------------------------------------------------------------------- */
.blog-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Title */
.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
}

.blog-card-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.blog-card-title a:hover {
  color: var(--primary-red);
}

/* Meta (date & author) */
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  font-size: 0.85rem;
  color: var(--grey);
  margin-bottom: 12px;
}

.blog-card-author a {
  color: var(--grey);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.blog-card-author a:hover {
  color: var(--primary-red);
}

/* Excerpt */
.blog-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--grey);
  margin-bottom: 15px;
  flex-grow: 1;
}

/* Read More link */
.blog-card-read-more {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 20px;
  background: var(--primary-red);
  color: var(--white);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.blog-card-read-more:hover {
  background: var(--primary-hover, #a00000);
}

/* Force the hero to be full width on the blog page */
.home-hero .container {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Blog content wrapper – 95% width with comfortable side margins */
.blog-content-wrapper {
  width: 100%;
  max-width: 1300px;
}
/* =============================================
   BLOG PAGE LAYOUT (template-blog.php)
   ============================================= */

.blog-layout {
  display: block;
  margin-top: 30px;
}

.blog-sidebar {
  background: var(--white);
  padding: 20px;
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  position: sticky;
  top: 100px;
  align-self: start;
}

/* --- Featured Post --- */
.blog-featured-card {
  display: flex;
  gap: 30px;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 50px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.blog-featured-img {
  flex: 0 0 50%;
  display: block;
}
.blog-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-featured-body {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blog-featured-label {
  display: inline-block;
  background: var(--primary-red);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
  align-self: flex-start;
}
.blog-featured-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.blog-featured-title a {
  color: var(--dark);
}
.blog-featured-title a:hover {
  color: var(--primary-red);
}
.blog-featured-excerpt {
  color: var(--grey);
  line-height: 1.6;
  margin-bottom: 20px;
}
.blog-featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  font-size: 0.85rem;
  color: var(--grey);
  margin-bottom: 20px;
}
.blog-featured-readmore {
  display: inline-block;
  background: var(--primary-red);
  color: var(--white);
  padding: 10px 25px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  align-self: flex-start;
  transition: background 0.2s;
}
.blog-featured-readmore:hover {
  background: var(--primary-hover);
}

/* --- Section Headings --- */
.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 12px;
  color: var(--dark);
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-red);
  border-radius: 2px;
}

/* Center the "Today's Lottery Jackpots" heading only on the result hub page */
.page-template-template-results .section-heading {
  text-align: center;
}

.page-template-template-results .section-heading::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --- List View --- */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 50px;
}
.blog-list-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  transition: box-shadow 0.2s;
}
.blog-list-item:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.blog-list-img {
  flex: 0 0 120px;
  display: block;
}
.blog-list-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.blog-list-body {
  flex: 1;
  min-width: 0; /* allows title/excerpt to wrap instead of forcing the flex item wide */
}
.blog-list-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.blog-list-title a {
  color: var(--dark);
}
.blog-list-title a:hover {
  color: var(--primary-red);
}
.blog-list-excerpt {
  color: var(--grey);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 10px;
}
.blog-list-date {
  font-size: 0.8rem;
  color: var(--grey);
}

/* --- Carousel --- */
.blog-carousel {
  margin-bottom: 50px;
  padding-bottom: 40px;
}
.blog-carousel .swiper-pagination-bullet-active {
  background: var(--primary-red) !important;
}
.blog-carousel .swiper-button-next,
.blog-carousel .swiper-button-prev {
  color: var(--primary-red);
}
.blog-carousel-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  padding: 15px;
}
.carousel-card-img img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}
.carousel-card-title {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.carousel-card-title a {
  color: var(--dark);
}
.carousel-card-title a:hover {
  color: var(--primary-red);
}
.carousel-card-date {
  font-size: 0.8rem;
  color: var(--grey);
}

/* --- Mini Cards (mobile‑app style) --- */
.blog-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 50px;
}
.blog-mini-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s;
}
.blog-mini-card:hover {
  transform: translateY(-3px);
}
.blog-mini-link {
  display: block;
  padding: 15px;
  text-decoration: none;
  color: inherit;
}
.blog-mini-img img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 10px;
}
.blog-mini-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}

/* --- Pagination --- */
.blog-pagination {
  margin-top: 40px;
  text-align: center;
}

/* ============================================================================
   Responsive
   ============================================================================ */

/* --- Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr; /* NOTE: only meaningful if .blog-layout is set
                                    to display:grid elsewhere in the project —
                                    see note in chat. */
  }
  .blog-featured-card {
    flex-direction: column;
  }
  .blog-featured-img {
    flex: auto;
    height: 250px;
  }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .blog-card-thumbnail {
    height: 180px;
  }

  .blog-list-item {
    flex-direction: column;
  }
  .blog-list-img {
    flex: auto;
    height: 180px;
  }

  .blog-featured-body {
    padding: 20px;
  }
  .blog-featured-title {
    font-size: 1.4rem;
  }

  .blog-mini-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* --- Small phones (≤400px) --- */
@media (max-width: 400px) {
  .blog-grid {
    grid-template-columns: 1fr; /* redundant safeguard once auto-fill's 300px
                                    minimum would otherwise overflow */
  }
  .blog-card-content {
    padding: 15px;
  }
  .blog-mini-grid {
    grid-template-columns: repeat(2, 1fr); /* lock to 2 columns rather than
                                                letting auto-fill collapse to 1
                                                with a stray gap */
  }
}