/* Digital manual. Only loaded on manual pages; every selector is scoped to manual or rich-toggle classes. */

/* The site's body text is 0.75rem with line-height 1, and links are bold. Give the manual the size of the site's running text (.rich-text). */
.manual-steps,
.manual-page {
    font-size: 1.05rem;
    line-height: 1.65;
}

/* Cards, rows and the step bar are links as a whole: no underline, and only the titles are bold */
.manual-steps a:hover,
.manual-step-cards a:hover,
.manual-cards a:hover,
.manual-rows a:hover,
.manual-breadcrumb a:hover {
    text-decoration: none;
}

.manual-step-cards p,
.manual-card-summary {
    font-weight: 400;
    font-variation-settings: 'wght' 400, 'wdth' 100;
}

/* Cover: same frame as the pages (step bar, narrow column, heading size), with the steps as cards */
.manual-eyebrow {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-top: 0.75rem;
}

.manual-page .manual-lead {
    font-size: 1.15rem;
    max-width: 40rem;
    margin: 0 0 2rem;
}

.manual-step-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.manual-step-cards a {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--card-background-color);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.manual-step-cards a:hover,
.manual-step-cards a:focus-visible {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.manual-step-cards h2 {
    font-size: 1.25rem;
    margin: 0.5rem 0 0;
}

.manual-step-cards p {
    margin: 0;
}

.manual-step-go {
    margin-top: auto;
    padding-top: 0.5rem;
    color: var(--color-primary);
    font-weight: 600;
}

.manual-step-cards .manual-step-number {
    width: 2.25rem;
    height: 2.25rem;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-contrast);
}

.manual-cover-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin-top: 2rem;
}

.manual-cover-links a {
    font-weight: 600;
    text-decoration: none;
    color: var(--color-primary);
}

@media (max-width: 500px) {
    .manual-step-cards {
        grid-template-columns: 1fr;
    }
}

/* Step bar, sticks below the site header. On manual pages the step bar casts the scroll shadow instead of the header. */
#header.scrolled {
    box-shadow: none;
}

.manual-steps {
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.manual-steps.scrolled {
    box-shadow: 0 12px 24px 0 rgb(0 0 0 / 14%);
}

.manual-steps ol {
    list-style: none;
    /* Only vertical padding, so the horizontal padding from .content stays intact on mobile */
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.manual-steps a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.4rem 0.6rem;
    border-radius: 100px;
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 600;
    font-variation-settings: 'wght' 600, 'wdth' 100;
    text-decoration: none;
}

.manual-steps a:hover {
    background: var(--background-color-gray);
    color: var(--color-text-dark);
}

.manual-steps-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manual-step-number {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1.5px solid var(--border-color-darker);
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.manual-steps a.manual-steps-past .manual-step-number {
    background: #12a150;
    border-color: #12a150;
    color: #fff;
}

.manual-steps a.manual-steps-current {
    background: var(--color-primary-bg);
    color: var(--color-text-dark);
}

.manual-steps a.manual-steps-current .manual-step-number {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-contrast);
}

@media (max-width: 768px) {
    .manual-steps ol {
        gap: 0.2rem;
    }

    .manual-steps a {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.3rem 0.2rem;
        border-radius: 0.75rem;
        font-size: 0.85rem;
    }

    .manual-steps-label {
        max-width: 100%;
    }
}

/* Page */
main > section.manual-page {
    padding-top: 2rem;
}

.manual-page h1 {
    font-size: 2.75rem;
    color: var(--color-text-dark);
    margin: 0.75rem 0 1.5rem;
}

@media (max-width: 768px) {
    .manual-page h1 {
        font-size: 2rem;
    }
}

.manual-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.manual-breadcrumb li + li::before {
    content: "›";
    margin-right: 0.4rem;
}

.manual-breadcrumb a {
    color: var(--color-text-light);
    text-decoration: none;
}

.manual-breadcrumb a:hover {
    color: var(--color-primary);
}

.manual-body img {
    max-width: 100%;
    height: auto;
}

.manual-callout {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: var(--color-primary-bg);
    color: var(--color-text-dark);
}

.manual-callout svg {
    color: var(--color-primary);
    margin-top: 0.1rem;
}

.manual-callout p {
    margin: 0;
}

.manual-callout a {
    font-weight: 600;
}

.manual-callout-gray {
    background: var(--background-color-gray);
}

/* Child pages: cards with an image, or rows */
.manual-cards,
.manual-rows {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

.manual-cards {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}

.manual-cards a,
.manual-rows a {
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    background: var(--card-background-color);
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}

.manual-cards a {
    height: 100%;
    align-content: start;
}

.manual-cards a:hover,
.manual-rows a:hover,
.manual-cards a:focus-visible,
.manual-rows a:focus-visible {
    border-color: var(--color-primary);
}

.manual-cards a:hover {
    transform: translateY(-2px);
}

.manual-cards img {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: contain;
    margin-bottom: 0.4rem;
}

.manual-rows a {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.manual-rows svg {
    color: var(--color-text-light);
}

.manual-card-title {
    display: block;
    font-family: "Poppins", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.3;
}

.manual-card-summary {
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
}

/* Wizard buttons */
.manual-wizard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.manual-wizard .manual-wizard-next {
    margin-left: auto;
}

@media (max-width: 500px) {
    .manual-wizard a.button {
        flex: 1 1 100%;
        justify-content: center;
        margin-left: 0;
    }

    .manual-wizard .manual-wizard-next {
        order: -1;
    }
}

.manual-help {
    margin-top: 1.5rem;
    color: var(--color-text-light);
}

/* Toggles rendered from the Editor.js `toggle` block */
.rich-toggle {
    margin: 0.75rem 0;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--card-background-color);
}

.rich-toggle > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-dark);
}

