/* ---------- CSS Variables ---------- */
:root {

    /* Extra tokens */
    --white: #ffffff;
    --light-bg: #F9FAFB;
    --border-color: #E5E7EB;
    --text-muted: #6B7280;
    --text-dark: #1E293B;
    --sidebar-width: 256px;
    --sidebar-active-bg: #0071BD;
    --sidebar-active-color: #ffffff;
    --transition: 0.25s ease;
    --radius: 4px;
    --shadow: 0px 4px 6px 0px #00000005;
}

/* ===========================================
   TERMS SECTION
   =========================================== */

.terms {
    padding-block: 179px 4rem;
}

/* ----- Page Header ----- */
.terms__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
}

.terms__title {
    font-size: 48px;
    font-weight: var(--font-semi-bold);
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.terms__subtitle {
    color: #6B7280;
    font-size: 18px;
    max-width: 846px;
    line-height: 1.6;
    margin-bottom: 0;
}

.terms__last-updated {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: nowrap;
    flex-shrink: 0;
}

.terms__last-updated-label {
    font-size: 14px;
    font-weight: var(--font-semi-bold);
    color: #6B7280;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.terms__last-updated-date {
    font-size: 16px;
    font-weight: var(--font-bold);
    color: var(--text-dark);
}

/* ----- Content Layout (Sidebar + Main) ----- */
.terms__content {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

/* ===========================================
   SIDEBAR
   =========================================== */
.terms__sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.terms__sidebar::-webkit-scrollbar {
    width: 4px;
}

.terms__sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.terms__sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.terms__toc {
    background: var(--white);
    border: 1px solid #D1D5DB;
    border-radius: var(--radius);
    overflow: hidden;
}

.terms__toc-header {
    padding: 1rem 1.1rem 0.75rem;
    margin-bottom: 10px;
}

.terms__toc-title {
    font-size: 14px;
    font-weight: var(--font-semi-bold);
    color: #191C1D;
    margin-bottom: 0.15rem;
}

.terms__toc-sub {
    font-size: 12px;
    color: #707974;
    margin-bottom: 0;
}

.terms__toc-nav {
    padding: 0.5rem 0;
}

.terms__toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.terms__toc-item {
    display: flex;
}

/* ----- TOC Link ----- */
.terms__toc-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    font-size: 14px;
    font-weight: var(--font-semi-bold);
    color: #6B7280;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
}

.terms__toc-link:hover {
    background-color: var(--blue);
    color: white;
}

/* Active state — set via JS */
.terms__toc-link.active {
    background-color: var(--blue);
    color: white;
    font-weight: var(--font-bold);
}

.terms__toc-link.active .terms__toc-icon {
    color: white;
}

.terms__toc-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--transition);
}

.terms__toc-link:hover .terms__toc-icon {
    color: white;
}

/* ----- Divider ----- */
.terms__toc-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.4rem 0;
}

/* ----- Help links ----- */
.terms__toc-link--help {
    color: var(--text-muted);
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.terms__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ----- Individual Section Article ----- */
.terms__section {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0px 4px 6px 0px #00000005;
    scroll-margin-top: 1.5rem;
    border: 1px solid #FFFFFF0D;
}

.terms__section-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.35rem 1.75rem;
}

.terms__section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.terms__section-title {
    font-size: 28px;
    font-weight: var(--font-semi-bold);
    color: var(--text-dark);
}

.terms__section-body {
    padding: 1.5rem 1.75rem;
    font-size: 16px;
    font-weight: var(--font-regular);
    color: #6B7280;
}

/* ----- Cards Grid (Student Responsibilities) ----- */
.terms__cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0;
}

.terms__card {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
}

.terms__card-title {
    font-size: 16px;
    font-weight: var(--font-semi-bold);
    color: #333333;
    margin-bottom: 8px;
}

.terms__card-text {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.55;
    margin-bottom: 0;
}

/* ----- Highlighted Card (Attendance) ----- */
.terms__card--highlighted {
    background-color: #F8F9FA;
    border: 1px solid #FFFFFF0D;
    margin-bottom: 1rem;
}

.terms__card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ----- Badge ----- */
.terms__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    background-color: var(--blue);
    color: var(--white);
    font-size: 14px;
    font-weight: var(--font-semi-bold);
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ----- Alert / Notice Box (Payment) ----- */
.terms__alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}

.terms__alert--warning {
    background-color: #FFF7ED;
    border: 1px solid #FED7AA;
    border-left: 3px solid var(--orange);
}

.terms__alert-icon {
    color: var(--orange);
    font-size: 0.9rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.terms__alert-text {
    font-size: 14px;
    color: #333333;
    line-height: 1.55;
    margin-bottom: 0;
}

/* ----- Contact Box ----- */
.terms__contact-box {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.terms__contact-box>p {
    margin-bottom: 1rem;
}

.terms__contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.terms__contact-details p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.terms__contact-details strong {
    color: var(--text-dark);
}

/* ----- Link ----- */
.terms__link {
    color: var(--blue);
    text-decoration: underline;
    transition: color var(--transition);
}

.terms__link:hover {
    color: var(--dark-blue);
}


/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 900px) {
    .section {
        padding-inline: 1rem;
    }

    .terms__header {
        flex-direction: column;
    }

    .terms__last-updated {
        align-items: flex-start;
    }

    .terms__content {
        flex-direction: column;
    }

    .terms__sidebar {
        display: none;
    }

    .terms__toc-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .terms__toc-item {
        width: auto;
    }
}

@media (max-width: 600px) {
    .section {
        padding-block: 8rem 2rem;
        padding-inline: 1rem;
    }

    .terms__title {
        font-size: 1.6rem;
    }

    .terms__cards-grid {
        grid-template-columns: 1fr;
    }

    .terms__section-title {
        font-size: 1.1rem;
    }
}