@charset "UTF-8";
/* ============================================================
   geom.css — учебник стереометрии (общие стили разделов)
   ============================================================ */

/* ===== MAIN CONTAINER ===== */
.container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 80px auto 40px;
    padding: 20px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 340px;
    flex-shrink: 0;

    border-radius: 12px;
    padding: 0;
    height: fit-content;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}
.sidebar-inner {
    height: 100%;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 16px 16px 20px 16px;
    border-radius: 12px;
}
.sidebar-inner::-webkit-scrollbar {
    width: 4px;
}
.sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 16px;
}
.sidebar-inner::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 16px;
    transition: background 0.2s ease;
}
.sidebar-inner::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
.sidebar-inner {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-title i {
    color: var(--text-secondary);
}

/* ===== MENU GROUPS ===== */
.menu-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}
.menu-group:last-child {
    margin-bottom: 0;
}

.menu-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
}
.menu-group-header:hover {
    background: var(--bg-surface);
}
.menu-group-header .group-icon {
    color: var(--text-secondary);
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.menu-group-header .group-title {
    flex: 1;
}
.menu-group-header .group-arrow {
    font-size: 12px;
    color: var(--text-tertiary);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: auto;
}
.menu-group-header.collapsed .group-arrow {
    transform: rotate(-90deg);
}

.menu-group-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
    padding-left: 8px;
}
.menu-group-items.collapsed {
    max-height: 0;
    opacity: 0;
}

/* До полной загрузки не анимируем восстановление меню (без "дёрганья") */
.menu-preload .menu-group-items {
    transition: none !important;
}

.menu-group-items .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 36px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-bottom: 1px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.menu-group-items .sidebar-nav-item:hover {
    background: var(--bg-surface);
    border-left-color: var(--text-secondary);
    color: var(--text-primary);
}
.menu-group-items .sidebar-nav-item.active {
    background: var(--bg-surface);
    border-left-color: var(--text-primary);
    color: var(--text-primary);

}
.menu-group-items .sidebar-nav-item .nav-number {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 12px;
    flex-shrink: 0;
    min-width: 22px;
}
.menu-group-items .sidebar-nav-item .nav-icon {
    font-size: 12px;
    color: var(--text-tertiary);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.menu-group-items .sidebar-nav-item.active .nav-icon {
    color: var(--text-primary);
}
.menu-group-items .sidebar-nav-item .nav-text {
    flex: 1;
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 32px 36px;
    min-height: 500px;
}

.page-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}
.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header h1 i {
    color: var(--text-secondary);
    font-size: 24px;
}
.page-header p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ===== SECTIONS (single section per page) ===== */

/* При полной перезагрузке страницы анимация подъёма блоков даёт «мигание» —
   исключаем плавный сдвиг, контент появляется сразу и стабильно */

.theory-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.theory-section h2 .section-number {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-tertiary);
    background: var(--bg-surface);
    padding: 2px 12px;
    border-radius: 16px;
}
.theory-section h2 i {
    color: var(--text-secondary);
    font-size: 18px;
}

.theory-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 18px;
    margin-bottom: 8px;
}

.theory-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 14px;
    margin-bottom: 4px;
}

.theory-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.theory-section ul,
.theory-section ol {
    padding-left: 24px;
    margin-bottom: 10px;
}
.theory-section li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.definition-block {
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-chart);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0 14px 0;
}
.definition-block strong {
    color: var(--text-primary);
}

.theorem-block {
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-chart);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0 14px 0;
}
.theorem-block strong {
    color: var(--text-primary);
}
.theorem-block .theorem-title {
    font-weight: 600;
    color: var(--accent-chart);
    font-size: 15px;
    margin-bottom: 4px;
}

.proof-block {
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 10px 0 14px 0;
}
.proof-block .proof-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 6px;
}
.proof-block p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.axiom-block {
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-danger);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0 14px 0;
}
.axiom-block .axiom-title {
    font-weight: 600;
    color: var(--accent-danger);
    font-size: 15px;
    margin-bottom: 4px;
}

