/**
 * Blog Article Styles
 * Polished typography, spacing, and readability improvements
 * for .left-content-block blog content
 */

/* ==========================================================================
   BASE TYPOGRAPHY & CONTENT CONTAINER
   ========================================================================== */

.left-content-block,
.post-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    font-weight: 450;
    line-height: 1.8;
    color: #1e1e2c;
    max-width: 100%;
}

/* Ensure all images are responsive and have breathing room */
.left-content-block img,
.post-content img,
.post-content .blog-post-thumbnail {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px auto;
    /* Standardized to 24px */
    border-radius: 8px;
}

/* Remove image margins when inside a figure to prevent double spacing */
.left-content-block figure img,
.post-content figure img {
    margin: 0 auto !important;
}

/* Figure/image container styling - Top level only */
.left-content-block>figure,
.post-content>figure {
    margin: 40px 0;
    padding: 0;
}

.left-content-block figure.wl-route-map,
.post-content figure.wl-route-map {
    margin-bottom: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   HEADINGS - Clear Visual Hierarchy
   ========================================================================== */

.left-content-block h1,
.post-content h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.25;
    margin-bottom: 28px;
    letter-spacing: -0.8px;
}

.left-content-block h2,
.post-content h2 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin-top: 48px !important;
    margin-bottom: 20px !important;
    line-height: 1.3 !important;
    padding-bottom: 0px !important;
    border-bottom: none !important;
}

.left-content-block h3,
.post-content h3 {
    font-size: 22px !important;
    font-weight: 600 !important;
    color: #2d2d44 !important;
    margin-top: 36px !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.left-content-block h4,
.post-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #3d3d5c;
    margin-top: 28px;
    margin-bottom: 14px;
    line-height: 1.4;
}

/* Spacing cleanup after media */
.left-content-block figure+h2,
.post-content figure+h2,
.left-content-block figure+h3,
.post-content figure+h3,
.left-content-block img+h2,
.post-content img+h2,
.left-content-block img+h3,
.post-content img+h3 {
    margin-top: 24px;
}

/* ==========================================================================
   PARAGRAPHS & TEXT
   ========================================================================== */

.left-content-block p,
.post-content p {
    margin-bottom: 24px;
    line-height: 1.8;
    font-weight: 450;
    color: #1e1e2c;
    font-size: 18px;
}

/* Standard paragraph size after headings */
.left-content-block h2+p:first-of-type,
.post-content h2+p:first-of-type,
.left-content-block h3+p:first-of-type,
.post-content h3+p:first-of-type {
    font-size: 18px;
}

/* Links */
.left-content-block a,
.post-content a {
    color: #2563eb;
    text-decoration: none;
    transition: all 0.2s ease;
}

.left-content-block a:hover,
.post-content a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Strong/Bold text */
.left-content-block strong,
.post-content strong {
    font-weight: 600;
    color: #1a1a2e;
}

/* ==========================================================================
   LISTS - Better Scanning & Readability
   ========================================================================== */

.left-content-block ul,
.post-content ul,
.left-content-block ol,
.post-content ol {
    margin: 24px 0;
    padding-left: 0;
    list-style: none !important;
}

.left-content-block li,
.post-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.left-content-block li:last-child,
.post-content li:last-child {
    margin-bottom: 0;
}

/* Ordered list styling */
.left-content-block ol,
.post-content ol {
    counter-reset: list-counter;
}

.left-content-block ol>li,
.post-content ol>li {
    counter-increment: list-counter;
    position: relative;
    padding-left: 40px;
}

.left-content-block ol>li::before,
.post-content ol>li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: #2563eb;
    min-width: 28px;
}

/* Unordered list styling */
.left-content-block ul>li,
.post-content ul>li {
    position: relative;
    padding-left: 24px;
}

.left-content-block ul>li::before,
.post-content ul>li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 6px;
    height: 6px;
    background-color: #2563eb;
    border-radius: 50%;
}

/* Nested lists */
.left-content-block ul ul,
.post-content ul ul,
.left-content-block ol ol,
.post-content ol ol,
.left-content-block ul ol,
.post-content ul ol,
.left-content-block ol ul,
.post-content ol ul {
    margin-top: 12px;
    margin-bottom: 0;
}

/* ==========================================================================
   ROUTE STATS SECTION - Info Card Styling
   ========================================================================== */

.left-content-block .wl-route-stats,
.post-content .wl-route-stats {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 32px;
    margin: 40px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.left-content-block .wl-route-stats__title,
.post-content .wl-route-stats__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px 0;
    padding: 0;
    border: none;
}

.left-content-block .wl-route-stats__grid,
.post-content .wl-route-stats__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.left-content-block .wl-kv,
.post-content .wl-kv {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.left-content-block .wl-kv span,
.post-content .wl-kv span {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 600;
}

.left-content-block .wl-kv strong,
.post-content .wl-kv strong {
    font-size: 18px;
    color: #1a1a2e;
    font-weight: 600;
}

/* ==========================================================================
   PRICE RANGE SECTION - Card Styling
   ========================================================================== */

.wl-price-range {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    margin: 40px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.wl-price-range__title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 0 0 24px 0 !important;
    padding: 0;
    border: none;
}

/* Adjust margins for any H2/H3 inside price range to keep layout compact but breathable */
.wl-price-range h2,
.wl-price-range h3 {
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
}

.wl-price-range__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.wl-price-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
}

