/* ─────────────────────────────────────────────────
   Newbeings 1619 Lexicon  —  nb-lexicon.css v2.0.0
   Colors: Gold #D4A847 · Brown #8B7355 · Dark #6B5B45
           Cream #F5F0E8 · Near-Black #1C1812
───────────────────────────────────────────────── */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,500&display=swap');

/* ═══════════════════════ WRAPPER ═══════════════════════ */
.nbl-lexicon-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1C1812;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 32px;
    box-sizing: border-box;
}

/* ═══════════════════════ SEARCH ════════════════════════ */
.nbl-search-wrap {
    position: relative;
    margin-bottom: 28px;
}

.nbl-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8B7355;
    font-size: 18px;
    pointer-events: none;
    line-height: 1;
}

#nbl-search {
    width: 100%;
    padding: 14px 18px 14px 48px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 2px solid #e0d5c5;
    border-radius: 12px;
    background: #fff;
    color: #1C1812;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    outline: none;
}

#nbl-search:focus {
    border-color: #8B7355;
    box-shadow: 0 0 0 4px rgba(139,115,85,.12);
}

#nbl-search::placeholder { color: #b8a89a; }

/* ═══════════════════════ ALPHABET NAV ══════════════════ */
.nbl-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
    background: #1C1812;
    border-radius: 14px;
    padding: 14px 16px;
}

.nbl-alpha-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    border: none;
    transition: background .18s, color .18s, transform .12s;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: rgba(255,255,255,.6);
}

.nbl-alpha-btn:hover {
    background: rgba(212,168,71,.2);
    color: #D4A847;
    transform: translateY(-1px);
}

.nbl-alpha-btn.active {
    background: #D4A847;
    color: #1C1812;
    box-shadow: 0 2px 8px rgba(212,168,71,.4);
}

.nbl-alpha-btn.has-terms {
    color: rgba(255,255,255,.85);
}

.nbl-alpha-btn.no-terms {
    color: rgba(255,255,255,.2);
    cursor: default;
    pointer-events: none;
}

.nbl-alpha-btn[data-letter="ALL"] {
    width: auto;
    padding: 0 14px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
}

.nbl-alpha-btn[data-letter="ALL"].active {
    background: #8B7355;
    color: #fff;
}

/* ═══════════════════════ RESULTS COUNT ═════════════════ */
.nbl-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 0 2px;
}

.nbl-results-count {
    font-size: 13px;
    color: #8B7355;
    font-weight: 600;
    letter-spacing: .02em;
}

.nbl-active-filter {
    font-size: 12px;
    color: #b8a89a;
}

/* ═══════════════════════ TERMS GRID ════════════════════ */
.nbl-terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

/* ═══════════════════════ TERM CARD ═════════════════════ */
.nbl-term-card {
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s, transform .15s;
    cursor: pointer;
}

.nbl-term-card:hover {
    border-color: #D4A847;
    box-shadow: 0 4px 16px rgba(139,115,85,.15);
    transform: translateY(-2px);
}

.nbl-term-card.open {
    border-color: #8B7355;
    box-shadow: 0 6px 24px rgba(139,115,85,.2);
    grid-column: 1 / -1;
}

.nbl-term-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 10px;
}

.nbl-term-letter-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F5F0E8;
    color: #8B7355;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Playfair Display', serif;
}

.nbl-term-card.open .nbl-term-letter-badge {
    background: #8B7355;
    color: #fff;
}

.nbl-term-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1C1812;
    line-height: 1.3;
}

.nbl-term-chevron {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F5F0E8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .25s, background .2s;
    font-size: 10px;
    color: #8B7355;
}

.nbl-term-card.open .nbl-term-chevron {
    transform: rotate(180deg);
    background: #8B7355;
    color: #fff;
}

/* ═══════════════════════ DEFINITION PANEL ══════════════ */
.nbl-term-body {
    display: none;
    padding: 0 16px 18px;
    border-top: 1px solid #f0e8de;
}

.nbl-term-card.open .nbl-term-body {
    display: block;
}

