/* style/blog.css */

/* General styles for the blog page */
.page-blog {
    font-family: Arial, sans-serif;
    background-color: #08160F; /* Body background from custom palette */
    color: #F2FFF6; /* Main text color for dark background */
    line-height: 1.6;
}

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

.page-blog__section-title {
    font-size: 2.5rem;
    color: #F2C14E; /* Gold for titles */
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

/* Hero Section */
.page-blog__hero-section {
    padding-top: 10px; /* Fixed header offset */
    background-color: #11271B; /* Card BG */
    padding-bottom: 50px;
    border-bottom: 1px solid #1E3A2A; /* Divider */
}

.page-blog__hero-content-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-blog__hero-text-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.page-blog__hero-title {
    font-size: clamp(2rem, 4vw, 3.2rem); /* H1 title size constraint */
    color: #F2FFF6;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: bold;
}

.page-blog__hero-description {
    font-size: 1.1rem;
    color: #A7D9B8; /* Secondary text color */
    margin-bottom: 30px;
}

.page-blog__hero-cta-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%; /* Button responsive */
    box-sizing: border-box; /* Button responsive */
    white-space: normal; /* Button responsive */
    word-wrap: break-word; /* Button responsive */
}

.page-blog__hero-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 209, 111, 0.4);
}

.page-blog__hero-image-block {
    flex: 1;
    text-align: right;
}

.page-blog__hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(87, 227, 141, 0.5); /* Glow */
    display: block; /* For image responsiveness */
}

/* Latest Articles Section */
.page-blog__latest-articles-section {
    padding: 60px 0;
    background-color: #08160F; /* Background */
}

.page-blog__article-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
    gap: 30px;
}

.page-blog__article-card {
    background-color: #11271B; /* Card BG */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2E7A4E; /* Border */
}

.page-blog__article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(87, 227, 141, 0.3); /* Glow */
}

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

.page-blog__article-thumbnail {
    width: 100%;
    height: 225px; /* Fixed height for consistency */
    object-fit: cover;
    display: block; /* For image responsiveness */
}

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

.page-blog__article-title {
    font-size: 1.4rem;
    color: #F2FFF6;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-blog__article-excerpt {
    font-size: 1rem;
    color: #A7D9B8;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit excerpt to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.page-blog__view-all-button {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 8px;
    background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
    max-width: 100%; /* Button responsive */
    box-sizing: border-box; /* Button responsive */
    white-space: normal; /* Button responsive */
    word-wrap: break-word; /* Button responsive */
}

.page-blog__view-all-button:hover {
    background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
}

/* Featured Article Section */
.page-blog__featured-article-section {
    padding: 60px 0;
    background-color: #11271B; /* Card BG */
    border-top: 1px solid #1E3A2A; /* Divider */
}

.page-blog__article-detail-content {
    max-width: 900px;
    margin: 0 auto;
    color: #F2FFF6;
}

.page-blog__article-detail-content h2,
.page-blog__article-detail-content h3,
.page-blog__article-detail-content h4 {
    color: #F2C14E; /* Gold for titles */
    margin-top: 30px;
    margin-bottom: 15px;
    line-height: 1.3;
}

.page-blog__article-detail-content h2 {
    font-size: 2.2rem;
}

.page-blog__article-detail-content h3 {
    font-size: 1.8rem;
}

.page-blog__article-detail-content p {
    margin-bottom: 1em;
    font-size: 1.05rem;
    color: #A7D9B8; /* Secondary text color */
}

.page-blog__article-detail-content strong {
    color: #F2FFF6;
}

.page-blog__figure {
    margin: 30px 0;
    text-align: center;
}

.page-blog__figure-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: block; /* For image responsiveness */
    margin: 0 auto;
}

.page-blog__figure-caption {
    font-style: italic;
    color: #A7D9B8;
    margin-top: 10px;
    font-size: 0.95rem;
}

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

.page-blog__cta-button--large {
    padding: 15px 40px;
    font-size: 1.2rem;
}

/* Categories Section */
.page-blog__categories-section {
    padding: 60px 0;
    background-color: #08160F; /* Background */
    border-top: 1px solid #1E3A2A; /* Divider */
}

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

.page-blog__category-card {
    background-color: #11271B; /* Card BG */
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #2E7A4E; /* Border */
}

.page-blog__category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(87, 227, 141, 0.3); /* Glow */
}

.page-blog__category-title {
    font-size: 1.5rem;
    color: #F2FFF6;
    margin-bottom: 10px;
}

.page-blog__category-description {
    font-size: 1rem;
    color: #A7D9B8;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__hero-content-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .page-blog__hero-text-block {
        align-items: center;
    }

    .page-blog__hero-image-block {
        text-align: center;
    }

    .page-blog__article-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
    }

    .page-blog__categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* General mobile styles */
    .page-blog__container {
        padding: 15px;
    }

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

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

    .page-blog__hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        text-align: center;
    }

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

    .page-blog__hero-cta-button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-blog__hero-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Latest Articles Section */
    .page-blog__article-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
        gap: 20px;
    }

    .page-blog__article-thumbnail {
        height: auto !important; /* Allow height to adjust for responsiveness */
        max-width: 100% !important;
        width: 100% !important;
    }

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

    .page-blog__article-excerpt {
        font-size: 0.95rem;
    }

    .page-blog__view-all-button {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Featured Article Section */
    .page-blog__article-detail-content {
        padding: 0 10px;
    }

    .page-blog__article-detail-content h2 {
        font-size: 1.8rem;
    }

    .page-blog__article-detail-content h3 {
        font-size: 1.5rem;
    }

    .page-blog__figure-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-blog__cta-button--large {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Categories Section */
    .page-blog__categories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

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

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

    /* Universal image and button rules for mobile */
    .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__cta-buttons,
    .page-blog__button-group,
    .page-blog__btn-container,
    .page-blog__hero-content-wrapper,
    .page-blog__latest-articles-section,
    .page-blog__featured-article-section,
    .page-blog__categories-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden; /* Ensure no horizontal scroll */
    }

    .page-blog__cta-button,
    .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__cta-buttons {
        display: flex;
        flex-direction: column; /* Ensure vertical stacking for buttons */
        gap: 10px;
    }
}