/* style/blog.css */

/* Variables */
:root {
    --page-blog-primary-color: #017439;
    --page-blog-secondary-color: #FFFFFF;
    --page-blog-text-dark: #333333;
    --page-blog-text-light: #ffffff;
    --page-blog-bg-light: #f9f9f9;
    --page-blog-btn-register: #C30808;
    --page-blog-btn-login: #C30808;
    --page-blog-text-login-register: #FFFF00;
}

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

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

.page-blog__section-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--page-blog-primary-color);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.2;
}

.page-blog__section-title--white {
    color: var(--page-blog-text-light);
}

.page-blog__section-subtitle {
    font-size: 18px;
    color: #666;
    text-align: center;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-blog__section-subtitle--white {
    color: #f0f0f0;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Ensure image is above content */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 10px; /* Small padding, assuming body has header offset */
    background-color: var(--page-blog-primary-color); /* Fallback color */
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    position: relative;
    z-index: 1;
    max-height: 500px; /* Limit hero image height */
}

.page-blog__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 15px 60px;
    background: rgba(0, 0, 0, 0.4);
    width: 100%;
    box-sizing: border-box;
    margin-top: -5px; /* Slight overlap with image edge, if desired */
}

.page-blog__hero-title {
    font-size: 48px;
    font-weight: bold;
    color: var(--page-blog-text-login-register);
    margin-bottom: 15px;
    line-height: 1.1;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-blog__hero-description {
    font-size: 20px;
    color: var(--page-blog-secondary-color);
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure long words break */
    box-sizing: border-box;
    max-width: 100%;
}

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

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

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

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

.page-blog__btn-primary--large {
    padding: 15px 30px;
    font-size: 20px;
}

/* Recent Posts Section */
.page-blog__recent-posts-section {
    padding: 60px 0;
    background: var(--page-blog-bg-light);
}

.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: var(--page-blog-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;
}

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

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

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

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

.page-blog__post-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--page-blog-primary-color);
    margin-bottom: 10px;
    line-height: 1.3;
}

.page-blog__post-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}

.page-blog__post-excerpt {
    font-size: 16px;
    color: var(--page-blog-text-dark);
    margin-bottom: 20px;
}

.page-blog__read-more-link {
    color: var(--page-blog-primary-color);
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

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

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

/* Category Section */
.page-blog__category-section {
    padding: 60px 0;
    background: var(--page-blog-primary-color);
}

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

.page-blog__category-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    color: var(--page-blog-text-light);
    transition: background-color 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-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--page-blog-text-light);
}

.page-blog__category-description {
    font-size: 15px;
    color: #f0f0f0;
    margin-bottom: 20px;
}

.page-blog__category-link {
    display: inline-block;
    padding: 8px 20px;
    background: var(--page-blog-secondary-color);
    color: var(--page-blog-primary-color);
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__category-link:hover {
    background: #e0e0e0;
}

/* Featured Articles Section */
.page-blog__featured-articles-section {
    padding: 60px 0;
    background: var(--page-blog-secondary-color);
}

.page-blog__article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.page-blog__article-item {
    background: var(--page-blog-bg-light);
    border-radius: 10px;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.page-blog__article-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__article-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

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

.page-blog__article-title a:hover {
    color: #005a2e;
}

.page-blog__article-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.page-blog__article-excerpt {
    font-size: 16px;
    color: var(--page-blog-text-dark);
}

/* Pagination */
.page-blog__pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-blog__pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--page-blog-bg-light);
    color: var(--page-blog-primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__pagination-link:hover:not(.page-blog__pagination-link--disabled):not(.page-blog__pagination-link--active) {
    background: var(--page-blog-primary-color);
    color: var(--page-blog-text-light);
}

.page-blog__pagination-link--active {
    background: var(--page-blog-primary-color);
    color: var(--page-blog-text-light);
}

.page-blog__pagination-link--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* FAQ Section */
.page-blog__faq-section {
    padding: 60px 0;
    background: var(--page-blog-bg-light);
}

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: var(--page-blog-secondary-color);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-blog__faq-item summary.page-blog__faq-question::-webkit-details-marker {
  display: none;
}
details.page-blog__faq-item summary.page-blog__faq-question:hover {
  background: #f5f5f5;
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--page-blog-primary-color);
}
.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: var(--page-blog-text-dark);
}

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

.page-blog__cta-content {
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--page-blog-text-light);
}

.page-blog__cta-title {
    font-size: 38px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.2;
}

.page-blog__cta-title--white {
    color: var(--page-blog-text-light);
}

.page-blog__cta-description {
    font-size: 18px;
    margin-bottom: 30px;
}

.page-blog__cta-description--white {
    color: #f0f0f0;
}

.page-blog__cta-image-wrapper {
    max-width: 1000px;
    margin: 30px auto 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

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


/* Responsive styles for @media (max-width: 768px) */
@media (max-width: 768px) {
    /* General adjustments */
    .page-blog__container {
        padding: 0 10px;
    }

    .page-blog__section-title {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .page-blog__section-subtitle {
        font-size: 16px;
        margin-bottom: 30px;
    }

    /* Hero Section */
    .page-blog__hero-title {
        font-size: 32px;
    }

    .page-blog__hero-description {
        font-size: 16px;
    }

    .page-blog__hero-cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        padding: 0 15px; /* Ensure buttons have side padding */
        box-sizing: border-box;
    }

    /* Buttons responsive fix */
    .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;
    }

    /* Button containers responsive fix */
    .page-blog__hero-cta-buttons,
    .page-blog__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      flex-wrap: wrap !important;
      gap: 10px;
    }
    .page-blog__hero-cta-buttons {
        display: flex;
        flex-direction: column;
    }

    /* Images responsive fix */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-blog__hero-section,
    .page-blog__recent-posts-section,
    .page-blog__category-section,
    .page-blog__featured-articles-section,
    .page-blog__faq-section,
    .page-blog__cta-section,
    .page-blog__post-card,
    .page-blog__category-card,
    .page-blog__article-item,
    .page-blog__cta-content,
    .page-blog__cta-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-blog__hero-image {
        max-height: 300px;
    }
    .page-blog__post-image {
        height: 180px;
    }

    /* Recent Posts Section */
    .page-blog__recent-posts-section,
    .page-blog__category-section,
    .page-blog__featured-articles-section,
    .page-blog__faq-section,
    .page-blog__cta-section {
        padding: 40px 0;
    }

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

    .page-blog__post-title {
        font-size: 18px;
    }

    /* Category Section */
    .page-blog__category-grid {
        grid-template-columns: 1fr;
    }
    .page-blog__category-title {
        font-size: 20px;
    }

    /* Featured Articles Section */
    .page-blog__article-title {
        font-size: 18px;
    }

    /* FAQ Section */
    details.page-blog__faq-item summary.page-blog__faq-question { padding: 15px; }
    .page-blog__faq-qtext { font-size: 15px; }
    details.page-blog__faq-item .page-blog__faq-answer { padding: 0 15px 15px; }
}