/* The manual of SCL Control Horario (control-horario/manual.html): the sections on the side, and
   each step with the screen it happens on. */

.manual {
    padding: 8.5rem 0 4rem;
}

.manual-head,
.manual-layout {
    max-width: 1080px;
}

.manual-head h1 {
    font-size: 2.5rem;
    color: var(--heading);
    margin-bottom: 0.5rem;
}

.manual-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 3rem;
}

.manual-toc {
    position: sticky;
    top: 6rem;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    font-size: 0.9375rem;
}

.manual-toc summary {
    display: none;
}

.manual-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.manual-toc li {
    margin: 0;
}

.manual-toc a {
    display: block;
    padding: 0.3rem 0.75rem;
    border-inline-start: 2px solid var(--border-light);
    color: var(--text-muted);
    text-decoration: none;
}

.manual-toc a:hover {
    color: var(--heading);
    border-inline-start-color: var(--primary);
}

.manual-body {
    max-width: 780px;
}

.manual-lead {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.manual-body section {
    scroll-margin-top: 6rem;
}

.manual-body section:first-child h2 {
    margin-top: 0;
}

.manual-body h2 {
    font-size: 1.625rem;
    color: var(--heading);
    margin: 2.5rem 0 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.manual-body h3 {
    font-size: 1.125rem;
    color: var(--heading);
    margin: 1.75rem 0 0.5rem;
}

/* a part of a chapter's steps: 1. Install Tailscale, 2. Put the program on the internet */
.manual-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    margin: 1.5rem 0 0.5rem;
}

.manual-body strong {
    color: var(--heading);
    font-weight: 600;
}

.manual-body p,
.manual-body li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.manual-body p {
    margin-bottom: 1rem;
}

.manual-body ul,
.manual-body ol {
    padding-inline-start: 1.5rem;
    margin-bottom: 1rem;
}

.manual-body li {
    margin-bottom: 0.4rem;
}

.manual-body a:not(.btn) {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* where something is in the program: Settings › Attendance › Kinds of day */
.manual-body .where {
    color: var(--heading);
    font-weight: 600;
}

.manual-body code {
    font-size: 0.9em;
    overflow-wrap: anywhere;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--bg-alt);
    color: var(--heading);
}

.manual-shot {
    margin: 1.25rem 0 1.75rem;
}

.manual-shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    background: #f3f3f3;
}

/* a small window (the installer) at its own size, not stretched */
.manual-shot-narrow img {
    max-width: 600px;
}

.manual-shot figcaption {
    margin-top: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* the App Store and Google Play badges of the Fichar app */
.manual-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0 1.5rem;
}

.manual-stores img {
    display: block;
    height: 40px;
    width: auto;
}

.manual-note {
    margin: 1.25rem 0;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    background: var(--primary-subtle);
    color: var(--heading);
    font-size: 0.9375rem;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .manual {
        padding-top: 6.5rem;
    }

    .manual-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .manual-toc {
        position: static;
        max-height: none;
        border: 1px solid var(--border-light);
        border-radius: 8px;
        padding: 0.75rem 1rem;
    }

    .manual-toc summary {
        display: list-item;
        cursor: pointer;
        font-weight: 600;
        color: var(--heading);
    }

    .manual-toc[open] summary {
        margin-bottom: 0.5rem;
    }

    .manual-head h1 {
        font-size: 2rem;
    }
}

/* the button that saves it as a PDF: the browser's own print, over the rules below */
.manual-pdf {
    margin: 0 0 2.5rem;
}

/* Printed or saved as a PDF: the manual alone, a section per page, no screen cut in two. */
@media print {
    @page {
        size: A4;
        margin: 16mm 14mm;
    }

    .topbar,
    .tabbar,
    .tabbar-sheet,
    footer,
    .manual-toc summary,
    .manual-pdf {
        display: none !important;
    }

    /* the contents on the first page, under the title */
    .manual-toc {
        position: static;
        max-height: none;
        overflow: visible;
        margin: 2rem 0 0;
        font-size: 12pt;
    }

    .manual-toc ol {
        list-style: decimal;
        padding-inline-start: 1.5rem;
    }

    .manual-toc a {
        display: inline;
        padding: 0;
        border: 0;
        color: #1c2024;
    }

    body,
    .manual {
        background: #fff;
    }

    .manual {
        padding: 0;
    }

    .manual-head,
    .manual-layout {
        display: block;
        max-width: none;
    }

    .manual-body {
        max-width: none;
    }

    .manual-head h1 {
        font-size: 2rem;
    }

    .manual-body h2 {
        break-before: page;
        border-top: 0;
        padding-top: 0;
        margin-top: 0;
    }

    .manual-body h3,
    .manual-body h4 {
        break-after: avoid;
    }

    .manual-body p,
    .manual-body li {
        font-size: 10.5pt;
        line-height: 1.55;
        color: #1c2024;
    }

    .manual-shot,
    .manual-body li {
        break-inside: avoid;
    }

    /* a small window at the size of a window on a page, not the page's width */
    .manual-shot-narrow img {
        max-width: 11cm;
    }

    .manual-shot img {
        box-shadow: none;
    }

    /* a link of the text stays one in the PDF: it opens with a click */
    .manual-body a:not(.btn) {
        color: #0b57d0;
        text-decoration: underline;
    }

    .manual-body code {
        background: #f1f3f5;
        color: #1c2024;
    }
}
