.glossary-section {
    padding: 60px 0 100px;
}

/* ── Search bar ───────────────────────────── */
.glossary-search-wrap {
    max-width: 500px;
    margin: 0 auto 40px;
}

.glossary-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.glossary-search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgb(14, 58, 96);
}

.glossary-search-input {
    width: 100%;
    padding: 8px 8px 8px 32px !important;
    border: none !important;
    border-bottom: 2px solid rgb(14, 58, 96) !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 1rem;
    color: rgb(81, 95, 113);
    outline: none;
}

.glossary-search-input::placeholder {
    color: rgb(81, 95, 113);
}

/* ── A–Z jump nav ─────────────────────────── */
.glossary-az-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 50px;
}

.glossary-az-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
}

.glossary-az-active {
    background-color: #1a3a6b;
    color: #fff;
}

.glossary-az-active:hover {
    background-color: #dc1f34;
    color: #fff;
}

.glossary-az-disabled {
    background-color: #e8e8e8;
    color: #bbb;
    cursor: default;
}

/* ── Letter group headings ────────────────── */
.glossary-letter-group {
    margin-bottom: 40px;
}

.glossary-letter-group[id] {
    scroll-margin-top: 150px;
}

.glossary-letter-heading {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a3a6b;
    border-bottom: 3px solid #1a3a6b;
    padding-bottom: 8px;
    margin-bottom: 24px;
}

/* ── Individual terms ─────────────────────── */
.glossary-term {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
    scroll-margin-top: 150px;
}

.glossary-term:last-child {
    border-bottom: none;
}

.glossary-term-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0 0 6px 0;
}

.glossary-term-definition {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin: 0;
}

/* ── No results message ───────────────────── */
.glossary-no-results {
    text-align: center;
    font-size: 1.1rem;
    color: #999;
    padding: 40px 0;
}

/* ── Highlight when arriving via anchor ───── */
.glossary-term:target {
    background-color: #f0f4fa;
    padding: 16px 20px 20px;
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 6px;
    border-bottom-color: transparent;
}

/* ── Auto-link styling (site-wide) ────────── */
.glossary-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #1a3a6b;
    text-underline-offset: 3px;
}

.glossary-link:hover {
    color: #1a3a6b;
    text-decoration-style: solid;
}

/* ── Back to top button ───────────────────── */
.glossary-back-to-top {
    position: fixed;
    bottom: 90px;
    right: 40px;
    z-index: 99;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: #1a3a6b;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.glossary-back-to-top.is-visible {
    display: flex;
}

.glossary-back-to-top:hover {
    background-color: #dc1f34;
}

@media (max-width: 767px) {
    .glossary-section {
        padding: 40px 15px 60px;
    }

    .glossary-az-link {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .glossary-letter-heading {
        font-size: 1.8rem;
    }

    .glossary-term:target {
        margin-left: -10px;
        margin-right: -10px;
        padding: 12px 10px 16px;
    }
    
    .glossary-back-to-top {
        bottom: 74px;
        right: 4px;
        width: 42px;
        height: 42px;
    }
}

@media (min-width: 768px) {
    .glossary-term-title {
        font-size: 1.6rem;
    }

    .glossary-term-definition {
        font-size: 1.30rem;
        line-height: 1.8;
    }
}