/* style/blog.css */

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

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

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  overflow: hidden;
  background: #000000; /* Body background is dark */
  color: var(--n88-light-text);
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__hero-content {
  z-index: 1;
  max-width: 800px;
  margin-top: 20px;
}

.page-blog__main-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 15px;
  color: var(--n88-secondary-color);
}

.page-blog__hero-description {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: var(--n88-secondary-color);
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

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

.page-blog__btn-primary:hover {
  background: darken(var(--n88-primary-color), 10%);
  border-color: darken(var(--n88-primary-color), 10%);
  transform: translateY(-2px);
}

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

.page-blog__btn-secondary:hover {
  background: var(--n88-primary-color);
  color: var(--n88-light-text);
  transform: translateY(-2px);
}

/* Section Titles and Descriptions */
.page-blog__section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
}

.page-blog__section-description {
  font-size: 1.1rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 60px 0;
  background: var(--n88-secondary-color); /* Light background */
  color: var(--n88-dark-text);
}

.page-blog__latest-posts .page-blog__section-title,
.page-blog__latest-posts .page-blog__section-description {
  color: var(--n88-dark-text);
}

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

.page-blog__post-card {
  background: var(--n88-secondary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  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-link-wrapper {
  display: block;
  overflow: hidden;
  height: 225px; /* Fixed height for image container */
}

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

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

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

.page-blog__post-category {
  display: inline-block;
  background: var(--n88-primary-color);
  color: var(--n88-light-text);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}

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

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

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

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

.page-blog__post-excerpt {
  font-size: 1rem;
  color: #555;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--n88-primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.page-blog__read-more:hover {
  color: darken(var(--n88-primary-color), 10%);
}

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

/* Categories Section */
.page-blog__categories {
  padding: 60px 0;
  background: #000000; /* Dark background */
  color: var(--n88-light-text);
}

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

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

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 25px 15px;
  text-decoration: none;
  color: var(--n88-light-text);
  transition: background 0.3s ease, transform 0.3s ease;
}

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

.page-blog__category-image {
  width: 100px;
  height: 75px; /* Adjust height to maintain aspect ratio for 400x300 source */
  object-fit: contain;
  margin-bottom: 15px;
  display: block;
}

.page-blog__category-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--n88-light-text);
}

/* Featured Posts Section - same styling as latest posts */
.page-blog__featured-posts {
  padding: 60px 0;
  background: var(--n88-secondary-color);
  color: var(--n88-dark-text);
}

.page-blog__featured-posts .page-blog__section-title,
.page-blog__featured-posts .page-blog__section-description {
  color: var(--n88-dark-text);
}

.page-blog__post-grid--featured {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 20px;
  background: linear-gradient(90deg, var(--n88-primary-color) 0%, #000000 100%);
  text-align: center;
  color: var(--n88-light-text);
}

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

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background: var(--n88-secondary-color);
  color: var(--n88-dark-text);
}

.page-blog__faq-section .page-blog__section-title,
.page-blog__faq-section .page-blog__section-description {
  color: var(--n88-dark-text);
}

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

.page-blog__faq-item {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--n88-dark-text);
}

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

.page-blog__faq-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  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 20px 20px 20px;
  font-size: 1rem;
  color: #555;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
  }

  .page-blog__section-title {
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  }

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

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

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important; /* body handles header offset */
  }

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

  .page-blog__main-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

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

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
  }

  .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__latest-posts,
  .page-blog__categories,
  .page-blog__featured-posts,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 40px 0;
  }

  .page-blog__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__section-title {
    font-size: clamp(1.5rem, 5.5vw, 2rem);
  }

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

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

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

  .page-blog__category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .page-blog__category-card {
    padding: 20px 10px;
  }

  .page-blog__category-image {
    width: 80px;
    height: 60px;
  }

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

  .page-blog__faq-item summary {
    font-size: 1rem;
    padding: 15px;
  }

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

  /* Image responsive rules for mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

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

  /* All images must be at least 200px. No small icons. */
  .page-blog__category-image {
    min-width: 200px !important;
    min-height: 150px !important; /* Ensure category images are not too small */
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }
}

/* Ensure content area images maintain minimum size if possible, or scale responsively */
.page-blog img:not(.page-blog__category-image) {
  min-width: 200px;
  min-height: 200px;
  object-fit: cover;
}

/* Override min-width for category images to allow responsive scaling below 200px only if absolutely necessary for layout, but aim for larger visual presence */
@media (max-width: 768px) {
  .page-blog__category-image {
    min-width: unset !important;
    min-height: unset !important;
    width: 100% !important;
    height: auto !important;
  }
}