/* style/blog.css */

/* General Body/Page styles - ensures text color contrasts with shared body background */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #1F2D3D; /* Text Main */
}

.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: 700;
  color: #1F2D3D; /* Text Main */
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.1em;
  color: #1F2D3D; /* Text Main */
  text-align: center;
  max-width: 800px;
  margin: 0 auto 30px auto;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff; /* Always white for primary */
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  background: linear-gradient(180deg, #2F6BFF 0%, #4A8BFF 100%);
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.4);
}

.page-blog__btn-secondary {
  background: #ffffff; /* Card BG */
  color: #2F6BFF; /* Main Color */
  border: 2px solid #2F6BFF; /* Main Color */
}

.page-blog__btn-secondary:hover {
  background: #F4F7FB; /* Background */
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.2);
}

/* 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 */
  overflow: hidden;
}

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

.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;
  text-align: center;
  color: #ffffff; /* White text on dark/blue background */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.page-blog__main-title {
  font-size: clamp(2.5em, 5vw, 3.5em); /* Responsive font size for H1 */
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #ffffff;
  max-width: 90%;
}

.page-blog__hero-content .page-blog__description {
  color: #f0f0f0;
}

.page-blog__hero-content .page-blog__btn-primary {
  margin-top: 20px;
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: #F4F7FB; /* Background */
}

.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: #ffffff; /* Card BG */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #1F2D3D; /* Text Main */
}

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

.page-blog__post-image-wrapper {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  overflow: hidden;
}

.page-blog__post-image {
  width: 100%;
  height: 100%;
  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: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-title a {
  color: #1F2D3D; /* Text Main */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
  color: #2F6BFF; /* Main Color */
}

.page-blog__post-date {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 15px;
  display: block;
}

.page-blog__post-snippet {
  font-size: 1em;
  color: #333;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__post-content .page-blog__btn-secondary {
  align-self: flex-start;
  margin-top: auto; /* Pushes button to the bottom */
}

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

/* Categories Section */
.page-blog__categories-section {
  padding: 80px 0;
  background-color: #6FA3FF; /* Auxiliary Color */
}

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

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

.page-blog__category-card {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
}

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

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  background: #2F6BFF; /* Main Color */
  color: #ffffff;
  text-align: center;
}

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

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

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: #F4F7FB; /* Background */
}

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

.page-blog__faq-item {
  background: #ffffff; /* Card BG */
  border: 1px solid #D6E2FF; /* Border */
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.page-blog__faq-item[open] {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: 600;
  color: #1F2D3D; /* Text Main */
  cursor: pointer;
  background: #ffffff;
  list-style: none; /* Remove default marker */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* Remove default marker for webkit browsers */
}

.page-blog__faq-question:hover {
  background-color: #F4F7FB;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: 300;
  color: #2F6BFF; /* Main Color */
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  padding: 0 25px 20px 25px;
  font-size: 1em;
  color: #333;
  line-height: 1.7;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__post-title {
    font-size: 1.3em;
  }
}

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

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important;
  }

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

  .page-blog__description {
    font-size: 1em;
    padding: 0 15px;
  }

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

  .page-blog__container {
    padding: 0 15px;
  }

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

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

  .page-blog__post-card {
    margin-left: 15px;
    margin-right: 15px;
    width: auto;
  }

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

  .page-blog__post-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__category-card {
    font-size: 1.1em;
    padding: 15px;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px; /* Constrain width for buttons */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  .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__faq-question {
    font-size: 1.1em;
    padding: 18px 20px;
  }
  .page-blog__faq-answer {
    padding: 0 20px 18px 20px;
  }
  
  /* Image and video containers for mobile */
  .page-blog__hero-image-wrapper,
  .page-blog__post-image-wrapper,
  .page-blog__container,
  .page-blog__hero-content,
  .page-blog__latest-posts,
  .page-blog__categories-section,
  .page-blog__cta-section,
  .page-blog__faq-section,
  .page-blog__posts-grid,
  .page-blog__categories-grid,
  .page-blog__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: clamp(1.8em, 9vw, 2.2em);
  }
  .page-blog__section-title {
    font-size: 1.6em;
  }
  .page-blog__posts-grid {
    gap: 15px;
  }
}