/* style/blog.css */

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --dark-text-color: #333333;
  --light-text-color: #FFFFFF;
  --login-button-color: #EA7C07;
  --background-color: #FFFFFF;
  --black-color-custom: #000000;
}

.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--dark-text-color); /* Default for light backgrounds */
}

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

/* --- Hero Section --- */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 500px;
  padding: 10px 20px 60px; /* Top padding 10px, bottom 60px */
  color: var(--light-text-color);
  background-color: var(--primary-color);
  overflow: hidden;
}

.page-blog__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.page-blog__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2; /* Slightly darken image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__main-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--light-text-color);
}

.page-blog__hero-description {
  font-size: 1.25rem;
  margin-bottom: 30px;
  color: var(--light-text-color);
}

/* --- Buttons --- */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background-color: var(--login-button-color);
  color: var(--light-text-color);
  border: 2px solid var(--login-button-color);
  margin-right: 15px;
}

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

.page-blog__btn-secondary {
  background-color: transparent;
  color: var(--light-text-color);
  border: 2px solid var(--light-text-color);
}

.page-blog__btn-secondary:hover {
  background-color: var(--light-text-color);
  color: var(--primary-color);
}

.page-blog__view-all-button-wrapper .page-blog__btn-secondary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-blog__view-all-button-wrapper .page-blog__btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--light-text-color);
}


/* --- General Section Styles --- */
.page-blog__latest-articles,
.page-blog__why-read-section,
.page-blog__faq-section {
  padding: 60px 0;
  background-color: var(--background-color);
}

.page-blog__categories-section,
.page-blog__cta-section {
  padding: 60px 0;
  background-color: var(--primary-color);
  color: var(--light-text-color);
}

.page-blog__section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
}

.page-blog__section-title--light {
  color: var(--light-text-color);
}

/* --- Latest Articles Grid --- */
.page-blog__article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.page-blog__article-card {
  background-color: var(--light-text-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__article-card:hover {
  transform: translateY(-5px);
}

.page-blog__article-image-wrapper {
  width: 100%;
  height: 225px; /* Fixed height for consistency */
  overflow: hidden;
}

.page-blog__article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.page-blog__article-date {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.page-blog__article-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.4;
}

.page-blog__article-title a {
  color: var(--dark-text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__article-title a:hover {
  color: var(--primary-color);
}

.page-blog__article-excerpt {
  font-size: 1rem;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-blog__read-more:hover {
  text-decoration: underline;
}

.page-blog__view-all-button-wrapper {
  text-align: center;
}

/* --- Categories Section --- */
.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.page-blog__category-card {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--light-text-color);
  padding: 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
  text-align: center;
}

.page-blog__category-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

/* --- Why Read Section --- */
.page-blog__why-read-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-blog__text-block {
  flex: 1;
}

.page-blog__image-block {
  flex: 1;
  text-align: center;
}

.page-blog__feature-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__benefit-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.page-blog__benefit-list li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
}

.page-blog__benefit-list li::before {
  content: '✔';
  color: var(--primary-color);
  position: absolute;
  left: 0;
  top: 0;
  font-weight: bold;
}

/* --- FAQ Section --- */
.page-blog__faq-section .page-blog__section-title {
  color: var(--primary-color);
}

.page-blog__faq-list {
  margin-bottom: 30px;
}

.page-blog__faq-item {
  background-color: var(--light-text-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--dark-text-color);
  cursor: pointer;
  background-color: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.page-blog__faq-item[open] .page-blog__faq-question {
  border-bottom: 1px solid #e0e0e0;
}

.page-blog__faq-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  margin-left: 15px;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  padding: 20px 25px;
  font-size: 1rem;
  color: #555;
}

.page-blog__faq-answer p {
  margin: 0;
}

.page-blog__faq-image-wrapper {
  text-align: center;
  margin-top: 40px;
}

.page-blog__faq-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Hide default details marker */
.page-blog__faq-item summary::-webkit-details-marker {
  display: none;
}
.page-blog__faq-item summary::marker {
  display: none;
}


/* --- CTA Section --- */
.page-blog__cta-content {
  text-align: center;
}

.page-blog__cta-description {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--light-text-color);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .page-blog__hero-section {
    min-height: 400px;
    padding-bottom: 40px;
  }

  .page-blog__main-title {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .page-blog__hero-description {
    font-size: 1.1rem;
  }

  .page-blog__why-read-content {
    flex-direction: column;
    text-align: center;
  }

  .page-blog__image-block {
    margin-top: 30px;
  }
}

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

  .page-blog__hero-section {
    padding: 10px 15px 40px;
    min-height: 350px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }

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

  .page-blog__section-title {
    font-size: 2rem;
  }

  .page-blog__article-grid {
    grid-template-columns: 1fr;
  }

  .page-blog__category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

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

  .page-blog__btn-primary {
    margin-right: 0;
  }

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

  /* Mobile forced container adaptation */
  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__latest-articles,
  .page-blog__categories-section,
  .page-blog__why-read-section,
  .page-blog__faq-section,
  .page-blog__cta-section,
  .page-blog__article-card,
  .page-blog__category-card,
  .page-blog__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  /* Mobile forced button adaptation */
  .page-blog__cta-button,
  .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;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .page-blog__cta-buttons {
    flex-wrap: wrap !important;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .page-blog__section-title {
    font-size: 1.8rem;
  }

  .page-blog__article-title {
    font-size: 1.1rem;
  }

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

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