/* Page: Glossary (page-glossary.php) */

/* Page Hero */
.page-hero {
    padding: 140px 0 var(--space-xl);
    background: linear-gradient(180deg, var(--bg-muted) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}
.page-hero__title {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 56px);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: var(--space-md);
}
.page-hero__subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: var(--space-xl);
}

/* Search */
.glossary-search {
    max-width: 480px;
}
.glossary-search__input {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.glossary-search__input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.glossary-search__input input {
    flex: 1;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}
.glossary-search__input input::placeholder {
    color: var(--text-tertiary);
}
.glossary-search__icon {
    color: var(--text-tertiary);
    font-size: 16px;
}

/* Glossary Layout */
.glossary-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-2xl);
    padding: var(--space-2xl) 0 var(--space-3xl);
}

/* Alphabet Nav */
.alphabet-nav {
    position: sticky;
    top: 96px;
    height: fit-content;
}
.alphabet-nav__title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}
.alphabet-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.alphabet-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.alphabet-nav__link:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}
.alphabet-nav__link.active {
    background: var(--accent-dim);
    color: var(--text-primary);
}
.alphabet-nav__link.disabled {
    color: var(--text-tertiary);
    opacity: 0.5;
    pointer-events: none;
}
.alphabet-nav__count {
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Glossary Content */
.glossary-content {
    max-width: 800px;
}

/* Letter Section */
.letter-section {
    margin-bottom: var(--space-2xl);
}
.letter-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}
.letter-section__letter {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--text-primary);
}
.letter-section__count {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Term Card */
.term-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}
.term-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card);
}
.term-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}
.term-card__term {
    font-size: 18px;
    font-weight: 600;
}
.term-card__abbr {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-dim);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    font-family: monospace;
}
.term-card__full {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}
.term-card__definition {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}
.term-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.term-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
}
.term-card__tag--region {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}
.term-card__link {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.term-card__link:hover {
    text-decoration: underline;
}

/* Best Match Section */
.best-match {
    margin-bottom: var(--space-2xl);
    display: none;
}
.best-match.visible {
    display: block;
}
.best-match__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}
.best-match__icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.best-match__title {
    font-family: var(--font-display);
    font-size: 24px;
}
.best-match__subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
}
.best-match .term-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-dim);
}

/* Other Matches Section */
.other-matches {
    display: none;
}
.other-matches.visible {
    display: block;
}
.other-matches__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}
.other-matches__icon {
    width: 48px;
    height: 48px;
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-tertiary);
}
.other-matches__title {
    font-family: var(--font-display);
    font-size: 24px;
}
.other-matches__subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-tertiary);
}
.no-results__icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}
.no-results__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

@media (max-width: 1024px) {
    .glossary-layout { grid-template-columns: 1fr; }
    .alphabet-nav {
        position: relative;
        top: 0;
        margin-bottom: var(--space-lg);
    }
    .alphabet-nav__list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }
    .alphabet-nav__link {
        padding: 8px 12px;
    }
    .alphabet-nav__count { display: none; }
}

@media (max-width: 768px) {
    .alphabet-nav__link { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
