/* ============================================================
   LoanRateCheck — glossary.css
   Glossary page styles — supplements style.css
   Place at: /glossary/glossary.css
   ============================================================ */

/* ── ACCESSIBILITY ───────────────────────────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── HERO ────────────────────────────────────────────────────── */
.gl-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1e3d5c 60%, #26527a 100%);
    padding: 36px 24px 44px;
    position: relative;
}
.gl-hero::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.gl-hero-inner { max-width: 720px; margin: 0 auto; }

.gl-hero .breadcrumb {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: .8rem; margin-bottom: 14px;
}
.gl-hero .breadcrumb a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.gl-hero .breadcrumb a:hover { color: var(--gold-light); }
.gl-hero .breadcrumb span:last-child { color: rgba(255,255,255,.75); }
.gl-hero .bc-sep { color: rgba(255,255,255,.3); }

.gl-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem; font-weight: 700; color: #fff;
    line-height: 1.2; margin-bottom: 10px;
}
.gl-hero-sub {
    font-size: 1rem; color: rgba(255,255,255,.68);
    font-weight: 300; line-height: 1.6; margin-bottom: 24px;
}

/* ── SEARCH ──────────────────────────────────────────────────── */
.gl-search-wrap {
    position: relative; max-width: 540px;
}
.gl-search-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 1rem; pointer-events: none; line-height: 1;
}
.gl-search-input {
    width: 100%; height: 50px;
    padding: 0 44px 0 42px;
    border: 2px solid rgba(255,255,255,.2);
    border-radius: 25px;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: .97rem;
    outline: none;
    transition: border-color .2s, background .2s;
    appearance: none;
}
.gl-search-input::placeholder { color: rgba(255,255,255,.42); }
.gl-search-input:focus {
    border-color: var(--gold-light);
    background: rgba(255,255,255,.15);
}
.gl-search-clear {
    position: absolute; right: 16px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.5); font-size: .8rem;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    transition: color .2s, background .2s;
}
.gl-search-clear:hover { color: #fff; }
.gl-no-results {
    margin-top: 12px; font-size: .88rem; color: rgba(255,255,255,.65);
}
.gl-no-results a { color: var(--gold-light); }

/* ── ALPHABET BAR ────────────────────────────────────────────── */
.gl-alpha-bar-wrap {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 62px; z-index: 100;
    box-shadow: var(--shadow-sm);
}
.gl-alpha-bar {
    max-width: 1100px; margin: 0 auto;
    padding: 10px 24px;
    display: flex; flex-wrap: wrap; gap: 4px;
    justify-content: center;
}
.gl-alpha-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 700;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.gl-alpha-active {
    color: var(--navy);
    background: transparent;
}
.gl-alpha-active:hover,
.gl-alpha-active.gl-alpha-current {
    background: var(--navy);
    color: #fff;
}
.gl-alpha-empty {
    color: var(--border);
    cursor: default;
}

/* ── PAGE LAYOUT ─────────────────────────────────────────────── */
.gl-layout {
    max-width: 1100px; margin: 0 auto;
    padding: 40px 24px 72px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.gl-sidebar { position: sticky; top: 120px; }
.gl-sidebar-inner {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 20px 16px;
    display: flex; flex-direction: column; gap: 20px;
}
.gl-sidebar-label {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-muted);
}
.gl-sidebar-letters {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.gl-sidebar-letter {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 700;
    color: var(--navy); text-decoration: none;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: background .15s, color .15s;
}
.gl-sidebar-letter:hover,
.gl-sidebar-letter.gl-alpha-current {
    background: var(--navy); color: #fff; border-color: var(--navy);
}

.gl-sidebar-stat {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.gl-stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1;
}
.gl-stat-label {
    font-size: .75rem; color: var(--text-muted); margin-top: 4px;
}

.gl-sidebar-cta {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 14px 12px;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: .83rem; font-weight: 700; line-height: 1.4;
    transition: background .2s;
}
.gl-sidebar-cta:hover { background: var(--navy-mid); }
.gl-sidebar-cta-alt {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
}
.gl-sidebar-cta-alt:hover { background: #eef5ff; border-color: var(--navy-light); }
.gl-sidebar-cta-icon { font-size: 1.3rem; margin-bottom: 6px; }

/* ── LETTER SECTION ──────────────────────────────────────────── */
.gl-letter-section { margin-bottom: 48px; }
.gl-letter-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.gl-letter-badge {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--navy);
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem; font-weight: 700;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.gl-letter-count {
    font-size: .78rem; color: var(--text-muted); font-weight: 500;
}

/* ── TERM CARDS ──────────────────────────────────────────────── */
.gl-terms-list {
    display: flex; flex-direction: column; gap: 12px;
}

.gl-term {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    transition: box-shadow .2s, border-color .2s;
    scroll-margin-top: 130px;
}
.gl-term:hover {
    box-shadow: var(--shadow-md);
    border-color: #c5d5e8;
}
.gl-term:target {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(61,122,181,.15);
}

.gl-term-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin-bottom: 10px;
}
.gl-term-name {
    font-size: 1.05rem; font-weight: 700; color: var(--navy);
    line-height: 1.3; margin: 0;
}
.gl-term-anchor {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: .85rem; font-weight: 600;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    opacity: 0;
    font-family: monospace;
    line-height: 1.8;
}
.gl-term:hover .gl-term-anchor { opacity: 1; }
.gl-term-anchor:hover { background: #eef5ff; color: var(--navy-mid); }

.gl-term-def {
    font-size: .93rem;
    color: var(--slate);
    line-height: 1.72;
    margin-bottom: 14px;
}

.gl-term-footer {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}

.gl-related {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    flex: 1;
}
.gl-related-label {
    font-size: .75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
    flex-shrink: 0;
}
.gl-related-tag {
    font-size: .77rem; font-weight: 600;
    padding: 3px 9px;
    background: #eef5ff;
    color: var(--navy-mid);
    border: 1px solid #d0e4f7;
    border-radius: 20px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.gl-related-tag:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.gl-related-plain {
    color: var(--text-muted);
    background: var(--bg);
    border-color: var(--border);
    cursor: default;
}

.gl-calc-link {
    flex-shrink: 0;
    font-size: .77rem; font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    padding: 3px 10px;
    border: 1px solid var(--gold);
    border-radius: 20px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.gl-calc-link:hover { background: var(--gold); color: #fff; }

/* ── BOTTOM CTA ──────────────────────────────────────────────── */
.gl-bottom-cta {
    margin-top: 48px;
    background: linear-gradient(135deg, var(--navy) 0%, #2c5f8a 100%);
    border-radius: var(--radius);
    padding: 36px 32px;
    text-align: center;
}
.gl-bottom-cta-inner { max-width: 400px; margin: 0 auto; }
.gl-bottom-cta-emoji { font-size: 2rem; margin-bottom: 10px; }
.gl-bottom-cta h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 8px;
}
.gl-bottom-cta p {
    font-size: .9rem; color: rgba(255,255,255,.65);
    line-height: 1.6; margin-bottom: 20px;
}
.gl-bottom-cta-btn {
    display: inline-block;
    padding: 11px 26px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #fff; border-radius: var(--radius-sm);
    font-weight: 700; font-size: .93rem;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(200,146,58,.4);
    transition: filter .15s, transform .15s;
}
.gl-bottom-cta-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .gl-layout {
        grid-template-columns: 1fr;
        padding: 32px 16px 56px;
    }
    .gl-sidebar { position: static; }
    .gl-sidebar-inner {
        flex-direction: row; flex-wrap: wrap; align-items: center;
        gap: 14px;
    }
    .gl-sidebar-label { display: none; }
    .gl-sidebar-letters { flex: 1; }
    .gl-sidebar-stat, .gl-sidebar-cta, .gl-sidebar-cta-alt { display: none; }
}

@media (max-width: 600px) {
    .gl-hero-title { font-size: 1.75rem; }
    .gl-alpha-bar { gap: 2px; padding: 8px 12px; }
    .gl-alpha-btn { width: 26px; height: 26px; font-size: .78rem; }
    .gl-term { padding: 16px 16px; }
    .gl-term-name { font-size: .97rem; }
    .gl-bottom-cta { padding: 28px 18px; }
}
