/* style/blog.css */

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

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

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.2;
}

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

.page-blog__highlight {
  color: var(--glow);
  font-weight: bold;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box;
}

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

.page-blog__btn-primary:hover {
  background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
  box-shadow: 0 4px 15px rgba(87, 227, 141, 0.4);
}

.page-blog__btn-secondary {
  background: #11271B;
  color: var(--glow);
  border: 2px solid var(--border);
}

.page-blog__btn-secondary:hover {
  background: var(--glow);
  color: var(--card-bg);
  border-color: var(--glow);
  box-shadow: 0 4px 15px rgba(87, 227, 141, 0.4);
}

.page-blog__button-container,
.page-blog__button-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  padding: 80px 20px;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  overflow: hidden;
  text-align: center;
}

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

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

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  color: var(--text-main);
  background: rgba(8, 22, 15, 0.7); /* Slightly darker background for text readability */
  padding: 30px;
  border-radius: 10px;
}

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

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

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

.page-blog__post-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

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

.page-blog__post-category {
  display: inline-block;
  background-color: var(--deep-green);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.85em;
  margin-bottom: 10px;
}

.page-blog__post-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
}

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

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

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

.page-blog__post-date {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.page-blog__post-link-wrapper {
  display: block;
}

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

.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  justify-items: center;
}

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  background-color: var(--background);
  padding: 20px;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 200px; /* Max width for category card */
  box-sizing: border-box;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(87, 227, 141, 0.3);
}

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

.page-blog__category-name {
  font-weight: bold;
  font-size: 1.1em;
}

/* Why Choose Section */
.page-blog__why-choose-section {
  padding: 60px 0;
  background-color: var(--background);
}

.page-blog__content-area p {
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-size: 1.05em;
  text-align: left;
}

.page-blog__content-area a {
  color: var(--glow);
  text-decoration: none;
  font-weight: bold;
}

.page-blog__content-area a:hover {
  text-decoration: underline;
}

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

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

.page-blog__faq-item {
  background-color: var(--background);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: var(--text-secondary);
}

.page-blog__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--text-main);
  list-style: none;
  outline: none;
}

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

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

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: var(--glow);
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  content: '−';
}

.page-blog__faq-answer {
  padding: 0 25px 18px 25px;
  font-size: 1em;
  color: var(--text-secondary);
  border-top: 1px solid var(--divider);
}

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

/* CTA Bottom Section */
.page-blog__cta-bottom-section {
  padding: 60px 0;
  background-color: var(--card-bg);
  text-align: center;
}

/* Dark background section for better contrast */
.page-blog__dark-section {
  background-color: var(--card-bg);
  color: var(--text-main);
}

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


/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 3em);
  }
}

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

  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__hero-section {
    padding: 60px 15px;
    padding-top: 10px !important;
    min-height: 400px;
  }

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

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

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

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

  .page-blog__post-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
  }

  .page-blog__category-card {
    max-width: 150px; /* Adjust for smaller screens */
    padding: 15px;
  }

  .page-blog__category-icon {
    width: 80px;
    height: 80px;
  }

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

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

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

  /* Responsive image and container styles */
  .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,
  .page-blog__hero-section,
  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__why-choose-section,
  .page-blog__faq-section,
  .page-blog__cta-bottom-section,
  .page-blog__button-container,
  .page-blog__button-group {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  /* Button specific mobile adaptations */
  .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;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__button-group {
    flex-direction: column !important;
    gap: 10px;
  }
  
  /* Content area images must be at least 200px, but also responsive */
  .page-blog__post-image, .page-blog__category-icon {
    min-width: 200px; /* Ensure content images are not too small */
    min-height: 200px;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__category-icon {
    width: 100% !important; /* Override specific small sizes if they conflict */
    height: auto !important;
    max-width: 100px !important; /* Keep original max-width for icon, but ensure it's responsive */
    max-height: 100px !important;
  }

  /* Ensuring content area images are not too small but still responsive */
  .page-blog__post-card img:not(.page-blog__category-icon) {
    min-width: 200px !important;
    min-height: 200px !important;
  }

  .page-blog__hero-image {
    min-width: unset !important; /* Hero image can be larger */
    min-height: unset !important;
  }
}

/* Dark background for sections with inverse text color */
.page-blog__dark-bg {
  color: var(--text-main);
  background: var(--card-bg);
}

.page-blog__light-bg {
  color: #333333;
  background: #ffffff;
}

.page-blog__medium-bg {
  color: #000000;
  background: var(--auxiliary-color);
}

/* Ensuring content area images are not too small for desktop */
.page-blog__post-card img:not(.page-blog__category-icon) {
  min-width: 200px;
  min-height: 200px;
}

/* Specific sizing for category icons to prevent them from being too small on desktop, yet responsive */
.page-blog__category-icon {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

/* No filter properties on images */
.page-blog img {
  filter: none;
}