/* ============================================
   Глоссарий — стиль в духе Binance Academy
   ============================================ */
.glossary {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}

.glossary__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.glossary__subtitle {
    color: #666;
    font-size: 1.0625rem;
    margin: 0 0 28px;
}

/* Поиск */
.glossary__search {
    position: relative;
    margin-bottom: 20px;
}

.glossary__search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px 14px 44px;
    font-size: 1rem;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    outline: none;
    transition: border-color .15s ease;
}

.glossary__search-input:focus {
    border-color: #3a5a7c;
}

.glossary__search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
}

/* Алфавит */
.glossary__alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.glossary__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 8px;
    background: #f4f5f7;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s ease, color .15s ease;
}

.glossary__letter:hover { background: #e7eaf0; }
.glossary__letter.is-active { background: #3a5a7c; color: #fff; }
.glossary__letter.is-disabled { opacity: .35; pointer-events: none; }

/* Список терминов — без рамок (.glossary-item border убран) */
.glossary__list {
    display: flex;
    flex-direction: column;
}

.glossary__item {
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
}

.glossary__item-term {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.glossary__item-term a {
    color: #1a1a1a;
    text-decoration: none;
}

.glossary__item-term a:hover { color: #3a5a7c; }

.glossary__item-def {
    margin: 0;
    color: #5f6368;
    line-height: 1.6;
    font-size: 0.95rem;
}

.glossary__empty {
    padding: 40px 0;
    color: #888;
    text-align: center;
}

/* Детальная страница термина */
.glossary-term {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 64px;
}

.glossary-term__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: #1a1a1a;
}

.glossary-term__lead {
    font-size: 1.1875rem;
    line-height: 1.6;
    color: #333;
    margin: 0 0 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.glossary-term__content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #2a2a2a;
}

.glossary-term__content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    margin: 32px 0 12px;
}

.glossary-term__content p { margin: 0 0 16px; }
.glossary-term__content a { color: #3a5a7c; }

.glossary-term__related {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid #eee;
}

.glossary-term__related-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 14px;
}

.glossary-term__related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.glossary-term__related-list a {
    display: inline-block;
    padding: 8px 14px;
    background: #f4f5f7;
    border-radius: 8px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9rem;
}

.glossary-term__related-list a:hover { background: #e7eaf0; color: #3a5a7c; }

@media (max-width: 768px) {
    .glossary__title, .glossary-term__title { font-size: 1.75rem; }
}

/* Дата обновления термина (E-E-A-T: свежесть контента) */
.glossary-term__updated {
    margin: 0 0 16px;
    font-size: 0.8125rem;
    color: #94a3b8;
}
.glossary-term__updated time { color: #64748b; }

/* Глоссарий → лонгриды/каталог (обратная перелинковка) */
.glossary-term__seealso {
    margin: 28px 0;
    padding: 18px 22px;
    background: #f8fafc;
    border-left: 4px solid #3a5a7c;
    border-radius: 8px;
}
.glossary-term__article-list {
    margin: 10px 0 0;
    padding-left: 1.2em;
}
.glossary-term__article-list li { margin-bottom: 6px; }
.glossary-term__article-list a { color: #3a5a7c; text-decoration: none; }
.glossary-term__article-list a:hover { text-decoration: underline; }

/* === Единый стандарт отступов заголовков (UX: сверху ~1.5–2em, снизу ~0.5em, ~3:1) === */
.glossary-term__content h1{margin:1.4em 0 .6em}
.glossary-term__content h2{margin:2em 0 .6em}
.glossary-term__content h3{margin:1.7em 0 .5em}
.glossary-term__content h4{margin:1.5em 0 .5em}
.glossary-term__content h1:first-child,.glossary-term__content h2:first-child,.glossary-term__content h3:first-child{margin-top:0}
.glossary-content h1{margin:1.4em 0 .6em}
.glossary-content h2{margin:2em 0 .6em}
.glossary-content h3{margin:1.7em 0 .5em}
.glossary-content h4{margin:1.5em 0 .5em}
.glossary-content h1:first-child,.glossary-content h2:first-child,.glossary-content h3:first-child{margin-top:0}

/* ── Категории на странице списка ── */
.glossary__cat { margin: 0 0 40px; }
.glossary__cat-title {
    font-size: 1.35rem; font-weight: 800; color: #1a1a1a;
    margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid #ff6b35;
}
.glossary__cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ── Страница термина: категория, CTA, FAQ ── */
.glossary-term__cat {
    display: inline-block; background: #ffe6d6; color: #d1481e;
    border-radius: 20px; padding: 6px 14px; font-weight: 700; font-size: .8rem; margin: 0 0 12px;
}
.glossary-term__cta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between;
    background: #f6f7f9; border: 1px solid #edf0f4; border-radius: 18px;
    padding: 22px 26px; margin: 32px 0;
}
.glossary-term__cta-text { margin: 0; font-weight: 600; color: #2b2f33; font-size: 1.05rem; }
.glossary-term__cta-btn {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 13px 26px; border-radius: 12px; background: #ff6b35; color: #fff;
    font-weight: 700; text-decoration: none; transition: all .2s ease;
}
.glossary-term__cta-btn:hover { background: #e85520; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,107,53,.3); }

.glossary-term__faq { margin: 36px 0; }
.glossary-faq__item {
    border: 1px solid #e7ebf0; border-radius: 12px; padding: 4px 18px; margin: 0 0 12px; background: #fff;
}
.glossary-faq__q {
    cursor: pointer; font-weight: 700; color: #1a1a1a; padding: 14px 0; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.glossary-faq__q::-webkit-details-marker { display: none; }
.glossary-faq__q::after { content: "+"; font-size: 1.4rem; color: #ff6b35; line-height: 1; }
.glossary-faq__item[open] .glossary-faq__q::after { content: "−"; }
.glossary-faq__a { padding: 0 0 16px; color: #4a4f57; line-height: 1.6; }

@media (max-width: 600px) {
    .glossary__cat-list { grid-template-columns: 1fr; }
    .glossary-term__cta { flex-direction: column; align-items: flex-start; }
}
