/* style/blog.css */

/* Variables for custom colors - using BEM prefix for safety */
:root {
    --page-blog__color-primary: #11A84E; /* Main color */
    --page-blog__color-secondary: #22C768; /* Auxiliary color */
    --page-blog__color-card-bg: #11271B; /* Card Background */
    --page-blog__color-background: #08160F; /* General Background */
    --page-blog__color-text-main: #F2FFF6; /* Main Text */
    --page-blog__color-text-secondary: #A7D9B8; /* Secondary Text */
    --page-blog__color-border: #2E7A4E; /* Border */
    --page-blog__color-glow: #57E38D; /* Glow */
    --page-blog__color-gold: #F2C14E; /* Gold */
    --page-blog__color-divider: #1E3A2A; /* Divider */
    --page-blog__color-deep-green: #0A4B2C; /* Deep Green */
    --page-blog__button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Button gradient */

    /* Default text color based on body background (from shared.css, assumed dark) */
    --page-blog__default-text-color: var(--page-blog__color-text-main); /* Assuming body is dark */
    --page-blog__default-light-text-color: #333333; /* For sections with light background */
}

/* Base styles for the blog page content */
.page-blog {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--page-blog__default-text-color); /* Inherit from body or set explicitly for dark background */
    background-color: var(--page-blog__color-background); /* Explicitly set page background */
}

/* General container for content sections */
.page-blog__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Section titles */
.page-blog__section-title {
    font-size: clamp(28px, 4vw, 48px); /* Responsive font size */
    font-weight: 700;
    color: var(--page-blog__color-text-main);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image above content */
    align-items: center;
    padding-top: 10px; /* Small top padding, body handles --header-offset */
    background-color: var(--page-blog__color-background);
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.page-blog__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 200px; /* Ensure minimum size */
}

.page-blog__hero-content {
    width: 100%;
    max-width: 1000px;
    padding: 40px 20px;
    text-align: center;
    box-sizing: border-box;
    background-color: var(--page-blog__color-card-bg); /* Use card background for contrast */
    border-radius: 8px;
    margin-top: -60px; /* Overlap slightly with image for visual interest */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1; /* Ensure content is above other elements if any */
    color: var(--page-blog__color-text-main);
}

.page-blog__main-title {
    font-size: clamp(32px, 5vw, 56px); /* Responsive H1 font size */
    font-weight: 800;
    color: var(--page-blog__color-gold);
    margin-bottom: 15px;
    line-height: 1.2;
}

.page-blog__description {
    font-size: 18px;
    color: var(--page-blog__color-text-secondary);
    margin-bottom: 30px;
}

.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap; /* Prevent text wrapping initially */
    box-sizing: border-box;
    max-width: 100%;
    word-wrap: break-word; /* Allow wrapping if forced */
}

.page-blog__btn-primary {
    background: var(--page-blog__button-gradient);
    color: #ffffff; /* White text for contrast */
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__btn-secondary {
    background: transparent;
    color: var(--page-blog__color-secondary); /* Use auxiliary color for text */
    border: 2px solid var(--page-blog__color-secondary);
}

.page-blog__btn-secondary:hover {
    background: var(--page-blog__color-secondary);
    color: var(--page-blog__color-background); /* Dark background text for contrast */
    transform: translateY(-2px);
}

/* Latest Posts Section */
.page-blog__latest-posts {
    background-color: var(--page-blog__color-background);
    color: var(--page-blog__color-text-main);
    padding-top: 60px;
    padding-bottom: 60px;
}

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

.page-blog__post-card {
    background-color: var(--page-blog__color-card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--page-blog__color-text-main); /* Ensure text is main color */
}

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

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

.page-blog__post-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-blog__post-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

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

.page-blog__post-title a:hover {
    color: var(--page-blog__color-secondary);
}

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

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

.page-blog__read-more {
    display: inline-block;
    color: var(--page-blog__color-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.page-blog__view-all {
    text-align: center;
}

/* Categories Section */
.page-blog__categories {
    background-color: var(--page-blog__color-card-bg); /* Use card background for contrast */
    color: var(--page-blog__color-text-main);
    padding-top: 60px;
    padding-bottom: 60px;
}

.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Adjusted for smaller cards */
    gap: 25px;
}

.page-blog__category-card {
    background-color: var(--page-blog__color-deep-green); /* Use a deeper green for category cards */
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--page-blog__color-text-main);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px; /* Ensure a decent size for category cards */
}

.page-blog__category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    background-color: var(--page-blog__color-primary); /* Slightly lighter on hover */
}

