/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: var(--background-color, #ffffff); /* Fallback to white if variable not set */
}

/* Sections */
.page-blog__section {
  padding: 60px 0;
  text-align: center;
  position: relative;
}

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

.page-blog__section-title {
  font-size: clamp(2em, 2.5vw, 3em); /* Flexible font size for H1/H2 */
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #26A9E0;
}

.page-blog__text-block {
  font-size: 1.1em;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
}

/* Hero Section */
.page-blog__hero-section {
  padding: 60px 0;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-color: #26A9E0; /* Brand color for dark section */
  color: #ffffff; /* White text for dark background */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  margin-bottom: 30px; /* Space between image and content */
}

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

.page-blog__hero-content {
  max-width: 900px;
  padding: 0 20px;
  text-align: center;
  z-index: 1;
}

.page-blog__main-title {
  font-size: clamp(2.5em, 4vw, 3.8em); /* Flexible font size for H1 */
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #ffffff;
}

.page-blog__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
  background-color: #EA7C07; /* Login color for primary action */
  color: #ffffff;
  border: 2px solid #EA7C07;
  margin: 0 10px 15px;
}

.page-blog__btn-primary:hover {
  background-color: #d16b06;
  border-color: #d16b06;
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
  margin: 0 10px 15px;
}

.page-blog__btn-secondary:hover {
  background-color: #ffffff;
  color: #26A9E0;
}

/* Introduction Section */
.page-blog__intro-section .page-blog__section-title,
.page-blog__featured-articles .page-blog__section-title,
.page-blog__faq-section .page-blog__section-title {
  color: #26A9E0;
}

.page-blog__intro-section .page-blog__text-block {
  color: #333333;
}

.page-blog__image-full-width {
  width: 100%;
  max-width: 1000px;
  height: auto;
  display: block;
  margin: 40px auto 0;
  border-radius: 8px;
  object-fit: cover;
}

/* Categories Grid */
.page-blog__categories-section {
  background-color: #26A9E0; /* Brand color for dark section */
  color: #ffffff;
}

.page-blog__categories-section .page-blog__section-title,
.page-blog__categories-section .page-blog__text-block {
  color: #ffffff;
}

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

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.page-blog__card-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-blog__card-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
}

.page-blog__card-text {
  font-size: 1em;
  color: #f0f0f0;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Featured Articles */
.page-blog__articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-blog__article-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.page-blog__article-link:hover .page-blog__card-title {
  color: #26A9E0;
}

.page-blog__article-card .page-blog__card-image {
  width: 100%;
  height: 220px; /* Consistent height for article images */
  object-fit: cover;
  border-radius: 0;
  margin-bottom: 0;
}

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

.page-blog__article-card .page-blog__card-title {
  font-size: 1.3em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333333;
  line-height: 1.4;
}

.page-blog__article-meta {
  font-size: 0.9em;
  color: #666666;
  margin-bottom: 15px;
}

.page-blog__card-excerpt {
  font-size: 1em;
  color: #555555;
  flex-grow: 1;
}

.page-blog__view-all-button {
  margin-top: 40px;
}

/* Why Choose Section */
.page-blog__why-choose-section {
  background-color: #26A9E0;
  color: #ffffff;
}

.page-blog__why-choose-section .page-blog__section-title,
.page-blog__why-choose-section .page-blog__text-block {
  color: #ffffff;
}

.page-blog__why-list {
  list-style: none;
  padding: 0;
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  text-align: left;
}

.page-blog__why-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.page-blog__why-item-title {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
}

.page-blog__why-item-text {
  font-size: 1em;
  color: #f0f0f0;
  flex-grow: 1;
}

/* FAQ Section */
.page-blog__faq-section {
  background-color: #f9f9f9;
}

.page-blog__faq-list {
  max-width: 900px;
  margin: 40px auto 0;
  text-align: left;
}

.page-blog__faq-item {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  background-color: #ffffff;
  transition: background-color 0.3s ease;
  list-style: none; /* For details tag */
}

.page-blog__faq-question::-webkit-details-marker { /* For details tag */
  display: none;
}

.page-blog__faq-question:hover {
  background-color: #f0f0f0;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: 600;
  color: #26A9E0;
  line-height: 1;
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  color: #555555;
}

.page-blog__faq-answer-text {
  margin-top: 10px;
}

.page-blog__text-link {
  color: #26A9E0;
  text-decoration: underline;
}

.page-blog__text-link:hover {
  color: #1a7bb2;
}

/* CTA Section */
.page-blog__cta-section {
  background-color: #26A9E0;
  color: #ffffff;
}

.page-blog__cta-section .page-blog__section-title,
.page-blog__cta-section .page-blog__text-block {
  color: #ffffff;
}

.page-blog__cta-buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 20px;
}

/* Global image responsiveness */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .page-blog__section {
    padding: 40px 0;
  }

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

  .page-blog__section-title {
    font-size: 1.8em;
  }

  .page-blog__main-title {
    font-size: 2em;
  }

  .page-blog__hero-description {
    font-size: 1em;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    margin: 10px 0 !important;
    font-size: 1em;
    padding: 12px 20px;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-blog__hero-image-wrapper,
  .page-blog__image-full-width,
  .page-blog__category-card,
  .page-blog__article-card,
  .page-blog__why-item,
  .page-blog__faq-item,
  .page-blog__categories-grid,
  .page-blog__articles-grid,
  .page-blog__why-list,
  .page-blog__faq-list,
  .page-blog__cta-buttons,
  .page-blog__hero-section,
  .page-blog__intro-section,
  .page-blog__categories-section,
  .page-blog__featured-articles,
  .page-blog__why-choose-section,
  .page-blog__faq-section,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Ensure no overflow */
  }

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

  .page-blog__category-card,
  .page-blog__article-card,
  .page-blog__why-item {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }

  .page-blog__faq-answer {
    padding: 0 20px 15px;
  }

  .page-blog__card-image {
    height: 180px;
  }
}