/* The Help Centre's own styles (Specs/Spec - Help Centre.md §2.3): only what the landing's site.css doesn't have (the
   search box and its results, breadcrumbs, the article's parts, step numbers, screenshot frames, notes, the category
   tiles), on site.css's tokens. Mobile first at 360 px, to the mobile standard's rules a static page can meet: L1 (no
   sideways scroll: tables scroll inside their own box), L3 (nothing collides), X1 (dates and codes don't break), X4
   (titles, headings and running text wrap), T1 (44 px targets; links inside running text excepted), N1 (no motion
   needed), Q7 (hover only where hover exists, a visible focus ring). The build renames it with its hash (a year's
   cache). No url(), no @import: the CSP allows this site's own files only. */

/* --- The search band (spec §5) --- */

.search-band {
    border-bottom: 1px solid var(--border-colour);
    background: white;
}

.search-band-home {
    padding-block: calc(var(--spacing) * 8) calc(var(--spacing) * 8);
}

.search-band-compact {
    padding-block: calc(var(--spacing) * 3);
}

/* Without JavaScript a compact band would be an empty strip: it goes with its box. */
.search-band-compact:has(> .container > .search[hidden]) {
    display: none;
}

.search-heading {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.search[hidden],
.search-results[hidden],
.search-empty[hidden] {
    display: none;
}

.search-band-home .search {
    margin-top: calc(var(--spacing) * 5);
}

.search-label {
    display: block;
    margin-bottom: calc(var(--spacing) * 1.5);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* F2: 16 px, so a phone never zooms on focus; 48 px tall (T1). */
.search-input {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    min-height: 48px;
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3.5);
    border: 1px solid var(--border-colour-darker);
    border-radius: var(--radius);
    background: white;
    color: var(--foreground);
    font: inherit;
    font-size: 1rem;
}

.search-input:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.search-input::placeholder {
    color: var(--muted-foreground);
    opacity: 1;
}

.search-results {
    margin: calc(var(--spacing) * 2) 0 0;
    padding: 0;
    border: 1px solid var(--border-colour);
    border-radius: var(--radius);
    background: white;
    list-style: none;
    overflow: hidden;
}

.search-results li + li {
    border-top: 1px solid var(--border-colour);
}

.search-result {
    display: block;
    min-height: 44px;
    padding: calc(var(--spacing) * 3) calc(var(--spacing) * 3.5);
    text-decoration: none;
    overflow-wrap: break-word;
}

.search-results li[aria-selected="true"] .search-result {
    background: var(--accent);
}

.search-result:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
}

.search-result-title {
    display: block;
    font-weight: 600;
}

.search-result-summary {
    display: block;
    margin-top: calc(var(--spacing) * 0.5);
    color: var(--muted-foreground);
    font-size: var(--text-sm);
}

.search-results mark {
    background: none;
    color: inherit;
    font-weight: 700;
}

.search-empty {
    margin-top: calc(var(--spacing) * 3);
    color: var(--muted-on-off-white);
    overflow-wrap: break-word;
}

/* --- The page --- */

.help-page {
    padding-block: calc(var(--spacing) * 6) calc(var(--spacing) * 12);
    overflow-wrap: break-word;
}

