/* ── Rubric Section ──────────────────────────────────────────────────── */

.rubric-section {
    margin-bottom: 2.5rem;
}

/* Override MkDocs h3 defaults so the section title renders cleanly */
.rubric-section__title.rubric-section__title {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--md-primary-fg-color);
    color: var(--md-default-fg-color);
}

.rubric-section__points {
    margin-left: auto;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--md-primary-fg-color);
    color: var(--md-primary-bg-color);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── Rubric Criterion (collapsible) ─────────────────────────────────── */

.rubric-criterion {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.4rem;
    margin-bottom: 0.4rem;
    overflow: hidden;
}

.rubric-criterion[open] > summary {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.rubric-criterion__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    background: var(--md-code-bg-color);
    list-style: none;
    user-select: none;
}

.rubric-criterion__header::-webkit-details-marker {
    display: none;
}

.rubric-criterion__header::before {
    content: "▶";
    font-size: 0.6rem;
    color: var(--md-default-fg-color--light);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.rubric-criterion[open] > .rubric-criterion__header::before {
    transform: rotate(90deg);
}

.rubric-criterion__name {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.rubric-criterion__summary {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.rubric-criterion__desc {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--md-default-fg-color--light);
    font-style: italic;
}

.rubric-criterion__points {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--md-default-fg-color--light);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Tier Table ──────────────────────────────────────────────────────── */

.rubric-criterion__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin: 0;
    /* Prevent MkDocs from adding extra table styles */
    display: table;
}

.rubric-criterion__table thead th {
    background: color-mix(in srgb, var(--md-default-fg-color) 6%, transparent);
    padding: 0.4rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-default-fg-color--light);
}

/* Points column */
.rubric-criterion__table thead th:first-child,
.rubric-tier__points {
    width: 5rem;
    text-align: center;
}

/* Level column */
.rubric-criterion__table thead th:nth-child(2) {
    width: 9rem;
}

.rubric-tier td {
    padding: 0.55rem 0.75rem;
    vertical-align: top;
    border-top: 1px solid var(--md-default-fg-color--lightest);
    line-height: 1.5;
}

.rubric-tier__points {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rubric-tier__label {
    font-weight: 600;
    white-space: nowrap;
}

/* Highlight the top (full-credit) tier */
.rubric-tier--top td {
    background: color-mix(in srgb, var(--md-primary-fg-color) 8%, transparent);
}

.rubric-tier--top .rubric-tier__points {
    color: var(--md-primary-fg-color);
}

/* Mute the zero tier */
.rubric-tier--zero td {
    opacity: 0.55;
}
