/**
 * PB Academy 2.1 - Lesson Template Styles
 *
 * Section context bar, lesson header, featured image, body, TOC, nav, access gate.
 * Loaded automatically by Framework_Loader for template type "academy-lesson".
 *
 * Imports shell.css (topbar, sidebar) via relative path.
 */

@import url('../shared/shell.css?v=20260327h');

/* ─── Content layout (main article + TOC sidebar) ───────────────────── */
.ac-content-layout {
    display: flex;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.ac-main-content {
    flex: 1;
    min-width: 0;
    max-width: 780px;
    padding: 40px 32px 80px;
}

/* ─── Section Context Bar (sticky) ──────────────────────────────────── */
.ac-section-context-bar {
    position: sticky;
    top: var(--ac-topbar-h, 52px);
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 32px;
    background: #fff;
    border-bottom: 1px solid var(--ac-gray-200, #e5e7eb);
    margin: -40px -32px 0;
    margin-bottom: 40px;
}

.ac-section-context-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ac-navy, #152F5E);
    white-space: nowrap;
    flex-shrink: 0;
}

.ac-section-context-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ac-section-context-progress-bar {
    width: 48px;
    height: 4px;
    background: var(--ac-gray-200, #e5e7eb);
    border-radius: 3px;
    overflow: hidden;
}

.ac-section-context-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ac-gold, #F4C542), var(--ac-amber, #F6A722));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ac-section-context-progress-pct {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--ac-gold-dark, #d4a722);
}

.ac-section-context-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.ac-section-context-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ac-navy-lighter, #44597f);
    background: var(--ac-gray-100, #f3f4f6);
    border: 1px solid var(--ac-gray-200, #e5e7eb);
    border-radius: var(--ac-radius, 6px);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.ac-section-context-pill:hover {
    background: var(--ac-gold-bg, #fffbeb);
    border-color: var(--ac-gold-light, #fef3c7);
    color: var(--ac-navy, #152F5E);
}
.ac-section-context-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
/* Member pill with no test/webinar URL — simple disabled */
.ac-section-context-pill[aria-disabled="true"]:not(.ac-section-context-pill--locked) {
    opacity: 0.5;
    pointer-events: none;
}
/* Non-member locked pill — visible but blocked */
.ac-section-context-pill--locked {
    color: var(--ac-gray-400, #9ca3af);
    background: var(--ac-gray-50, #f9fafb);
    border-color: var(--ac-gray-200, #e5e7eb);
    cursor: not-allowed;
}
.ac-section-context-pill--locked:hover {
    background: var(--ac-gray-100, #f3f4f6);
    border-color: var(--ac-gray-300, #d1d5db);
}
.ac-section-context-pill--locked svg {
    width: 12px;
    height: 12px;
    color: var(--ac-gray-400, #9ca3af);
}

/* ─── Lesson Header ─────────────────────────────────────────────────── */
.ac-lesson-header {
    margin-bottom: 0;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--ac-gold-light, #fef3c7);
}

.ac-lesson-position {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ac-gray-400, #9ca3af);
    margin-bottom: 6px;
}

.ac-lesson-title-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.ac-lesson-title-row .ac-lesson-title {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.ac-main-content .ac-lesson-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ac-gray-900, #0a0a0a);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

/* Font-size button (inline in lesson header) */
.ac-font-size-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ac-gray-400, #9ca3af);
    background: none;
    border: 1px solid var(--ac-gray-200, #e5e7eb);
    border-radius: var(--ac-radius, 6px);
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    flex-shrink: 0;
    align-self: center;
}
.ac-font-size-btn:hover {
    background: var(--ac-gray-100, #f3f4f6);
    color: var(--ac-gray-600, #4b5563);
    border-color: var(--ac-gray-300, #d1d5db);
}

/* ─── Featured Image ────────────────────────────────────────────────── */
.ac-lesson-featured-image {
    margin: 0 0 32px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
.ac-lesson-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 0 8px 8px;
}

/* ─── Lesson Body ────────────────────────────────────────────────────── */
.ac-lesson-body {
    font-size: 1rem;
    line-height: 1.75;
    color: #4a5568;
}

.ac-lesson-body h2,
.ac-lesson-body h3,
.ac-lesson-body h4 {
    scroll-margin-top: 110px;
}
.ac-lesson-body h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0a0a0a;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.01em;
    padding-top: 0.5rem;
}
.ac-lesson-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1.5rem 0 0.5rem;
}
.ac-lesson-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.4rem;
}
.ac-lesson-body p { margin-bottom: 1.1rem; }
.ac-lesson-body ul,
.ac-lesson-body ol { margin: 0 0 1.1rem 1.5rem; }
.ac-lesson-body li { margin-bottom: 0.4rem; }
.ac-lesson-body strong { color: #0a0a0a; font-weight: 600; }
.ac-lesson-body a { color: #152F5E; text-decoration: underline; }
.ac-lesson-body a:hover { color: #1e3f78; }
.ac-lesson-body figure { margin: 1.5rem 0; border-radius: 8px; overflow: hidden; }
.ac-lesson-body figure img { width: 100%; height: auto; display: block; }
.ac-lesson-body blockquote {
    border-left: 3px solid #F4C542;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: #fffbeb;
    color: #374151;
    font-style: italic;
}
.ac-lesson-body pre {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

/* ─── Access Gate ────────────────────────────────────────────────────── */
.ac-access-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 24px;
}
.ac-access-gate__icon {
    width: 64px;
    height: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}
.ac-access-gate__icon svg { width: 100%; height: 100%; }
.ac-access-gate__heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: #152F5E;
    margin: 0 0 12px;
}
.ac-access-gate__text {
    font-size: 0.95rem;
    color: #6b7280;
    max-width: 480px;
    margin: 0 0 24px;
    line-height: 1.6;
}
.ac-access-gate__btn {
    background: #152F5E;
    color: #fff;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
}
.ac-access-gate__btn:hover { background: #1e3f78; }

/* ─── Mark as Complete ───────────────────────────────────────────────── */
.ac-complete-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.ac-btn-complete {
    background: #152F5E;
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, transform 0.1s;
}
.ac-btn-complete:hover { background: #1e3f78; }
.ac-btn-complete:active { transform: scale(0.98); }
.ac-btn-complete svg { width: 16px; height: 16px; }

.ac-btn-complete.completed {
    background: #059669;
    cursor: default;
}
.ac-btn-complete.completed:hover { background: #059669; }

/* ─── Lesson Navigation ──────────────────────────────────────────────── */
.ac-lesson-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 2px solid #fef3c7;
    gap: 12px;
}

.ac-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    max-width: 48%;
}
.ac-nav-btn:hover {
    border-color: #F4C542;
    color: #152F5E;
    background: #fffbeb;
}
.ac-nav-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.ac-nav-btn--invisible { visibility: hidden; }

.ac-nav-btn__label {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ac-nav-btn__direction {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9ca3af;
    line-height: 1;
}
.ac-nav-btn:hover .ac-nav-btn__direction { color: #d4a722; }
.ac-nav-btn__title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: #374151;
}
.ac-nav-btn:hover .ac-nav-btn__title { color: #152F5E; }

/* Next button (right-aligned) */
.ac-nav-btn--next {
    flex-direction: row-reverse;
    text-align: right;
}
.ac-nav-btn--next .ac-nav-btn__label { align-items: flex-end; }

/* ─── TOC Sidebar (right, desktop only) ─────────────────────────────── */
.ac-toc-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: relative;
}

.ac-toc-inner {
    position: sticky;
    top: calc(var(--ac-topbar-h, 52px) + 40px);
    max-height: calc(100vh - var(--ac-topbar-h, 52px) - 80px);
    overflow-y: auto;
    padding: 0 0 20px;
}
.ac-toc-inner::-webkit-scrollbar { width: 3px; }
.ac-toc-inner::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.ac-toc-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 12px;
    padding-left: 12px;
}
.ac-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid #e5e7eb;
}
.ac-toc-link {
    display: block;
    padding: 5px 12px;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #6b7280;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.ac-toc-link:hover { color: #374151; }
.ac-toc-link.active {
    color: #152F5E;
    font-weight: 600;
    border-left-color: #F4C542;
}
.ac-toc-link.ac-toc-h3 {
    padding-left: 24px;
    font-size: 0.70rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .ac-toc-sidebar { display: none; }
}

@media (max-width: 1024px) {
    .ac-main-content { padding: 32px 24px 60px; }
    .ac-section-context-bar { padding: 10px 24px; margin: -32px -24px 0; margin-bottom: 32px; }
}

@media (max-width: 768px) {
    .ac-main-content { padding: 24px 16px 60px; }

    /* Context bar — pills wrap to second line on mobile */
    .ac-section-context-bar {
        gap: 8px;
        padding: 8px 16px;
        margin: -24px -16px 0;
        margin-bottom: 24px;
    }
    .ac-section-context-pills { margin-left: 0; width: 100%; }

    .ac-main-content .ac-lesson-title { font-size: 1.5rem; }

    .ac-lesson-nav { flex-direction: column; }
    .ac-nav-btn { width: 100%; justify-content: flex-start; max-width: 100%; }
    .ac-nav-btn--next { flex-direction: row; text-align: left; }
    .ac-nav-btn--next .ac-nav-btn__label { align-items: flex-start; }
}
