/*
 * Extracted from mu-plugins/kalon-blog-post.php on 2026-04-10
 * (Phase 4 of the kalon-theme refactor).
 */


    /* ── White background wrapper (overrides body gray) ─────── */
    .kbp-wrapper {
        background: #ffffff;
        padding-bottom: 48px;
    }

    /* ── Main layout: content + TOC sidebar ──────────────────── */
    .kbp-layout {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: 48px;
        max-width: 1100px;
        margin: 0 auto;
        padding: 48px 24px 0;
        align-items: start;
    }

    /* Ensure white background on the content area */
    .e-con:has(.kbp-wrapper),
    .e-con:has(.kbp-layout) {
        background: #ffffff !important;
    }

    /* ── Post Content Column ─────────────────────────────────── */
    .kbp-content {
        min-width: 0;
    }

    .kbp-content {
        font-family: 'Montserrat', sans-serif;
        font-size: 17px;
        line-height: 1.85;
        color: #3a3a3a;
    }

    .kbp-content p {
        margin-bottom: 1.5em;
        font-weight: 400;
    }

    /* ── Headings ── */
    .kbp-content h2 {
        font-family: 'Montserrat', sans-serif;
        font-size: 26px;
        font-weight: 700;
        line-height: 1.3;
        color: #1a1a1a;
        letter-spacing: 0.01em;
        margin: 2.2em 0 0.8em 0;
        padding-bottom: 14px;
        border-bottom: 3px solid transparent;
        border-image: linear-gradient(90deg, rgb(0,179,219), rgb(88,214,82)) 1;
        text-transform: none;
    }

    .kbp-content h3 {
        font-family: 'Montserrat', sans-serif;
        font-size: 22px;
        font-weight: 600;
        line-height: 1.35;
        color: #2a2a2a;
        letter-spacing: 0.01em;
        margin: 2em 0 0.6em 0;
        text-transform: none;
    }

    .kbp-content h3:not(.kbp-content h2 ~ h3) {
        padding-bottom: 12px;
        border-bottom: 2px solid transparent;
        border-image: linear-gradient(90deg, rgb(0,179,219), rgb(88,214,82)) 1;
    }

    .kbp-content h2 strong,
    .kbp-content h3 strong {
        font-weight: inherit;
    }

    .kbp-content h4 {
        font-family: 'Montserrat', sans-serif;
        font-size: 18px;
        font-weight: 600;
        color: #333;
        margin: 1.8em 0 0.5em 0;
        text-transform: none;
    }

    .kbp-content p > strong:first-child:last-child,
    .kbp-content p > b:first-child:last-child {
        display: block;
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 2px;
    }

    /* ── Links ── */
    .kbp-content a {
        color: rgb(0, 179, 219);
        text-decoration: none;
        border-bottom: 1px solid rgba(0, 179, 219, 0.3);
        transition: color 0.3s, border-color 0.3s;
    }

    .kbp-content a:hover {
        color: rgb(0, 145, 180);
        border-bottom-color: rgb(0, 145, 180);
    }

    /* ── Images ── */
    .kbp-content img {
        display: block;
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        border-radius: 12px;
        margin: 0 auto;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        transition: box-shadow 0.4s ease;
    }

    .kbp-content img:hover {
        box-shadow: 0 6px 28px rgba(0,0,0,0.13);
    }

    .kbp-content .wp-block-image,
    .kbp-content figure.wp-block-image,
    .kbp-content figure.wp-block-image.is-resized,
    .kbp-content figure.wp-block-image.aligncenter,
    .kbp-content figure.wp-block-image.alignnone,
    .kbp-content figure.wp-block-image.alignleft,
    .kbp-content figure.wp-block-image.alignright {
        margin: 1.8em 0 !important;
        text-align: center;
        max-width: 100% !important;
        width: 100% !important;
    }

    .kbp-content figure.wp-block-image[style],
    .kbp-content figure.wp-block-image.is-resized[style] {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .kbp-content .wp-block-image img,
    .kbp-content figure img,
    .kbp-content figure.wp-block-image img,
    .kbp-content figure.wp-block-image.is-resized img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 12px;
    }

    .kbp-content .wp-block-image.size-large,
    .kbp-content .wp-block-image.size-medium,
    .kbp-content .wp-block-image.size-full,
    .kbp-content .wp-block-image.size-thumbnail {
        max-width: 100% !important;
        width: 100% !important;
    }

    .kbp-content figcaption,
    .kbp-content .wp-element-caption {
        font-size: 13px;
        color: #999;
        text-align: center;
        margin-top: 12px;
        font-style: italic;
        letter-spacing: 0.02em;
    }

    /* ── Lists ── */
    .kbp-content ul,
    .kbp-content ol {
        margin: 1em 0 1.8em 0;
        padding-left: 1.3em;
    }

    .kbp-content li {
        margin-bottom: 0.55em;
        line-height: 1.75;
        padding-left: 0.4em;
    }

    .kbp-content ul li::marker {
        color: rgb(0, 179, 219);
        font-size: 1.15em;
    }

    .kbp-content ol li::marker {
        color: rgb(0, 179, 219);
        font-weight: 700;
    }

    /* ── Blockquotes / Guest quotes ── */
    .kbp-content blockquote,
    .kbp-content .wp-block-quote {
        margin: 2em 0;
        padding: 24px 28px;
        background: linear-gradient(135deg, #f7fafb 0%, #f0f8f7 100%);
        border-left: 4px solid rgb(0, 179, 219);
        border-radius: 0 10px 10px 0;
        font-style: italic;
        font-size: 17px;
        line-height: 1.75;
        color: #444;
    }

    .kbp-content blockquote p,
    .kbp-content .wp-block-quote p {
        margin-bottom: 0;
    }

    .kbp-content p > em:only-child {
        display: block;
        font-size: 18px;
        line-height: 1.65;
        color: #444;
        padding: 12px 0;
        border-left: 3px solid rgb(0, 179, 219);
        padding-left: 20px;
        margin: 0.5em 0;
    }

    /* ── Horizontal rules ── */
    .kbp-content hr {
        border: none;
        height: 2px;
        background: linear-gradient(90deg, transparent, #ddd, transparent);
        margin: 2.5em 0;
    }

    /* ── Kalon logo at end of posts ── */
    .kbp-content img[src*="kalon-logo"],
    .kbp-content img[src*="kalon_logo"],
    .kbp-content img[src*="kalon-logo-invert"] {
        max-width: 200px !important;
        width: auto !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 2em auto 1em !important;
        display: block !important;
    }

    /* ═══════════════════════════════════════════════════════════
       TABLE OF CONTENTS
       ═══════════════════════════════════════════════════════════ */

    .kbp-toc {
        position: sticky;
        top: 100px;
        align-self: start;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .kbp-toc__box {
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 16px rgba(0,0,0,0.04);
    }

    .kbp-toc__header {
        background: #fafafa;
        padding: 16px 20px;
        border-bottom: 1px solid #eee;
    }

    .kbp-toc__title {
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #1a1a1a;
        margin: 0;
    }

    .kbp-toc__list {
        list-style: none;
        padding: 12px 16px;
        margin: 0;
    }

    .kbp-toc__list li {
        margin: 0;
        padding: 0;
    }

    .kbp-toc__list a {
        font-family: 'Montserrat', sans-serif;
        font-size: 13.5px;
        font-weight: 500;
        color: #3a3a3a;
        text-decoration: none;
        border-bottom: none;
        transition: all 0.25s ease;
        line-height: 1.45;
        display: block;
        padding: 8px 14px;
        border-radius: 6px;
        border-left: 2px solid transparent;
    }

    .kbp-toc__list a:hover,
    .kbp-toc__list a.kbp-toc--active {
        color: rgb(0, 179, 219);
        background: rgba(0, 179, 219, 0.05);
        border-left-color: rgb(0, 179, 219);
    }

    .kbp-toc__list a.kbp-toc--active {
        font-weight: 600;
    }

    .kbp-toc__list .kbp-toc__sub {
        padding-left: 16px;
        list-style: none;
        margin: 0;
    }

    .kbp-toc__list .kbp-toc__sub a {
        font-size: 13px;
        color: #555;
        padding: 6px 14px;
    }

    /* ═══════════════════════════════════════════════════════════
       AUTHOR BOX
       ═══════════════════════════════════════════════════════════ */

    .kbp-author {
        max-width: 1100px;
        margin: 0 auto;
        padding: 40px 24px 0;
    }

    .kbp-author__inner {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 24px;
        align-items: center;
        background: #f8f7f5;
        border: 1px solid #ece8e2;
        border-radius: 14px;
        padding: 28px;
    }

    .kbp-author__image img {
        width: 120px;
        height: 120px;
        object-fit: cover;
        border-radius: 999px;
        display: block;
        box-shadow: none;
    }

    .kbp-author__eyebrow {
        font-family: 'Montserrat', sans-serif;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: rgb(0, 179, 219);
        margin: 0 0 8px 0;
    }

    .kbp-author__name {
        font-family: 'Montserrat', sans-serif;
        font-size: 24px;
        font-weight: 600;
        line-height: 1.25;
        color: #1a1a1a;
        margin: 0 0 6px 0;
    }

    .kbp-author__title {
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        font-weight: 500;
        color: #666;
        margin: 0 0 12px 0;
    }

    .kbp-author__bio {
        font-family: 'Montserrat', sans-serif;
        font-size: 15px;
        line-height: 1.75;
        color: #3a3a3a;
        margin: 0 0 16px 0;
    }

    .kbp-author__link {
        display: inline-block;
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgb(0, 179, 219);
        text-decoration: none;
        border-bottom: none;
    }

    .kbp-author__link:hover {
        color: rgb(0, 145, 180);
    }

    /* ═══════════════════════════════════════════════════════════
       POST NAVIGATION
       ═══════════════════════════════════════════════════════════ */

    .kbp-nav {
        max-width: 1100px;
        margin: 0 auto;
        padding: 48px 24px 0;
    }

    .kbp-nav__inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 32px;
        border-top: 2px solid #f0f0f0;
        gap: 24px;
    }

    .kbp-nav__link {
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        font-weight: 500;
        color: rgb(0, 179, 219);
        text-decoration: none;
        border-bottom: none;
        transition: color 0.3s;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .kbp-nav__link:hover {
        color: rgb(0, 145, 180);
    }

    .kbp-nav__link--next {
        margin-left: auto;
        text-align: right;
    }

    .kbp-nav__arrow {
        font-size: 18px;
        line-height: 1;
    }

    /* ═══════════════════════════════════════════════════════════
       RELATED POSTS
       ═══════════════════════════════════════════════════════════ */

    .kbp-related {
        background: #f8f7f5;
        padding: 64px 24px;
        /* C-4 (Phase 5): make this section a query container so the
           related-posts grid responds to its actual width, not the
           viewport. Lets the grid drop into narrower contexts and
           still reflow. */
        container-type: inline-size;
        container-name: kbp-related;
    }

    .kbp-related__inner {
        max-width: 1100px;
        margin: 0 auto;
    }

    /* C-4 (Phase 5): container-query alternates for the related-posts
       grid. The viewport @media rules below still set the section's
       outer padding (which is correctly viewport-bound), but the grid
       itself reflows based on its container. */
    @container kbp-related (max-width: 768px) {
        .kbp-related__grid {
            grid-template-columns: 1fr;
            max-width: 420px;
            margin: 0 auto;
        }
    }

    .kbp-related__heading {
        font-family: 'Montserrat', sans-serif;
        font-size: 32px;
        font-weight: 300;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #1a1a1a;
        margin: 0 0 32px;
    }

    .kbp-related__grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    .kbp-related__card {
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        border: 1px solid #eee;
        transition: box-shadow 0.3s ease, transform 0.3s ease;
    }

    .kbp-related__card:hover {
        box-shadow: 0 6px 24px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }

    .kbp-related__card a {
        text-decoration: none;
        border-bottom: none;
        color: inherit;
    }

    .kbp-related__thumb {
        height: 200px;
        overflow: hidden;
    }

    .kbp-related__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 0;
        box-shadow: none;
        transition: transform 0.4s;
    }

    .kbp-related__card:hover .kbp-related__thumb img {
        transform: scale(1.03);
    }

    .kbp-related__body {
        padding: 16px 20px 20px;
    }

    .kbp-related__card-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.4;
        color: #1a1a1a;
        margin: 0 0 8px;
        transition: color 0.3s;
    }

    .kbp-related__card:hover .kbp-related__card-title {
        color: rgb(0, 179, 219);
    }

    .kbp-related__excerpt {
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        line-height: 1.55;
        color: #777;
        margin: 0 0 12px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .kbp-related__readmore {
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 12px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: rgb(0, 179, 219);
        transition: color 0.3s;
    }

    .kbp-related__readmore:hover {
        color: rgb(0, 145, 180);
    }

    /* ═══════════════════════════════════════════════════════════
       CTA / FORM SECTION
       ═══════════════════════════════════════════════════════════ */

    .kbp-cta {
        border-top: 2px solid #f0f0f0;
    }

    /* ═══════════════════════════════════════════════════════════
       RESPONSIVE
       ═══════════════════════════════════════════════════════════ */

    @media (max-width: 1024px) {
        .kbp-content {
            font-size: 16px;
        }

        .kbp-content h2 { font-size: 24px; }
        .kbp-content h3 { font-size: 20px; }
    }

    @media (max-width: 768px) {
        .kbp-layout {
            grid-template-columns: 1fr;
            gap: 0;
            padding: 32px 20px 0;
        }

        .kbp-toc {
            position: relative;
            top: 0;
            max-height: none;
            order: -1;
            margin-bottom: 24px;
        }

        .kbp-toc__list {
            max-height: 0;
            overflow: hidden;
            padding: 0 16px;
            transition: max-height 0.3s ease, padding 0.3s ease;
        }

        .kbp-toc__box.kbp-toc--open .kbp-toc__list {
            max-height: 600px;
            padding: 12px 16px;
        }

        .kbp-toc__header {
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .kbp-toc__toggle {
            display: block;
            font-size: 18px;
            color: #999;
            transition: transform 0.3s;
        }

        .kbp-toc--open .kbp-toc__toggle {
            transform: rotate(180deg);
        }

        .kbp-content {
            font-size: 15.5px;
            line-height: 1.8;
        }

        .kbp-content h2 {
            font-size: 22px;
            margin: 1.8em 0 0.7em 0;
            padding-bottom: 10px;
        }

        .kbp-content h3 { font-size: 19px; }

        .kbp-content blockquote,
        .kbp-content .wp-block-quote {
            padding: 18px 20px;
            font-size: 15px;
        }

        .kbp-content img {
            border-radius: 8px;
        }

        .kbp-content figure,
        .kbp-content .wp-block-image,
        .kbp-content figure.wp-block-image,
        .kbp-content figure.wp-block-image[style],
        .kbp-content figure.wp-block-image.is-resized,
        .kbp-content figure.wp-block-image.is-resized[style] {
            margin-left: 0 !important;
            margin-right: 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            height: auto !important;
        }

        .kbp-content p > em:only-child {
            font-size: 16px;
        }

        .kbp-author {
            padding: 32px 20px 0;
        }

        .kbp-author__inner {
            grid-template-columns: 1fr;
            text-align: center;
            padding: 22px;
        }

        .kbp-author__image {
            display: flex;
            justify-content: center;
        }

        .kbp-author__image img {
            width: 96px;
            height: 96px;
        }

        .kbp-author__name {
            font-size: 21px;
        }

        .kbp-nav {
            padding: 32px 20px 0;
        }

        .kbp-related {
            padding: 48px 20px;
        }

        .kbp-related__grid {
            grid-template-columns: 1fr;
            max-width: 420px;
            margin: 0 auto;
        }

        .kbp-related__heading {
            font-size: 26px;
        }
    }

    @media (max-width: 480px) {
        .kbp-layout {
            padding: 24px 16px 0;
        }

        .kbp-content {
            font-size: 15px;
            line-height: 1.75;
        }

        .kbp-content h2 { font-size: 20px; }
        .kbp-content h3 { font-size: 17px; }

        .kbp-content blockquote,
        .kbp-content .wp-block-quote {
            padding: 14px 16px;
            margin: 1.5em 0;
        }

        .kbp-author {
            padding: 24px 16px 0;
        }

        .kbp-nav {
            padding: 24px 16px 0;
        }

        .kbp-related {
            padding: 40px 16px;
        }
    }

    @media (min-width: 769px) {
        .kbp-toc__toggle {
            display: none;
        }
    }