.note-block {
    background: var(--bg-surface);
    border-left: 4px solid var(--accent-success);
    padding: 10px 16px;
    border-radius: 0 8px 8px 0;
    margin: 10px 0 14px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.note-block i {
    color: var(--accent-success);
    margin-right: 6px;
}

.image-placeholder {
    background: var(--bg-surface);
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin: 10px 0 14px 0;
    color: var(--text-tertiary);
    font-size: 14px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.image-placeholder i {
    font-size: 18px;
    color: var(--text-tertiary);
}

.subtopic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0 14px 0;
}
.subtopic-grid .two-col,
.subtopic-grid.two-col {
    grid-template-columns: repeat(2, 1fr);
}
.subtopic-grid .subtopic-card {
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s;
}
.subtopic-grid .subtopic-card:hover {
    background: var(--bg-surface);
    border-color: var(--border-light);
}
.subtopic-grid .subtopic-card .subtopic-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}
.subtopic-grid .subtopic-card .subtopic-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.subtopic-grid .subtopic-card .subtopic-math {
    font-family: 'Times New Roman', 'Liberation Serif', Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}
.subtopic-card {
    display: flex;
    flex-direction: column;
}

/* ===== TRAINER CARDS (страница «Метод следов: тренажеры») ===== */
.ms-trainers .subtopic-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    min-height: 100%;
}
.ms-trainers .subtopic-card:hover {
    background: var(--bg-surface);
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.ms-trainers .ms-trainer-img {
    width: 100%;
    height: 130px;
    object-fit: contain;
    display: block;
    border: none;
    padding: 10px;
    box-sizing: border-box;
    background: var(--bg-canvas);
    border-radius: 8px 8px 0 0;
}
.ms-trainers .ms-trainer-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.ms-trainers .subtopic-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.ms-trainers .subtopic-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.ms-trainers .ms-trainer-go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-primary-text);
    background: var(--btn-primary-bg);
    padding: 8px 16px;
    border-radius: 20px;
    align-self: flex-start;
    margin-top: auto;
}

.figure-scene {
    position: relative;
    height: 200px;
    margin: -10px -14px 10px -14px;
    border-radius: 8px 8px 0 0;
    background: var(--bg-canvas);
    overflow: hidden;
    flex-shrink: 0;
}
.figure-scene canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.figure-scene.ready canvas {
    opacity: 1;
}

.figure-label {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    white-space: nowrap;
    text-shadow: 0 0 4px var(--bg-canvas);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 2;
}

.figure-scene.ready .figure-label {
    opacity: 1;
}

.figure-label-plane,
.figure-label-line {
    font-style: italic;
}

/* Solution button hidden in theory */
.solution-btn {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    .container {
        gap: 20px;
        padding: 16px;
    }
    .content {
        padding: 24px 20px;
    }
}

@media (max-width: 820px) {
    .container {
        flex-direction: column;
        gap: 16px;
        padding: 12px;
        margin-top: 72px;
    }
    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-radius: 12px;
    }
    .sidebar-inner {
        max-height: none;
        padding: 12px 14px;
    }
    .sidebar-title {
        font-size: 16px;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .menu-group-header {
        font-size: 13px;
        padding: 6px 10px;
    }
    .menu-group-items .sidebar-nav-item {
        padding: 5px 10px 5px 28px;
        font-size: 12px;
    }
    .content {
        padding: 18px 16px;
        border-radius: 12px;
    }
    .page-header h1 {
        font-size: 22px;
    }
    .page-header p {
        font-size: 14px;
    }
    .theory-section h2 {
        font-size: 19px;
    }
    .theory-section h3 {
        font-size: 16px;
    }
    .theory-section p {
        font-size: 14px;
    }
    .definition-block,
    .theorem-block,
    .axiom-block {
        padding: 10px 14px;
    }
    .subtopic-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
        margin-top: 64px;
    }
    .content {
        padding: 14px 12px;
    }
    .subtopic-grid,
    .subtopic-grid.two-col {
        grid-template-columns: 1fr;
    }
    .page-header h1 {
        font-size: 19px;
    }
    .theory-section h2 {
        font-size: 17px;
    }
    .menu-group-items .sidebar-nav-item {
        padding: 4px 8px 4px 24px;
        font-size: 11px;
    }
    .menu-group-items .sidebar-nav-item .nav-number {
        min-width: 18px;
        font-size: 10px;
    }
}

