/* style/blog.css */

/* Base styles for the blog page, ensuring text contrast against the dark background */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-color);
}

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

.page-blog__section-title {
  font-size: clamp(2em, 4vw, 2.8em);
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__section-description {
  font-size: 1.1em;
  color: var(--text-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 60px 0; /* body handles top padding, this is extra decor */
  overflow: hidden;
  background: var(--bg-color);
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 500px;
  filter: brightness(0.7); /* Slightly darken image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px;
  max-width: 900px;
  margin-top: -120px; /* Pull content up over the image, but not *on* it */
  background: linear-gradient(180deg, rgba(8, 22, 15, 0.9) 0%, rgba(8, 22, 15, 0.95) 100%);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
}

.page-blog__main-title {
  font-size: clamp(2.5em, 5vw, 3.5em);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.1;
}

.page-blog__description {
  font-size: 1.2em;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.7;
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 180px;
  box-sizing: border-box;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  color: var(--text-main);
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
  box-shadow: 0 0 15px var(--glow);
}

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

.page-blog__btn-secondary:hover {
  background: var(--deep-green);
  border-color: var(--deep-green);
  color: var(--text-main);
}

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

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

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

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

.page-blog__card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.page-blog__card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-blog__card-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  height: calc(100% - 220px); /* Adjust height based on image */
}

.page-blog__card-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
  line-height: 1.3;
}

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

.page-blog__post-date {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: auto;
  margin-bottom: 10px;
}

.page-blog__read-more {
  font-size: 1em;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-blog__read-more .page-blog__arrow {
  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;
}

/* Categories Section */
.page-blog__categories {
  padding: 80px 0;
  background: var(--card-bg);
}

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

.page-blog__category-card {
  background: var(--deep-green);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border-color);
}

.page-blog__category-card:hover {
  background: var(--primary-color);
  transform: translateY(-5px);
}

.page-blog__category-title {
  font-size: 1.6em;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-main);
}

.page-blog__category-desc {
  font-size: 1em;
  color: var(--text-secondary);
}

/* Featured Video Section */
.page-blog__featured-video {
  padding: 80px 0;
  background-color: var(--background);
}

.page-blog__video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-top: 40px;
  width: 100%;
  max-width: 1000px; /* Max width for video container */
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.page-blog__video-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.page-blog__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  display: block;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background: var(--card-bg);
}

.page-blog__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__faq-item {
  background: var(--deep-green);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: background 0.3s ease;
}

.page-blog__faq-item[open] {
  background: var(--deep-green);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none; /* For <summary> tag */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  color: var(--gold);
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Change + to X or similar */
}

.page-blog__faq-answer {
  padding: 0 25px 20px 25px;
  font-size: 1em;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Call to Action Bottom Section */
.page-blog__cta-bottom {
  padding: 80px 0;
  background: var(--bg-color);
}

/* Color Contrast Specifics */
.page-blog__dark-section {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.page-blog__light-bg {
  background-color: var(--background);
  color: var(--text-main);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    margin-top: -80px;
  }
}

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

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

  .page-blog__hero-section {
    padding: 10px 0 40px 0;
  }

  .page-blog__hero-content {
    padding: 30px 15px;
    margin-top: -60px;
  }

  .page-blog__main-title {
    font-size: clamp(2em, 8vw, 2.5em);
  }

  .page-blog__description {
    font-size: 1em;
    margin-bottom: 30px;
  }

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

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

  .page-blog__section-title {
    font-size: clamp(1.8em, 7vw, 2.2em);
  }

  .page-blog__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-blog__latest-posts,
  .page-blog__categories,
  .page-blog__featured-video,
  .page-blog__faq-section,
  .page-blog__cta-bottom {
    padding: 50px 0;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .page-blog__card-title {
    font-size: 1.2em;
  }

  .page-blog__category-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-blog__category-title {
    font-size: 1.4em;
  }

  .page-blog__video-wrapper {
    margin-top: 30px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

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

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

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

  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    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 already handles --header-offset */
  }

  .page-blog__video-section {
    padding-top: 10px !important;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-content {
    margin-top: -40px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 9vw, 2.2em);
  }

  .page-blog__description {
    font-size: 0.9em;
  }

  .page-blog__card-title {
    font-size: 1.1em;
  }

  .page-blog__category-title {
    font-size: 1.2em;
  }
}