/* ============================================
   Learn module — shared styles for /learn/*
   Built on top of /_includes/free.css (reuses .free-page, .card,
   .section-tile, .breadcrumbs, .seo-* article styles).
   ============================================ */

.learn-page main {
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}

/* Root /learn/ index uses the wider hero grid like /free/ */
.learn-page .learn-root { max-width: 1000px; }
.learn-root-hero {
    text-align: center;
    margin: 0 auto 44px;
    max-width: 720px;
}
.learn-root-hero h1 {
    font-size: 42px;
    line-height: 1.12;
    margin: 0 0 14px;
    letter-spacing: -0.025em;
}
.learn-root-hero .lede { font-size: 17px; }

/* Section index hero */
.learn-section-index { max-width: 1000px; }

/* Detail-page hero */
.learn-hero {
    margin: 16px 0 34px;
}
.learn-chrome {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.learn-eyebrow {
    display: inline-block;
    background: rgba(124, 58, 237, 0.16);
    color: var(--fm-accent-soft);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
}
.learn-read {
    color: var(--fm-text-muted);
    font-size: 13px;
    font-weight: 500;
}
.learn-page h1 {
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.022em;
    margin: 0;
}

/* Article body — re-uses the .seo-* hierarchy from free.css */
.learn-article {
    margin-top: 24px;
}

/* The article body comes through with our existing classes
   (.seo-intro, .seo-h3, etc.) so it picks up the same readability
   styles we just polished on the /free/ pages. */

/* Slightly stronger separator between article and the app-cta below */
.learn-detail .app-cta {
    margin-top: 56px;
}

@media (max-width: 720px) {
    .learn-root-hero h1 { font-size: 32px; }
    .learn-page h1 { font-size: 28px; }
}

/* ============================================
   Glossary page — editorial layout
   Reference: ideaproof.io/glossary structure
   - Hero with search
   - A-Z navigation
   - Featured terms
   - Alphabetised term list
   - Sidebar with cross-links + upsell
   ============================================ */

.learn-glossary-page {
    max-width: 1180px !important;
    padding: 40px 24px 96px !important;
}

.glossary-hero {
    text-align: center;
    margin: 8px auto 32px;
    max-width: 720px;
}
.glossary-hero h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 12px 0 14px;
}
.glossary-hero .lede {
    color: var(--fm-text-soft);
    font-size: 17px;
    line-height: 1.6;
    margin: 0 0 28px;
}

/* Search input */
.glossary-search {
    max-width: 540px;
    margin: 0 auto;
    position: relative;  /* so the results dropdown anchors below input */
}

/* Cross-page search dropdown — shows up to 8 hits across all glossary
   pages while the user types in the hero search box. */
.search-results-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--fm-card);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
    padding: 6px;
    z-index: 50;
    box-shadow: 0 24px 48px -16px rgba(0,0,0,0.55), 0 8px 16px -8px rgba(0,0,0,0.35);
    max-height: 420px;
    overflow-y: auto;
    text-align: left;
}
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--fm-text);
    transition: background 0.15s;
}
.search-result-item:hover,
.search-result-item:focus {
    background: rgba(124, 58, 237, 0.12);
    outline: none;
}
.search-result-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--fm-text);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-result-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.search-result-cat {
    background: rgba(124, 58, 237, 0.18);
    color: var(--fm-accent);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.search-result-jump,
.search-result-here {
    font-size: 11px;
    color: var(--fm-text-muted);
    font-weight: 500;
}
.search-result-here { color: #4ade80; }
.search-result-empty {
    padding: 16px;
    text-align: center;
    color: var(--fm-text-muted);
    font-size: 14px;
}
.glossary-search input {
    width: 100%;
    background: var(--fm-card);
    color: var(--fm-text);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
    padding: 16px 22px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.glossary-search input:focus {
    outline: none;
    border-color: var(--fm-accent);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}
.glossary-search input::placeholder { color: var(--fm-text-muted); }

/* A-Z navigation strip */
.az-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 18px 0;
    margin: 0 0 36px;
    border-top: 1px solid var(--fm-border);
    border-bottom: 1px solid var(--fm-border);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.94);
    backdrop-filter: blur(8px);
    z-index: 10;
}
.az-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s;
}
.az-link-active {
    color: var(--fm-text) !important;
    background: transparent;
}
.az-link-active:hover {
    background: var(--fm-accent);
    color: #fff !important;
}
.az-link-inactive {
    color: var(--fm-text-muted);
    opacity: 0.35;
    pointer-events: none;
}

/* 2-column layout: main + sidebar */
.glossary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: start;
}

.section-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--fm-text-muted);
    margin: 0 0 18px;
}

/* Category filter chips (above A-Z nav) */
.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 0 20px;
}
.cat-chip {
    background: transparent;
    color: var(--fm-text-soft);
    border: 1px solid var(--fm-border);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.cat-chip:hover {
    background: var(--fm-card);
    color: var(--fm-text);
    border-color: var(--fm-accent-soft);
}
.cat-chip-active {
    background: var(--fm-accent);
    color: #fff;
    border-color: var(--fm-accent);
}
.cat-chip-active:hover {
    background: var(--fm-accent);
    color: #fff;
}

/* Letter groups */
.letter-group {
    margin-bottom: 36px;
    scroll-margin-top: 80px;
}
.letter-heading {
    font-size: 24px;
    font-weight: 800;
    color: var(--fm-text);
    letter-spacing: -0.018em;
    padding: 8px 16px;
    background: rgba(124, 58, 237, 0.10);
    border-left: 4px solid var(--fm-accent);
    border-radius: 4px;
    margin: 0 0 18px;
    display: inline-block;
    min-width: 64px;
    text-align: center;
}

/* Term cards — main glossary entry shape */
.term-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.term-card {
    background: var(--fm-card);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
    padding: 22px 24px;
    scroll-margin-top: 96px;
    transition: border-color 0.16s, box-shadow 0.16s;
}
.term-card:hover {
    border-color: rgba(124, 58, 237, 0.40);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.08);
}

