/**
 * Linked List tutorial pages (body.ll-tutorial-page)
 * — base font + justified main column. New pages: link ll-pages.css after menus.css
 */

body.ll-tutorial-page {
    font-size: 1rem;
    line-height: 1.6;
}

@media (min-width: 992px) {
    body.ll-tutorial-page {
        font-size: 1.0625rem;
    }
}

/* Wider reading column (sidebar uses separate column in grid) */
body.ll-tutorial-page main.main-content.ll-main {
    max-width: 62rem;
}

/* Main column: justified reading text (sidebar is outside <main>) */
body.ll-tutorial-page main {
    text-align: justify;
}

/* Headings & UI: keep visually aligned start */
body.ll-tutorial-page main h1,
body.ll-tutorial-page main h2,
body.ll-tutorial-page main h3,
body.ll-tutorial-page main h4,
body.ll-tutorial-page main h5,
body.ll-tutorial-page main h6,
body.ll-tutorial-page main .ll-index-card h3,
body.ll-tutorial-page main .breadcrumb {
    text-align: left;
}

/* Index rows: serial + link layout reads better left-aligned */
body.ll-tutorial-page main .ll-index-card li {
    text-align: left;
}

/* Lesson page main titles (h2 inside tutorial sections) */
body.ll-tutorial-page main .ll-tutorial-section > h2 {
    color: #ffffff;
    background: linear-gradient(90deg, #db2777 0%, #2563eb 46%, #7c3aed 100%);
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 0.7rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    padding-bottom: 0.45rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(244, 114, 182, 0.82), rgba(59, 130, 246, 0.75), rgba(139, 92, 246, 0.78)) 1;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.22);
}

/* Code blocks */
body.ll-tutorial-page main pre,
body.ll-tutorial-page main .hljs,
body.ll-tutorial-page main figure {
    text-align: left;
}

/* Explicit centered blocks */
body.ll-tutorial-page main .text-center,
body.ll-tutorial-page main p.text-center {
    text-align: center !important;
}

/* Previous / next topic (injected by leftmenubar-ll.js) */
body.ll-tutorial-page .ll-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(219, 39, 119, 0.35), rgba(13, 148, 136, 0.35)) 1;
    text-align: left;
}

@media (max-width: 575.98px) {
    body.ll-tutorial-page .ll-prev-next {
        grid-template-columns: 1fr;
    }
    body.ll-tutorial-page .ll-prev-next__link--next {
        justify-self: stretch !important;
        text-align: left !important;
    }
}

body.ll-tutorial-page .ll-prev-next__link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(219, 39, 119, 0.22);
    background: linear-gradient(180deg, #ffffff, #fdf2f8);
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

body.ll-tutorial-page .ll-prev-next__link:hover {
    border-color: rgba(219, 39, 119, 0.45);
    box-shadow: 0 4px 18px rgba(190, 24, 93, 0.12);
    color: #831843;
}

body.ll-tutorial-page .ll-prev-next__link--prev {
    justify-self: start;
    text-align: left;
}

body.ll-tutorial-page .ll-prev-next__link--next {
    justify-self: end;
    text-align: right;
}

body.ll-tutorial-page .ll-prev-next__dir {
    font-size: 0.8rem;
    font-weight: 700;
    color: #db2777;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.ll-tutorial-page .ll-prev-next__title {
    font-size: 0.98rem;
    color: #0f172a;
    line-height: 1.35;
}

body.ll-tutorial-page .ll-prev-next__placeholder {
    visibility: hidden;
    min-height: 0;
    pointer-events: none;
}

body.ll-tutorial-page .ll-prev-next--no-prev {
    grid-template-columns: 1fr;
}

body.ll-tutorial-page .ll-prev-next--no-prev .ll-prev-next__placeholder {
    display: none;
}

body.ll-tutorial-page .ll-prev-next--no-prev .ll-prev-next__link--next {
    justify-self: stretch;
    text-align: left;
}

body.ll-tutorial-page .ll-prev-next--no-next {
    grid-template-columns: 1fr;
}

body.ll-tutorial-page .ll-prev-next--no-next .ll-prev-next__placeholder {
    display: none;
}

body.ll-tutorial-page .ll-prev-next--no-next .ll-prev-next__link--prev {
    justify-self: stretch;
}

/* Bottom-of-lesson nav: All topics + Data Structures Hub (and index hub extras) */
body.ll-tutorial-page .ll-tutorial-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-top: 2rem;
    padding-top: 1.35rem;
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(219, 39, 119, 0.35), rgba(13, 148, 136, 0.35)) 1;
}

body.ll-tutorial-page .ll-footer-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    line-height: 1.3;
    border: 2px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
}

body.ll-tutorial-page .ll-footer-nav-btn:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

body.ll-tutorial-page .ll-footer-nav-btn--topics {
    color: #831843;
    background: linear-gradient(180deg, #ffffff, #fdf2f8);
    border-color: rgba(219, 39, 119, 0.38);
    box-shadow: 0 2px 10px rgba(190, 24, 93, 0.1);
}

body.ll-tutorial-page .ll-footer-nav-btn--topics:hover {
    color: #fff;
    background: linear-gradient(90deg, #be185d, #db2777);
    border-color: #be185d;
    box-shadow: 0 4px 18px rgba(190, 24, 93, 0.28);
    transform: translateY(-1px);
}

body.ll-tutorial-page .ll-footer-nav-btn--hub {
    color: #0f766e;
    background: linear-gradient(180deg, #ffffff, #f0fdfa);
    border-color: rgba(13, 148, 136, 0.42);
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.1);
}

body.ll-tutorial-page .ll-footer-nav-btn--hub:hover {
    color: #fff;
    background: linear-gradient(90deg, #0f766e, #0d9488);
    border-color: #0d9488;
    box-shadow: 0 4px 18px rgba(13, 148, 136, 0.24);
    transform: translateY(-1px);
}

body.ll-tutorial-page .ll-footer-nav-btn--secondary {
    color: #be185d;
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(219, 39, 119, 0.45);
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.06);
}

body.ll-tutorial-page .ll-footer-nav-btn--secondary:hover {
    background: linear-gradient(90deg, #fdf2f8, #f0fdfa);
    border-color: #db2777;
    color: #831843;
    box-shadow: 0 4px 14px rgba(219, 39, 119, 0.15);
    transform: translateY(-1px);
}

/* Copy button on <pre><code> blocks (injected by leftmenubar-ll.js) */
body.ll-tutorial-page main .ll-pre-copyable {
    position: relative;
    padding-top: 2.4rem;
}

body.ll-tutorial-page main .ll-code-copy-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.65rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.ll-tutorial-page main .ll-code-copy-btn:hover {
    background: rgba(219, 39, 119, 0.85);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

body.ll-tutorial-page main .ll-code-copy-btn:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

body.ll-tutorial-page main .ll-code-copy-btn.ll-code-copy-btn--done {
    background: rgba(13, 148, 136, 0.9);
    border-color: rgba(255, 255, 255, 0.45);
}