/* ============================================================
   МЕТОД СЛЕДОВ: БЛОК-СХЕМА АЛГОРИТМА ПОСТРОЕНИЯ СЕЧЕНИЙ
   ============================================================ */

.alg-desc {
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 20px;
}

/* ============================================================
   МЕТОД СЛЕДОВ: ПОШАГОВЫЙ АЛГОРИТМ (общие стили с /math)
   ============================================================ */

.alg-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.alg-step:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.step-num {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-text strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-text p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.step-text .alg-hint {
    margin-top: 6px;
    padding: 8px 14px;
    background: var(--bg-canvas);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-chart);
}

.alg-result {
    padding: 14px 18px;
    background: var(--bg-canvas);
    border-radius: 10px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.alg-result strong {
    color: var(--text-primary);
}

.flowchart-svg-wrapper {
    max-width: 750px;
    margin: 0 auto;
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.flowchart-svg {
    width: 100%;
    height: auto;
    display: block;
    background: var(--bg-base);
    border-radius: 12px;
}

@media (max-width: 480px) {
    .flowchart-svg-wrapper {
        padding: 4px 0;
    }
}

/* ============================================================
   МОБИЛЬНАЯ НАВИГАЦИЯ /geom: полоска раздела, пейджер «назад/далее»
   и меню-шторка с содержанием (разметку создаёт js/mobile-nav.js)
   ============================================================ */

.geom-mobile-chapter {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 42px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    margin: 0;
    border: none;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 995;
    text-align: left;
    font-family: 'Inter', sans-serif;
}
.geom-mobile-chapter > i {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}
.geom-mobile-chapter:active {
    background: var(--bg-surface);
}
.geom-chapter-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.geom-chapter-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    flex-shrink: 0;
}
.geom-chapter-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.geom-chapter-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-radius: 6px;
    padding: 4px 8px;
    flex-shrink: 0;
}
.geom-chapter-hint i {
    font-size: 11px;
}

.geom-mobile-pager {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    background: var(--bg-base);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 996;
}
.geom-mobile-pager a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 50%;
    height: 46px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s ease;
}
.geom-mobile-pager a + a {
    border-left: 1px solid var(--border-light);
}
.geom-mobile-pager a:active {
    background: var(--bg-surface);
}
.geom-mobile-pager a.disabled {
    color: var(--text-tertiary);
    opacity: 0.55;
    pointer-events: none;
}
.geom-mobile-pager a i {
    font-size: 12px;
}

.geom-drawer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 30px;
    height: 30px;
    display: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.geom-drawer-close:active {
    background: var(--bg-surface);
}

.geom-drawer-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(20, 24, 40, 0.38);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 820px) {
    .geom-mobile-chapter {
        display: flex;
    }
    .geom-mobile-pager {
        display: flex;
    }
    .geom-drawer-close {
        display: flex;
    }
    .geom-drawer-overlay {
        display: block;
    }
    .geom-drawer-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    body.geom-mobile-drawer {
        padding-bottom: 56px;
    }
    body.geom-mobile-drawer .container {
        margin-top: 108px;
    }

    body.geom-mobile-drawer .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        max-height: none;
        width: min(340px, 88vw);
        border-radius: 0;
        background: var(--bg-base);
        border-right: 1px solid var(--border-light);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        z-index: 1200;
    }
    body.geom-mobile-drawer.geom-drawer-open .sidebar {
        transform: translateX(0);
    }
    body.geom-mobile-drawer.geom-drawer-open {
        overflow: hidden;
    }
    html.geom-mobile-drawer.geom-drawer-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    body.geom-mobile-drawer .sidebar {
        width: 86vw;
    }
    .geom-chapter-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.geom-mobile-drawer .sidebar,
    .geom-drawer-overlay {
        transition: none;
    }
}