/* style/blog.css */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --background-light: #f8f8f8;
  --background-dark: #017439;
  --button-register: #C30808;
  --button-login: #C30808;
  --button-text-login-register: #FFFF00;
}

.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color-dark);
  background-color: var(--background-light);
}

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

/* Hero Banner Section */
.page-blog__hero-banner {
  position: relative;
  text-align: center;
  padding: 40px 0;
  padding-top: 10px; /* Adhering to the 10px top padding rule for non-homepage hero */
  background-color: var(--background-light);
  color: var(--text-color-dark);
}

.page-blog__banner-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto 30px;
  border-radius: 8px;
  object-fit: cover;
}

.page-blog__hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.page-blog__hero-banner h1 {
  font-size: clamp(28px, 4vw, 48px);
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.2;
}

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

.page-blog__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-register);
  color: var(--button-text-login-register);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.page-blog__cta-button:hover {
  background: #a30606;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 60px 0;
  background-color: var(--background-dark);
  color: var(--text-color-light);
}

.page-blog__section-title {
  font-size: clamp(24px, 3.5vw, 40px);
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-color-light);
  font-weight: 700;
}

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

.page-blog__post-card {
  background: var(--secondary-color);
  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;
}

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

.page-blog__post-link {
  text-decoration: none;
  display: block;
  color: var(--text-color-dark);
}

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

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

.page-blog__post-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--primary-color);
}

.page-blog__post-excerpt {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.page-blog__post-date {
  font-size: 14px;
  color: #666;
  display: block;
  text-align: right;
}

.page-blog__view-all-button-container {
  text-align: center;
  margin-top: 50px;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: var(--background-light);
  color: var(--text-color-dark);
}

.page-blog__faq-list {
  margin-top: 40px;
}

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: var(--secondary-color);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-blog__faq-item summary.page-blog__faq-question::-webkit-details-marker {
  display: none;
}
details.page-blog__faq-item summary.page-blog__faq-question:hover {
  background: #f5f5f5;
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--primary-color);
}
.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  color: var(--text-color-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-blog__container {
    padding: 0 15px;
  }
  .page-blog__hero-banner {
    padding: 30px 0;
    padding-top: 10px !important;
  }
  .page-blog__hero-banner h1 {
    font-size: 32px;
  }
  .page-blog__hero-description {
    font-size: 16px;
  }
  .page-blog__cta-button {
    padding: 12px 25px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  .page-blog__section-title {
    font-size: 28px;
  }
  .page-blog__latest-posts, .page-blog__faq-section {
    padding: 40px 0;
  }
  .page-blog__post-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-blog__post-image {
    height: 180px;
  }
  .page-blog__post-title {
    font-size: 18px;
  }
  .page-blog__post-excerpt {
    font-size: 14px;
  }
  details.page-blog__faq-item summary.page-blog__faq-question { padding: 15px; }
  .page-blog__faq-qtext { font-size: 15px; }
  details.page-blog__faq-item .page-blog__faq-answer { padding: 0 15px 15px; }

  /* Image responsive rules */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-blog__hero-banner,
  .page-blog__latest-posts,
  .page-blog__faq-section,
  .page-blog__post-card,
  .page-blog__post-grid,
  .page-blog__view-all-button-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}