/**
 * Glossary Stylesheet
 * Matches Figma design for Main Glossary and Individual Glossary pages
 *
 * @package Objectways
 */

:root {
    --glossary-purple: #8F81FD;
    --glossary-purple-dark: #6C5CE7;
    --glossary-purple-light: #F1EFFF;
    --glossary-purple-pill: #ECE8FD;
    --glossary-purple-border: #E4E0FC;
    --glossary-bg-tint: #EEEEFF;
    --glossary-card-bg: #FFFFFF;
    --glossary-card-border: #E8E7F0;
    --glossary-text-primary: #1C1C1C;
    --glossary-text-muted: rgba(37, 39, 38, 0.65);
    --glossary-cta-green: #CEFF68;
}

/* ==========================================================================
   Base & Common Styles
   ========================================================================== */

.glossary-page-wrapper,
.single_glossary_page {
    background-color: var(--glossary-bg-tint);
    min-height: 100vh;
    color: var(--glossary-text-primary);
    padding-bottom: 90px;
}

/* ==========================================================================
   Main Glossary Listing Page (Archive)
   ========================================================================== */

/* Hero Section */
.glossary-hero-section {
    padding: 70px 0 35px;
    text-align: center;
}

.glossary-hero-inner {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glossary-hero-title {
    font-family: 'gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 58px;
    line-height: 1.15;
    color: var(--glossary-text-primary);
    margin: 0 0 18px;
    letter-spacing: -0.02em;
    text-align: center;
}

.glossary-hero-title .highlight {
    font-family: 'gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    color: var(--glossary-text-primary);
}

.glossary-hero-desc {
    font-family: 'gilroy', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(28, 28, 28, 0.7);
    max-width: 620px;
    margin: 0 auto 26px;
    text-align: center;
}

/* Dynamic Stats Pill Container: "70 terms • 21 letters • 1 source" */
.glossary-stats-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 9999px;
    padding: 8px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    font-family: 'gilroy', sans-serif;
    font-size: 14px;
    color: var(--glossary-text-primary);
}

.glossary-stats-pill .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.glossary-stats-pill .stat-count {
    font-weight: 700;
    color: var(--glossary-text-primary);
}

.glossary-stats-pill .stat-sep {
    color: rgba(28, 28, 28, 0.3);
    font-size: 12px;
}

/* Main Section Layout Grid */
.glossary-main-section {
    padding-bottom: 60px;
}

.glossary-layout-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 36px;
    max-width: 1080px;
    margin: 0 auto;
    align-items: start;
}

/* Sticky Left Sidebar: JUMP TO A-Z */
.glossary-sidebar {
    position: sticky;
    top: 90px;
}

.glossary-jump-nav-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(143, 129, 253, 0.25);
    border-radius: 16px;
    padding: 14px 10px;
    box-shadow: 0 4px 20px rgba(143, 129, 253, 0.05);
}

.jump-nav-header {
    padding: 4px 10px 10px;
    border-bottom: 1px solid rgba(143, 129, 253, 0.15);
    margin-bottom: 8px;
}

.jump-nav-title {
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--glossary-purple);
    margin: 0;
}

.jump-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.jump-nav-item {
    margin: 0;
}

.jump-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--glossary-text-primary);
    font-family: 'Space Mono', 'gilroy', monospace;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.jump-nav-link:hover {
    background: var(--glossary-purple-light);
    color: var(--glossary-purple-dark);
}

.jump-nav-link.active {
    background: var(--glossary-purple);
    color: #FFFFFF;
}

.jump-nav-link .letter-char {
    display: inline-block;
}

.jump-nav-link .letter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    background: #ECE8FD;
    color: var(--glossary-purple-dark);
    transition: all 0.2s ease;
}

.jump-nav-link.active .letter-count {
    background: var(--glossary-text-primary);
    color: #FFFFFF;
}

.jump-nav-link.disabled {
    color: rgba(28, 28, 28, 0.3);
    cursor: default;
    pointer-events: none;
}

.jump-nav-link .letter-empty-dash {
    font-size: 13px;
    color: rgba(28, 28, 28, 0.35);
    margin-right: 4px;
}

