/* style/blog.css */

/* Custom Properties based on brand colors */
:root {
  --primary-color: #E53935;
  --secondary-color: #FF5A4F;
  --text-main-color: #333333;
  --card-bg-color: #FFFFFF;
  --background-color: #F5F7FA;
  --border-color: #E0E0E0;
  --button-gradient: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

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

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

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

.page-blog__section-intro {
  font-size: 18px;
  color: #555555;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 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;
  /* Fixed header spacing: body handles padding-top, this section gets a small top margin */
  padding-top: 10px; 
  background-color: var(--background-color);
}

.page-blog__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.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 8px 25px rgba(0, 0, 0, 0.1);
  filter: none; /* Ensure no image filters */
}

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

.page-blog__main-title {
  /* H1 font size controlled by font-weight, line-height, etc., not fixed large size */
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: clamp(28px, 4vw, 48px); /* Using clamp for responsive H1 */
}

.page-blog__description {
  font-size: 18px;
  color: #555555;
  max-width: 900px;
  margin: 0 auto 30px auto;
}

.page-blog__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-gradient);
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px; /* Adjusted margin to avoid overlap with description */
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__cta-button:hover {
  background: var(--primary-color); /* Simpler hover for gradient */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

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

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

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

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-blog__post-card img {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  filter: none; /* Ensure no image filters */
}

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

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

.page-blog__post-excerpt {
  font-size: 15px;
  color: #666666;
  margin-bottom: 15px;
  min-height: 60px; /* Ensure consistent height */
}

.page-blog__post-meta {
  font-size: 14px;
  color: #999999;
  display: block;
}

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

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

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

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

.page-blog__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.page-blog__category-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.page-blog__category-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}


/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
  background: var(--primary-color); /* Dark section uses primary color */
  color: #ffffff; /* White text for dark background */
}

.page-blog__cta-section .page-blog__section-title {
  color: #ffffff;
  margin-bottom: 20px;
}

.page-blog__cta-section .page-blog__section-intro {
  color: #f0f0f0;
  margin-bottom: 40px;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  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 {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.page-blog__btn-secondary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
  color: var(--text-main-color);
}
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: #f5f5f5;
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--text-main-color);
}
.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #555555;
}
details.page-blog__faq-item .page-blog__faq-answer p {
    margin: 0;
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 30px;
  }
  .page-blog__section-intro {
    font-size: 16px;
  }
  .page-blog__hero-section {
    padding: 50px 15px;
  }
  .page-blog__main-title {
    font-size: clamp(24px, 5vw, 40px);
  }
  .page-blog__description {
    font-size: 16px;
  }
  .page-blog__posts-grid {
    gap: 20px;
  }
  .page-blog__post-title {
    font-size: 20px;
  }
  .page-blog__post-card img {
    
  }
}

@media (max-width: 768px) {
  .page-blog__container {
    padding: 0 15px;
  }
  .page-blog__hero-section {
    padding-top: 10px !important; /* Ensure small top padding, body handles header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__hero-image img {
    border-radius: 4px;
  }
  .page-blog__main-title {
    font-size: clamp(24px, 6vw, 36px);
    margin-bottom: 15px;
  }
  .page-blog__description {
    font-size: 15px;
    margin-bottom: 20px;
  }
  .page-blog__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 50px 0;
  }
  .page-blog__section-title {
    font-size: 26px;
    margin-bottom: 15px;
  }
  .page-blog__section-intro {
    font-size: 15px;
    margin-bottom: 30px;
  }
  .page-blog__posts-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .page-blog__post-card img {
    height: 200px;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; /* Ensure image scales down */
  }
  .page-blog__post-content {
    padding: 15px;
  }
  .page-blog__post-title {
    font-size: 18px;
  }
  .page-blog__post-excerpt {
    font-size: 14px;
    min-height: unset; /* Allow natural height on mobile */
  }
  .page-blog__categories-grid {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 15px;
  }
  .page-blog__category-card {
      padding: 20px 10px;
  }
  .page-blog__category-icon {
      font-size: 40px;
  }
  .page-blog__category-title {
      font-size: 16px;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px; /* Ensure internal padding for text */
    padding-right: 15px;
  }

  details.page-blog__faq-item summary.page-blog__faq-question { padding: 15px; }
  .page-blog__faq-qtext { font-size: 15px; }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 15px 15px;
  }
  /* Global image overflow fix for mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__posts-grid, /* Specific grid container */
  .page-blog__categories-grid /* Specific grid container */
  {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Ensure no image filters are applied */
.page-blog img {
  filter: none !important;
}