/* style/blog.css */
.page-blog {
    background-color: var(--deep-navy); /* Base background for the main content */
    color: var(--text-main);
    font-family: Arial, sans-serif; /* Example font */
    line-height: 1.6;
}

.page-blog__hero-section {
    display: flex;
    flex-direction: column; /* Default to column for mobile first, then row for desktop */
    align-items: center;
    text-align: center;
    padding: 10px 20px 40px; /* Small top padding, good bottom padding */
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.page-blog__hero-content {
    order: 2; /* Content below image on mobile */
    max-width: 800px;
    padding: 20px;
}

.page-blog__hero-visual {
    order: 1; /* Image above content on mobile */
    width: 100%;
    max-width: 1200px; /* Ensure it doesn't stretch too wide */
}

.page-blog__hero-visual img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    min-width: 200px; /* Enforce min image size */
    min-height: 200px;
}

.page-blog__main-title {
    font-size: clamp(2rem, 5vw, 2.8rem); /* Using clamp for H1 font size */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-main);
}

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

.page-blog__cta-button {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 200px; /* Ensure button is not too small */
    text-align: center;
}

.page-blog__cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--glow-rgb), 0.4); /* Using glow color for shadow */
}

.page-blog__latest-posts-section,
.page-blog__categories-section,
.page-blog__cta-banner {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-blog__section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.page-blog__section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--glow);
    border-radius: 2px;
}

.page-blog__posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.page-blog__post-card {
    background-color: var(--card-b-g);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
}

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

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

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

.page-blog__post-title {
    font-size: 1.4rem;
    color: var(--text-main);
    margin: 20px 20px 10px;
    line-height: 1.3;
}

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

.page-blog__post-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 20px 20px;
}

.page-blog__read-more-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--auxiliary-color); /* Using auxiliary color for read more */
    color: var(--text-main);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 0 20px 20px;
    transition: background-color 0.2s ease;
}

.page-blog__read-more-button:hover {
    background-color: #1a6fdc; /* Slightly darker aux color */
}

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

.page-blog__view-all-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-blog__view-all-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--glow-rgb), 0.4);
}

.page-blog__categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjusted minmax to accommodate 200px image */
    gap: 25px;
    text-align: center;
}

.page-blog__category-card {
    background-color: var(--card-b-g);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 15px;
    border: 1px solid var(--border);
}

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

.page-blog__category-card img {
    width: 100%;
    height: 200px; /* Adjusted height to meet minimum 200px */
    object-fit: cover;
    display: block;
    margin-bottom: 15px;
}


.page-blog__category-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
    padding: 0 15px;
}

.page-blog__cta-banner {
    background-color: var(--card-b-g);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px;
    gap: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.page-blog__cta-banner-content {
    max-width: 700px;
}

.page-blog__cta-banner-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--text-main);
    margin-bottom: 20px;
}

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

.page-blog__cta-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    min-width: 200px; /* Enforce min image size */
    min-height: 200px;
}

/* Responsive adjustments */
@media (min-width: 769px) {
    .page-blog__hero-section {
        flex-direction: row; /* Image and content side-by-side on desktop */
        text-align: left;
        gap: 40px;
        padding: 40px 20px;
    }

    .page-blog__hero-content {
        order: 1; /* Content on left, image on right */
        flex: 1;
        padding: 0;
    }

    .page-blog__hero-visual {
        order: 2;
        flex: 1;
        max-width: 600px; /* Control image width on larger screens */
    }
    .page-blog__hero-visual img {
        height: 380px; /* Adjust height for desktop hero visual */
    }

    .page-blog__section-title {
        text-align: center;
    }

    .page-blog__cta-banner {
        flex-direction: row;
        text-align: left;
        gap: 40px;
    }
    .page-blog__cta-banner-content {
        flex: 1;
    }
    .page-blog__cta-banner img {
        flex: 1;
        max-width: 400px;
        height: 300px;
        object-fit: cover;
    }
}

