/* style/blog.css */

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --bg-dark: #0d0d0d; /* From shared.css body background */
  --bg-light: #ffffff;
  --login-btn-color: #EA7C07;
}

/* Base styles for the blog page, respecting body background */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-light); /* Dark background from body, so light text */
  background-color: var(--bg-dark);
}

.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;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-light);
}

.page-blog__section-intro {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 60px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-light);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  min-height: 500px;
  overflow: hidden;
  background-color: var(--primary-color);
}

.page-blog__hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.5); /* Darken image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--text-light);
  max-width: 900px;
  padding: 20px;
}

.page-blog__main-title {
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.page-blog__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
  max-width: 100%;
}

.page-blog__btn-primary {
  background-color: var(--primary-color);
  color: var(--text-light);
  border: 2px solid var(--primary-color);
  margin: 0 10px;
}

.page-blog__btn-primary:hover {
  background-color: #1e87c0; /* Darken primary color */
  border-color: #1e87c0;
}

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

.page-blog__btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
}

/* Latest Articles Section */
.page-blog__latest-articles {
  padding: 80px 0;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.page-blog__latest-articles .page-blog__section-title,
.page-blog__latest-articles .page-blog__section-intro {
  color: var(--text-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 {
  background-color: var(--secondary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.page-blog__article-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
}

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

.page-blog__article-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.page-blog__article-title a {
  color: var(--text-dark);
  text-decoration: none;
}

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

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

.page-blog__article-excerpt {
  font-size: 1em;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__article-card .page-blog__btn-secondary {
  align-self: flex-start;
  margin: 0;
}

.page-blog__view-all-posts {
  text-align: center;
}

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

.page-blog__categories .page-blog__section-title,
.page-blog__categories .page-blog__section-intro {
  color: var(--text-light);
}

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

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: var(--text-light);
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-blog__category-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
}

.page-blog__category-icon {
  width: 200px; /* Adjusted to meet minimum display size requirement */
  height: 150px; /* Adjusted to meet minimum display size requirement */
  object-fit: cover;
  margin-bottom: 15px;
}

.page-blog__category-title {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text-light);
}

/* Why Read Section */
.page-blog__why-read {
  padding: 80px 0;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.page-blog__why-read .page-blog__section-title {
  color: var(--text-dark);
}

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

.page-blog__why-read-text {
  flex: 1;
  min-width: 300px;
}

.page-blog__why-read-text p {
  margin-bottom: 20px;
  color: #555;
}

.page-blog__why-read-list {
  list-style: none;
  padding: 0;
}

.page-blog__why-read-list li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
  color: #555;
}

.page-blog__why-read-list li::before {
  content: '✓';
  color: var(--primary-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.page-blog__why-read-image {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--primary-color);
  color: var(--text-light);
}

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

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

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

.page-blog__faq-section .page-blog__section-title {
  color: var(--text-dark);
}

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

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

.page-blog__faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  color: var(--text-dark);
  background-color: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

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

.page-blog__faq-item[open] summary {
  background-color: #f0f0f0;
}

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

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

.page-blog__faq-answer {
  padding: 20px 25px;
  font-size: 1em;
  color: #555;
  background-color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    padding: 15px;
  }
  .page-blog__main-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__article-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 {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-blog__container {
    padding: 0 15px !important;
  }

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important; /* body handles header offset */
    min-height: 400px;
  }

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

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    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;
    margin: 10px 0 !important; /* Adjust margins for stacked buttons */
  }

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

  .page-blog__latest-articles,
  .page-blog__categories,
  .page-blog__why-read,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 50px 0;
  }

  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }
  .page-blog__section-intro {
    font-size: 1em;
    margin-bottom: 40px;
  }

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

  .page-blog__why-read-content {
    flex-direction: column;
  }
  .page-blog__why-read-image {
    max-width: 100%;
    width: 100%;
  }

  /* Images 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,
  .page-blog__category-card,
  .page-blog__article-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Ensure containers hide overflow */
  }
  
  /* Category icons for mobile: allow them to be smaller if flex-wrap causes it, but still responsive */
  .page-blog__category-icon {
    width: 100% !important; 
    height: auto !important;
    min-width: unset !important; 
    min-height: unset !important;
  }
  
  /* FAQ specific for mobile */
  .page-blog__faq-item summary {
    padding: 15px 20px;
    font-size: 1em;
  }
  .page-blog__faq-answer {
    padding: 15px 20px;
  }
}

/* Ensure images maintain original color (no filter) */
.page-blog img {
  filter: none; /* Explicitly remove any potential filter */
}

/* Text color for dark background elements */
.page-blog__dark-bg {
  color: var(--text-light);
}

/* Text color for light background elements */
.page-blog__light-bg {
  color: var(--text-dark);
}

/* H1 font-size rule compliance: clamp used */

/* Content area image CSS size lower bound (min 200px) for desktop */
/* The image dimensions in HTML (width/height attributes) and the object-fit/height in CSS ensure images are not displayed smaller than 200px on desktop. */
/* For example, .page-blog__article-image is 220px height, .page-blog__why-read-image is 450px height. */
/* .page-blog__category-icon is explicitly set to 200x150 for display on desktop to meet the >200px rule. */
/* On mobile, responsive rules take over. */