/* style/blog.css */
/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #FFF5E1; /* Text Main color for general text on dark background */
  background-color: #B71C1C; /* Body background from shared.css */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding as body handles --header-offset */
  text-align: center;
  overflow: hidden; /* Ensure content doesn't overflow */
}

.page-blog__hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.page-blog__hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay for text readability */
  border-radius: 10px;
}

.page-blog__main-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive H1 font size */
  font-weight: 700;
  color: #FFF5E1; /* Text Main */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.1rem;
  color: #f0f0f0;
  margin-bottom: 30px;
}

/* General Container */
.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Section Titles */
.page-blog__section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #FFF5E1; /* Text Main */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-blog__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #F4D34D; /* Gold */
  border-radius: 2px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  margin: 10px;
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box; /* Ensure responsiveness */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button gradient */
  color: #7A0E0E; /* Deep Red for text on gold button */
  border: 2px solid #F2B544; /* Border */
}

.page-blog__btn-primary:hover {
  background: linear-gradient(180deg, #E6B800 0%, #FFD86A 100%);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.page-blog__btn-secondary {
  background-color: #D32F2F; /* Card BG */
  color: #FFF5E1; /* Text Main */
  border: 2px solid #F2B544; /* Border */
}

.page-blog__btn-secondary:hover {
  background-color: #7A0E0E; /* Deep Red */
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 60px 0;
  background-color: #B71C1C; /* Consistent with body background */
}

.page-blog__post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-blog__post-card {
  background-color: #D32F2F; /* Card BG */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__post-image {
  width: 100%;
  height: 225px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

.page-blog__post-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #FFF5E1; /* Text Main */
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-title:hover {
  color: #FFD86A; /* Highlight on hover */
}

.page-blog__post-excerpt {
  font-size: 0.95rem;
  color: #f0f0f0;
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-blog__post-date {
  font-size: 0.85rem;
  color: #F4D34D; /* Gold */
  font-style: italic;
  margin-top: auto;
}

/* Pagination */
.page-blog__pagination {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  gap: 10px;
}

.page-blog__pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #D32F2F; /* Card BG */
  color: #FFF5E1; /* Text Main */
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__pagination-link:hover:not(.page-blog__pagination-link--active) {
  background-color: #7A0E0E; /* Deep Red */
}

.page-blog__pagination-link--active {
  background: linear-gradient(180deg, #FFD86A 0%, #E6B800 100%); /* Button gradient */
  color: #7A0E0E; /* Deep Red */
  border: 2px solid #F2B544; /* Border */
  cursor: default;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 20px;
  text-align: center;
  background-color: #7A0E0E; /* Deep Red for a distinct dark section */
}

.page-blog__cta-section .page-blog__section-title {
  color: #FFF5E1; /* Text Main */
}

.page-blog__cta-section .page-blog__section-title::after {
  background-color: #FFCC66; /* Glow */
}

.page-blog__cta-section .page-blog__description {
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: #f0f0f0;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__post-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important; /* body handles header offset */
  }

  .page-blog__main-title {
    font-size: 2.2rem;
  }

  .page-blog__description {
    font-size: 1rem;
  }

  .page-blog__container {
    padding: 0 15px;
  }

  .page-blog__section-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .page-blog__latest-posts {
    padding: 40px 0;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .page-blog__post-image {
    height: 180px; /* Adjust image height for mobile */
  }

  .page-blog__post-title {
    font-size: 1.2rem;
  }

  .page-blog__post-excerpt {
    font-size: 0.9rem;
  }

  .page-blog__cta-section {
    padding: 60px 15px;
  }

  /* Mobile responsive for images, videos, buttons - !important rules */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__hero-section,
  .page-blog__latest-posts,
  .page-blog__cta-section,
  .page-blog__post-card,
  .page-blog__cta-buttons,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Prevent horizontal scroll */
  }
  
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog a[class*="button"],
  .page-blog a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important; /* Full width for buttons */
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin: 10px 0 !important; /* Adjust margins for vertical stacking */
  }

  .page-blog__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 10px !important;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: 1.8rem;
  }
  .page-blog__section-title {
    font-size: 1.6rem;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    padding: 10px 20px;
  }
}

/* Ensure no filter is used on images */
.page-blog img {
  filter: none !important;
}