/* style/blog.css */
:root {
  --primary-color: #017439;
  --secondary-color: #C30808; /* For register/login */
  --text-color: #333333;
  --text-color-light: #ffffff;
  --background-color-light: #ffffff;
  --background-color-dark: #017439;
  --link-color: #017439;
  --hover-color: #005f2e;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

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

.page-blog a {
  text-decoration: none;
  color: var(--link-color);
}

.page-blog a:hover {
  color: var(--hover-color);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: var(--background-color-light);
}

.page-blog__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; /* Ensure full width on desktop */
}

.page-blog__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-blog__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.page-blog__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-blog__main-title {
  font-size: clamp(2.2em, 4vw, 3.5em);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-blog__description {
  font-size: 1.1em;
  color: var(--text-color);
  max-width: 800px;
  margin: 0 auto 30px;
}

.page-blog__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--secondary-color); /* Use #C30808 for CTA buttons */
  color: #FFFF00; /* Use #FFFF00 for CTA button text */
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__cta-button:hover {
  background: #a30606; /* Slightly darker red for hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

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

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.3;
}

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

.page-blog__section-intro {
  font-size: 1.1em;
  color: var(--text-color);
  text-align: center;
  max-width: 900px;
  margin: 0 auto 50px;
}

.page-blog__section-intro--white {
  color: rgba(255, 255, 255, 0.9);
}

/* Blog Posts Section */
.page-blog__posts-section {
  padding: 80px 0;
}

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

.page-blog__post-card {
  background: var(--background-color-light);
  border-radius: 10px;
  box-shadow: 0 4px 15px var(--shadow-color);
  overflow: hidden;
  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 25px rgba(0, 0, 0, 0.15);
}

.page-blog__post-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit; /* Inherit text color for the entire card link */
}

.page-blog__post-image-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.page-blog__post-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__post-image-wrapper img {
  transform: scale(1.05);
}

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

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

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: var(--text-color);
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-blog__post-date {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 10px;
}

.page-blog__read-more {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.page-blog__read-more:hover {
  color: var(--hover-color);
}

.page-blog__arrow {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__read-more .page-blog__arrow {
  transform: translateX(5px);
}

.page-blog__view-all {
  text-align: center;
  margin-top: 60px;
}

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

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

details.page-blog__faq-item[open] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  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: rgba(255, 255, 255, 0.1);
}

.page-blog__faq-qtext {
  flex: 1;
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--text-color-light);
}

.page-blog__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-color-light);
  flex-shrink: 0;
  margin-left: 20px;
  width: 30px;
  text-align: center;
  transition: transform 0.3s ease;
}

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

details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 25px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 0 8px 8px;
}

details.page-blog__faq-item .page-blog__faq-answer p {
  font-size: 1em;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 3em);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-blog__hero-section {
    padding-top: 10px !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__hero-image img {
    border-radius: 4px;
  }
  .page-blog__hero-content {
    padding: 0 15px;
  }
  .page-blog__cta-button {
    padding: 12px 30px;
    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__container {
    padding: 30px 15px;
  }
  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  .page-blog__section-intro {
    font-size: 1em;
    margin-bottom: 30px;
  }
  .page-blog__posts-section {
    padding: 50px 0;
  }
  .page-blog__post-image-wrapper {
    height: 180px;
  }
  .page-blog__post-title {
    font-size: 1.3em;
  }
  .page-blog__post-excerpt {
    font-size: 0.9em;
  }
  details.page-blog__faq-item summary.page-blog__faq-question {
    padding: 15px 18px;
  }
  .page-blog__faq-qtext {
    font-size: 1em;
  }
  .page-blog__faq-toggle {
    font-size: 24px;
    margin-left: 15px;
    width: 24px;
  }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 18px 15px;
  }

  /* Ensure all content containers are responsive */
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__posts-grid,
  .page-blog__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__posts-grid {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: 1.8em;
  }
  .page-blog__description {
    font-size: 0.95em;
  }
  .page-blog__section-title {
    font-size: 1.5em;
  }
  .page-blog__cta-button {
    font-size: 15px;
    padding: 10px 25px;
  }
  .page-blog__post-title {
    font-size: 1.1em;
  }
  .page-blog__post-image-wrapper {
    height: 160px;
  }
}