/* ============================================================================
   key-terms.css -- widget #04 (glossary accordion)

   reuses library theme tokens. the monogram + accent rail use --cw-accent /
   --cw-accent-soft so a course recolors by overriding the accent. no
   hard-coded hex.
   ============================================================================ */

.cw-term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
    gap: 12px;
    /* size each card to its own content -- without this, grid items default to
       align-items:stretch, so opening one accordion stretches its row-neighbor to
       match (an empty "drop" on the parallel card). start = each card grows alone. */
    align-items: start;
}

.cw-term-card {
    position: relative;
    border-radius: var(--cw-radius, 14px);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
    overflow: hidden;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.cw-term-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--cw-accent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cw-term-card:hover { border-color: var(--cw-accent); }
.cw-term-card[open] { border-color: var(--cw-accent); background: var(--cw-accent-soft); }
.cw-term-card[open]::before { opacity: 1; }
.cw-term-card[open] .cw-term-chev { transform: rotate(90deg); }

.cw-term-summary {
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
}

.cw-term-summary::-webkit-details-marker { display: none; }
.cw-term-summary::marker { content: ''; }
.cw-term-summary:focus-visible {
    outline: 2px solid var(--cw-accent);
    outline-offset: 2px;
    border-radius: 8px;
}

.cw-term-monogram {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cw-accent-soft);
    border: 1px solid var(--cw-accent);
    color: var(--cw-accent);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.cw-term-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.cw-term-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cw-text);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.cw-term-cat {
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0.08em;
    color: var(--cw-muted);
    font-weight: 500;
}

.cw-term-chev {
    width: 16px;
    height: 16px;
    color: var(--cw-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.cw-term-card:hover .cw-term-chev,
.cw-term-card[open] .cw-term-chev { color: var(--cw-accent); }

.cw-term-body {
    padding: 0 16px 16px 16px;
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--cw-muted);
}