@media (max-width: 849px) {
    .page-blog__hero-visual img {
        aspect-ratio: 16/9; /* For mobile hero image */
    }
}

@media (max-width: 768px) {
    .page-blog__hero-section {
        padding: 10px 15px 30px;
    }
    .page-blog__main-title {
        font-size: 2rem;
    }
    .page-blog__hero-description {
        font-size: 1rem;
    }
    .page-blog__cta-button {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .page-blog__latest-posts-section,
    .page-blog__categories-section,
    .page-blog__cta-banner {
        padding: 30px 15px;
    }
    .page-blog__section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

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

    .page-blog__post-card img {
        
    }

    .page-blog__category-card img {
         /* Ensure min 200px still applies */
    }
    .page-blog__categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }


    .page-blog__cta-banner {
        flex-direction: column;
        padding: 30px;
    }
    .page-blog__cta-banner-title {
        font-size: 1.8rem;
    }
    .page-blog__cta-banner-description {
        font-size: 1rem;
    }
    .page-blog__cta-banner img {
        height: 250px;
        width: 100%;
        max-width: 400px;
    }

    /* Enforce max-width: 100%; height: auto for all content images on mobile */
    .page-blog img {
        max-width: 100%;
        height: auto;
        display: block; /* Ensure no inline-block issues */
        min-width: 200px; /* Keep min size, but allow shrinking to max-width */
        min-height: 200px;
    }

    /* Specific overrides for smaller images if needed, but still > 200px */
    .page-blog__post-card img,
    .page-blog__category-card img,
    .page-blog__cta-banner img {
        width: 100%; /* Override fixed heights to allow auto */
        height: auto; /* Maintain aspect ratio */
        object-fit: cover;
    }
}

@media (max-width: 549px) {
    .page-blog__main-title {
        font-size: 1.8rem;
    }
    .page-blog__section-title {
        font-size: 1.8rem;
    }
    .page-blog__cta-banner-title {
        font-size: 1.6rem;
    }
}

/* Custom colors */
:root {
    --primary-color: #113B7A;
    --auxiliary-color: #1D5FD1;
    --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    --card-b-g: #10233F;
    --text-main: #F3F8FF;
    --text-secondary: #AFC4E8;
    --border: #244D84;
    --glow: #4FA8FF;
    --gold: #F2C14E;
    --divider: #1B3357;
    --deep-navy: #08162B;
    --glow-rgb: 79, 168, 255; /* RGB for glow color for rgba usage */
}

/* Apply custom colors */
.page-blog {
    background-color: var(--deep-navy);
}

.page-blog__cta-button,
.page-blog__view-all-button {
    background: var(--button-gradient);
}

.page-blog__post-card,
.page-blog__category-card,
.page-blog__cta-banner {
    background-color: var(--card-b-g);
    border: 1px solid var(--border);
}

.page-blog__main-title,
.page-blog__section-title,
.page-blog__post-title,
.page-blog__category-name,
.page-blog__cta-banner-title {
    color: var(--text-main);
}

.page-blog__hero-description,
.page-blog__post-meta,
.page-blog__post-excerpt,
.page-blog__cta-banner-description {
    color: var(--text-secondary);
}

.page-blog__section-title::after {
    background-color: var(--glow);
}

.page-blog__read-more-button {
    background-color: var(--auxiliary-color);
}

/* Ensure content area images are never smaller than 200px in CSS */
/* This selects all images within .page-blog content sections */
.page-blog__hero-visual img,
.page-blog__post-card img,
.page-blog__category-card img,
.page-blog__cta-banner img {
    min-width: 200px;
    min-height: 200px;
}
/* For mobile, ensure responsiveness while respecting min size */
@media (max-width: 768px) {
    .page-blog img {
        max-width: 100%;
        height: auto;
    }
    /* Specific content images, still ensuring min-width/height */
    .page-blog__post-card img,
    .page-blog__category-card img,
    .page-blog__cta-banner img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
}