/* Pathfind Education - POLISHED AESTHETIC OVERRIDE */

/* 0. CRITICAL: Universal Box-Sizing & Smooth Scrolling */
* {
    box-sizing: border-box !important;
}

html {
    scroll-behavior: smooth;
}

/* 1. Enhanced Global Typography */
body, h1, h2, h3, h4, h5, h6, span, a, p, li {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

body {
    font-size: 16px;
    line-height: 1.65;
    color: #374151;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Enhanced Heading Hierarchy */
h1 {
    font-size: 2.5em;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: #112649;
    letter-spacing: -0.5px;
    text-wrap: balance; /* ADDED: Prevents orphan words on mobile titles */
}

h2 {
    font-size: 2em;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5em 0 0.75em;
    color: #112649;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.4;
    margin: 1.25em 0 0.5em;
    color: #112649;
}

h4 {
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.4;
    margin: 1em 0 0.5em;
    color: #374151;
}

p {
    margin: 0 0 1.25em;
    line-height: 1.75;
}

/* 3. FIXED: Simple Hyperlink Styling - NO BOXES */
.post-content a,
article p a,
.post-content.e-content a {
    color: #f5a623 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    transition: color 0.2s ease !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    display: inline !important;
}

.post-content a:hover,
article p a:hover,
.post-content.e-content a:hover {
    color: #112649 !important;
}

/* 4. Scroll & Overflow Management */
body {
    overflow-x: hidden !important;
}

/* 5. Enhanced List Styling */
.post-content ul,
.post-content ol {
    margin: 1.5em 0;
    padding-left: 1.75em;
}

.post-content li {
    margin-bottom: 0.75em;
    line-height: 1.7;
}

.post-content ul li {
    list-style-type: disc;
}

.post-content ul li::marker {
    color: #f5a623;
}

/* 6. BEAUTIFUL TABLE STYLING */

/* Base table container */
.post-content.e-content table {
    width: 100% !important;
    max-width: 750px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 2.5em auto !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 6px 24px rgba(17, 38, 73, 0.12) !important;
    border: none !important;
    background: #ffffff !important;
}

/* Stunning header row with gradient */
.post-content.e-content table thead {
    position: relative !important;
}

.post-content.e-content table th {
    background: linear-gradient(135deg, #0e203d 0%, #112649 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 20px 24px !important;
    text-align: left !important;
    font-size: 0.9em !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    border: none !important;
    position: relative !important;
}

/* Orange accent line below headers */
.post-content.e-content table thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f5a623 0%, #ff9800 50%, #f5a623 100%);
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.4);
}

/* Body cells with better spacing */
.post-content.e-content table td {
    padding: 18px 24px !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: left !important;
    font-size: 0.95em !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    color: #374151 !important;
    line-height: 1.6 !important;
    transition: all 0.2s ease !important;
}

/* Zebra striping for better readability */
.post-content.e-content table tbody tr:nth-child(odd) {
    background-color: #fafbfc !important;
}

.post-content.e-content table tbody tr:nth-child(even) {
    background-color: #ffffff !important;
}

/* Smooth hover effect on entire row */
.post-content.e-content table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.post-content.e-content table tbody tr:hover {
    background: linear-gradient(135deg, #fef9f3 0%, #fef6ed 100%) !important;
    transform: translateX(4px);
    box-shadow: -4px 0 0 0 #f5a623;
}

/* Remove border from last row */
.post-content.e-content table tbody tr:last-child td {
    border-bottom: none !important;
}

/* First column emphasis for comparison tables */
.post-content.e-content table td:first-child {
    font-weight: 600 !important;
    color: #112649 !important;
    background: linear-gradient(90deg, rgba(17, 38, 73, 0.03) 0%, transparent 100%) !important;
}

/* Visual separator between columns */
.post-content.e-content table td:not(:last-child) {
    border-right: 2px solid #f1f5f9 !important;
}

/* IMPORTANT: Bold text in tables stays NAVY BLUE, not orange */
.post-content.e-content table td strong,
.post-content.e-content table td b {
    color: #112649 !important;
    font-weight: 700 !important;
}

/* Special styling for 2-column comparison tables */
.post-content.e-content table thead th:first-child {
    width: 35% !important;
}

.post-content.e-content table thead th:last-child {
    width: 65% !important;
}

/* Add subtle animation on page load */
@keyframes fadeInTable {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-content.e-content table {
    animation: fadeInTable 0.6s ease-out !important;
}

/* 7. Enhanced Blockquote Styling */
.post-content blockquote {
    border-left: 4px solid #f5a623;
    margin: 2em 0;
    padding: 1.25em 1.5em;
    background: linear-gradient(135deg, #fef9f3 0%, #fef6ed 100%);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

/* 8. CRITICAL: Post Header Layout Fix */
.post-header-fixed {
    text-align: center !important;
    width: 750px !important;
    max-width: 95% !important;
    margin: 0 auto 50px !important;
    padding: 40px 32px !important;
    box-sizing: border-box !important;
}

.post-header-fixed h1 {
    font-size: 2em !important;
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
    text-align: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: block !important;
    letter-spacing: -0.5px !important;
}

/* 9. Enhanced Code Blocks */
.post-content code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #112649;
    font-family: 'Courier New', Courier, monospace;
}

.post-content pre {
    background: #1e293b;
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-content pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
}

/* 10. Enhanced Image Styling */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2em 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* 11. Selection Styling */
::selection {
    background-color: rgba(245, 166, 35, 0.3);
    color: #112649;
}

::-moz-selection {
    background-color: rgba(245, 166, 35, 0.3);
    color: #112649;
}

/* 12. Mobile Responsive Enhancements */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 2em !important;
    }
    
    h2 {
        font-size: 1.65em !important;
    }
    
    h3 {
        font-size: 1.35em !important;
    }
    
    .post-header-fixed {
        width: calc(100% - 20px) !important;
        max-width: 100% !important;
        margin: 0 auto 40px !important;
        padding: 28px 20px !important;
    }
    
    .post-header-fixed h1 {
        font-size: 1.65em !important;
        line-height: 1.3 !important;
    }
    
    .post-content {
        font-size: 1.05em !important;
    }
    
    /* Mobile table adjustments */
    .post-content.e-content table {
        font-size: 0.9em !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 16px rgba(17, 38, 73, 0.08) !important;
    }
    
    .post-content.e-content table th,
    .post-content.e-content table td {
        padding: 14px 16px !important;
        font-size: 0.9em !important;
    }
    
    .post-content.e-content table th {
        font-size: 0.8em !important;
        padding: 16px !important;
    }
}

/* For very small screens - enable horizontal scroll */
@media (max-width: 600px) {
    .post-content.e-content {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .post-content.e-content table {
        min-width: 500px !important;
        display: block !important;
    }
}

/* 13. Enhanced Focus States for Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #f5a623;
    outline-offset: 3px;
    border-radius: 4px;
}

/* 14. Smooth Transitions for Interactive Elements */
a, button, .post-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 15. Print Styles */
@media print {
    .post-header-fixed {
        background: none !important;
        color: #000 !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .post-content.e-content table {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .post-content.e-content table th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}