.page-blog__category-card .page-blog__category-icon {
    width: 200px; /* Explicitly set to 200px */
    height: 200px; /* Explicitly set to 200px */
    min-width: 200px;
    min-height: 200px;
    object-fit: cover; /* Changed to cover to fill the 200x200 space */
    margin-bottom: 15px;
}


.page-blog__category-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--page-blog__color-text-main);
}

/* Deep Content Section */
.page-blog__deep-content {
    background-color: var(--page-blog__color-background);
    color: var(--page-blog__color-text-main);
    padding-top: 60px;
    padding-bottom: 60px;
}

.page-blog__sub-title {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 700;
    color: var(--page-blog__color-gold);
    margin-top: 40px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.page-blog__text-block {
    font-size: 17px;
    color: var(--page-blog__color-text-secondary);
    margin-bottom: 20px;
}

.page-blog__image-with-text {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 40px;
}

.page-blog__image-with-text--reverse {
    flex-direction: row-reverse;
}

.page-blog__content-image {
    flex: 0 0 40%; /* Fixed width for image in desktop */
    max-width: 40%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px; /* Enforce minimum size */
    min-height: 200px;
}

.page-blog__image-with-text .page-blog__text-block {
    flex: 1;
    font-size: 17px;
}

.page-blog__list {
    list-style: disc;
    margin-left: 25px;
    margin-bottom: 20px;
    color: var(--page-blog__color-text-secondary);
}

.page-blog__list li {
    margin-bottom: 10px;
    font-size: 17px;
    color: var(--page-blog__color-text-secondary);
}

.page-blog__list li strong {
    color: var(--page-blog__color-text-main);
}

/* FAQ Section */
.page-blog__faq-section {
    background-color: var(--page-blog__color-card-bg); /* Use card background for contrast */
    color: var(--page-blog__color-text-main);
    padding-top: 60px;
    padding-bottom: 60px;
}

.page-blog__faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-blog__faq-item {
    background-color: var(--page-blog__color-deep-green); /* Deeper green for FAQ items */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    color: var(--page-blog__color-text-main);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    color: var(--page-blog__color-text-main);
    background-color: var(--page-blog__color-deep-green);
    border-bottom: 1px solid var(--page-blog__color-divider);
    transition: background-color 0.3s ease;
}

.page-blog__faq-question:hover {
    background-color: var(--page-blog__color-divider);
}

.page-blog__faq-toggle {
    font-size: 24px;
    font-weight: 700;
    margin-left: 15px;
    color: var(--page-blog__color-gold);
}

/* For details tag, hide default marker */
.page-blog__faq-item[open] .page-blog__faq-toggle {
    content: "−"; /* Minus sign when open */
}

.page-blog__faq-item summary {
    list-style: none; /* Hide default marker */
}

.page-blog__faq-item summary::-webkit-details-marker {
    display: none; /* Hide default marker for webkit */
}

.page-blog__faq-answer {
    padding: 20px;
    font-size: 16px;
    color: var(--page-blog__color-text-secondary);
    line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .page-blog__hero-content {
        margin-top: -40px;
    }
    .page-blog__post-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .page-blog__category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .page-blog__image-with-text {
        flex-direction: column;
    }
    .page-blog__image-with-text--reverse {
        flex-direction: column; /* Also stack in reverse order */
    }
    .page-blog__content-image {
        max-width: 100%;
        width: 100%;
        flex: none;
    }
}

@media (max-width: 768px) {
    .page-blog__container {
        padding: 20px 15px;
    }

    .page-blog__section-title {
        font-size: 32px;
    }

    .page-blog__hero-content {
        padding: 30px 15px;
        margin-top: -30px;
    }

    .page-blog__main-title {
        font-size: 38px;
    }

    .page-blog__description {
        font-size: 16px;
    }

    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    /* Mobile specific button styles */
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        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;
    }

    /* Mobile specific image styles */
    .page-blog img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-blog__hero-image-wrapper,
    .page-blog__post-image,
    .page-blog__category-icon,
    .page-blog__content-image {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

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

    .page-blog__image-with-text {
        gap: 20px;
    }
    .page-blog__content-image {
        margin-bottom: 20px;
    }

    /* Ensure containers have padding and don't overflow */
    .page-blog__section,
    .page-blog__card,
    .page-blog__container,
    .page-blog__hero-section,
    .page-blog__latest-posts,
    .page-blog__categories,
    .page-blog__deep-content,
    .page-blog__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-blog__hero-section {
        padding-top: 10px !important; /* body already handles --header-offset */
    }
    
    .page-blog__category-card .page-blog__category-icon {
        width: 200px; /* Maintain minimum size */
        height: 200px;
        min-width: 200px;
        min-height: 200px;
    }
}