.lectio .dispositio {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    align-items: start;
}

.lectio .margo {
    position: -webkit-sticky;
    position: sticky;
    top: 140px;
    padding-right: 20px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    align-self: start;
}

.lectio .index {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: block;
    font-weight: 700;
}

.lectio .nexus {
    display: block;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 0;
}

.lectio .minor {
    margin-left: 12px
}

.lectio .materies {
    width: 100%;
    max-width: 800px;
}

.lectio .fasciculus {
    margin-bottom: 40px;
}

.lectio .materies h1.index {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    color: var(--J-amber-5, #f59e0b);
    letter-spacing: -1px;
    text-transform: none;
    margin-bottom: 32px;
}

.lectio .inscriptio {
    font-size: 16px;
    color: var(--J-gray-4, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.lectio .versus {
    display: flex;
    flex-direction: column;
    align-items: baseline;
    text-decoration: none;
    padding: 12px 0;
}

/* Offset for anchor links so they aren't hidden behind the fixed header */
html {
    scroll-padding-top: 120px;
    scroll-behavior: smooth;
}

.lectio .titulus {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-top: 24px;
    margin-bottom: 16px;
}

.lectio .materies .fasciculus-sectio:first-of-type .versus > div:first-child .titulus,
.lectio .materies .fasciculus > .versus:first-of-type > div:first-child .titulus {
    margin-top: 8px;
}

.lectio .sententia {
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 16px;
}

.lectio .sententia p {
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: justify;
}

.lectio .sententia p:last-child {
    margin-bottom: 0;
}

.lectio .sententia a {
    color: var(--J-accent);
}

.lectio .sententia code {
    background-color: #f8f9fa;
    color: #334155;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    word-break: break-word;
}


.lectio .sententia img {
    border: 1px solid #d1d5db;
    /* Làm viền đậm hơn một chút (xám nhạt) */
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Thêm bóng mờ siêu nhẹ */
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    display: block;
    cursor: zoom-in;
}

/* Level 3 sidebar: thụt sâu hơn .minor */
.lectio .nexus.sub {
    margin-left: 24px;
    font-size: 12.5px;
    opacity: 0.7;
    padding: 5px 0;
}

.lectio.policies-page .nexus.active {
    font-weight: 700 !important;
}

/* Section container (Level 2) */
.lectio .fasciculus-sectio {
    margin-bottom: 32px;
    padding-left: 0;
    border-left: 2px solid var(--J-border, #e5e7eb);
    padding-left: 16px;
}

/* Section heading (Level 2) — giữa Category (28px) và Article title (22px) */
.lectio .inscriptio-minor {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    opacity: 0.75;
}



/* ========================================================= */
/* FORMAT ĐỊNH DẠNG DOCUMENT (THỤT LỀ, ĐÁNH SỐ TỰ ĐỘNG)      */
/* ========================================================= */

/* Tắt định dạng list mặc định của web */
/* 1. Ép nội dung chữ thụt vào vừa phải, sát với dấu gạch */
/* 1. Tắt sạch định dạng list mặc định VÀ đẩy cả khối list thụt vào trong */
.lectio .sententia ol,
.lectio .sententia ul {
    list-style: none !important;
    padding-left: 0;
    margin-left: 0;
    /* TRẢ VỀ 0: Không thụt list vào nữa */
    margin-bottom: 20px;
    counter-reset: point-counter;
}

/* 2. Thụt phần chữ vào trong 1 đoạn rộng y chang phím Tab (Khoảng 40px-50px) */
.lectio .sententia ol li,
.lectio .sententia ul li {
    position: relative;
    padding-left: 48px;
    /* Tăng khoảng cách chữ để canh thẳng với chữ "Cơ sở" ở trên */
    margin-bottom: 12px;
    text-align: justify;
    line-height: 1.5;
}

/* 3. Ký tự a,b,c dính chặt vào lề trái (Trục dọc 0) */
.lectio .sententia ol>li::before {
    counter-increment: point-counter;
    content: counter(point-counter, lower-alpha) ")";
    position: absolute;
    left: 0;
    /* Nằm ở mép lề trái tuyệt đối */
    font-weight: normal;
}

/* 4. Dấu gạch ngang dính chặt vào lề trái (Trục dọc 0) */
.lectio .sententia ul>li::before {
    content: "-";
    position: absolute;
    left: 0;
    /* Nằm ở mép lề trái tuyệt đối */
}

/* Chia cột cho Tiêu đề: Số 1 bên trái, Chữ bên phải */
.lectio .titulus {
    display: flex;
    align-items: flex-start;
}

.lectio .titulus .num {
    width: 48px;
    /* Khóa cứng độ rộng bằng đúng padding-left của thẻ li bên dưới */
    flex-shrink: 0;
    /* Không cho cái số bị ép nhỏ lại */
}

/* Chữ tự động chiếm phần không gian còn lại */
.lectio .titulus .text {
    flex: 1;
}

/* 1. Đẩy các đoạn văn (P) thụt vào trong để thẳng hàng với chữ "Mục đích" */
.lectio .sententia p {
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: justify;
}

/* 2. Đẩy cả khối danh sách (a, b, c) thụt vào trong thẳng hàng với đoạn văn */
.lectio .sententia ol,
.lectio .sententia ul {
    list-style: none !important;
    padding-left: 0;
    margin-left: 48px;
    /* <--- ĐỔI TỪ 0 THÀNH 48px */
    margin-bottom: 20px;
    counter-reset: point-counter;
}

/* KHỐI NÀY GIỮ NGUYÊN KHÔNG ĐỔI */
.lectio .sententia ol li,
.lectio .sententia ul li {
    position: relative;
    padding-left: 48px;
    margin-bottom: 12px;
    text-align: justify;
    line-height: 1.5;
}

/* ========================================================= */
/* CẤP 3: XỬ LÝ DANH SÁCH LỒNG NHAU (i, ii, iii)             */
/* ========================================================= */

/* Khởi tạo bộ đếm riêng cho cấp 3 (nằm trong cấp 2) */
.lectio .sententia ol ol {
    counter-reset: subpoint-counter;
    margin-left: 0;
    /* Ép thẳng hàng với chữ của cấp cha */
    margin-top: 8px;
    /* Cách dòng trên một chút cho thoáng */
    margin-bottom: 0;
}

/* Kéo chữ i. ii. iii. ra sát lề và định dạng số La Mã thường */
.lectio .sententia ol ol>li::before {
    counter-increment: subpoint-counter;
    content: counter(subpoint-counter, lower-roman) ".";
    position: absolute;
    left: 0;
    font-weight: normal;
    /* Thường thì mục i, ii không in đậm */
}


/* ========================================================= */
/* MOBILE RESPONSIVE                                         */
/* ========================================================= */
/* ========================================================= */
/* MOBILE RESPONSIVE                                         */
/* ========================================================= */
@media (max-width: 768px) {
    .lectio .dispositio {
        display: flex;
        /* Sửa lỗi display: block để gap hoạt động */
        flex-direction: column;
        gap: 24px;
    }

    .lectio .margo {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        /* Hoặc dùng var(--J-border) của fen */
        padding-right: 0;
        padding-bottom: 20px;
    }

    /* 1. Trả lại không gian cho chữ: Bỏ thụt lề 48px của Desktop */
    .lectio .sententia p,
    .lectio .sententia ol,
    .lectio .sententia ul {
        margin-left: 0;
    }

    /* 2. Thu hẹp cột số của Tiêu đề (1. 2. 3. ...) */
    .lectio .titulus .num {
        width: 32px;
    }

    /* 3. Thu hẹp lề danh sách (a, b, c) cho cân đối với mobile */
    .lectio .sententia ol li,
    .lectio .sententia ul li {
        padding-left: 28px;
        /* Vừa đủ chỗ cho ký tự đếm */
    }

    /* 4. Kéo ký tự a) b) c) và gạch đầu dòng về sát mép trái */
    .lectio .sententia ol>li::before,
    .lectio .sententia ul>li::before {
        left: 0;
    }

    /* 5. Chỉnh nhẹ danh sách cấp 3 (i, ii, iii) thụt vào một chút xíu */
    .lectio .sententia ol ol {
        margin-left: 20px;
    }

    .lectio .sententia ol ol li {
        padding-left: 36px;
    }
}

/* ========================================================= */
/* HIỆU ỨNG LIGHTBOX (PHÓNG TO ẢNH)                          */
/* ========================================================= */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* Nền đen mờ siêu ngầu */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: zoom-out; /* Bấm vào ngoài hay vào ảnh là thoát */
}

.custom-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.custom-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Zoom nảy xíu cho mượt */
}

.custom-lightbox.active img {
    transform: scale(1);
}

/* ========================================================= */
/* ACCORDION SIDEBAR & SCROLLSPY                             */
/* ========================================================= */

.lectio .chevron {
    float: right;
    margin-top: 2px;
    display: inline-block;
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.lectio .chevron.is-open {
    transform: rotate(90deg);
}

.lectio .policy-sections-group {
    display: none;
    flex-direction: column;
}

.lectio .policy-sections-group.is-open {
    display: flex;
}

.lectio .policy-category-toggle.is-active,
.lectio .nav-article.is-active {
    color: var(--J-accent);
}