/* ===============================
   BLOG FEED PAGE STYLES — MOBILE FIRST
   =============================== */

/* Wrapper: centers content and limits max width */
.blogfeed {
  margin: 0 auto;
  max-width: 1600px;
}

/* ===============================
   CAROUSEL STYLES
   =============================== */

/* Section wrapper for the carousel with spacing around it */
.carousel-section {
  margin: 20px 10px 50px 10px;
  position: relative;
}

/* Main carousel container — layout for all slides */
.carousel {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: visible; /* Allows box-shadow from slides to be visible */
}

/* Carousel slide: hidden by default, centered when active */
.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 85%;
  height: 100%;
  margin: 0 auto;
  right: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  z-index: 1;
}

/* Active slide — visible and centered */
.carousel-slide.active {
  opacity: 1;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.carousel-slide:hover {
  transform: translateX(-50%) scale(1.02);
}

/* Slide image styling */
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Carousel arrow buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 4rem;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  z-index: 3;
}

.carousel-btn:hover {
  color: var(--secondary-color);
}

/* Space between carousel image and arrow buttons */
.carousel-btn.prev {
  left: -30px;
}

.carousel-btn.next {
  right: -30px;
}

/* ===============================
   THUMBNAIL GRID 
   =============================== */

/* Grid layout for blog post thumbnails */
#blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin: 0 auto;
}

/* Individual thumbnail card */
.blog-thumbnail-card {
  display: block;
  background-color: var(--thumbnails-background-color);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 10px;
  transition: transform 0.2s ease-in-out;
}

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

/* Thumbnail image */
.blog-thumbnail-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Text section below image */
.blog-thumbnail-content {
  padding: 15px;
}

.blog-thumbnail-content h3 {
  font-size: 1.8rem;
  font-family: "Inter", sans-serif;
  margin: 0 0 10px 0;
  color: var(--text-color-black);
}

.blog-thumbnail-content p {
  font-size: 1.4rem;
  font-family: "Merriweather", serif;
  color: var(--text-color-black);
  margin: 0;
}

/* Message to the viewer if there are no blog posts created yet */
.no-posts-message {
  grid-column: 1/-1; /* Fill width of the grid */
  display: flex;
  justify-content: center;
  text-align: center;
  width: 100%;
}

/* ===============================
   MEDIA QUERIES
   =============================== */

/* Between typical Mobile and Tablet screen sizes (just to make sure it looks nice on all screen sizes) */
@media (min-width: 500px) and (max-width: 767px) {
  /* CAROUSEL */
  .carousel {
    height: 300px;
  }

  /* THUMBNAIL GRID */
  /* Prevent thumbnails from stretching too wide on mid-sized screens */
  #blog-grid {
    max-width: 550px;
  }
}

/* TABLET (768px - 1024px) */
@media (min-width: 768px) {
  /* CAROUSEL */

  /* Larger space between carousel and thumbnails */
  .carousel-section {
    margin-bottom: 70px;
  }

  /* Larger carousel */
  .carousel {
    max-width: 1000px;
    height: 400px;
  }

  /* Larger arrow buttons */
  .carousel-btn {
    font-size: 4rem;
  }

  /* Reposition arrow buttons for better alignment on tablet - the arrows look like they are too far away from the image when using devtools, but it looks good on actual ipad (gen. 6) */
  .carousel-btn.prev {
    left: -40px;
  }

  .carousel-btn.next {
    right: -40px;
  }

  /* THUMBNAIL GRID */

  /* Two-column grid for blog thumbnails */
  #blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Larger thumbnail image */
  .blog-thumbnail-card img {
    height: 250px;
  }

  /* Larger text for thumbnail h3 */
  .blog-thumbnail-content h3 {
    font-size: 2rem;
  }

  /* Larger text for thumbnail p */
  .blog-thumbnail-content p {
    font-size: 1.6rem;
  }
}

/* DESKTOP (1024px - 1400px) */
@media (min-width: 1024px) {
  /* CAROUSEL */

  /* Larger space between carousel and thumbnails */
  .carousel-section {
    margin-bottom: 80px;
  }

  /* Larger carousel */
  .carousel {
    max-width: 1400px;
    height: 500px;
  }

  /* Larger arrow buttons */
  .carousel-btn {
    font-size: 5rem;
  }

  /* Reposition arrow buttons for better alignment on desktop */
  .carousel-btn.prev {
    left: -30px;
  }

  .carousel-btn.next {
    right: -30px;
  }

  /* THUMBNAIL GRID */

  /* Three-column grid for blog thumbnails */
  #blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  /* Larger thumbnail image */
  .blog-thumbnail-card img {
    height: 280px;
  }

  /* Larger text for thumbnail h3 */
  .blog-thumbnail-content h3 {
    font-size: 2.2rem;
  }

  /* Larger text for thumbnail p */
  .blog-thumbnail-content p {
    font-size: 1.8rem;
  }
}

/* LARGER DESKTOP (1400px and up) */
@media (min-width: 1400px) {
  /* CAROUSEL */

  /* Larger carousel */
  .carousel {
    max-width: 1600px;
    height: 800px;
  }

  /* THUMBNAIL GRID */

  /* Four-column grid for blog thumbnails */
  #blog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
