/**
 * Civil & Construction Engineering Glossary
 * Comprehensive A–Z branch index, built for large term counts (~13k+).
 * Shared base styles (_base.css) are loaded before this file; this page uses
 * its own compact list layout rather than the card grid.
 */

.civil-engineering-glossary-glossary {
    display: block;
}

/* Sticky A–Z jump index. */
.ceg-index {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.6rem 0.4rem;
    margin: 0 0 1.25rem;
    background: var(--special-page-surface-bg, #fff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ceg-index__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    color: inherit;
}

.ceg-index__link:hover,
.ceg-index__link:focus {
    background: rgba(0, 0, 0, 0.06);
}

/* Letter sections. */
.ceg-letter {
    margin: 0 0 1.75rem;
    scroll-margin-top: 3.5rem; /* clear the sticky index on jump */
}

.ceg-letter__head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.ceg-letter__char {
    font-size: 1.5rem;
    font-weight: 700;
}

.ceg-letter__count {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Multi-column compact list for density at scale. */
.ceg-list {
    list-style: none;
    margin: 0;
    padding: 0;
    column-width: 340px;
    column-gap: 2rem;
}

.ceg-row {
    break-inside: avoid;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ceg-row__mn {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

a.ceg-row__mn:hover,
a.ceg-row__mn:focus {
    text-decoration: underline;
}

.ceg-row__jp {
    opacity: 0.85;
}

.ceg-row__en {
    width: 100%;
    font-size: 0.85rem;
    opacity: 0.6;
}

.ceg-row__tag {
    font-size: 0.7rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    color: #fff;
    background: var(--ceg-tag, #607d8b);
    white-space: nowrap;
}

.ceg-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ceg-footer__total {
    font-weight: 600;
    margin: 0 0 0.5rem;
}