/* style/blog.css */
:root {
  --primary-color: #2F6BFF;
  --secondary-color: #6FA3FF;
  --gradient-button: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  --card-bg: #FFFFFF;
  --background-page: #F4F7FB;
  --text-main: #1F2D3D;
  --text-black: #000000;
  --border-color: #D6E2FF;
  --glow-color: #A5C4FF;
}

/* Base styles for the page-blog content */
.page-blog {
  font-family: 'Arial', sans-serif;
  color: var(--text-main);
  background-color: var(--background-page);
  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: clamp(28px, 3.5vw, 42px);
  color: var(--text-black);
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.page-blog__section-description {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-main);
  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;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  overflow: hidden;
  text-align: center;
}

.page-blog__hero-image-wrapper {
  position: relative;
  width: 100%;
  max-height: 600px; /* Limit height of hero image */
  overflow: hidden;
  margin-bottom: 30px;
}

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

.page-blog__hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95); /* Semi-transparent background for text clarity */
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  margin-top: -80px; /* Overlap slightly with the image for visual flow */
}

.page-blog__main-title {
  font-size: clamp(32px, 4.5vw, 54px); /* Responsive H1 font size */
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: 800;
  line-height: 1.1;
}

.page-blog__hero-description {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-main);
  margin-bottom: 30px;
}

.page-blog__hero-cta {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
}

/* Buttons */
.page-blog__btn-primary {
  background: var(--gradient-button);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.3);
}

.page-blog__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(47, 107, 255, 0.4);
}

.page-blog__btn-secondary {
  background: var(--card-bg);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  cursor: pointer;
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
}

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

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

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

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

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

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

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

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

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

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

.page-blog__post-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.page-blog__post-excerpt {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 20px;
  flex-grow: 1;
}

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

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

.page-blog__categories .page-blog__section-title,
.page-blog__categories .page-blog__section-description {
  color: #ffffff;
}

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

.page-blog__category-card {
  background: rgba(255, 255, 255, 0.15); /* Slightly transparent white for contrast */
  color: #ffffff;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.page-blog__category-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #ffffff;
}

.page-blog__category-count {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

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

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

.page-blog__faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

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

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

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

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

/* Call to Action Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: var(--primary-color);
  color: #ffffff;
  text-align: center;
}

.page-blog__cta-section .page-blog__section-title,
.page-blog__cta-section .page-blog__section-description {
  color: #ffffff;
}

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

/* Dark/Light Background Helpers for contrast */
.page-blog__dark-section {
  background: var(--primary-color);
  color: #ffffff;
}

.page-blog__light-bg {
  background: var(--background-page);
  color: var(--text-main);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .page-blog__categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@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: 40px 15px;
    padding-top: 10px !important;
  }

  .page-blog__hero-content {
    margin-top: -60px;
    padding: 15px;
  }

  .page-blog__main-title {
    font-size: 30px;
  }

  .page-blog__hero-description {
    font-size: 16px;
  }

  .page-blog__section-title {
    font-size: 26px;
  }

  .page-blog__section-description {
    font-size: 15px;
  }

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

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

  .page-blog__categories-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .page-blog__faq-item summary {
    font-size: 16px;
    padding: 18px 20px;
  }

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

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

  /* Image responsive adaptation */
  .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 {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Button responsive adaptation */
  .page-blog__cta-button,
  .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__cta-buttons,
  .page-blog__button-group,
  .page-blog__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  .page-blog__cta-buttons {
    display: flex;
    flex-direction: column;
  }
}