/* style/blog.css */

:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --text-main-color: #F2FFF6;
  --text-secondary-color: #A7D9B8;
  --card-bg-color: #11271B;
  --background-color: #08160F;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green-color: #0A4B2C;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
}

/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  color: var(--text-main-color); /* Default text color for dark body background */
  background-color: var(--background-color); /* Matches body background if shared is dark */
}

/* Sections */
.page-blog__hero-section,
.page-blog__recent-posts,
.page-blog__categories,
.page-blog__popular-posts,
.page-blog__cta-section,
.page-blog__faq-section {
  padding: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-blog__dark-section {
  background-color: var(--background-color);
  color: var(--text-main-color);
}

.page-blog__light-bg {
  background-color: #f5f5f5; /* A light background for contrast */
  color: #333333; /* Dark text for light background */
}

.page-blog__section-title {
  font-size: 2.8em;
  font-weight: 700;
  margin-bottom: 40px;
  color: inherit;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.page-blog__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

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

/* Hero Section */
.page-blog__hero-section {
  padding: 10px 0 60px 0; /* Small top padding for fixed header */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
  position: relative;
}

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

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 20px;
  max-width: 900px;
  margin-top: -100px; /* Overlap slightly with the image for visual flow */
  background-color: var(--card-bg-color); /* Use a darker background for text */
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size */
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-main-color);
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.1em;
  line-height: 1.6;
  margin-bottom: 30px;
  color: var(--text-secondary-color);
}

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

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

.page-blog__btn-primary {
  background: var(--button-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

.page-blog__btn-secondary {
  background-color: #ffffff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Post Grid */
.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-color: #ffffff; /* Light background for cards */
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
  color: #333333; /* Dark text for cards */
}

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

.page-blog__post-thumbnail-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.page-blog__post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-blog__post-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-blog__post-title a {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

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

.page-blog__post-excerpt {
  font-size: 1em;
  line-height: 1.6;
  color: #555555;
  margin-bottom: 20px;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 3px;
  transition: all 0.3s ease;
}

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

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

/* Categories */
.page-blog__categories .page-blog__section-title {
  color: var(--text-main-color);
}

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

.page-blog__category-card {
  background-color: var(--card-bg-color);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  text-decoration: none;
  color: var(--text-main-color);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-blog__category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background-color: var(--deep-green-color);
}

.page-blog__category-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  object-fit: contain;
}

.page-blog__category-title {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-main-color);
}

/* Popular Posts */
.page-blog__popular-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__popular-item {
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  text-align: left;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #333333;
}

.page-blog__popular-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.page-blog__popular-thumbnail {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 20px;
  flex-shrink: 0;
}

.page-blog__popular-content {
  flex-grow: 1;
}

.page-blog__popular-title {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.4;
}

.page-blog__popular-title a {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.page-blog__popular-meta {
  font-size: 0.85em;
  color: #777777;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: var(--deep-green-color);
}

.page-blog__cta-section .page-blog__section-title {
  color: var(--text-main-color);
}

.page-blog__cta-section .page-blog__description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: var(--text-secondary-color);
}

/* FAQ Section */
.page-blog__faq-section .page-blog__section-title {
  color: #333333;
}

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

.page-blog__faq-item {
  background-color: #ffffff;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  color: #333333;
}

.page-blog__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: #333333;
  border-bottom: 1px solid #eeeeee;
}

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

.page-blog__faq-item summary:hover {
  background-color: #f9f9f9;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: 300;
  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: 15px 25px 20px 25px;
  font-size: 1em;
  line-height: 1.6;
  color: #555555;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    margin-top: -60px;
    padding: 30px;
  }

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

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

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

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

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding-top: 10px !important; /* body already handles header offset */
  }

  .page-blog__hero-content {
    margin-top: -40px;
    padding: 20px;
    border-radius: 10px;
  }

  .page-blog__main-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

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

  .page-blog__section-title {
    font-size: 1.8em;
    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;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__recent-posts,
  .page-blog__categories,
  .page-blog__popular-posts,
  .page-blog__cta-section,
  .page-blog__faq-section,
  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__popular-item,
  .page-blog__faq-item {
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

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

  .page-blog__post-grid,
  .page-blog__category-grid {
    grid-template-columns: 1fr;
  }

  .page-blog__popular-item {
    flex-direction: column;
    text-align: center;
  }

  .page-blog__popular-thumbnail {
    margin-right: 0;
    margin-bottom: 15px;
    width: 100%;
    height: auto;
    max-width: 200px;
  }

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

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

@media (max-width: 480px) {
  .page-blog__hero-content {
    padding: 15px;
  }
  .page-blog__main-title {
    font-size: 1.8em;
  }
  .page-blog__section-title {
    font-size: 1.6em;
  }
  .page-blog__hero-section,
  .page-blog__recent-posts,
  .page-blog__categories,
  .page-blog__popular-posts,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 40px 0;
  }
}