.nbl-term-body-inner {
    padding-top: 16px;
}

.nbl-definition-text {
    font-size: 14px;
    line-height: 1.75;
    color: #3a3028;
}

.nbl-definition-text p { margin: 0 0 10px; }
.nbl-definition-text p:last-child { margin-bottom: 0; }

.nbl-no-def {
    font-size: 13px;
    color: #b8a89a;
    font-style: italic;
}

.nbl-term-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0e8de;
    flex-wrap: wrap;
}

.nbl-btn-permalink {
    font-size: 12px;
    color: #8B7355;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color .15s;
}

.nbl-btn-permalink:hover { color: #D4A847; }

.nbl-btn-close {
    font-size: 12px;
    color: #b8a89a;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: color .15s;
}

.nbl-btn-close:hover { color: #1C1812; }

/* ═══════════════════════ LETTER SECTION HEADERS ════════ */
.nbl-letter-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 4px;
}

.nbl-letter-heading-char {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 600;
    color: #D4A847;
    line-height: 1;
    min-width: 32px;
}

.nbl-letter-heading-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #e0d5c5, transparent);
}

/* ═══════════════════════ EMPTY STATE ═══════════════════ */
.nbl-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #b8a89a;
}

.nbl-empty-icon { font-size: 40px; margin-bottom: 12px; }
.nbl-empty-msg  { font-size: 15px; }

/* ═══════════════════════ SINGLE TERM PAGE ══════════════ */
.nbl-single-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.nbl-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1C1812;
    color: #D4A847;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 32px;
    transition: background .2s, transform .15s;
}

.nbl-back-btn:hover {
    background: #2e2820;
    transform: translateX(-3px);
    color: #D4A847;
    text-decoration: none;
}

.nbl-back-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nbl-single-card {
    background: #fff;
    border: 1px solid #e8e0d5;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.nbl-single-header {
    background: linear-gradient(135deg, #1C1812 0%, #2e2820 100%);
    padding: 36px 36px 32px;
    position: relative;
}

.nbl-single-badge {
    display: inline-block;
    background: rgba(212,168,71,.15);
    color: #D4A847;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(212,168,71,.25);
    margin-bottom: 14px;
}

.nbl-single-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.nbl-single-letter-bg {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Playfair Display', serif;
    font-size: 120px;
    font-weight: 600;
    color: rgba(212,168,71,.08);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.nbl-single-body {
    padding: 36px;
}

.nbl-single-definition {
    font-size: 16px;
    line-height: 1.85;
    color: #3a3028;
}

.nbl-single-definition p { margin: 0 0 16px; }
.nbl-single-definition p:last-child { margin-bottom: 0; }

.nbl-single-no-def {
    font-size: 15px;
    color: #b8a89a;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.nbl-single-footer {
    padding: 20px 36px 28px;
    border-top: 1px solid #f0e8de;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.nbl-single-back-bottom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #8B7355;
    color: #fff !important;
    text-decoration: none !important;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    transition: background .2s, transform .15s;
}

.nbl-single-back-bottom:hover {
    background: #7a6449;
    transform: translateX(-3px);
}

.nbl-single-back-bottom svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nbl-single-meta {
    font-size: 12px;
    color: #c0b0a0;
}

/* ═══════════════════════ RESPONSIVE ════════════════════ */
@media (max-width: 640px) {
    .nbl-lexicon-wrap { padding: 0 16px; }
    .nbl-alpha-nav { padding: 10px 12px; gap: 4px; }
    .nbl-alpha-btn { width: 30px; height: 30px; font-size: 12px; border-radius: 6px; }
    .nbl-alpha-btn[data-letter="ALL"] { padding: 0 10px; }
    .nbl-terms-grid { grid-template-columns: 1fr; }
    .nbl-single-header { padding: 24px 22px 20px; }
    .nbl-single-body   { padding: 22px; }
    .nbl-single-footer { padding: 16px 22px 22px; }
    .nbl-single-letter-bg { display: none; }
}
