/* Theorem index page, /quiz cards and article backlinks. */

/* ---------- Theorem index (docs/theorems/index.md) ---------- */
.zdd-statement-controls {
    display: grid;
    gap: 0.6rem;
    margin: 0.4rem 0 0.8rem;
}

.zdd-statement-controls input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface);
    color: var(--zdd-surface-ink);
    font: inherit;
}

.zdd-statement-controls input:focus-visible {
    outline: 2px solid var(--md-accent-fg-color);
    outline-offset: 1px;
}

.zdd-statement-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.zdd-statement-kind-filter {
    padding: 0.2rem 0.65rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 999px;
    background: transparent;
    color: var(--zdd-surface-muted);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.zdd-statement-kind-filter.is-active {
    background: var(--zdd-nav-bg);
    color: var(--zdd-nav-ink);
    border-color: transparent;
}

.zdd-statement-summary {
    color: var(--zdd-surface-muted);
    font-size: 0.72rem;
}

.md-typeset ol.zdd-statement-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.md-typeset .zdd-statement-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.6rem;
    margin: 0;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--zdd-line);
}

.zdd-statement-kind {
    grid-row: span 3;
    align-self: start;
    min-width: 2.6em;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    background: var(--zdd-nav-bg);
    color: var(--zdd-nav-ink);
    font-size: 0.66rem;
    text-align: center;
}

.zdd-statement-item[data-kind="definition"] .zdd-statement-kind { background: var(--zdd-statement-definition); }
.zdd-statement-item[data-kind="problem"] .zdd-statement-kind { background: var(--zdd-statement-problem); }

.zdd-statement-title { font-weight: 600; }

.zdd-statement-where,
.zdd-statement-text {
    color: var(--zdd-surface-muted);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}

.zdd-statement-more {
    display: block;
    margin: 1rem auto 0;
    padding: 0.35rem 1.2rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface);
    color: var(--zdd-surface-ink);
    font: inherit;
    cursor: pointer;
}

/* ---------- /thm results and /quiz cards (command console) ---------- */
.zdd-statement-result .zdd-search-preview { white-space: normal; }

.zdd-command-more {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.72rem;
}

.zdd-quiz-card {
    padding: 0.8rem 1rem;
    border: 1px solid var(--zdd-line);
    border-radius: 8px;
    background: var(--zdd-surface);
    color: var(--zdd-surface-ink);
    text-align: left;
}

.zdd-quiz-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.zdd-quiz-kind {
    padding: 0.05rem 0.45rem;
    border-radius: 4px;
    background: var(--zdd-nav-bg);
    color: var(--zdd-nav-ink);
    font-size: 0.66rem;
}

.zdd-quiz-title { font-weight: 600; }

.zdd-quiz-statement,
.zdd-quiz-answer {
    max-height: 22rem;
    overflow: auto;
    font-size: 0.78rem;
}

.zdd-quiz-answer {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--zdd-line);
}

.zdd-quiz-answer-title {
    margin-bottom: 0.3rem;
    color: var(--zdd-surface-muted);
    font-size: 0.7rem;
}

.zdd-quiz-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.zdd-quiz-button {
    padding: 0.25rem 0.8rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.zdd-quiz-button:hover { background: var(--zdd-surface-hover); }

.zdd-quiz-source {
    margin-left: auto;
    font-size: 0.7rem;
}

/* ---------- Backlinks (overrides/partials/backlinks.html) ---------- */
.zdd-backlinks {
    margin: 1.6rem 0 0.4rem;
    padding: 0.7rem 0 0.2rem;
    border-top: 1px solid var(--zdd-surface-border);
    font-size: 0.78rem;
}

.md-typeset .zdd-backlinks-title {
    margin: 0 0 0.3rem;
    color: var(--zdd-surface-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.md-typeset .zdd-backlinks ul {
    margin: 0;
    padding-left: 1.1rem;
}

.md-typeset .zdd-backlinks li { margin: 0.15rem 0; }

.zdd-course-navigation + .zdd-backlinks {
    margin-top: 0.4rem;
    border-top: 0;
}

/* ---------- Comments (overrides/partials/comments.html) ---------- */
.zdd-comments {
    margin-top: 1.6rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--zdd-surface-border);
}

.md-typeset .zdd-comments-title {
    margin: 0 0 0.6rem;
    color: var(--zdd-surface-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.zdd-comments-frame { min-height: 8rem; }

/* ---------- Click-to-copy LaTeX (javascripts/math-copy.js) ---------- */
mjx-container[data-zdd-copy] { cursor: copy; }

.zdd-math-copy-toast {
    position: fixed;
    z-index: 1000;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: var(--zdd-nav-ink);
    color: var(--zdd-nav-bg);
    font-size: 0.68rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.zdd-math-copy-toast.is-visible {
    opacity: 1;
    transform: none;
}
