﻿.pb-scope {
    --paper: var(--custom-bg);
    --paper-raised: #FFFFFF;
    --ink: var(--bg-custom-dark);
    --ink-soft: var(--bg-custom-medium);
    --kashi: #1B4965;
    --kashi-dark: #123249;
    --firuze: #1E8A8A;
    --saffron: #C68A2E;
    --border: #E4DFD0;
    --shadow: 0 8px 24px rgba(27, 73, 101, 0.08);
    --shadow-hover: 0 14px 32px rgba(27, 73, 101, 0.14);
    --radius: 14px;
    --content-width: 720px;
    --reader-scale: 1; /* set by blog-public.js, only affects .pb-article-body */
    min-height: 55.9vh;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.8;
    display: block;
    padding-bottom: 40px;
}

    .pb-scope, .pb-scope * {
        box-sizing: border-box;
    }

        .pb-scope a {
            color: inherit;
            text-decoration: none;
        }

        .pb-scope img {
            max-width: 100%;
            display: block;
        }

        /* ---------- Signature element: girih diamond-chain divider ---------- */
        .pb-scope .pb-girih-divider {
            height: 14px;
            margin: 0 auto;
            max-width: 220px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M14 1 L27 7 L14 13 L1 7 Z' fill='none' stroke='%23C68A2E' stroke-width='1'/%3E%3Ccircle cx='0' cy='7' r='1.4' fill='%23C68A2E'/%3E%3Ccircle cx='28' cy='7' r='1.4' fill='%23C68A2E'/%3E%3C/svg%3E");
            background-repeat: repeat-x;
            background-position: center;
            opacity: 0.85;
        }

        /* ---------- Reader font-size toggle (article page only) ---------- */
        .pb-scope .pb-font-toggle {
            display: inline-flex;
            gap: 4px;
            align-items: center;
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 4px;
            background: var(--paper-raised);
        }

            .pb-scope .pb-font-toggle button {
                border: none;
                background: transparent;
                width: 30px;
                height: 30px;
                border-radius: 999px;
                cursor: pointer;
                color: var(--kashi);
                font-weight: 600;
                font-size: 0.85rem;
                transition: background 0.15s ease;
            }

                .pb-scope .pb-font-toggle button:hover {
                    background: rgba(27,73,101,0.08);
                }

                .pb-scope .pb-font-toggle button:focus-visible {
                    outline: 2px solid var(--kashi);
                    outline-offset: 2px;
                }

        /* ---------- Category pills ---------- */
        .pb-scope .pb-categories {
            max-width: 1140px;
            margin: 0px auto 0;
            padding: 0 24px;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .pb-scope .pb-pill {
            padding: 7px 18px;
            border-radius: 999px;
            border: 1px solid var(--border);
            font-size: 0.85rem;
            color: var(--ink-soft);
            background: var(--paper-raised);
            transition: all 0.15s ease;
        }

            .pb-scope .pb-pill:hover {
                border-color: var(--kashi);
                color: var(--kashi);
            }

            .pb-scope .pb-pill.is-active {
                background: var(--kashi);
                color: #fff;
                border-color: var(--kashi);
            }

        /* ---------- Hero (latest post) ---------- */
        .pb-scope .pb-hero {
            max-width: 1140px;
            margin: 28px auto 0;
            padding: 0 24px;
        }

        .pb-scope .pb-hero-card {
            display: grid;
            grid-template-columns: 1.1fr 1fr;
            gap: 0;
            background: var(--paper-raised);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
        }

        .pb-scope .pb-hero-image {
            height: 100%;
            min-height: 340px;
            object-fit: cover;
        }

        .pb-scope .pb-hero-content {
            padding: 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .pb-scope .pb-eyebrow {
            font-size: 0.8rem;
            color: var(--firuze);
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pb-scope .pb-hero-title {
            font-size: 2.1rem;
            line-height: 1.5;
            font-weight: 700;
            color: var(--ink);
            margin: 0 0 16px;
        }

        .pb-scope .pb-hero-summary {
            color: var(--ink-soft);
            font-size: 1.02rem;
            margin: 0 0 20px;
        }

        .pb-scope .pb-meta {
            display: flex;
            gap: 14px;
            flex-wrap: wrap;
            font-size: 0.82rem;
            color: var(--ink-soft);
            align-items: center;
        }

            .pb-scope .pb-meta span::after {
                content: '·';
                margin-inline-start: 14px;
                color: var(--border);
            }

            .pb-scope .pb-meta span:last-child::after {
                content: '';
                margin: 0;
            }

        .pb-scope .pb-cta {
            margin-top: 24px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--kashi);
            font-weight: 600;
            width: fit-content;
            border-bottom: 2px solid var(--saffron);
            padding-bottom: 2px;
        }

        /* ---------- Post grid ---------- */
        .pb-scope .pb-section-title {
            max-width: 1140px;
            margin: 56px auto 20px;
            padding: 0 24px;
            display: flex;
            align-items: center;
            gap: 16px;
        }

            .pb-scope .pb-section-title h2 {
                font-size: 1.4rem;
                margin: 0;
                color: var(--ink);
                white-space: nowrap;
            }

            .pb-scope .pb-section-title .pb-girih-divider {
                flex: 1;
                max-width: none;
            }

        .pb-scope .pb-grid {
            max-width: 1140px;
            margin: 0 auto;
            padding: 0 24px 64px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 28px;
        }

        .pb-scope .pb-card {
            background: var(--paper-raised);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            display: flex;
            flex-direction: column;
        }

            .pb-scope .pb-card:hover {
                transform: translateY(-4px);
                box-shadow: var(--shadow-hover);
            }

        .pb-scope .pb-card-image {
            width: 100%;
            height: 180px;
            object-fit: cover;
        }

        .pb-scope .pb-card-body {
            padding: 22px;
            display: flex;
            flex-direction: column;
            flex: 1;
        }

        .pb-scope .pb-card-category {
            font-size: 0.75rem;
            color: var(--firuze);
            font-weight: 600;
            margin-bottom: 8px;
        }

        .pb-scope .pb-card-title {
            font-size: 1.15rem;
            font-weight: 600;
            line-height: 1.6;
            color: var(--ink);
            margin: 0 0 10px;
        }

        .pb-scope .pb-card-summary {
            color: var(--ink-soft);
            font-size: 0.92rem;
            margin: 0 0 16px;
            flex: 1;
        }

        .pb-scope .pb-card .pb-meta {
            font-size: 0.78rem;
            margin-top: auto;
        }

        /* ---------- Empty state ---------- */
        .pb-scope .pb-empty {
            max-width: 640px;
            margin: 0 auto;
            text-align: center;
            color: var(--ink-soft);
            padding: 0 24px;
        }

        /* ---------- Pagination ---------- */
        .pb-scope .pb-pagination {
            max-width: 1140px;
            margin: 0 auto 24px;
            padding: 0 24px;
            display: flex;
            justify-content: center;
            gap: 8px;
        }

            .pb-scope .pb-pagination a, .pb-scope .pb-pagination span {
                width: 38px;
                height: 38px;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 999px;
                border: 1px solid var(--border);
                color: var(--ink-soft);
                font-size: 0.9rem;
            }

                .pb-scope .pb-pagination a:hover {
                    border-color: var(--kashi);
                    color: var(--kashi);
                }

            .pb-scope .pb-pagination .is-active {
                background: var(--kashi);
                color: #fff;
                border-color: var(--kashi);
            }

        /* ================= Article (Details) page ================= */

        .pb-scope .pb-article-header {
            max-width: var(--content-width);
            margin: 0 auto 0;
            padding: 0 24px;
            text-align: center;
        }

        .pb-scope .pb-article-toolbar {
            max-width: var(--content-width);
            margin: 24px auto 0;
            padding: 0 24px;
            display: flex;
            justify-content: center;
        }

        .pb-scope .pb-article-category {
            display: inline-block;
            font-size: 0.8rem;
            color: #fff;
            background: var(--kashi);
            padding: 5px 16px;
            border-radius: 999px;
            margin-bottom: 20px;
        }

        .pb-scope .pb-article-title {
            font-size: 2.4rem;
            line-height: 1.55;
            font-weight: 700;
            color: var(--ink);
            margin: 0 0 20px;
        }

        .pb-scope .pb-article-summary {
            font-size: 1.15rem;
            color: var(--ink-soft);
            margin: 0 0 24px;
            line-height: 1.9;
        }

        .pb-scope .pb-article-meta {
            display: flex;
            justify-content: center;
            gap: 14px;
            flex-wrap: wrap;
            font-size: 0.88rem;
            color: var(--ink-soft);
            margin-bottom: 8px;
        }

            .pb-scope .pb-article-meta span::after {
                content: '·';
                margin-inline-start: 14px;
                color: var(--border);
            }

            .pb-scope .pb-article-meta span:last-child::after {
                content: '';
            }

        .pb-scope .pb-article-image-wrap {
            max-width: 980px;
            margin: 0 auto 48px;
            padding: 0 24px;
        }

        .pb-scope .pb-article-image {
            width: 100%;
            max-height: 520px;
            object-fit: cover;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }

        .pb-scope .pb-article-image-caption {
            text-align: center;
            font-size: 0.82rem;
            color: var(--ink-soft);
            margin-top: 10px;
        }

        /* ---- Reading body: this is the content editors write in the rich text editor ---- */
        .pb-scope .pb-article-body {
            max-width: var(--content-width);
            margin: 0 auto;
            padding: 0 24px 56px;
            font-size: calc(1.08rem * var(--reader-scale, 1));
            line-height: 2;
            color: var(--ink);
        }

            .pb-scope .pb-article-body h2 {
                font-size: calc(1.5rem * var(--reader-scale, 1));
                color: var(--kashi);
                margin: 44px 0 18px;
                padding-inline-start: 16px;
                border-inline-start: 3px solid var(--saffron);
            }

            .pb-scope .pb-article-body h3 {
                font-size: calc(1.25rem * var(--reader-scale, 1));
                color: var(--ink);
                margin: 32px 0 14px;
            }

            .pb-scope .pb-article-body p {
                margin: 0 0 22px;
            }

            .pb-scope .pb-article-body img {
                border-radius: var(--radius);
                box-shadow: var(--shadow);
                margin: 24px auto;
            }

            .pb-scope .pb-article-body a {
                color: var(--kashi);
                border-bottom: 1px solid var(--saffron);
            }

            .pb-scope .pb-article-body video,
            .pb-scope .pb-article-body iframe {
                width: 100%;
                aspect-ratio: 16 / 9;
                height: auto;
                border: none;
                border-radius: var(--radius);
                box-shadow: var(--shadow);
                margin: 24px auto;
                display: block;
            }

            .pb-scope .pb-article-body blockquote {
                margin: 32px 0;
                padding: 20px 24px;
                background: var(--paper-raised);
                border-inline-start: 3px solid var(--firuze);
                border-radius: 0 var(--radius) var(--radius) 0;
                color: var(--ink-soft);
                font-style: normal;
            }

            .pb-scope .pb-article-body ul, .pb-scope .pb-article-body ol {
                padding-inline-start: 24px;
                margin: 0 0 22px;
            }

            .pb-scope .pb-article-body li {
                margin-bottom: 8px;
            }

            .pb-scope .pb-article-body table {
                width: 100%;
                border-collapse: collapse;
                margin: 24px 0;
                font-size: 0.95rem;
            }

            .pb-scope .pb-article-body th, .pb-scope .pb-article-body td {
                border: 1px solid var(--border);
                padding: 10px 14px;
                text-align: right;
            }

            .pb-scope .pb-article-body th {
                background: var(--paper);
                color: var(--kashi);
            }

        /* ---- Tags ---- */
        .pb-scope .pb-tags {
            max-width: var(--content-width);
            margin: 0 auto 48px;
            padding: 0 24px;
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .pb-scope .pb-tag {
            font-size: 0.82rem;
            color: var(--kashi);
            background: rgba(27, 73, 101, 0.07);
            padding: 6px 14px;
            border-radius: 999px;
        }

        /* ---- Author card ---- */
        .pb-scope .pb-author-card {
            max-width: var(--content-width);
            margin: 0 auto 56px;
            padding: 24px;
            background: var(--paper-raised);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .pb-scope .pb-author-avatar {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: var(--kashi);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .pb-scope .pb-author-name {
            font-weight: 600;
            margin: 0 0 4px;
        }

        .pb-scope .pb-author-role {
            font-size: 0.85rem;
            color: var(--ink-soft);
            margin: 0;
        }

/* ---------- Motion (respect reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .pb-scope .pb-hero-card, .pb-scope .pb-card {
        animation: pb-rise 0.5s ease both;
    }

    @keyframes pb-rise {
        from {
            opacity: 0;
            transform: translateY(12px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .pb-scope .pb-card, .pb-scope .pb-hero-card {
        transition: none;
        animation: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .pb-scope .pb-hero-card {
        grid-template-columns: 1fr;
    }

    .pb-scope .pb-hero-image {
        min-height: 220px;
    }

    .pb-scope .pb-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pb-scope .pb-grid {
        grid-template-columns: 1fr;
    }

    .pb-scope .pb-hero-content {
        padding: 26px;
    }

    .pb-scope .pb-article-title {
        font-size: 1.7rem;
    }

    .pb-scope .pb-article-summary {
        font-size: 1rem;
    }
}
