/* style/blog.css */

/* Custom Colors */
:root {
    --thabet-primary: #11A84E;
    --thabet-secondary: #22C768;
    --thabet-btn-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --thabet-card-bg: #11271B;
    --thabet-bg: #08160F;
    --thabet-text-main: #F2FFF6;
    --thabet-text-secondary: #A7D9B8;
    --thabet-border: #2E7A4E;
    --thabet-glow: #57E38D;
    --thabet-gold: #F2C14E;
    --thabet-divider: #1E3A2A;
    --thabet-deep-green: #0A4B2C;

    /* Fallback for body background, assuming dark background for text contrast */
    --bg-color: #08160F; /* Assuming body background from shared.css */
}

.page-blog {
    font-family: 'Arial', sans-serif;
    color: var(--thabet-text-main); /* Default text color for the page */
    background-color: var(--thabet-bg); /* Use the specified background color */
    line-height: 1.6;
}

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

.page-blog__section {
    padding: 60px 0;
    text-align: center;
}

.page-blog__section-title {
    font-size: 2.8em;
    color: var(--thabet-gold);
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(242, 193, 78, 0.4);
}

.page-blog__main-title {
    font-size: clamp(2.5em, 4vw, 3.8em); /* Flexible font size for H1 */
    color: var(--thabet-gold);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(242, 193, 78, 0.6);
}

.page-blog__text-block {
    font-size: 1.1em;
    color: var(--thabet-text-secondary);
    max-width: 900px;
    margin: 0 auto 30px auto;
}

/* Hero Section */
.page-blog__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, content below */
    align-items: center;
    justify-content: center;
    padding: 10px 0 60px 0; /* Small top padding, larger bottom padding */
    overflow: hidden;
    background-color: var(--thabet-deep-green); /* Fallback background */
}

.page-blog__hero-image-wrapper {
    width: 100%;
    max-height: 600px; /* Limit height for hero image */
    overflow: hidden;
    margin-bottom: 30px; /* Space between image and text */
}

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

.page-blog__hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

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

/* Buttons */
.page-blog__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    width: 100%;
    max-width: 600px;
    margin: 30px auto 0 auto;
    box-sizing: border-box;
}

.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog__btn-tertiary {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%; /* Ensure buttons don't overflow */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
}

.page-blog__btn-primary {
    background: var(--thabet-btn-gradient);
    color: var(--thabet-text-main);
    border: none;
    box-shadow: 0 4px 15px rgba(42, 209, 111, 0.4);
}

.page-blog__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 209, 111, 0.6);
}

.page-blog__btn-secondary {
    background: transparent;
    color: var(--thabet-gold);
    border: 2px solid var(--thabet-gold);
    box-shadow: 0 2px 10px rgba(242, 193, 78, 0.2);
}