.rich-toggle > summary::-webkit-details-marker {
    display: none;
}

.rich-toggle-tag {
    flex: none;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--background-color-gray);
    color: var(--color-text-light);
}

.rich-toggle-situation .rich-toggle-tag {
    background: var(--color-primary-bg);
    color: var(--color-primary-darker);
}

.rich-toggle-problem .rich-toggle-tag {
    background: #fff3e0;
    color: #a35400;
}

.rich-toggle-link {
    position: relative;
    display: inline-grid;
    place-items: center;
    padding: 0.2rem;
    border-radius: 0.4rem;
    color: var(--color-text-light);
    opacity: 0;
    transition: opacity 0.15s;
}

.rich-toggle > summary:hover .rich-toggle-link,
.rich-toggle-link:focus-visible,
.rich-toggle-link.copied {
    opacity: 1;
}

.rich-toggle-link:hover {
    color: var(--color-primary);
}

@media (hover: none) {
    .rich-toggle-link {
        opacity: 0.6;
    }
}

.rich-toggle-link.copied::after {
    content: attr(data-copied);
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    background: var(--color-text-dark);
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
}

.rich-toggle-chevron {
    flex: none;
    margin-left: auto;
    color: var(--color-text-light);
    transition: transform 0.2s;
}

.rich-toggle[open] .rich-toggle-chevron {
    transform: rotate(180deg);
}

.rich-toggle-body {
    padding: 0 1.1rem 1rem;
}

/* On small screens the title gets its own full-width row below the badge and icons */
@media (max-width: 768px) {
    .rich-toggle > summary {
        display: grid;
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas:
            "tag link . chevron"
            "title title title title";
        align-items: center;
        gap: 0.4rem 0.5rem;
    }

    .rich-toggle-tag {
        grid-area: tag;
    }

    .rich-toggle-link {
        grid-area: link;
    }

    .rich-toggle-title {
        grid-area: title;
    }

    .rich-toggle-chevron {
        grid-area: chevron;
        margin-left: 0;
    }
}

.rich-toggle-body > :first-child {
    margin-top: 0;
}

.rich-toggle-body > :last-child {
    margin-bottom: 0;
}

/* Anchored toggles and headings stay clear of the sticky header and step bar */
.manual-page [id] {
    scroll-margin-top: calc(var(--header-height) + 5rem);
}

.rich-toggle.highlight {
    animation: manual-highlight 1.6s ease-out;
}

@keyframes manual-highlight {
    from { box-shadow: 0 0 0 4px var(--color-primary); }
    to { box-shadow: 0 0 0 4px transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .manual-step-cards a,
    .manual-cards a,
    .rich-toggle-chevron,
    .rich-toggle.highlight {
        transition: none;
        animation: none;
    }
}
