/* style/blog.css */

:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --btn-login-color: #EA7C07;
}

.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default to dark text for light body background */
  background-color: var(--secondary-color);
}

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

.page-blog__hero-section {
  padding-top: 10px; /* Rely on body padding-top from shared.css for header offset */
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, #34ace0 100%);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
  padding-bottom: 40px;
}

.page-blog__hero-section .page-blog__container {
  position: relative;
  z-index: 2;
}

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

.page-blog__description {
  font-size: 1.15rem;
  max-width: 800px;
  margin: 0 auto 30px;
  color: var(--text-light);
}

.page-blog__hero-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1920px;
  height: auto;
  opacity: 0.2;
  z-index: 1;
  object-fit: cover;
}

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

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

.page-blog__btn-primary:hover {
  background-color: #e06c00;
  border-color: #e06c00;
}

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

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

.page-blog__latest-articles-section,
.page-blog__categories-section,
.page-blog__cta-section,
.page-blog__about-blog-section {
  padding: 60px 0;
}

.page-blog__section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.page-blog__section-description {
  font-size: 1.1rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px;
  color: var(--text-dark);
}

.page-blog__dark-bg .page-blog__section-title,
.page-blog__dark-bg .page-blog__section-description {
  color: var(--text-light);
}

.page-blog__dark-bg {
  background-color: var(--primary-color);
  color: var(--text-light);
}

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

.page-blog__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.page-blog__blog-card {
  background-color: var(--secondary-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

.page-blog__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.page-blog__blog-card-content {
  padding: 20px;
}

.page-blog__blog-card-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary-color);
  line-height: 1.3;
}

.page-blog__blog-card-date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 15px;
  display: block;
}

.page-blog__blog-card-excerpt {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-blog__read-more-btn {
  color: var(--btn-login-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.page-blog__read-more-btn::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background-color: var(--btn-login-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.page-blog__read-more-btn:hover::after {
  transform: scaleX(1);
}

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

.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.page-blog__category-card {
  background-color: var(--secondary-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

.page-blog__category-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.page-blog__category-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.page-blog__category-desc {
  font-size: 1rem;
  color: #555;
}

.page-blog__cta-section {
  text-align: center;
  background: linear-gradient(90deg, #26A9E0 0%, #34ace0 100%);
  color: var(--text-light);
}

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  width: 100%; /* Ensure container takes full width */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-blog__cta-buttons .page-blog__btn-primary,
.page-blog__cta-buttons .page-blog__btn-secondary {
  min-width: 180px;
}

.page-blog__about-blog-section .page-blog__text-block {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: var(--text-dark);
  text-align: justify;
}

/* General image responsive style */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-blog__categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-blog__hero-image {
    width: 150%;
    bottom: -20px;
  }
}

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

  .page-blog__hero-section {
    padding-top: 10px !important; /* Keep small top padding */
    padding-bottom: 30px;
  }

  .page-blog__main-title {
    font-size: clamp(2rem, 8vw, 2.5rem) !important;
    margin-bottom: 15px;
  }

  .page-blog__description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-blog__hero-image {
    width: 200%;
    bottom: -50px;
    opacity: 0.15;
  }

  .page-blog__section-title {
    font-size: clamp(1.8rem, 7vw, 2.2rem) !important;
    margin-bottom: 15px;
  }

  .page-blog__section-description {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .page-blog__latest-articles-section,
  .page-blog__categories-section,
  .page-blog__cta-section,
  .page-blog__about-blog-section {
    padding: 40px 0;
  }

  /* Blog card section */
  .page-blog__blog-grid {
    grid-template-columns: 1fr; /* Single column for blog cards */
    gap: 25px;
  }

  .page-blog__blog-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
  }

  .page-blog__blog-card-image {
    height: 180px; /* Adjust height for mobile */
  }

  .page-blog__blog-card-title {
    font-size: 1.2rem;
  }

  .page-blog__blog-card-excerpt {
    -webkit-line-clamp: 4;
  }

  /* Categories section */
  .page-blog__categories-grid {
    grid-template-columns: 1fr; /* Single column for categories */
    gap: 20px;
  }

  .page-blog__category-card {
    padding: 25px;
  }

  .page-blog__category-icon {
    font-size: 2.5rem;
  }

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

  /* CTA Section buttons */
  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  /* General images and containers for mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__container,
  .page-blog__section,
  .page-blog__card,
  .page-blog__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }
}