/*
 * Exam listing (/exams) and exam pages (/exam/<slug>[/<section>]).
 * The exam page reuses college.css (hero, tabs, cards, apply card) and
 * sidebar.css; this file only adds what exams need on top.
 */

/* ---------- exam page ---------- */

.exam-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #6b7280;
    margin: 12px 0 4px;
}

.exam-breadcrumb a {
    color: var(--color-primary);
}

.exam-breadcrumb i {
    font-size: 0.7rem;
}

.exam-page .hero-info h1 {
    line-height: 1.3;
}

.exam-date-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 0 20px 18px;
}

.exam-date-chip {
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--color-primary);
    border-radius: 8px;
    padding: 8px 12px;
    background: #f9fafb;
}

.exam-date-chip.is-past {
    border-left-color: #9ca3af;
    opacity: 0.75;
}

.exam-date-chip .label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.exam-date-chip .value {
    font-weight: 600;
    color: #111827;
}

.exam-page .nav-college .nav-link {
    display: block;
    text-align: center;
    white-space: nowrap;
}

.exam-page .college-card {
    margin-bottom: 20px;
}

.exam-block-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-secondary, #0d3d63);
    margin-bottom: 14px;
}

.exam-toc ol {
    margin: 0;
    padding-left: 1.2rem;
    columns: 2;
    column-gap: 2rem;
}

.exam-toc li {
    margin-bottom: 6px;
    break-inside: avoid;
}

.exam-toc a {
    color: #374151;
}

.exam-toc a:hover {
    color: var(--color-primary);
}

/* Admin-authored HTML */
.exam-content {
    line-height: 1.75;
    color: #374151;
    overflow-wrap: anywhere;
    /* Wide pasted tables scroll inside the card instead of the page. */
    overflow-x: auto;
}

.exam-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 28px 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--color-primary);
    scroll-margin-top: 90px;
}

.exam-content h2:first-child {
    margin-top: 0;
}

.exam-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.exam-content p {
    margin-bottom: 12px;
}

.exam-content img {
    max-width: 100%;
    height: auto;
}

.exam-content table,
.exam-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 18px;
    font-size: 0.92rem;
}

.exam-content th,
.exam-content td,
.exam-table th,
.exam-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    vertical-align: top;
}

.exam-content thead th,
.exam-content tr:first-child th,
.exam-table > thead > tr > th {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.exam-content tbody tr:nth-child(even),
.exam-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.exam-news-item {
    display: flex;
    gap: 12px;
    height: 100%;
    padding: 10px;
    border: 1px solid #eef0f3;
    border-radius: 10px;
}

.exam-news-item img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.exam-news-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.35;
}

.exam-news-item time {
    font-size: 0.78rem;
    color: #6b7280;
}

.exam-news-item p {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 4px 0 0;
}

.exam-next {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    color: #111827;
}

.exam-next span {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 500;
    margin-right: auto;
}

.exam-next:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.exam-quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exam-quick-links a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    color: #374151;
    font-size: 0.92rem;
}

.exam-quick-links a:hover,
.exam-quick-links a.active {
    background: #f1f5ff;
    color: var(--color-primary);
    font-weight: 600;
}

@media (max-width: 767px) {
    .exam-toc ol {
        columns: 1;
    }

    .exam-date-strip {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 14px 14px;
    }
}

/* ---------- listing ---------- */

.exam-listing {
    background: #f8f9fa;
    padding-bottom: 60px;
}

.exam-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}

.exam-filter-chips a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
}

.exam-filter-chips a span {
    font-size: 0.75rem;
    color: #9ca3af;
}

.exam-filter-chips a:hover {
    background: #eef2f7;
}

.exam-filter-chips a.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.exam-filter-chips a.active span {
    color: rgba(255, 255, 255, 0.8);
}

.exam-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f3;
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.05);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.exam-card:hover {
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.1);
    transform: translateY(-2px);
}

.exam-card-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.exam-card-head img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: contain;
    border: 1px solid #eef0f3;
    padding: 4px;
    flex-shrink: 0;
}

.exam-card-head > div {
    flex: 1;
    min-width: 0;
}

.exam-card-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.exam-card-head h3 a {
    color: #111827;
}

.exam-card-head h3 a:hover {
    color: var(--color-primary);
}

.exam-card-body-name {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 6px;
}

.exam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.exam-tags span {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 50px;
    background: #f1f5ff;
    color: #3b5bdb;
}

.exam-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.exam-status.upcoming {
    background: #e7f8ee;
    color: #15803d;
}

.exam-status.past {
    background: #f3f4f6;
    color: #6b7280;
}

.exam-card-dates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
}

.exam-card-dates dt {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.exam-card-dates dd {
    margin: 2px 0 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #111827;
}

.exam-card-foot {
    margin-top: auto;
    text-align: right;
}

.exam-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.exam-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 575px) {
    .exam-card-dates {
        grid-template-columns: 1fr;
    }

    .exam-card-head {
        flex-wrap: wrap;
    }
}
