/* style/blog.css */

/* Variables */
:root {
  --page-blog-primary-color: #113B7A;
  --page-blog-secondary-color: #1D5FD1;
  --page-blog-text-main: #F3F8FF;
  --page-blog-text-secondary: #AFC4E8;
  --page-blog-card-bg: #10233F;
  --page-blog-border-color: #244D84;
  --page-blog-divider-color: #1B3357;
  --page-blog-deep-navy: #08162B;
  --page-blog-button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --page-blog-gold: #F2C14E;
}

/* Base styles for the page-blog content */
.page-blog {
  color: var(--page-blog-text-main); /* Light text on dark body background */
  background-color: var(--page-blog-deep-navy); /* Assumed body background from shared.css */
  font-family: Arial, sans-serif;
  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: 2.5em;
  color: var(--page-blog-text-main);
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

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

/* 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: all 0.3s ease;
  text-align: center;
  cursor: pointer;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  box-sizing: border-box;
  max-width: 100%;
}

.page-blog__btn-primary {
  background: var(--page-blog-button-gradient);
  color: var(--page-blog-text-main);
  border: none;
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

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

.page-blog__btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  background-color: var(--page-blog-deep-navy);
  overflow: hidden;
  box-sizing: border-box;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  margin-bottom: 30px;
  overflow: hidden;
  border-radius: 12px;
}

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

.page-blog__hero-content {
  text-align: center;
  max-width: 900px;
  z-index: 1;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size */
  color: var(--page-blog-text-main);
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.2em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 30px;
}

/* Featured Posts Section */
.page-blog__featured-posts {
  padding: 80px 0;
  background-color: var(--page-blog-card-bg);
  color: var(--page-blog-text-main);
}

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

.page-blog__post-card {
  background-color: var(--page-blog-deep-navy);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  box-sizing: border-box;
}

.page-blog__post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__post-image {
  width: 100%;
  height: 250px;
  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;
  color: var(--page-blog-text-main);
  margin-bottom: 15px;
  font-weight: bold;
  line-height: 1.3;
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more {
  color: var(--page-blog-secondary-color);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-blog__read-more .page-blog__arrow {
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__read-more .page-blog__arrow {
  transform: translateX(5px);
}

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

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: var(--page-blog-deep-navy); /* Dark background */
  color: var(--page-blog-text-main); /* Light text */
}

.page-blog__latest-posts .page-blog__section-title,
.page-blog__latest-posts .page-blog__section-description {
  color: var(--page-blog-text-main); /* Ensure light text on dark background */
}

.page-blog__post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.page-blog__list-item {
  display: flex;
  background-color: var(--page-blog-card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.page-blog__list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.page-blog__list-image-wrapper {
  flex-shrink: 0;
  width: 300px; /* Fixed width for desktop */
  height: 200px;
  overflow: hidden;
}

.page-blog__list-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-blog__post-date {
  font-size: 0.9em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 10px;
}

.page-blog__list-title {
  font-size: 1.3em;
  color: var(--page-blog-text-main);
  margin-bottom: 10px;
  font-weight: bold;
  line-height: 1.3;
}

.page-blog__list-link {
  text-decoration: none;
  color: inherit;
}

.page-blog__list-link:hover {
  color: var(--page-blog-secondary-color);
}

.page-blog__list-excerpt {
  font-size: 0.9em;
  color: var(--page-blog-text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
}

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

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

.page-blog__category-card {
  background-color: var(--page-blog-deep-navy);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  max-width: 100%;
  box-sizing: border-box;
}

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

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

.page-blog__category-description {
  font-size: 0.9em;
  color: var(--page-blog-text-secondary);
}

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

.page-blog__cta-section .page-blog__btn-primary {
  margin-top: 30px;
}

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

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

.page-blog__faq-item {
  background-color: var(--page-blog-deep-navy);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  box-sizing: border-box;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15em;
  font-weight: bold;
  color: var(--page-blog-text-main);
  cursor: pointer;
  background-color: var(--page-blog-deep-navy);
  border-bottom: 1px solid var(--page-blog-divider-color);
  list-style: none; /* Remove default marker for details */
  -webkit-touch-callout: none; /* Disable callout on iOS */
  -webkit-user-select: none; /* Disable text selection on iOS */
  user-select: none; /* Standard property */
}

.page-blog__faq-item[open] > .page-blog__faq-question {
  border-bottom: 1px solid var(--page-blog-divider-color);
}

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

.page-blog__faq-qtext {
  flex-grow: 1;
  pointer-events: none; /* Ensure click on summary triggers details */
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: var(--page-blog-secondary-color);
  pointer-events: none; /* Ensure click on summary triggers details */
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  color: var(--page-blog-text-secondary);
}

.page-blog__faq-answer p {
  margin-top: 10px;
  margin-bottom: 0;
}

.page-blog__faq-answer a {
  color: var(--page-blog-secondary-color);
  text-decoration: underline;
}

/* --- Responsive Design --- */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .page-blog__hero-section {
    padding: 40px 15px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 3em);
  }

  .page-blog__description {
    font-size: 1.1em;
  }

  .page-blog__section-title {
    font-size: 2em;
  }

  .page-blog__section-description {
    font-size: 1em;
  }

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

  .page-blog__list-item {
    flex-direction: column;
  }

  .page-blog__list-image-wrapper {
    width: 100%;
    height: 250px;
  }

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

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__featured-posts .page-blog__container,
  .page-blog__latest-posts .page-blog__container,
  .page-blog__categories-section .page-blog__container,
  .page-blog__cta-section .page-blog__container,
  .page-blog__faq-section .page-blog__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Images responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__hero-image-wrapper,
  .page-blog__post-card,
  .page-blog__list-item,
  .page-blog__category-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Buttons responsiveness */
  .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;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .page-blog__view-all-button {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Adjust gap for multiple buttons if needed */
  }

  .page-blog__hero-section {
    padding: 20px 15px;
    padding-top: 10px !important; /* Ensure small top padding */
  }

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

  .page-blog__description {
    font-size: 1em;
  }

  .page-blog__section-title {
    font-size: 1.8em;
  }

  .page-blog__section-description {
    font-size: 0.9em;
  }

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

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

  .page-blog__list-item {
    flex-direction: column;
  }

  .page-blog__list-image-wrapper {
    width: 100%;
    height: 200px;
  }

  .page-blog__list-content {
    padding: 15px;
  }

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

  .page-blog__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }

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

/* Dark section specific text color */
.page-blog__dark-section .page-blog__section-title,
.page-blog__dark-section .page-blog__section-description,
.page-blog__dark-section .page-blog__post-title,
.page-blog__dark-section .page-blog__post-excerpt,
.page-blog__dark-section .page-blog__category-title,
.page-blog__dark-section .page-blog__category-description,
.page-blog__dark-section .page-blog__faq-question,
.page-blog__dark-section .page-blog__faq-answer {
  color: var(--page-blog-text-main);
}

/* Light section specific text color (using for CTA section text, which is on dark background) */
.page-blog__light-bg .page-blog__section-title,
.page-blog__light-bg .page-blog__section-description,
.page-blog__light-bg .page-blog__post-title,
.page-blog__light-bg .page-blog__post-excerpt {
  color: var(--page-blog-text-main); /* Ensure light text on dark background */
}

/* Ensure all p and li tags within the main content are readable */
.page-blog p, .page-blog li {
  color: var(--page-blog-text-main);
}

/* Specific contrast fix for links in dark background sections */
.page-blog__faq-answer a {
  color: var(--page-blog-secondary-color);
}