/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main, #333333); /* Fallback to default if not set */
  background-color: var(--bg-color, #F5F7FA); /* Ensure body background is respected */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-bottom: 40px; /* Space below content */
  background: var(--bg-color, #F5F7FA); /* Inherit from body or use default */
  padding-top: 10px; /* Small padding at the top, body handles header offset */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 600px; /* Max height for hero image */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-blog__hero-content {
  max-width: 900px;
  margin: 20px auto 0;
  text-align: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-blog__main-title {
  font-size: clamp(2.2em, 4vw, 3.2em); /* Responsive font size */
  font-weight: 700;
  line-height: 1.2;
  color: #E53935; /* Brand color for H1 */
  margin-bottom: 15px;
}

.page-blog__description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: var(--text-main, #333333);
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
  box-sizing: border-box;
  max-width: 100%;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  border: none;
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Post Grid Section */
.page-blog__post-grid {
  padding: 60px 20px;
  background-color: var(--card-bg, #FFFFFF);
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: clamp(1.8em, 3.5vw, 2.5em);
  font-weight: 700;
  color: #333333;
  text-align: center;
  margin-bottom: 40px;
}

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

.page-blog__post-card {
  background: var(--card-bg, #FFFFFF);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color, #E0E0E0);
}

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

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.page-blog__post-content {
  padding: 20px;
}

.page-blog__post-title {
  font-size: 1.4em;
  font-weight: 600;
  color: #E53935; /* Brand color for post titles */
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: #555555;
  margin-bottom: 15px;
}

.page-blog__post-date {
  font-size: 0.85em;
  color: #888888;
  display: block;
}

.page-blog__cta-area {
  text-align: center;
  margin-top: 50px;
}

/* Newsletter CTA Section */
.page-blog__newsletter-cta {
  padding: 80px 20px;
  text-align: center;
  background: #E53935;
  color: #ffffff;
}

.page-blog__newsletter-cta .page-blog__section-title {
  color: #ffffff;
  margin-bottom: 20px;
}

.page-blog__newsletter-cta .page-blog__description {
  color: #f0f0f0;
  max-width: 800px;
  margin: 0 auto 30px;
}

.page-blog__btn-secondary {
  background: #ffffff;
  color: #E53935;
  border: 2px solid #E53935;
}

.page-blog__btn-secondary:hover {
  background: #f0f0f0;
  color: #E53935;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-image-wrapper {
    max-height: 400px;
  }
  .page-blog__hero-content {
    margin-top: 15px;
  }
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 2.8em);
  }
  .page-blog__description {
    font-size: 1em;
  }
  .page-blog__post-thumbnail {
    height: 180px;
  }
  .page-blog__post-title {
    font-size: 1.3em;
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding-top: 10px !important;
    padding: 40px 15px; /* Adjust padding for mobile */
  }
  .page-blog__hero-image-wrapper {
    max-height: 300px;
  }
  .page-blog__hero-content {
    margin-top: 10px;
    padding: 0 15px;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 6vw, 2.5em);
  }
  .page-blog__description {
    font-size: 0.95em;
    margin-bottom: 20px;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    margin-bottom: 15px; /* Add space between stacked buttons */
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  .page-blog__post-grid,
  .page-blog__newsletter-cta {
    padding: 40px 15px;
  }
  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-blog__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-blog__post-thumbnail {
    height: 160px;
  }
  .page-blog__post-title {
    font-size: 1.2em;
  }
  .page-blog__section-title {
    font-size: clamp(1.6em, 5vw, 2em);
    margin-bottom: 30px;
  }

  /* Mobile image specific rules */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-image-wrapper {
    max-height: 250px;
  }
  .page-blog__main-title {
    font-size: clamp(1.6em, 7vw, 2.2em);
  }
  .page-blog__description {
    font-size: 0.9em;
  }
  .page-blog__post-thumbnail {
    height: 140px;
  }
  .page-blog__post-title {
    font-size: 1.1em;
  }
}