/* Mobile Alphabet Scroller (hidden on desktop) */
.glossary-mobile-jump-bar {
    display: none;
    margin-bottom: 24px;
    background: #FFFFFF;
    border: 1px solid var(--glossary-card-border);
    border-radius: 12px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.glossary-mobile-jump-bar::-webkit-scrollbar {
    display: none;
}

.mobile-jump-inner {
    display: flex;
    gap: 6px;
    min-width: max-content;
}

.mobile-jump-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-family: 'Space Mono', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--glossary-text-primary);
    background: #F8F9FA;
    transition: all 0.2s ease;
}

.mobile-jump-btn:hover,
.mobile-jump-btn.active {
    background: var(--glossary-purple);
    color: #FFFFFF;
}

.mobile-jump-btn.disabled {
    color: #CBD5E1;
    background: transparent;
    pointer-events: none;
}

/* Search Bar Section in Right Column */
.glossary-content-column {
    min-width: 0;
}

.glossary-search-wrapper {
    margin-bottom: 24px;
}

.glossary-search-label {
    display: block;
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--glossary-text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.glossary-search-bar {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E2E2EA;
    border-radius: 9999px;
    padding: 6px 20px 6px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    gap: 12px;
    transition: border-color 0.2s ease;
}

.glossary-search-bar:focus-within {
    border-color: var(--glossary-purple);
}

.glossary-search-bar .search-icon {
    display: inline-flex;
    align-items: center;
    color: var(--glossary-text-primary);
    flex-shrink: 0;
}

.glossary-search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'gilroy', sans-serif;
    font-size: 15px;
    color: var(--glossary-text-primary);
    background: transparent;
    padding: 8px 0;
}

input:focus,
.glossary-search-input:focus {
    border-color: transparent !important;
    border: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.glossary-search-input::placeholder {
    color: rgba(28, 28, 28, 0.4);
}

.glossary-search-clear {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    border-radius: 50%;
    color: #6B7280;
    transition: background 0.2s;
}

.glossary-search-clear:hover {
    background: #F3F4F6;
}

.glossary-search-meta {
    flex-shrink: 0;
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 12px;
    color: rgba(28, 28, 28, 0.55);
    white-space: nowrap;
}

.glossary-search-meta strong {
    color: var(--glossary-text-primary);
    font-weight: 700;
}

/* Letter Groups & Term Cards */
.glossary-terms-container {
    display: flex;
    flex-direction: column;
}

.glossary-letter-group {
    scroll-margin-top: 100px;
    margin-bottom: 8px;
}

.glossary-group-row {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 20px;
    align-items: start;
}

.glossary-big-letter-wrap {
    padding-top: 6px;
}

.glossary-big-letter {
    font-family: 'gilroy', sans-serif;
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    color: var(--glossary-purple);
    display: block;
}

.glossary-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.glossary-term-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid var(--glossary-card-border);
    border-radius: 14px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--glossary-text-primary);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.015);
}

/* Left vertical accent indicator on hover */
.glossary-term-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--glossary-purple);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.glossary-term-card .term-title {
    font-family: 'gilroy', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--glossary-text-primary);
    transition: color 0.2s ease;
}

.glossary-term-card .term-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #F8F9FA;
    color: #6B7280;
    flex-shrink: 0;
    margin-left: 12px;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.glossary-term-card .term-arrow svg {
    display: block;
    width: 12px;
    height: 12px;
}

/* Hover effect maintaining old purple theme colors */
.glossary-term-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(143, 129, 253, 0.12);
    border-color: var(--glossary-purple);
    background: #FFFFFF;
}

.glossary-term-card:hover::before {
    opacity: 1;
}

.glossary-term-card:hover .term-title {
    color: var(--glossary-purple-dark);
}

.glossary-term-card:hover .term-arrow {
    background-color: var(--glossary-purple);
    color: #FFFFFF;
    transform: translateX(2px);
}

.glossary-section-divider {
    border: 0;
    border-top: 1px solid rgba(228, 224, 252, 0.8);
    margin: 24px 0;
}

/* Live Search No Results State */
.glossary-no-results {
    background: #FFFFFF;
    border: 1px dashed #D1D5DB;
    border-radius: 16px;
    padding: 60px 30px;
    text-align: center;
    margin-top: 20px;
}