.wl-price-card h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0369a1 !important;
    margin: 0 0 12px 0 !important;
}

.wl-price-card__range {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #0c4a6e !important;
    margin: 8px 0 !important;
    display: block !important;
}

.wl-price-card__avg {
    font-size: 16px !important;
    color: #475569 !important;
    margin: 0 !important;
}

.wl-price-range__note {
    font-size: 15px !important;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin: 16px 0 0 0 !important;
}

/* ==========================================================================
   SECTION SPACING - Scannable Content Blocks
   ========================================================================== */

.left-content-block section {
    margin: 56px 0;
}

/* Add visual separator between major sections */
.left-content-block h2:not(:first-of-type) {
    padding-top: 16px;
}

/* ==========================================================================
   FAQ STYLING
   ========================================================================== */

/* Style Q&A format for FAQs */
.left-content-block h3 strong:first-child {
    color: #2563eb;
}

/* ==========================================================================
   CTA LINKS - Call to Action Styling
   ========================================================================== */

.left-content-block p strong a {
    color: #2563eb;
    font-weight: 600;
}

.left-content-block p strong a:hover {
    color: #1d4ed8;
}

/* Phone number links */
.left-content-block a[href^="tel:"] {
    white-space: nowrap;
}

/* Blocks - Spacing Consolidator */
.left-content-block .wp-block-columns,
.post-content .wp-block-columns {
    display: flex;
    gap: 24px;
    margin: 40px 0;
}

.left-content-block .wp-block-column,
.post-content .wp-block-column {
    flex: 1;
    min-width: 0;
}

