/* BLOG STYLES - Based on Main Site with Blog Extensions */

/* MOBILE-FIRST BASE STYLES (0-599px) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-padding-top: 125px; /* Mobile base - 3-row vertical layout */
}

body {
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: 
        "header"
        "main"
        "footer";
}

/* Typography Hierarchy System with 800px Width Constraint */
h1, h2, h3, h4, p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #003D83;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #003D83;
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #003D83;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
}

h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #003D83;
    line-height: 1.4;
    margin-bottom: var(--space-xs);
}

/* Mathematical Spacing System (8px Grid) */
:root {
    --space-xs: 0.5rem;   /* 8px */
    --space-sm: 1rem;     /* 16px */
    --space-md: 1.5rem;   /* 24px */
    --space-lg: 2rem;     /* 32px */
    --space-xl: 3rem;     /* 48px */
    --space-2xl: 4rem;    /* 64px */
    --space-3xl: 6rem;    /* 96px */
}

/* Header - Mobile 3-Row Layout */
.header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #003D83 0%, #002a5c 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.8rem 0;
    gap: 0.8rem;
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(10px);
}

.header.scrolled {
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #004394 0%, #002f5a 100%);
}

main {
    grid-area: main;
}

.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FFD700;
}

/* Header Container - Mobile 3-Row */
.header-container {
    display: grid;
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr;
    grid-template-areas:
        "logo"
        "nav"
        "login";
    gap: 0.8rem;
    padding: 0 1rem;
    width: 100%;
}

.logo {
    grid-area: logo;
    justify-self: center;
}

.nav-menu {
    grid-area: nav;
    justify-self: center;
    width: 100%;
}

.nav-menu ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
    text-align: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    text-align: center;
}

.nav-menu a:hover {
    color: #FFD700;
}

/* Mobile Menu Toggle - Hidden by default */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: var(--spacing-xs, 0.25rem);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    grid-area: nav;
    justify-self: center;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle svg {
    display: block;
}

/* Hide mobile login on desktop */
.mobile-login {
    display: none;
}

.header-actions {
    grid-area: login;
    justify-self: center;
    display: block;
}

.login-button {
    background: transparent;
    color: white;
    border: 2px solid white;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.login-button:hover {
    background: white;
    color: #003D83;
}

/* BLOG-SPECIFIC STYLES */

/* Blog Hero Section */
.blog-hero {
    background: white;
    color: #333;
    padding: 40px 0 30px 0;
    display: grid;
    justify-items: center;
    text-align: center;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.blog-hero-content {
    width: 100%;
    max-width: min(1200px, calc(100vw - 2rem));
    padding: 0 1rem;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 2.375rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.blog-hero .subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

/* Blog Navigation Links */
.blog-nav {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
}

.blog-nav-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.blog-nav-link {
    color: #003D83;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.blog-nav-link:hover {
    background: white;
    color: #FFD700;
    text-decoration: underline;
}

/* Blog Posts Grid */
.blog-section {
    background: white;
    padding: 3rem 0;
    display: grid;
    justify-items: center;
    width: 100%;
}

.blog-container {
    width: 100%;
    max-width: min(900px, calc(100vw - 2rem));
    display: grid;
    gap: 2rem;
    justify-items: center;
    padding: 0 0.5rem;
    margin: 0 auto;
}

.blog-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    margin-bottom: 3rem;
}

/* Blog Post Cards */
.blog-post-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 61, 131, 0.15);
    border-left: 4px solid #003D83;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 61, 131, 0.25);
}

