/*
 * Module Tuyển sinh (tuyen-sinh) — phần CSS riêng của module; mọi thành phần chung dùng hệ thống mn-* của giao diện
 * (mn.css). Tiền tố lớp riêng: ts-. Màu lấy từ biến --mn-* (có giá trị dự phòng).
 */

/* Điểm neo của mục lục trong trang không bị che khi cuộn tới */
.ts-page .mn-section[id] {
    scroll-margin-top: 16px;
}

.ts-page > .mn-notice,
.ts-page > .mn-filter {
    margin-bottom: var(--mn-space-5, 24px);
}

/* ----- Dải thông tin nhanh: năm học, trạng thái, mốc gần nhất, phạm vi áp dụng ----- */
.ts-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin: 0 0 var(--mn-space-5, 24px);
    padding: 0;
    background: var(--mn-line, #E6DFD0);
    border: 1px solid var(--mn-line, #E6DFD0);
    border-radius: var(--mn-radius, 14px);
    overflow: hidden;
}

.ts-facts__item {
    display: flex;
    flex: 1 1 180px;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 14px 16px;
    background: var(--mn-blue-50, #EEF5FE);
    min-width: 0;
}

/* Ô "mốc gần nhất" rộng gấp đôi; các ô tự giãn kín hàng nên không bao giờ có ô trống */
.ts-facts__item--wide {
    flex: 2 1 320px;
}

.ts-facts dt {
    margin: 0;
    color: var(--mn-blue-800, #063F86);
    font-size: var(--mn-text-xs, 0.875rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ts-facts dd {
    margin: 0;
    color: var(--mn-ink-900, #1F2937);
    font-size: 1.0625rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ts-facts__time {
    color: var(--mn-ink-700, #374151);
    font-weight: 400;
    white-space: nowrap;
}

@media (max-width: 479.98px) {
    .ts-facts__item,
    .ts-facts__item--wide {
        flex-basis: 100%;
    }
}

/* ----- Mục lục trong trang: hàng liên kết tự xuống dòng; trên điện thoại xếp hai cột cho gọn ----- */
.ts-toc {
    margin: 0 0 var(--mn-space-6, 32px);
    padding: 12px 16px 8px;
    background: var(--mn-bg-soft, #FBF4E4);
    border-radius: var(--mn-radius, 14px);
}

.ts-toc__title {
    margin: 0 0 2px;
    color: var(--mn-ink-600, #4B5563);
    font-size: var(--mn-text-xs, 0.875rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ts-toc__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--mn-space-5, 24px);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-toc__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--mn-link, #0B63CE);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--mn-blue-200, #BBD6F7);
    text-underline-offset: 3px;
}

.ts-toc__link:hover,
.ts-toc__link:focus {
    color: var(--mn-link-hover, #063F86);
    text-decoration-color: currentColor;
}

@media (max-width: 575.98px) {
    .ts-toc__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 var(--mn-space-4, 16px);
    }

    .ts-toc__link {
        display: flex;
        line-height: 1.3;
        padding: 4px 0;
    }
}

/* ----- Mốc thời gian: mốc đã qua dịu màu (vẫn đủ tương phản) và luôn có nhãn chữ "Đã qua" ----- */
.ts-timeline .mn-timeline__title {
    margin-bottom: 6px;
}

.ts-moc__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 6px;
}

.ts-moc__badges:empty {
    display: none;
}

.ts-moc--past .mn-timeline__time,
.ts-moc--past .mn-timeline__title {
    color: var(--mn-ink-600, #4B5563);
}

.ts-moc--past::before {
    background: #fff;
    border-color: var(--mn-line-strong, #8A8F98);
}

.ts-moc--now::before {
    background: var(--mn-green-700, #15792A);
    border-color: var(--mn-green-700, #15792A);
    box-shadow: 0 0 0 4px var(--mn-green-100, #CFEBD4);
}

.ts-moc--tba .mn-timeline__time {
    color: var(--mn-ink-600, #4B5563);
    font-weight: 700;
}

/* ----- Mục chưa có dữ liệu: ô "Thông tin đang cập nhật" của từng mục thấp một dòng, biểu tượng nằm cùng dòng ----- */
.ts-updating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 18px;
    font-size: 1rem;
    text-align: left;
}

.ts-updating::before {
    flex: none;
    margin: 0;
    font-size: 22px;
}

/* ----- Ghi chú chỉ tiêu, lưu ý ----- */
.ts-chi-tieu {
    margin-top: var(--mn-space-4, 16px);
}

/* .mn-prose p đặt lề dưới bằng !important: đoạn cuối trong khung lưu ý không được đẩy khung cao thêm */
.ts-luu-y > .mn-prose > *:last-child {
    margin-bottom: 0 !important;
}

/* ----- Biểu mẫu, tài liệu ----- */
.ts-docs,
.ts-files-old {
    margin-top: var(--mn-space-4, 16px);
}

/* Liên kết "xem bản gốc" trong dòng nguồn: vùng chạm 44px mà không đổi chiều cao dòng */
.ts-source a {
    display: inline-block;
    padding: 11px 0;
    margin: -11px 0;
}

/* ----- Liên hệ theo cơ sở ----- */
ul.ts-contacts {
    list-style: none;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

.ts-contact {
    height: 100%;
}

.ts-contact__info {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-contact__info > li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
    overflow-wrap: anywhere;
}

.ts-contact__info > li > .fa {
    flex: none;
    color: var(--mn-blue-700, #084C9E);
}

.ts-contact__info > li > span {
    min-width: 0;
}

/* Liên kết đứng riêng một dòng: vùng chạm tối thiểu 44px */
.ts-contact__info a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--mn-link, #0B63CE);
    font-weight: 700;
}

.ts-contact__more {
    margin: var(--mn-space-4, 16px) 0 0;
}

.ts-source {
    margin: 0 0 var(--mn-space-5, 24px);
}

/* ----- Block thẻ kêu gọi tuyển sinh ----- */
.ts-cta__next {
    margin: 0;
    padding: 10px 12px;
    background: var(--mn-yellow-50, #FFFAE0);
    border-radius: var(--mn-radius-sm, 8px);
    color: var(--mn-ink-900, #1F2937);
}

@media print {
    .ts-toc,
    .ts-contact__more {
        display: none !important;
    }

    .ts-facts {
        background: none;
    }

    .ts-facts__item {
        background: none;
        border: 1px solid #999;
    }

    .ts-page .mn-section {
        break-inside: auto;
    }

    .ts-moc,
    .ts-contact {
        break-inside: avoid;
    }
}

/*
 * Bản in: nội dung của các khối <details> đang đóng (câu hỏi thường gặp, phiên bản tệp cũ) vẫn phải có trên giấy.
 * Trình duyệt hỗ trợ ::details-content hiện nội dung bằng CSS; các trình duyệt khác được js/tuyen-sinh.js mở khối khi in.
 * Quy tắc đứng riêng: trình duyệt chưa biết ::details-content sẽ chỉ bỏ qua khối @media này.
 */
@media print {
    .ts-page details.mn-accordion::details-content {
        content-visibility: visible;
    }
}
