/* style/blog.css */

/* Ensure the main content area has padding-top to clear the fixed header */
.page-blog {
    padding-top: var(--header-offset, 120px); /* Default for desktop, responsive via shared.css */
    background-color: #FFFFFF; /* Default light background */
    color: #333333; /* Dark text for light background */
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

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

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    padding: 60px 0; /* Adjust vertical padding */
    overflow: hidden; /* Ensure image doesn't overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px; /* Minimum height for hero section */
}

.page-blog__hero-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

.page-blog__hero-image {
    width: 100%; /* Occupy full width of its container */
    height: 100%; /* Occupy full height of its container */
    display: block;
    object-fit: cover; /* Cover the area without distorting aspect ratio */
    filter: brightness(0.7); /* Darken image for better text readability */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    min-width: 200px; /* Enforce minimum size */
    min-height: 200px; /* Enforce minimum size */
}

.page-blog__hero-content {
    position: relative;
    z-index: 1;
    color: #FFFFFF; /* White text for dark background image */
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.4); /* Semi-transparent black overlay for text */
    border-radius: 8px;
}

.page-blog__hero-title {
    font-size: 3.2em;
    margin-bottom: 15px;
    color: #FFFFFF;
    line-height: 1.2;
}

.page-blog__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #F0F0F0;
}

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

.page-blog__hero-button {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-width: 150px; /* Ensure buttons are not too small */
    text-align: center;
}

.page-blog__hero-button--primary {
    background-color: #FCBC45; /* Login button color */
    color: #000000;
}

.page-blog__hero-button--primary:hover {
    background-color: #E0A43C;
    color: #000000;
}

.page-blog__hero-button--secondary {
    background-color: #FFFFFF; /* Register button color */
    color: #000000;
    border: 1px solid #FCBC45;
}

.page-blog__hero-button--secondary:hover {
    background-color: #FCBC45;
    color: #000000;
    border-color: #FCBC45;
}

/* Section Titles & Descriptions */
.page-blog__section-title {
    font-size: 2.5em;
    color: #000000;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 60px;
}

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

/* Latest Articles Grid */
.page-blog__latest-articles {
    padding: 40px 0;
    background-color: #F8F8F8;
}

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

.page-blog__article-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-blog__article-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    min-width: 200px; /* Enforce minimum size */
    min-height: 200px; /* Enforce minimum size */
}

.page-blog__article-content {
    padding: 25px;
    flex-grow: 1; /* Allow content to take available space */
    display: flex;
    flex-direction: column;
}

.page-blog__article-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
    color: #000000;
}

.page-blog__article-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

.page-blog__article-excerpt {
    font-size: 1em;
    color: #555555;
    margin-bottom: 20px;
    flex-grow: 1; /* Allow excerpt to grow */
}

.page-blog__read-more {
    display: inline-block;
    color: #FCBC45;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    margin-top: auto; /* Push to bottom */
}

.page-blog__read-more:hover {
    text-decoration: underline;
    color: #E0A43C;
}

/* Featured Article */
.page-blog__featured-article {
    padding: 60px 0;
}

.page-blog__featured-content h3 {
    font-size: 1.8em;
    color: #000000;
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-blog__featured-content p {
    margin-bottom: 15px;
    color: #333333;
    font-size: 1.05em;
}

.page-blog__featured-content strong {
    color: #FCBC45; /* Highlight keywords */
}

/* Call to Action Section */
.page-blog__cta-section {
    padding: 60px 0;
    background-color: #000000; /* Dark background */
    color: #FFFFFF;
    text-align: center;
}

.page-blog__cta-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px; /* Ensure a minimum height for CTA */
}

.page-blog__cta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    filter: brightness(0.6); /* Darken image for text readability */
    min-width: 200px;
    min-height: 200px;
}

.page-blog__cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.page-blog__cta-title {
    font-size: 2.8em;
    margin-bottom: 15px;
    color: #FFFFFF;
    line-height: 1.2;
}

.page-blog__cta-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #F0F0F0;
}

.page-blog__cta-button {
    display: inline-block;
    background-color: #FCBC45;
    color: #000000;
    padding: 15px 35px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-blog__cta-button:hover {
    background-color: #E0A43C;
    color: #000000;
}

/* Categories Section */
.page-blog__categories {
    padding: 60px 0;
    background-color: #F0F0F0;
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.page-blog__category-card {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: #333333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px; /* Ensure cards have a decent height */
}

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

.page-blog__category-title {
    font-size: 1.6em;
    margin-bottom: 10px;
    color: #000000;
}

.page-blog__category-description {
    font-size: 0.95em;
    color: #666666;
}

/* Scroll to Top Button */
.page-blog__scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #FCBC45;
    color: #000000;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.page-blog__scroll-top:hover {
    background-color: #E0A43C;
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-blog__hero-title {
        font-size: 2.8em;
    }
    .page-blog__hero-description {
        font-size: 1.1em;
    }
    .page-blog__section-title {
        font-size: 2.2em;
    }
    .page-blog__cta-title {
        font-size: 2.4em;
    }
}

@media (max-width: 768px) {
    .page-blog {
        padding-top: var(--header-offset, 80px); /* Adjust for smaller header on mobile */
    }
    .page-blog__hero-section {
        padding: 40px 0;
        min-height: 350px;
    }
    .page-blog__hero-content {
        padding: 25px;
    }
    .page-blog__hero-title {
        font-size: 2.2em;
    }
    .page-blog__hero-description {
        font-size: 1em;
    }
    .page-blog__hero-actions {
        flex-direction: column;
        gap: 15px;
    }
    .page-blog__hero-button {
        width: 80%; /* Make buttons wider on mobile */
        margin: 0 auto;
    }
    .page-blog__articles-grid {
        grid-template-columns: 1fr;
    }
    .page-blog__article-image {
        height: 180px; /* Adjust height for mobile cards */
    }
    .page-blog__section-title {
        font-size: 1.8em;
    }
    .page-blog__section-description {
        font-size: 1em;
    }
    .page-blog__cta-container {
        min-height: 200px;
    }
    .page-blog__cta-title {
        font-size: 2em;
    }
    .page-blog__cta-description {
        font-size: 1em;
    }
    .page-blog__cta-button {
        width: 90%;
        padding: 12px 25px;
    }
    .page-blog__categories-grid {
        grid-template-columns: 1fr;
    }
    .page-blog__container {
        padding: 0 15px;
    }

    /* Mobile content area images must not overflow */
    .page-blog img {
        max-width: 100%;
        height: auto;
    }
    /* Ensure content area images maintain minimum size if possible, but prioritize max-width: 100% for overflow prevention */
    .page-blog__article-image,
    .page-blog__cta-image,
    .page-blog__hero-image {
        min-width: unset; /* Remove min-width for mobile */
        min-height: unset; /* Remove min-height for mobile */
    }
    .page-blog__scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1em;
    }
}

/* Ensure no image filters are used, except for controlled brightness for text readability */
.page-blog img:not(.page-blog__hero-image):not(.page-blog__cta-image) {
    filter: none !important; /* Override any potential filter from shared.css or elsewhere */
}

/* Re-apply brightness for hero and CTA images for text readability, as they are background-like */
.page-blog__hero-image {
    filter: brightness(0.7);
}
.page-blog__cta-image {
    filter: brightness(0.6);
}