.blog-post-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.blog-post-title {
    color: #003D83;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

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

.blog-post-title a:hover {
    color: #FFD700;
}

.blog-post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-read-more {
    color: #003D83;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-read-more:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* Single Post Styles */
.post-header {
    background: white;
    padding: 3rem 0 2rem 0;
    text-align: center;
}

.post-header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-meta {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.2rem;
    color: #003D83;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.post-content {
    background: white;
    padding: 2rem 0 3rem 0;
}

.post-content-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #333;
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Post Navigation */
.post-navigation {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem 0;
    border-top: 1px solid #dee2e6;
}

.post-nav-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Main Site Button Consistency */
.cta-button, .post-nav-link {
    background: linear-gradient(45deg, #FF6B35, #FFA500);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.post-nav-link {
    padding: 12px 24px; /* Slightly smaller for navigation context */
}

.cta-button:hover, .post-nav-link:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.post-nav-link.secondary {
    background: transparent;
    color: #003D83;
    border: 2px solid #003D83;
}

.post-nav-link.secondary:hover {
    background: #003D83;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 61, 131, 0.4);
}

/* Footer */
.footer {
    grid-area: footer;
    background: #001a3d;
    color: white;
    padding: 2rem;
    display: grid;
    justify-items: center;
    align-items: center;
    min-height: 80px;
}

.footer p {
    margin: 0;
    padding: 0;
    color: white;
}

/* Social Sharing */
.social-sharing {
    background: linear-gradient(135deg, #003D83 0%, #002a5c 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.social-sharing-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.social-sharing h3 {
    color: white;
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #6c757d;
    color: white;
}

.social-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: #5a6268;
}

.social-icon {
    font-weight: 700;
    font-size: 1.2rem;
    color: inherit;
}

/* Mobile Menu Styles */
@media (max-width: 599px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-actions {
        display: none;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #003D83 0%, #002a5c 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 999;
    }
    
    .nav-menu.open {
        display: block;
    }
    
    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        margin: 0;
        list-style: none;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
    }
    
    .mobile-login {
        display: block;
    }
    
    .nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
    }
    
    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #FFD700;
    }
    
    .mobile-login a {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
        margin: 0.5rem 1rem;
        font-weight: 500;
    }
    
    .mobile-login a:hover {
        background: rgba(255, 215, 0, 0.2);
        border-color: #FFD700;
        color: #FFD700;
    }
    
    .header-container {
        position: relative;
        grid-template-areas:
            "logo"
            "nav";
    }
}

/* UTILITY CLASSES FOR CONSISTENT STYLING */

/* Question Series Navigation */
.question-series-nav {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem auto 2rem auto;
    max-width: 800px;
    text-align: center;
}

.question-series-nav p {
    margin: 0;
    color: #003D83;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Question Highlight Box */
.question-highlight {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #003D83;
    margin: 2rem auto;
    max-width: 800px;
}

.question-highlight p {
    margin: 0;
    color: #003D83;
    font-weight: 600;
}

/* Problem Box */
.problems-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #FFD700;
    margin: 1.5rem auto;
    max-width: 800px;
}

.problems-box h4 {
    color: #003D83;
    margin-top: 0;
    margin-bottom: 1rem;
}

.problems-box ul {
    margin: 0;
    padding-left: 1.2rem;
}

/* Solutions Box */
.solutions-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin: 1.5rem auto;
    max-width: 800px;
}

.solutions-box h4 {
    color: #003D83;
    margin-top: 0;
    margin-bottom: 1rem;
}

.solutions-box ol {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.7;
}

/* CTA Assessment Box */
.cta-assessment-box {
    background: linear-gradient(45deg, #003D83, #002a5c);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    margin: 2rem auto;
    max-width: 800px;
}

.cta-assessment-box h3 {
    color: #FFD700;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.cta-assessment-box p {
    margin-bottom: 1.5rem;
    color: white;
}

.cta-assessment-box .cta-details {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    color: #e9ecef;
}

.cta-assessment-box .cta-button {
    background: #FFD700;
    color: #003D83;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: all 0.3s ease;
}

.cta-assessment-box .cta-button:hover {
    color: #003D83;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* Tablet and Desktop Styles */
@media (min-width: 600px) {
    .header-container {
        grid-template-areas:
            "logo"
            "nav"
            "login";
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }

    .logo {
        font-size: 1.3rem;
    }
    
    .blog-hero h1 {
        font-size: 3.2rem;
    }
    
    .post-title {
        font-size: 2.5rem;
    }
    
    /* Blog posts remain single column for better readability */
}

@media (min-width: 900px) {
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    h3 {
        font-size: 1.6rem;
    }
    
    h4 {
        font-size: 1.3rem;
    }

    .header-container {
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "desktop-logo desktop-nav desktop-login";
        gap: 3rem;
        padding: 0 2rem;
        align-items: center;
    }
    
    .logo {
        grid-area: desktop-logo;
        justify-self: start;
        font-size: 1.4rem;
        white-space: nowrap;
        min-width: max-content;
    }
    
    .nav-menu {
        grid-area: desktop-nav;
        justify-self: center;
    }
    
    .nav-menu ul {
        gap: 1.5rem;
    }
    
    .header-actions {
        grid-area: desktop-login;
        justify-self: end;
    }
    
    .blog-hero h1 {
        font-size: 3.2rem;
    }
    
    .post-title {
        font-size: 2.8rem;
    }
}