.no-results-inner {
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.no-results-title {
    font-family: 'gilroy', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--glossary-text-primary);
}

.no-results-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--glossary-text-muted);
    margin: 0 0 24px;
}

.no-results-reset-btn {
    font-size: 14px;
    padding: 10px 24px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    background: var(--glossary-purple);
    color: #FFFFFF;
}

.no-results-reset-btn:hover {
    background: var(--glossary-purple-dark);
}


/* ==========================================================================
   Individual Glossary Term Page (Single)
   ========================================================================== */

.single_glossary_page {
    padding-top: 50px;
}

.glossary-single-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb Navigation */
.glossary-single-breadcrumb {
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 13px;
    color: rgba(28, 28, 28, 0.6);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glossary-single-breadcrumb .breadcrumb-link {
    color: rgba(28, 28, 28, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}

.glossary-single-breadcrumb .breadcrumb-link:hover {
    color: var(--glossary-purple-dark);
}

.glossary-single-breadcrumb .sep {
    color: rgba(28, 28, 28, 0.4);
}

.glossary-single-breadcrumb .breadcrumb-current {
    color: var(--glossary-text-primary);
    font-weight: 600;
}

/* Letter Badge: [A] */
.glossary-letter-badge-wrap {
    margin-bottom: 12px;
}

.glossary-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--glossary-purple);
    color: var(--glossary-purple-dark);
    background: rgba(255, 255, 255, 0.65);
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* Post Title in Recoleta Serif */
.glossary-single-title {
    font-family: 'recoleta', 'Recoleta', 'Georgia', serif;
    font-size: 54px;
    font-weight: 500;
    line-height: 1.15;
    color: var(--glossary-text-primary);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

/* Wavy Decorative Underline SVG */
.glossary-wavy-wrap {
    width: 100%;
    max-width: 720px;
    margin-bottom: 22px;
    overflow: hidden;
}

.glossary-wavy-line {
    display: block;
    width: 100%;
    height: 16px;
}

/* Author & Metadata Row */
.glossary-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-bottom: 36px;
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 14px;
    color: rgba(28, 28, 28, 0.75);
}

.glossary-single-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.meta-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glossary-purple);
    color: #2A1D19;
    /* color: #FFFFFF; */
    font-size: 16px;
    font-weight: 700;
    font-family: 'gilroy', sans-serif;
}

.meta-author-name {
    font-weight: 600;
    color: var(--glossary-text-primary);
}

.meta-icon {
    display: inline-flex;
    align-items: center;
    width: 32px;
    height: 32px;
    background: #9180FF;
    border-radius: 50%;
    justify-content: center;
}

/* Main Content Layout: Article directly on background + Right Sticky TOC */
.glossary-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

.glossary-single-article {
    min-width: 0;
}

/* Body Content sits directly on background (NO white card wrapper) */
.glossary-body-content {
    font-family: 'gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #252726;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.glossary-body-content p {
    margin-bottom: 1.4em;
    font-size: 17px;
    line-height: 1.7;
}

.glossary-body-content p:first-of-type {
    font-size: 18px;
    line-height: 1.7;
    color: var(--glossary-text-primary);
}

/* Section Headings in Monospace Font (Matches Image 2) */
.glossary-body-content h2 {
    font-family: 'Space Mono', 'SF Mono', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--glossary-text-primary);
    margin: 36px 0 14px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    scroll-margin-top: 100px;
}

.glossary-body-content h3 {
    font-family: 'Space Mono', 'SF Mono', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
    font-size: 17px;
    font-weight: 700;
    color: var(--glossary-text-primary);
    margin: 28px 0 12px;
    line-height: 1.35;
    scroll-margin-top: 100px;
}

.glossary-body-content ul {
    margin: 14px 0 24px 24px;
    padding: 0;
    list-style-type: disc;
}

.glossary-body-content li {
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 8px;
    color: #2D3748;
}

/* Figure / Image in Article */
.glossary-featured-figure,
.glossary-body-content figure {
    margin: 36px 0 24px;
    text-align: center;
}

.glossary-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: inline-block;
}

.glossary-body-content figcaption {
    margin-top: 8px;
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 12px;
    font-style: italic;
    color: rgba(28, 28, 28, 0.55);
    text-align: center;
}

