/* style/blog.css */

:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --card-bg-color: #11271B;
  --background-color-dark: #08160F;
  --text-main-color: #F2FFF6;
  --text-secondary-color: #A7D9B8;
  --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%);
}

.page-blog {
  font-family: Arial, sans-serif;
  color: var(--text-main-color); /* Default text color for the page */
  background-color: var(--background-color-dark);
}

.page-blog__section-spacing {
  padding: 60px 0;
}

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

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

.page-blog__section-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary-color);
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.5;
}

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

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text breaking */
  box-sizing: border-box;
}

.page-blog__btn-primary {
  background: var(--button-gradient);
  color: #ffffff;
  border: none;
}

.page-blog__btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px var(--glow-color);
}

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

.page-blog__btn-secondary:hover {
  background-color: var(--secondary-color);
  color: var(--background-color-dark);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 60px 0; /* Small top padding, more bottom padding */
  background-color: var(--background-color-dark);
  overflow: hidden;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  margin-bottom: 30px;
  border-radius: 10px;
}

.page-blog__hero-content {
  text-align: center;
  max-width: 800px;
  padding: 0 20px;
}

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

.page-blog__hero-description {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-secondary-color);
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Latest Articles Section */
.page-blog__latest-articles {
  background-color: var(--background-color-dark);
}

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

.page-blog__article-card {
  display: flex;
  flex-direction: column;
}

.page-blog__card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  min-height: 200px; /* Enforce min size */
}

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

.page-blog__card-title {
  font-size: clamp(20px, 2.5vw, 24px);
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: 700;
}

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

.page-blog__card-title a:hover {
  color: var(--secondary-color);
}

.page-blog__card-meta {
  font-size: 14px;
  color: var(--text-secondary-color);
  margin-bottom: 15px;
}

.page-blog__card-description {
  font-size: 16px;
  color: var(--text-secondary-color);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__card-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.page-blog__card-link:hover {
  text-decoration: underline;
  color: var(--glow-color);
}

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

/* Categories Section */
.page-blog__categories-section {
  background-color: var(--background-color-dark);
}

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

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  text-decoration: none;
  min-height: 180px;
}

.page-blog__category-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 15px;
  min-width: 100px; /* Enforce min size */
  min-height: 100px; /* Enforce min size */
}

.page-blog__category-title {
  font-size: 18px;
  color: var(--text-main-color);
  font-weight: 600;
  line-height: 1.3;
}

/* Featured Article Section */
.page-blog__featured-article {
  background-color: var(--deep-green-color);
  color: #ffffff;
}

.page-blog__featured-article .page-blog__section-title,
.page-blog__featured-article .page-blog__section-subtitle {
  color: #ffffff;
}

.page-blog__featured-content {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
}

.page-blog__featured-image {
  flex: 1;
  min-width: 400px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  min-height: 200px; /* Enforce min size */
}

.page-blog__featured-text {
  flex: 2;
  min-width: 300px;
}

.page-blog__featured-title {
  font-size: clamp(24px, 3vw, 36px);
  color: var(--gold-color);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.page-blog__featured-meta {
  font-size: 15px;
  color: var(--text-secondary-color);
  margin-bottom: 20px;
}

.page-blog__featured-description {
  font-size: 17px;
  color: var(--text-main-color);
  line-height: 1.7;
  margin-bottom: 30px;
}

/* Why Choose Us Section */
.page-blog__why-choose-us {
  background-color: var(--background-color-dark);
}

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

.page-blog__feature-item {
  padding: 30px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.page-blog__feature-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
  min-width: 100px; /* Enforce min size */
  min-height: 100px; /* Enforce min size */
}

.page-blog__feature-title {
  font-size: 22px;
  color: var(--text-main-color);
  margin-bottom: 10px;
  font-weight: 600;
}

.page-blog__feature-description {
  font-size: 16px;
  color: var(--text-secondary-color);
  line-height: 1.6;
}

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

.page-blog__faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-blog__faq-item {
  background-color: var(--deep-green-color);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  color: var(--text-main-color);
}

.page-blog__faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main-color);
  transition: background-color 0.3s ease;
}

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

.page-blog__faq-item summary:hover {
  background-color: rgba(34, 199, 104, 0.1);
}

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

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

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

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

/* CTA Section */
.page-blog__cta-section {
  background-color: var(--background-color-dark);
  text-align: center;
}

.page-blog__cta-title {
  font-size: clamp(28px, 4vw, 48px);
  color: var(--text-main-color);
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.page-blog__cta-description {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary-color);
  margin-bottom: 40px;
  line-height: 1.6;
}

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

/* --- Responsive Styles --- */
@media (max-width: 1024px) {
  .page-blog__hero-image {
    max-height: 400px;
  }
  .page-blog__featured-content {
    flex-direction: column;
    text-align: center;
  }
  .page-blog__featured-image {
    min-width: unset;
    width: 100%;
    max-width: 600px; /* Constrain image on smaller screens */
    margin: 0 auto 30px auto;
  }
  .page-blog__featured-text {
    min-width: unset;
    width: 100%;
  }
  .page-blog__featured-description {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .page-blog__section-spacing {
    padding: 40px 0;
  }
  .page-blog__hero-section {
    padding-bottom: 40px;
  }
  .page-blog__hero-image {
    max-height: 300px;
  }
  .page-blog__hero-content {
    padding: 0 15px;
  }
  .page-blog__section-title {
    font-size: 28px;
  }
  .page-blog__section-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }
  .page-blog__article-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-blog__card-image {
    height: 180px;
  }
  .page-blog__card-content {
    padding: 20px;
  }
  .page-blog__card-title {
    font-size: 18px;
  }
  .page-blog__card-description {
    font-size: 15px;
  }
  .page-blog__categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }
  .page-blog__category-card {
    padding: 20px 10px;
    min-height: 140px;
  }
  .page-blog__category-icon {
    width: 80px;
    height: 80px;
    min-width: 80px; /* Enforce min size */
    min-height: 80px; /* Enforce min size */
  }
  .page-blog__category-title {
    font-size: 16px;
  }
  .page-blog__featured-image {
    min-width: unset;
  }
  .page-blog__feature-icon {
    width: 80px;
    height: 80px;
    min-width: 80px; /* Enforce min size */
    min-height: 80px; /* Enforce min size */
  }
  .page-blog__features-grid {
    grid-template-columns: 1fr;
  }
  .page-blog__faq-item summary {
    font-size: 16px;
    padding: 15px 20px;
  }
  .page-blog__faq-answer {
    padding: 0 20px 15px 20px;
    font-size: 15px;
  }
  .page-blog__cta-title {
    font-size: 26px;
  }
  .page-blog__cta-description {
    font-size: 16px;
  }
  .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-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Ensure all images are responsive and do not overflow */
  .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-articles,
  .page-blog__categories-section,
  .page-blog__featured-article,
  .page-blog__why-choose-us,
  .page-blog__faq-section,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Prevent horizontal scroll from padding */
  }
  .page-blog__hero-section {
    padding-top: 10px !important;
  }
}

@media (max-width: 480px) {
  .page-blog__section-title {
    font-size: 24px;
  }
  .page-blog__hero-title {
    font-size: 28px;
  }
  .page-blog__hero-description {
    font-size: 16px;
  }
  .page-blog__featured-title {
    font-size: 22px;
  }
}