/* Learn page — TOC sidebar and content layout */

/* Sticky sidebar (desktop) — wraps search + TOC together */
.learn-sidebar-sticky {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.learn-toc {
    /* Inner TOC inside the sticky wrapper — no longer sticky on its own */
}

/* Mobile sticky search + TOC */
@media (max-width: 991.98px) {
    .learn-mobile-sticky {
        position: sticky;
        top: 64px;
        z-index: 5;
        background: var(--bs-body-bg);
        padding: 0.5rem 0;
        margin: 0 -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        border-bottom: 1px solid var(--bs-border-color);
    }
}

.learn-toc .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    border-left: 2px solid transparent;
}

.learn-toc .nav-link:hover {
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
}

/* Mobile TOC — horizontal badge bar */
.learn-toc-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Category sections */
.learn-category {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 2rem;
}

.learn-category:last-child {
    border-bottom: none;
}

/* Entry styling */
.learn-entry {
    padding-left: 1rem;
    border-left: 3px solid var(--bs-border-color);
}

.learn-entry h3 {
    font-size: 1.25rem;
}

.learn-entry-body {
    font-size: 0.95rem;
    line-height: 1.7;
}

.learn-entry-body ul,
.learn-entry-body ol {
    padding-left: 1.5rem;
}

.learn-entry-body video {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.learn-see-also a {
    text-decoration: none;
}

.learn-see-also a:hover {
    text-decoration: underline;
}

/* Search bar */
.learn-search-bar {
    position: relative;
}

.learn-search-bar input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.learn-search-bar input:focus {
    border-color: var(--bs-primary);
}

.learn-search-bar::before {
    content: "⌕";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    pointer-events: none;
}

.learn-search-empty {
    display: none;
    padding: 2rem 0;
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
}

/* Entry image block */
.learn-entry-image {
    margin: 0.75rem 0 1rem;
}

.learn-entry-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    display: block;
}

/* Annotated / Plain toggle */
.learn-image-toggle {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.learn-image-toggle button {
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.learn-image-toggle button.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.learn-image-toggle button:not(.active):hover {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

/* Entry-title link: keep heading appearance, reveal link affordance on hover. */
.learn-entry-title-link {
    color: inherit;
    text-decoration: none;
}
.learn-entry-title-link:hover,
.learn-entry-title-link:focus {
    color: var(--bs-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Glossary index entries are now summaries — title + one-line description +
   "Read more" link to the focused page. Tighter spacing than the previous
   full-body layout. */
.learn-entry--summary {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(255, 255, 255, 0.08));
}
.learn-entry--summary:last-child {
    border-bottom: none;
}
.learn-entry-readmore {
    color: var(--bs-primary);
    text-decoration: none;
    font-weight: 500;
}
.learn-entry-readmore:hover,
.learn-entry-readmore:focus {
    text-decoration: underline;
    text-underline-offset: 3px;
}
