/* Słownik pojęć — listing i strona hasła (wg projektu) */
.smart-glossary,
.smart-term {
    --gl-text: #111;
    --gl-navy: #303e4b;
    --gl-muted: #5f6b76;
    --gl-line: #e7e4df;
    --gl-bg: #faf9f7;
    --gl-brand: #f4991a;
    --gl-radius: 10px;
    --gl-shadow: 0 4px 24px rgba(17, 17, 17, .06);
}

.smart-glossary [hidden] { display: none !important; }

/* ---------- Listing ---------- */
.smart-glossary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.smart-glossary .smart-glossary-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 3.6vw, 42px);
    letter-spacing: -.02em;
    margin: 0;
    color: var(--gl-text);
}
.smart-glossary-count { margin: 6px 0 0 !important; color: var(--gl-muted); }
.smart-glossary-search-wrap { flex: 0 1 300px; display: flex; margin: 0; }
.smart-glossary-search {
    width: 100%;
    border: 1px solid var(--gl-line);
    border-radius: 50px;
    padding: 11px 20px;
    font-size: 15px;
    color: var(--gl-text);
    background: #fff;
    outline: none;
}
.smart-glossary-search:focus { border-color: var(--gl-brand); }

.smart-glossary-az {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 14px 0;
    margin-bottom: 24px;
    position: sticky;
    top: calc(var(--header-h, 78px) - 1px);
    background: #fff;
    z-index: 5;
    border-bottom: 1px solid var(--gl-line);
}
.smart-glossary-az a,
.smart-glossary-az-empty {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: .04em;
    border-radius: 50%;
}
.am .smart-glossary-az a { color: var(--gl-text); }
.am .smart-glossary-az a:hover { background: var(--gl-brand); color: var(--gl-navy); }
.smart-glossary-az-empty { color: #cfd4d9; }

.smart-glossary-section { padding: 24px 0 16px; scroll-margin-top: calc(var(--header-h, 78px) + 70px); }
.smart-glossary .smart-glossary-letter {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 30px;
    color: var(--gl-text);
}
.smart-glossary-letter span {
    width: 48px;
    height: 48px;
    background: var(--gl-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.smart-glossary-letter::after { content: ''; flex: 1; height: 1px; background: var(--gl-line); }
.smart-glossary-letter--text span { width: auto; padding: 0 16px; font-size: 18px; }

.smart-glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.am .smart-glossary-term {
    display: block;
    padding: 14px 18px;
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    background: #fff;
    font-weight: 600;
    color: var(--gl-text);
    transition: box-shadow .2s, border-color .2s;
}
.am .smart-glossary-term:hover { border-color: var(--gl-brand); box-shadow: var(--gl-shadow); color: var(--gl-text); }

/* ---------- Strona hasła (kompaktowa) ---------- */
.smart-term-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.smart-term-def { text-align: left; }
.smart-term-chips { justify-content: center; }
.smart-term-back { margin: 0 0 20px !important; }
.am .smart-term-back a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--gl-muted); }
.am .smart-term-back a:hover { color: var(--gl-brand); }
.smart-term .smart-term-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.1;
    letter-spacing: -.02em;
    margin: 0 0 32px;
    color: var(--gl-text);
    text-wrap: balance;
}
.smart-term-def {
    padding: 28px 32px;
    margin-bottom: 40px;
    background: var(--gl-bg);
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
}
.smart-term-def-body,
.smart-term-def-body p { font-size: 18px; line-height: 1.7; color: #333; margin: 0; }
.smart-term-def-body p + p { margin-top: 12px; }

.smart-term-chips-block { margin-bottom: 32px; }
.smart-term .smart-term-chips-block h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gl-text);
    margin: 0 0 16px;
}
/* Pojęcia jako połączone ze sobą elementy */
.smart-term-chips {
    display: inline-flex;
    flex-wrap: wrap;
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
    overflow: hidden;
    background: #fff;
}
.am .smart-term-chip {
    display: block;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gl-text);
    border-right: 1px solid var(--gl-line);
    border-bottom: 1px solid var(--gl-line);
    margin: 0 -1px -1px 0;
    background: #fff;
}
.am .smart-term-chip:hover,
.am .smart-term-chip:focus { background: var(--gl-brand); color: var(--gl-navy); }

/* Listy pojęć — osobne elementy z odstępem */
.smart-term-chips--spaced {
    display: flex;
    gap: 10px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}
.am .smart-term-chips--spaced .smart-term-chip {
    margin: 0;
    border: 1px solid var(--gl-line);
    border-radius: var(--gl-radius);
}
.am .smart-term-chips--spaced .smart-term-chip:hover { border-color: var(--gl-brand); }

@media (max-width: 767px) {
    .smart-glossary-search-wrap { flex-basis: 100%; }
    .smart-term-def { padding: 22px 18px; }
}