.help-page h1 {
    font-size: clamp(1.625rem, 5.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-summary {
    margin-top: calc(var(--spacing) * 3);
    font-size: 1.0625rem;
}

.help-section + .help-section {
    margin-top: calc(var(--spacing) * 10);
}

.help-section h2,
.related h2 {
    font-size: 1.125rem;
}

.language-switcher ul {
    display: flex;
    gap: calc(var(--spacing) * 1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-switcher a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    padding-inline: calc(var(--spacing) * 2);
    color: var(--muted-on-off-white);
    font-size: var(--text-sm);
}

.language-switcher a[aria-current="true"] {
    color: var(--foreground);
    font-weight: 600;
    text-decoration: none;
}

/* --- Breadcrumbs --- */

.breadcrumbs {
    margin-bottom: calc(var(--spacing) * 3);
    font-size: var(--text-sm);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li + li::before {
    content: "\203A";
    content: "\203A" / "";
    padding-inline: calc(var(--spacing) * 1.5);
    color: var(--muted-on-off-white);
}

.breadcrumbs a,
.breadcrumbs [aria-current] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    color: var(--muted-on-off-white);
}

/* --- Lists of articles and the category tiles --- */

.article-list,
.tiles {
    margin: calc(var(--spacing) * 4) 0 0;
    padding: 0;
    list-style: none;
}

.article-list li + li {
    border-top: 1px solid var(--border-colour);
}

.article-list a,
.tile {
    display: block;
    min-height: 44px;
    padding-block: calc(var(--spacing) * 3);
    text-decoration: none;
}

.article-list-title,
.tile-title {
    display: block;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--border-colour-darker);
    text-underline-offset: 0.2em;
}

.article-list-summary,
.tile-summary {
    display: block;
    margin-top: calc(var(--spacing) * 0.5);
    color: var(--muted-on-off-white);
    font-size: var(--text-sm);
}

.tiles {
    display: grid;
    gap: calc(var(--spacing) * 3);
}

.tile {
    padding: calc(var(--spacing) * 4);
    border: 1px solid var(--border-colour);
    border-radius: var(--card-radius);
    background: white;
}

.tile-summary {
    color: var(--muted-foreground);
}

@media (width >= 40rem) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- An article (spec §3) --- */

.article-who {
    margin-top: calc(var(--spacing) * 3);
    font-size: var(--text-sm);
}

.article-who-label {
    font-weight: 600;
}

.note {
    margin-top: calc(var(--spacing) * 4);
    padding: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
    border: 1px solid var(--border-colour);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    background: white;
}

.note-us,
.note-stale {
    border-left-color: var(--border-colour-darker);
}

.article-body {
    margin-top: calc(var(--spacing) * 6);
}

.article-body h2 {
    margin-top: calc(var(--spacing) * 9);
    font-size: 1.375rem;
}

.article-body h3 {
    margin-top: calc(var(--spacing) * 6);
    font-size: 1.125rem;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body .table-wrap {
    margin-top: calc(var(--spacing) * 3);
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
}

.article-body li + li {
    margin-top: calc(var(--spacing) * 2.5);
}

.article-body li > ul,
.article-body li > ol,
.article-body li > .note {
    margin-top: calc(var(--spacing) * 2);
}

/* Step numbers: bold, like the screenshots' numbered markers. */
.article-body ol > li::marker {
    font-weight: 700;
}

.article-body code {
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
    background: var(--accent);
    font-size: 0.9em;
    white-space: nowrap;
}

/* A screenshot after its step (spec §6): framed, at its own size or narrower, never wider than the column. Not
   site.css's .shot, which stretches the landing's shots to the column. At 1280 px the column holds 648 px under a step
   (tools/HelpSite's Site.ShotMaxWidth, which --check holds every image to): change one, change the other. */
.help-shot {
    margin-top: calc(var(--spacing) * 3);
}

.help-shot img {
    border: 1px solid var(--border-colour);
    border-radius: var(--radius);
    background: white;
}

/* Reference tables scroll inside their own box on a phone (L1), never the page. */
.table-wrap {
    overflow-x: auto;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table-wrap th,
.table-wrap td {
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
    border-bottom: 1px solid var(--border-colour);
    text-align: left;
    vertical-align: top;
}

.table-wrap th {
    font-weight: 600;
}

.related {
    margin-top: calc(var(--spacing) * 10);
}

.article-foot {
    margin-top: calc(var(--spacing) * 10);
    padding-top: calc(var(--spacing) * 4);
    border-top: 1px solid var(--border-colour);
    color: var(--muted-on-off-white);
    font-size: var(--text-sm);
}

.article-support {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--foreground);
    font-weight: 600;
}

/* --- The 404 --- */

.not-found-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--spacing) * 3);
    margin-top: calc(var(--spacing) * 6);
    padding: 0;
    list-style: none;
}

@media (hover: hover) {
    .search-results li:not([aria-selected="true"]) .search-result:hover,
    .tile:hover {
        background: var(--accent);
    }

    .article-list a:hover .article-list-title,
    .tile:hover .tile-title {
        text-decoration-color: currentColor;
    }
}