/* Zero out margins for elements inside columns to prevent accumulation */
.left-content-block .wp-block-column>*,
.post-content .wp-block-column>* {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Add spacing between multiple elements inside a column if they exist */
.left-content-block .wp-block-column>*+*,
.post-content .wp-block-column>*+* {
    margin-top: 24px !important;
}

.left-content-block .wp-block-gallery,
.post-content .wp-block-gallery {
    display: flex !important;
    gap: 16px !important;
    margin: 40px 0;
    padding: 0 !important;
}

.left-content-block .wp-block-gallery figure,
.post-content .wp-block-gallery figure {
    margin: 0 !important;
    flex: 1;
}

.left-content-block .wp-block-gallery img,
.post-content .wp-block-gallery img {
    margin: 0 !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Tables Styling - Enhanced Readability & Contrast */
/* Reset Gutenberg table wrapper (figure & div) to prevent redundant borders */
.left-content-block div.wp-block-table,
.post-content div.wp-block-table,
.left-content-block figure.wp-block-table:not(.has-many-columns),
.post-content figure.wp-block-table:not(.has-many-columns) {
    border: none !important;
    padding: 0 !important;
    margin: 40px 0;
    box-shadow: none !important;
    overflow: visible !important;
    background: none !important;
    border-radius: 0 !important;
}

/* Apply premium styling ONLY to the actual table element */
.left-content-block table,
.post-content table,
.left-content-block .wp-block-table table,
.post-content .wp-block-table table {
    width: 100% !important;
    margin: 0 !important;
    /* Margin handled by parent wrapper if exists */
    border-collapse: separate !important;
    /* Required for rounded corners */
    border-spacing: 0 !important;
    font-size: 18px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Handle Header Row - robustly targeting both th and first-row td */
.left-content-block table tr:first-child th,
.post-content table tr:first-child th,
.left-content-block table tr:first-child td,
.post-content table tr:first-child td {
    background-color: #252e59 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-align: left !important;
    padding: 18px 20px !important;
    border: none !important;
}

/* Ensure strong tags inside headers are also white */
.left-content-block table tr:first-child td strong,
.post-content table tr:first-child td strong,
.left-content-block table tr:first-child th strong,
.post-content table tr:first-child th strong {
    color: #ffffff !important;
}

/* Standard Data Cells */
.left-content-block table tr:not(:first-child) td,
.post-content table tr:not(:first-child) td {
    padding: 16px 20px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e1e2c !important;
    line-height: 1.6 !important;
    vertical-align: top !important;
}

/* Remove bottom border from last child td for clean look */
.left-content-block table tr:last-child td,
.post-content table tr:last-child td {
    border-bottom: none !important;
}

/* Alternate Row Background */
.left-content-block table tr:not(:first-child):nth-child(even),
.post-content table tr:not(:first-child):nth-child(even) {
    background-color: #f8fafc !important;
}

/* Hover State for better UX */
.left-content-block table tr:not(:first-child):hover,
.post-content table tr:not(:first-child):hover {
    background-color: #f1f5f9 !important;
}

/* Standardized TOC/Sidebar space protection */

/* TOC Overrides Removed as requested */

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {

    .left-content-block,
    .post-content {
        font-size: 16px;
        line-height: 1.7;
        width: 100% !important;
    }

    .right-sidebar-geo-pages,
    .blog-post-wrapper+sidebar {
        display: none !important;
    }

    .blog-post-wrapper {
        padding: 0 15px;
    }

    .left-content-block h2,
    .post-content h2 {
        font-size: 24px;
        margin-top: 40px;
    }

    .left-content-block h3,
    .post-content h3 {
        font-size: 20px;
        margin-top: 32px;
    }

    .left-content-block .wl-route-stats,
    .left-content-block .wl-price-range {
        padding: 20px;
    }

    .left-content-block .wl-route-stats__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .left-content-block .wl-price-range__cards {
        grid-template-columns: 1fr;
    }

    .left-content-block ol>li {
        padding-left: 32px;
    }

    .left-content-block .wp-block-columns,
    .post-content .wp-block-columns {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .left-content-block h2 {
        font-size: 22px;
    }

    .left-content-block h3 {
        font-size: 18px;
    }

    .left-content-block .wl-route-stats__grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CLEARFIX UTILITY
   ========================================================================== */

.left-content-block .clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   SIDEBAR SPACING
   ========================================================================== */

.right-sidebar-geo-pages>div {
    margin-bottom: 40px;
}

/* ==========================================================================
   RESPONSIVE TABLES - Horizontal Scroll for Multi-Column Tables
   ========================================================================== */

/* 
   Bulletproof Horizontal Scroll 
   Requires parent figure/div to have .has-many-columns class added via JS
*/
@media (max-width: 1024px) {

    /* 1. Ensure the container is a scroll container */
    .left-content-block figure.wp-block-table.has-many-columns,
    .post-content figure.wp-block-table.has-many-columns {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        /* Force to viewport width */
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        /* Smooth scroll on iOS */
        touch-action: pan-x !important;
        /* Ensure horizontal panning */
        margin: 32px 0 !important;
        position: relative !important;
    }

    /* 2. Force the table to expand beyond the viewport */
    .left-content-block figure.wp-block-table.has-many-columns table,
    .post-content figure.wp-block-table.has-many-columns table {
        display: table !important;
        /* Reset display if changed */
        width: auto !important;
        /* Allow it to be wider than container */
        min-width: 800px !important;
        /* Force a minimum width to trigger scroll */
        table-layout: auto !important;
        /* Let content dictate width */
        margin: 0 !important;
    }

    /* 3. Style cells for readability in horizontal scroll */
    .left-content-block figure.wp-block-table.has-many-columns td,
    .post-content figure.wp-block-table.has-many-columns td,
    .left-content-block figure.wp-block-table.has-many-columns th,
    .post-content figure.wp-block-table.has-many-columns th {
        white-space: nowrap !important;
        /* Prevent text wrapping unless explicitly allowed */
        padding: 12px 16px !important;
        font-size: 15px !important;
        min-width: 100px;
    }

    /* 4. Allow text-heavy columns to wrap while maintaining a reasonable width */
    .left-content-block figure.wp-block-table.has-many-columns td:nth-child(3),
    .post-content figure.wp-block-table.has-many-columns td:nth-child(3),
    .left-content-block figure.wp-block-table.has-many-columns td:nth-child(4),
    .post-content figure.wp-block-table.has-many-columns td:nth-child(4) {
        white-space: normal !important;
        min-width: 250px !important;
        max-width: 400px !important;
    }

    /* 5. Visual hint that table is scrollable */
    .left-content-block figure.wp-block-table.has-many-columns::after {
        content: "← Scroll horizontally to view full table →";
        display: block;
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        color: #6366f1;
        /* Indigo color for visibility */
        padding: 12px 0 0;
        opacity: 0.8;
    }
}

/* ==========================================================================
   BLOG ARCHIVE SIDEBAR LAYOUT (.archive_page)
   Fix for sidebar "break" - ensures it stays as sidebar until 768px
   ========================================================================== */

.archive_page #main {
    display: flex !important;
    flex-direction: row-reverse !important;
    /* Sidebar on right, content on left */
    align-items: flex-start !important;
    gap: 40px !important;
    max-width: 1240px !important;
    margin: 0 auto !important;
    float: none !important;
}

.archive_page .right-sidebar {
    width: 300px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    float: none !important;
    position: sticky !important;
    top: 100px !important;
}

.archive_page .infopage-body {
    flex: 1 !important;
    margin: 0 !important;
    width: auto !important;
    float: none !important;
    min-width: 0 !important;
    /* Prevents flex items from overflowing */
}

/* Adjustments for medium screens (Tablet/Small Desktop) */
@media only screen and (max-width: 1200px) {
    .archive_page #main {
        gap: 30px !important;
        padding: 0 20px !important;
    }
}

@media only screen and (max-width: 991px) {
    .archive_page .right-sidebar {
        width: 250px !important;
    }

    .archive_page #main {
        gap: 20px !important;
    }
}

/* Mobile Breakpoint - Hide Sidebar according to requirements */
@media only screen and (max-width: 768px) {
    .archive_page #main {
        display: block !important;
    }

    .archive_page .right-sidebar {
        display: none !important;
    }

    .archive_page .infopage-body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 15px !important;
    }
}