/**
 * Single blog post typography & layout.
 *
 * Loaded only on is_singular('post'), after new-theme.css. Fixes the global
 * resets in the child style.css that leak into article content:
 *   - `ol, ul { list-style: none }`        → plain lists had no bullets/numbers
 *   - `h2 { color: #000 !important }`       → headings (incl. WPBakery inline colors) forced black
 *   - `p { font-family: Lato !important }`  → p/li rendered in different fonts
 *
 * Per-post WPBakery custom CSS (`_wpb_post_custom_css`) still wins: the shared
 * list-class styles below are wrapped in :where() so they only fill in for
 * posts that use the classes without defining them.
 */

/* --------------------------------------------------------------------------
   Readable measure — hero, breadcrumbs and article share one column width
   -------------------------------------------------------------------------- */
.single-post-page .post-content-wrapper,
.single-post-page .post-hero-inner,
.single-post-page .breadcrumb-list {
    max-width: 1040px;
}

.single-post-page .post-content {
    padding: 3rem;
}

/* --------------------------------------------------------------------------
   Body copy
   -------------------------------------------------------------------------- */
.single-post-page .post-content p,
.single-post-page .post-content li,
.single-post-page .post-content blockquote {
    font-family: "Lato", sans-serif;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #3d3d3d;
}

.single-post-page .post-content strong {
    color: #222222;
}

/* --------------------------------------------------------------------------
   Headings — plain headings from text blocks get the brand palette.
   WPBakery "Custom Heading" elements keep their own (inline) colors.
   -------------------------------------------------------------------------- */
.single-post-page .post-content h2:not(.vc_custom_heading) {
    color: #003d7a !important;
    font-size: 1.75rem;
    line-height: 1.25;
    margin: 2.75rem 0 0.875rem;
}

.single-post-page .post-content h3:not(.vc_custom_heading) {
    color: #1d2b3a;
    font-size: 1.3125rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 0.625rem;
}

.single-post-page .post-content h4:not(.vc_custom_heading) {
    color: #1d2b3a;
    line-height: 1.35;
    margin: 1.5rem 0 0.5rem;
}

.single-post-page .post-content .vc_custom_heading {
    line-height: 1.25;
}

/* No extra top gap when a heading opens a column/block. */
.single-post-page .post-content .wpb_wrapper > h2:first-child,
.single-post-page .post-content .wpb_wrapper > h3:first-child,
.single-post-page .post-content .wpb_wrapper > h4:first-child,
.single-post-page .post-content > h2:first-child {
    margin-top: 0;
}

/* The child style.css `h2 { color:#000 !important }` beats inline styles, which
   turned every designed WPBakery heading black. Restore the brand colors used. */
.single-post-page .post-content .vc_custom_heading[style*="#003d7a"] { color: #003d7a !important; }
.single-post-page .post-content .vc_custom_heading[style*="#0053a0"] { color: #0053a0 !important; }
.single-post-page .post-content .vc_custom_heading[style*="#5b9bd5"] { color: #5b9bd5 !important; }
.single-post-page .post-content .vc_custom_heading[style*="#ff6b35"] { color: #ff6b35 !important; }
.single-post-page .post-content .vc_custom_heading[style*="#e74c3c"] { color: #e74c3c !important; }
.single-post-page .post-content .vc_custom_heading[style*="#70ad47"] { color: #70ad47 !important; }
.single-post-page .post-content .vc_custom_heading[style*="#ffffff"] { color: #ffffff !important; }

/* --------------------------------------------------------------------------
   Plain lists (no class) — restore markers removed by the global reset
   -------------------------------------------------------------------------- */
.single-post-page .post-content ul:not([class]),
.single-post-page .post-content ol:not([class]) {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
}

.single-post-page .post-content ul:not([class]) { list-style: disc; }
.single-post-page .post-content ol:not([class]) { list-style: decimal; }

.single-post-page .post-content ul:not([class]) ul:not([class]) { list-style: circle; margin: 0.5rem 0 0; }

.single-post-page .post-content ul:not([class]) > li,
.single-post-page .post-content ol:not([class]) > li {
    margin-bottom: 0.625rem;
    padding-left: 0.25rem;
}

.single-post-page .post-content ul:not([class]) > li::marker {
    color: #0051a3;
}

.single-post-page .post-content ol:not([class]) > li::marker {
    color: #0051a3;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Shared list styles used across articles (fallbacks; per-post CSS wins)
   -------------------------------------------------------------------------- */
:where(.single-post-page .post-content) :where(.altitude-list, .inspection-checklist, .danger-list) {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

:where(.single-post-page .post-content) .altitude-list > li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
}
:where(.single-post-page .post-content) .altitude-list > li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #ff6b35;
    font-weight: bold;
}
:where(.single-post-page .post-content) .altitude-list > li strong {
    color: #003d7a;
}

:where(.single-post-page .post-content) .inspection-checklist > li {
    position: relative;
    padding: 12px 0 12px 35px;
    border-bottom: 1px solid #e9ecef;
}
:where(.single-post-page .post-content) .inspection-checklist > li:last-child {
    border-bottom: none;
}
:where(.single-post-page .post-content) .inspection-checklist > li::before {
    content: "✓";
    position: absolute;
    left: 10px;
    color: #70ad47;
    font-weight: bold;
    font-size: 1.2em;
}

:where(.single-post-page .post-content) .danger-list > li {
    position: relative;
    padding: 12px 0 12px 40px;
    border-bottom: 1px solid #f0e0e0;
}
:where(.single-post-page .post-content) .danger-list > li:last-child {
    border-bottom: none;
}
:where(.single-post-page .post-content) .danger-list > li::before {
    content: "⚠";
    position: absolute;
    left: 10px;
    color: #e74c3c;
    font-size: 1.2em;
}

/* --------------------------------------------------------------------------
   Callout boxes (.sa-callout) for new articles
   -------------------------------------------------------------------------- */
.single-post-page .post-content .sa-callout {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    background: #fff9e6;
    border-left: 4px solid #ff6b35;
    border-radius: 0 8px 8px 0;
}

.single-post-page .post-content .sa-callout--warn {
    background: #fdf0ef;
    border-left-color: #e74c3c;
}

.single-post-page .post-content .sa-callout > :last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Quotes
   -------------------------------------------------------------------------- */
.single-post-page .post-content blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
}

.single-post-page .post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Text + image rows: center the shorter column instead of leaving a gap
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .single-post-page .post-content .vc_row:has(> .wpb_column .wpb_single_image):not(.vc_row-flex) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .single-post-page .post-content .vc_row:has(> .wpb_column .wpb_single_image):not(.vc_row-flex)::before,
    .single-post-page .post-content .vc_row:has(> .wpb_column .wpb_single_image):not(.vc_row-flex)::after {
        display: none;
    }
}

.single-post-page .post-content .wpb_single_image img {
    margin: 0;
}

.single-post-page .post-content .wpb_single_image {
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Related articles — center the cards when there are fewer than three
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
    .single-post-page .related-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .single-post-page .post-content {
        padding: 1.5rem;
    }

    .single-post-page .post-content h2:not(.vc_custom_heading) {
        font-size: 1.5rem;
        margin-top: 2.25rem;
    }

    .single-post-page .post-content h3:not(.vc_custom_heading) {
        font-size: 1.1875rem;
    }
}

@media (max-width: 480px) {
    .single-post-page .post-content h2:not(.vc_custom_heading) {
        font-size: 1.375rem;
    }

    .single-post-page .post-content p,
    .single-post-page .post-content li,
    .single-post-page .post-content blockquote {
        font-size: 1rem;
    }
}
