/* Manual identity; shared styles live in design-system.css. */
:root {
    --site-accent: #ce0058;
    --site-accent-strong: var(--site-accent);
    --site-accent-soft: #ff8db8;
}

/* Compact, left-aligned shortcuts; search remains visible while tabs scroll. */
.md-header .md-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.md-header .md-tabs > .md-grid {
    flex: 1;
    min-width: 0;
}

.site-header-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    right: 0;
    background: var(--color-black);
    z-index: 1;
}

/* Make room for search beside the Manual's longer shortcuts on tablets. */
@media screen and (max-width: 60em) {
    #__search:checked ~ .md-header .md-tabs__item:not(:has(.site-search-trigger)) {
        display: none;
    }
}

/* Keep the start-page heading and its anchor available without a visual title. */
.manual-home > h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.manual-home > h1 .headerlink { display: none; }

/* Match the Lab landing-page cards, using the Manual's ruby accent. */
.md-typeset .grid.cards.manual-paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}

.md-typeset .grid.cards.manual-current-release {
    grid-template-columns: minmax(0, 1fr);
}

.md-typeset .grid.cards.manual-paths > ul > li {
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-top: 3px solid var(--site-accent);
    border-radius: 0.5rem;
    background: var(--md-code-bg-color);
    box-shadow: none;
}

.md-typeset .grid.cards.manual-paths > ul > li > p {
    margin: 0;
}

.md-typeset .grid.cards.manual-paths > ul > li > hr {
    margin: 0.6rem 0;
}

.md-typeset .grid.cards.manual-paths > ul > li > p:last-child {
    margin-top: auto;
    padding-top: 0.7rem;
}

.md-typeset .grid.cards.manual-paths .md-button {
    width: 100%;
    padding: 0.5em 0.8em;
    border-radius: 0.25rem;
    text-align: center;
}

/* Retain the full Manual sidebar, including its category labels. */
@media screen and (min-width: 76.25em) {
    .md-nav--primary > .md-nav__list > .md-nav__item--section > .md-nav__link {
        display: flex;
    }
}

/* The Changelog remains reachable through its header tab and footer link. */
.md-nav--primary .md-nav__item:has(> a[href$="changelog/"]) {
    display: none;
}

/* Release cards reuse the same quiet surfaces as the documentation cards. */
.manual-changelog__intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 2rem;
    margin-bottom: 1.4rem;
}

.manual-changelog__intro h1 { margin: 0 0 0.5rem; }
.manual-changelog__intro > p { margin: 0.4rem 0; }
.manual-changelog__intro > p:has(.md-button) {
    grid-column: 2;
    grid-row: 1;
}

.manual-changelog__intro > .admonition {
    grid-column: 1 / -1;
    margin: 1rem 0 0;
}

.manual-release {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 1.2rem;
    margin: 1rem 0;
    padding: 24px;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.35rem;
    background: var(--md-code-bg-color);
}

.manual-release:first-child { border-top: 3px solid var(--site-link-color); }

.manual-release__heading {
    padding-right: 1.2rem;
    border-right: 1px solid var(--md-default-fg-color--lightest);
}

.manual-release__heading h2 {
    margin: 0;
    color: var(--site-link-color);
    font-size: 1.05rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.manual-release__notes { min-width: 0; }
.manual-release__notes > :first-child { margin-top: 0; }
.manual-release__notes > :last-child { margin-bottom: 0; }
.manual-release__notes > p:has(+ ul) {
    margin-bottom: 0.4rem;
    color: var(--site-link-color);
    font-weight: 600;
}
.manual-release__notes > ul { margin-top: 0.4rem; }

@media screen and (max-width: 59.99em) {
    .manual-release { grid-template-columns: minmax(0, 1fr); }
    .manual-release__heading {
        padding: 0 0 0.8rem;
        border-right: 0;
        border-bottom: 1px solid var(--md-default-fg-color--lightest);
    }
}

@media screen and (max-width: 37.5em) {
    .md-typeset .grid.cards.manual-paths { grid-template-columns: minmax(0, 1fr); }
    .manual-changelog__intro { grid-template-columns: minmax(0, 1fr); }
    .manual-changelog__intro > p:has(.md-button) { grid-column: auto; grid-row: auto; }
    .manual-release { padding: 16px; }
}

.site-footer-palette {
    display: grid;
    justify-items: start;
    margin-top: 0.5rem;
}

.site-footer-palette label:not([hidden]) {
    display: flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.site-footer-palette label[hidden] {
    display: none;
}

.site-footer-palette label:hover { color: var(--color-white); }

.site-footer-palette input:focus-visible + label {
    outline: 2px solid var(--site-accent-soft);
    outline-offset: 3px;
}