.page-blog__btn-secondary:hover {
    background: rgba(242, 193, 78, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(242, 193, 78, 0.4);
}

.page-blog__btn-tertiary {
    background: var(--thabet-primary);
    color: var(--thabet-text-main);
    border: none;
    font-size: 0.95em;
    padding: 10px 20px;
    border-radius: 5px;
}

.page-blog__btn-tertiary:hover {
    background: var(--thabet-secondary);
    transform: translateY(-1px);
}

/* Category Grid */
.page-blog__category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.page-blog__category-card {
    background-color: var(--thabet-card-bg);
    border: 1px solid var(--thabet-border);
    border-radius: 10px;
    overflow: hidden;
    padding-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.page-blog__category-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
    margin-bottom: 20px;
}

.page-blog__card-title {
    font-size: 1.5em;
    color: var(--thabet-gold);
    margin: 0 20px 10px 20px;
    font-weight: bold;
}

.page-blog__card-description {
    font-size: 0.95em;
    color: var(--thabet-text-secondary);
    margin: 0 20px 20px 20px;
    flex-grow: 1; /* Allow description to take available space */
}

.page-blog__category-card .page-blog__btn-tertiary {
    align-self: flex-start;
    margin: 0 20px;
}

/* Why Read Section */
.page-blog__why-read-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.page-blog__why-read-item {
    background-color: var(--thabet-card-bg);
    border: 1px solid var(--thabet-border);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__benefit-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.page-blog__item-title {
    font-size: 1.3em;
    color: var(--thabet-gold);
    margin-bottom: 10px;
    font-weight: bold;
}

.page-blog__item-description {
    font-size: 0.95em;
    color: var(--thabet-text-secondary);
}

/* Featured Articles */
.page-blog__article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: left;
}

.page-blog__article-card {
    background-color: var(--thabet-card-bg);
    border: 1px solid var(--thabet-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.page-blog__article-card:hover {
    transform: translateY(-5px);
}

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

.page-blog__article-image {
    width: 100%;
    height: 250px; /* Fixed height for article images */
    object-fit: cover;
    display: block;
}

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

.page-blog__article-content .page-blog__card-title {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--thabet-gold);
}

.page-blog__article-meta {
    font-size: 0.85em;
    color: var(--thabet-text-secondary);
    margin-bottom: 15px;
}

.page-blog__article-content .page-blog__card-description {
    font-size: 0.9em;
    color: var(--thabet-text-secondary);
    margin-bottom: 0;
}

.page-blog__view-all-button {
    margin-top: 50px;
}

/* FAQ Section */
.page-blog__faq {
    background-color: var(--thabet-deep-green); /* Slightly different background for contrast */
}

.page-blog__faq-list {
    max-width: 900px;
    margin: 40px auto 0 auto;
    text-align: left;
}

.page-blog__faq-item {
    background-color: var(--thabet-card-bg);
    border: 1px solid var(--thabet-border);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-blog__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--thabet-gold);
    cursor: pointer;
    background-color: var(--thabet-card-bg);
    list-style: none; /* Remove default marker for details summary */
}
.page-blog__faq-question::-webkit-details-marker {
    display: none; /* Hide default marker for Webkit browsers */
}

.page-blog__faq-qtext {
    flex-grow: 1;
}

.page-blog__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    width: 20px;
    text-align: center;
}

.page-blog__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1em;
    color: var(--thabet-text-secondary);
    line-height: 1.7;
    /* For details tag, the content is naturally hidden/shown */
}
.page-blog__faq-answer p {
    margin-bottom: 0;
}

/* Final CTA Section */
.page-blog__cta-final {
    padding-bottom: 80px;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .page-blog__section-title {
        font-size: 2.2em;
    }
    .page-blog__main-title {
        font-size: clamp(2em, 5vw, 3em);
    }
    .page-blog__text-block {
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    .page-blog__section {
        padding: 40px 0;
    }
    .page-blog__hero-section {
        padding-bottom: 40px;
        padding-top: 10px !important; /* body already handles --header-offset */
    }
    .page-blog__section-title {
        font-size: 1.8em;
    }
    .page-blog__main-title {
        font-size: clamp(1.8em, 6vw, 2.5em);
    }
    .page-blog__hero-description {
        font-size: 1em;
    }
    .page-blog__cta-buttons {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px; /* Add padding to buttons container */
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary,
    .page-blog__btn-tertiary {
        width: 100% !important; /* Force full width for buttons */
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    .page-blog__category-grid,
    .page-blog__why-read-grid,
    .page-blog__article-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 15px; /* Add padding to grid containers */
    }

    /* Mobile image responsiveness */
    .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__hero-image-wrapper,
    .page-blog__hero-content,
    .page-blog__category-card,
    .page-blog__why-read-item,
    .page-blog__article-card,
    .page-blog__faq-list,
    .page-blog__faq-item {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important; /* Ensure no overflow */
    }

    .page-blog__faq-question {
        font-size: 1.1em;
        padding: 15px 20px;
    }
    .page-blog__faq-answer {
        padding: 0 20px 15px 20px;
    }
    .page-blog__category-card .page-blog__btn-tertiary {
        margin: 0 20px 0 20px; /* Adjust margin for mobile */
    }
}

@media (max-width: 480px) {
    .page-blog__section-title {
        font-size: 1.6em;
    }
    .page-blog__main-title {
        font-size: clamp(1.6em, 7vw, 2em);
    }
    .page-blog__btn-primary,
    .page-blog__btn-secondary {
        padding: 12px 20px;
        font-size: 1em;
    }
}