/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main); /* Using custom text color */
  background-color: var(--bg); /* Using custom background color */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 20px 60px; /* Small top padding, more bottom padding */
  overflow: hidden;
  background-color: var(--bg); /* Ensure background for contrast */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 1920px; /* Max width for large screens */
  margin-bottom: 40px; /* Space between image and content */
}

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

.page-blog__hero-content-wrapper {
  position: relative; /* Ensure content is in normal flow below image */
  z-index: 1;
  max-width: 900px;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

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

.page-blog__description {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

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

.page-blog__btn-primary {
  background: var(--button-gradient); /* Custom button gradient */
  color: var(--text-main); /* Light text for dark button */
  border: 2px solid transparent;
}

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

.page-blog__btn-secondary {
  background: transparent;
  color: var(--main-color); /* Brand color for text */
  border: 2px solid var(--border-color); /* Custom border color */
}

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

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

.page-blog__dark-section {
  background-color: var(--card-bg); /* Darker green background */
  padding: 80px 0;
}

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 20px;
}

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

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

.page-blog__post-card {
  background-color: var(--bg); /* Darker background for cards */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px 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 20px rgba(0, 0, 0, 0.3);
}

.page-blog__post-image-wrapper {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  overflow: hidden;
}

.page-blog__post-image {
  position: absolute;
  top: 0;
  left: 0;
  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: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

.page-blog__post-title a:hover {
  color: var(--gold-color); /* Gold on hover */
}

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

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

.page-blog__read-more {
  color: var(--main-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.page-blog__read-more:hover {
  color: var(--gold-color);
}

.page-blog__view-all-posts {
  text-align: center;
  margin-top: 60px;
}

/* Featured Article */
.page-blog__featured-article {
  padding: 80px 0;
  background-color: var(--bg);
}

.page-blog__featured-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.page-blog__featured-image-wrapper {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
  padding-bottom: 60%; /* Aspect ratio 5:3 */
  position: relative;
}

.page-blog__featured-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-blog__featured-text {
  flex: 1;
}

.page-blog__featured-title {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-blog__featured-meta {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.page-blog__featured-excerpt {
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

/* Categories */
.page-blog__categories {
  padding: 80px 0;
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  text-align: center;
}

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding-bottom: 20px;
}

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

.page-blog__category-image {
  width: 100%;
  height: 200px; /* Fixed height for category images */
  object-fit: cover;
  margin-bottom: 20px;
  display: block;
}

.page-blog__category-title {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 15px;
}

/* Why SC88 Benefits */
.page-blog__why-sc88 {
  padding: 80px 0;
  background-color: var(--bg);
}

.page-blog__benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  text-align: center;
}

.page-blog__benefit-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-blog__benefit-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
}

.page-blog__benefit-title {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 15px;
}

.page-blog__benefit-text {
  font-size: 0.95em;
  color: var(--text-secondary);
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
}

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

.page-blog__faq-item {
  background-color: var(--bg);
  border: 1px solid var(--divider-color); /* Custom border color */
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-item[open] {
  background-color: var(--card-bg);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.3s ease;
  list-style: none; /* For details/summary */
}

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

.page-blog__faq-question:hover {
  background-color: rgba(var(--main-color-rgb), 0.05);
}

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

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: 700;
  color: var(--main-color);
  margin-left: 20px;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Rotate for 'x' or '-' */
}

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

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

/* Call to Action Section */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
  background-color: var(--main-color); /* Brand main color for CTA */
  color: var(--text-main); /* Light text on brand color */
}

.page-blog__cta-title {
  font-size: 2.8em;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-main);
}

.page-blog__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: var(--text-main);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__btn-large {
  padding: 16px 40px;
  font-size: 1.2em;
}

/* Utility classes for colors (Contrast assurance) */
:root {
  --main-color: #11A84E;
  --secondary-color: #22C768;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --bg: #08160F;
  --card-bg: #11271B;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold-color: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green-color: #0A4B2C;

  /* RGB values for transparent colors */
  --main-color-rgb: 17, 168, 78;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-blog__featured-content {
    flex-direction: column;
  }
  .page-blog__featured-image-wrapper {
    margin-bottom: 30px;
    padding-bottom: 56.25%; /* 16:9 for better mobile display */
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding: 10px 15px 40px;
  }
  .page-blog__main-title {
    font-size: 2em;
  }
  .page-blog__description {
    font-size: 1em;
  }
  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 10px;
    padding: 0 15px;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px;
    font-size: 1em;
  }

  .page-blog__dark-section,
  .page-blog__featured-article,
  .page-blog__categories,
  .page-blog__why-sc88,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding: 50px 0;
  }

  .page-blog__section-title {
    font-size: 2em;
    margin-bottom: 15px;
  }
  .page-blog__section-description {
    font-size: 0.95em;
    margin-bottom: 30px;
  }

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

  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__benefit-item {
    margin-left: 15px;
    margin-right: 15px;
  }

  .page-blog__post-image-wrapper,
  .page-blog__featured-image-wrapper {
    padding-bottom: 65%; /* Adjust aspect ratio for mobile */
  }
  .page-blog__category-image {
    height: 180px; /* Adjust height for mobile */
  }

  .page-blog__featured-title {
    font-size: 1.6em;
  }
  .page-blog__featured-text {
    padding: 0 15px;
  }

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

  .page-blog__cta-title {
    font-size: 2em;
  }
  .page-blog__cta-description {
    font-size: 1em;
  }
  .page-blog__btn-large {
    padding: 14px 25px;
    font-size: 1.1em;
  }

  /* Force responsive images and containers */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__benefit-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__hero-section,
  .page-blog__latest-posts,
  .page-blog__featured-article,
  .page-blog__categories,
  .page-blog__why-sc88,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .page-blog__hero-content-wrapper,
  .page-blog__post-content,
  .page-blog__featured-text,
  .page-blog__category-card,
  .page-blog__benefit-item,
  .page-blog__faq-list {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Specific padding for hero section on mobile */
  .page-blog__hero-section {
    padding-top: 10px !important; /* body already handles --header-offset */
  }

  .page-blog__cta-buttons {
    flex-wrap: wrap !important;
    gap: 10px;
  }
}