/* Single Article Horizontal Divider Line */
.glossary-single-divider {
    border: 0;
    border-top: 1px solid rgba(143, 129, 253, 0.4);
    margin: 48px 0 36px;
}

/* Bottom Centered CTA Section (Matches Reference Image 2) */
.glossary-single-cta-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto 36px;
    padding: 0;
}

.glossary-single-cta-title {
    font-family: 'gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--glossary-text-primary);
    margin: 0 0 18px;
    line-height: 1.3;
    text-align: center;
}

.glossary-lime-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--glossary-cta-green);
    border: 1px solid #1C1C1C;
    border-radius: 10px;
    padding: 10px 24px;
    width: auto;
    height: auto;
    min-height: 40px;
    white-space: nowrap;
    color: #1C1C1C;
    font-family: 'gilroy', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(206, 255, 104, 0.25);
}

.glossary-lime-pill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(206, 255, 104, 0.45);
    background: #BFFF3B;
    color: #1C1C1C;
}

.glossary-lime-pill-btn svg {
    display: inline-block;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.glossary-lime-pill-btn:hover svg {
    transform: translateX(3px);
}

/* Sticky Sidebar: On this page (Table of Contents) */
.glossary-single-sidebar {
    position: sticky;
    top: 90px;
}

.glossary-toc-card {
    background: #FFFFFF;
    border: 1px solid rgba(228, 224, 252, 0.8);
    border-radius: 16px;
    padding: 22px 18px;
    box-shadow: 0 2px 25px #9180FF !important;
    /* box-shadow: 0 10px 30px rgba(143, 129, 253, 0.12); */
}

.glossary-toc-card .toc-header {
    padding-bottom: 12px;
    border-bottom: 1px solid #F1F1F5;
    margin-bottom: 12px;
}

.glossary-toc-card .toc-title {
    font-family: 'Space Mono', 'Consolas', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--glossary-purple);
    margin: 0;
}

.glossary-toc-card .toc-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.glossary-toc-card .toc-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'gilroy', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--glossary-text-primary);
    line-height: 1.4;
    transition: all 0.2s ease;
}

.glossary-toc-card .toc-link.toc-h3 {
    padding-left: 20px;
    font-size: 13px;
}

.glossary-toc-card .toc-link:hover {
    background: var(--glossary-purple-light);
    color: var(--glossary-purple-dark);
}

.glossary-toc-card .toc-link.active {
    background: #C7C0FD;
    color: #1C1C1C;
    font-weight: 600;
}


/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .glossary-layout-grid {
        grid-template-columns: 120px 1fr;
        gap: 28px;
    }

    .glossary-single-layout {
        grid-template-columns: 1fr 260px;
        gap: 32px;
    }

    .glossary-hero-title {
        font-size: 46px;
    }

    .glossary-single-title {
        font-size: 44px;
    }
}

@media (max-width: 860px) {
    .glossary-layout-grid {
        display: block;
    }

    .glossary-sidebar {
        display: none;
    }

    .glossary-mobile-jump-bar {
        display: block;
        position: sticky;
        top: 75px;
        z-index: 10;
    }

    .glossary-single-layout {
        display: flex;
        flex-direction: column-reverse;
    }

    .glossary-single-sidebar {
        position: static;
        width: 100%;
        margin-bottom: 30px;
    }

    .glossary-cards-grid {
        grid-template-columns: 1fr;
    }

    .glossary-group-row {
        grid-template-columns: 36px 1fr;
        gap: 14px;
    }

    .glossary-big-letter {
        font-size: 36px;
    }

    .glossary-hero-section {
        padding: 40px 0 20px;
    }

    .glossary-hero-title {
        font-size: 34px;
    }

    .glossary-single-title {
        font-size: 36px;
    }
}

@media (max-width: 540px) {
    .glossary-hero-title {
        font-size: 28px;
    }

    .glossary-single-title {
        font-size: 28px;
    }

    .glossary-stats-pill {
        flex-wrap: wrap;
        border-radius: 16px;
        padding: 10px 16px;
        gap: 8px;
    }

    .glossary-single-meta {
        gap: 12px;
    }

    .glossary-search-bar {
        padding: 6px 14px;
    }
}