/* Header row: title (left) + category chip + share (right) */
.term-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.term-card-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--fm-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}
.term-card-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.term-card-category {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--fm-text-soft);
    border: 1px solid var(--fm-border);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

/* Share button (replaces the old top-right copy-link) */
.term-share {
    background: transparent;
    border: 1px solid var(--fm-border);
    color: var(--fm-text-muted);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.14s, border-color 0.14s, background 0.14s, transform 0.14s;
}
.term-share:hover {
    color: var(--fm-accent-soft);
    border-color: var(--fm-accent);
    background: rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}
.term-share:active { transform: translateY(0); }
.term-share-done {
    color: var(--fm-accent) !important;
    border-color: var(--fm-accent) !important;
    background: rgba(124, 58, 237, 0.16) !important;
}

/* Definition paragraph — plain prose, no label */
.term-definition {
    color: var(--fm-text);
    font-size: 15.5px;
    line-height: 1.6;
    margin: 0 0 14px;
}

/* Example sub-card — small wrapped card with bold body */
.term-example-card {
    background: rgba(124, 58, 237, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-left: 3px solid var(--fm-accent);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 4px 0 0;
}
.term-example-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--fm-accent-soft);
    margin-bottom: 4px;
}
.term-example-body {
    margin: 0;
    color: var(--fm-text);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 600;
}

@media (max-width: 540px) {
    .term-card-head {
        flex-wrap: wrap;
    }
    .term-card-meta {
        order: 2;
        width: 100%;
        justify-content: flex-start;
    }
}

.no-results {
    color: var(--fm-text-muted);
    text-align: center;
    padding: 40px 0;
}

/* Sidebar */
.learn-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
    align-self: start;
}
.sidebar-card {
    background: var(--fm-card);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
    padding: 22px;
}
.sidebar-h {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--fm-text-muted);
    margin: 0 0 12px;
}
.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sidebar-list li { margin: 0; }
.free-page .sidebar-list a {
    display: block;
    color: var(--fm-text);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none !important;
    transition: color 0.12s;
    padding-left: 12px;
    border-left: 2px solid var(--fm-border);
}
.free-page .sidebar-list a:hover {
    color: var(--fm-accent-soft);
    border-left-color: var(--fm-accent);
}

.sidebar-upsell {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.04));
    border-color: rgba(124, 58, 237, 0.30);
}
.sidebar-upsell p {
    color: var(--fm-text-soft);
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 14px;
}
.free-page a.sidebar-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    background: #0a0a0f;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--fm-text) !important;
    text-decoration: none !important;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.free-page a.sidebar-store-btn:hover {
    background: #15151c;
    border-color: var(--fm-accent);
    transform: translateY(-1px);
}
.free-page a.sidebar-store-btn:last-child { margin-bottom: 0; }
.free-page a.sidebar-store-btn svg {
    flex-shrink: 0;
    color: var(--fm-text);
}
.free-page a.sidebar-store-btn span {
    flex: 1;
    text-align: left;
    line-height: 1.2;
}

@media (max-width: 980px) {
    .glossary-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .learn-sidebar {
        position: static;
        order: 2;
    }
    .featured-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .glossary-hero h1 { font-size: 32px; }
    .az-nav { padding: 12px 0; }
    .az-link { width: 28px; height: 28px; font-size: 12px; }
    .letter-heading { font-size: 20px; }
}

/* ============================================
   PAGINATION
   ============================================ */
.page-indicator {
    text-align: center;
    color: var(--fm-text-muted);
    font-size: 14px;
    margin: 20px 0 8px;
}
.page-indicator strong {
    color: var(--fm-text);
    font-weight: 600;
}

.glossary-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 28px;
    padding: 14px 18px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid var(--fm-border);
    border-radius: 14px;
}
.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pagination-page,
.pagination-prev,
.pagination-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--fm-text);
    background: var(--fm-card);
    border: 1px solid var(--fm-border);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.pagination-page:hover,
.pagination-prev:hover,
.pagination-next:hover {
    background: rgba(124, 58, 237, 0.18);
    border-color: var(--fm-accent);
    color: var(--fm-text);
    transform: translateY(-1px);
}
.pagination-current {
    background: var(--fm-accent) !important;
    border-color: var(--fm-accent);
    color: white !important;
    cursor: default;
}
.pagination-current:hover {
    transform: none;
}
.pagination-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    border-color: transparent;
}
.pagination-disabled:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
}

/* The bottom pagination strip is the same look but visually slightly
   stronger so users notice it after scrolling through 50 cards. */
.glossary-main + .glossary-pagination,
.glossary-layout + .glossary-pagination {
    margin-top: 32px;
}

@media (max-width: 640px) {
    .glossary-pagination {
        gap: 10px;
        padding: 12px;
    }
    .pagination-page,
    .pagination-prev,
    .pagination-next {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    .pagination-pages { gap: 4px; }
}
