/* style/blog.css */

/* Color definitions from the palette */
:root {
  --main-color: #113B7A;
  --secondary-color: #1D5FD1;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
  --card-bg-color: #10233F;
  --text-main-color: #F3F8FF;
  --text-secondary-color: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy-color: #08162B; /* This is the body background */
}

/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  color: var(--text-main-color); /* #F3F8FF for contrast on dark background */
  background-color: var(--deep-navy-color); /* Matches body background from shared.css */
  line-height: 1.6;
  padding-bottom: 60px; /* Ensure space above footer */
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px; /* Small top padding, body handles header offset */
  padding-bottom: 40px;
  overflow: hidden; /* Ensure image doesn't overflow */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 500px; /* Limit height for hero image */
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 10px;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__hero-content {
  max-width: 900px;
  padding: 0 20px;
}

.page-blog__hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive font size */
  font-weight: 700;
  color: var(--text-main-color); /* #F3F8FF */
  margin-bottom: 15px;
  line-height: 1.2;
}

.page-blog__hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary-color); /* #AFC4E8 */
  margin-bottom: 30px;
}

.page-blog__hero-cta-button {
  display: inline-block;
  background: var(--button-gradient); /* linear-gradient(180deg, #2B73F6 0%, #1144A6 100%) */
  color: #ffffff;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__hero-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Blog Posts Section */
.page-blog__posts-section {
  padding: 60px 0;
}

.page-blog__section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-main-color); /* #F3F8FF */
  text-align: center;
  margin-bottom: 40px;
}

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

.page-blog__post-card {
  background-color: var(--card-bg-color); /* #10233F */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  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.3);
}

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

.page-blog__post-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__post-image {
  transform: scale(1.05);
}

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

.page-blog__post-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-title a {
  color: var(--text-main-color); /* #F3F8FF */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
  color: var(--glow-color); /* #4FA8FF */
}

.page-blog__post-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary-color); /* #AFC4E8 */
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-blog__post-date {
  font-size: 0.85rem;
  color: var(--text-secondary-color); /* #AFC4E8 */
  margin-bottom: 20px;
  display: block;
}

.page-blog__read-more-button {
  display: inline-block;
  color: var(--glow-color); /* #4FA8FF */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-blog__read-more-button:hover {
  text-decoration: underline;
}

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

.page-blog__view-all-button {
    display: inline-block;
    background: linear-gradient(180deg, #1D5FD1 0%, #113B7A 100%); /* Using main colors for a slightly different gradient */
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__view-all-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Call to Action Section */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--deep-navy-color); /* Ensure dark background for this section */
  border-top: 1px solid var(--divider-color); /* #1B3357 */
}

.page-blog__cta-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-main-color); /* #F3F8FF */
  margin-bottom: 20px;
}

.page-blog__cta-description {
  font-size: 1.1rem;
  color: var(--text-secondary-color); /* #AFC4E8 */
  max-width: 800px;
  margin: 0 auto 40px auto;
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-primary {
  background: var(--button-gradient); /* linear-gradient(180deg, #2B73F6 0%, #1144A6 100%) */
  color: #ffffff;
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__btn-secondary {
  background: #ffffff;
  color: var(--main-color); /* #113B7A */
  border: 2px solid var(--main-color); /* #113B7A */
}

.page-blog__btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: var(--glow-color); /* #4FA8FF */
  color: #ffffff;
  border-color: var(--glow-color);
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-blog__hero-image-wrapper {
      max-height: 400px;
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding-bottom: 30px;
  }

  .page-blog__hero-title {
    font-size: 2.2rem;
  }

  .page-blog__hero-description {
    font-size: 1rem;
  }

  .page-blog__hero-cta-button {
    padding: 12px 25px;
  }

  .page-blog__posts-section {
    padding: 40px 0;
  }

  .page-blog__section-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .page-blog__post-image-wrapper {
    height: 180px; /* Adjust card image height */
  }

  .page-blog__post-title {
    font-size: 1.3rem;
  }

  .page-blog__post-excerpt {
    font-size: 0.9rem;
  }

  .page-blog__cta-section {
    padding: 60px 0;
  }

  .page-blog__cta-title {
    font-size: 2.2rem;
  }

  .page-blog__cta-description {
    font-size: 1rem;
  }

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to prevent overflow */
  }

  .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;
  }

  /* Universal image, video, container responsive rules for mobile */
  .page-blog img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__hero-image-wrapper,
  .page-blog__post-image-wrapper,
  .page-blog__container,
  .page-blog__post-card,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Ensure no overflow */
  }

  /* Specific override for hero content padding, as container already has padding */
  .page-blog__hero-content {
      padding-left: 0;
      padding-right: 0;
  }

  /* Ensure content area images are not too small */
  .page-blog__posts-grid img {
    min-width: 200px;
    min-height: 200px;
  }
}