/* Keep typography and contrast consistent across the public and authenticated pages. */
:root {
    color-scheme: light;
    --ink: #182e32;
    --muted: #53686c;
    --paper: #f7f8f4;
    --line: #d7dfda;
    --accent: #12665c;
    font-family: Segoe UI,system-ui,sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.6;
}

/* Include borders and padding in responsive width calculations. */
* {
    box-sizing: border-box;
}

/* Let the shared layout control spacing at every viewport width. */
body {
    margin: 0;
}

/* Keep links recognisable without crowding their text. */
a {
    color: var(--accent);
    text-underline-offset: 4px;
}

/* Make pointer feedback visible without moving surrounding text. */
a:hover {
    text-decoration-thickness: 2px;
}

/* Keep native form controls consistent with the reading typography. */
button,input,select {
    font: inherit;
}

/* Leave room for visible keyboard focus indicators. */
button,a,input,select {
    outline-offset: 5px;
}

/* Keep multiline headings compact while retaining legibility. */
h1,h2,h3 {
    line-height: 1.18;
}

/* Scale page titles to the available viewport width. */
h1 {
    font-size: clamp(2rem,4vw,3.4rem);
    letter-spacing: -.045em;
    margin: .3em 0 .7em;
}

/* Distinguish section headings without competing with the page title. */
h2 {
    font-size: 1.3rem;
    letter-spacing: -.02em;
}

/* Separate prose into comfortable reading blocks. */
p {
    margin: .7em 0 1.2em;
}

/* Align branding and navigation with the main content area. */
.site-header {
    max-width: 1280px;
    margin: auto;
    padding: 26px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

/* Give the site identity a clear navigation anchor. */
.brand {
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink);
}

/* Distinguish the knowledge area from the organisation name. */
.brand span {
    font-weight: 400;
    margin-left: 8px;
    color: var(--muted);
}

/* Keep navigation targets separated and vertically aligned. */
nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

/* Prevent the sign-out form from changing navigation alignment. */
nav form {
    margin: 0;
}

/* Present sign-out as a secondary action alongside navigation links. */
.text-button {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Constrain reading width and keep short pages from collapsing the layout. */
main {
    max-width: 1280px;
    margin: auto;
    padding: 56px 48px;
    min-height: 75vh;
}

/* Separate service information from the primary reading area. */
footer {
    border-top: 1px solid var(--line);
    max-width: 1184px;
    margin: 0 auto;
    padding: 24px 0;
    color: var(--muted);
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

/* Identify collections without competing with document titles. */
.eyebrow {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
}

/* Keep introductory content focused and separated from feature details. */
.hero {
    max-width: 790px;
    padding: 22px 0 66px;
}

/* Give the landing page a responsive introductory heading. */
.hero h1 {
    font-size: clamp(2.8rem,6vw,5rem);
    line-height: 1.06;
}

/* Keep introductory paragraphs readable across wide screens. */
.lead {
    font-size: 1.15rem;
    line-height: 1.65;
    max-width: 680px;
    color: var(--muted);
}

/* Provide a prominent, comfortably sized primary action. */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 12px 22px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

/* Make the primary action respond visibly to pointer hover. */
.button:hover {
    background: #0d5149;
}

/* Group the service capabilities into equal columns on wide screens. */
.features {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    border-top: 1px solid var(--line);
    padding-top: 30px;
    gap: 40px;
}

/* Keep supporting copy subordinate to headings and actions. */
.features p,.muted {
    color: var(--muted);
}

/* Make informational and unavailable states easy to distinguish from prose. */
.notice {
    padding: 16px 20px;
    background: #e9eee7;
    border-left: 3px solid var(--accent);
    max-width: 780px;
}

/* Keep the search inputs and submission action together. */
.search-form {
    display: flex;
    gap: 16px;
    align-items: end;
    margin: 30px 0 40px;
    padding: 24px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* Keep input purpose visible when fields contain values. */
.search-form label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    margin-bottom: 6px;
}

/* Give controls clear boundaries and comfortable interaction targets. */
.search-form input,.search-form select {
    padding: 12px;
    border: 1px solid #879994;
    border-radius: 3px;
    background: #fff;
    color: var(--ink);
    width: 100%;
}

/* Let the query field use the remaining horizontal space. */
.search-field {
    flex: 1;
}

/* Allow long document titles to wrap within equal result columns. */
.document-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px;
}

/* Visually separate individual search results. */
.document-list li {
    padding: 26px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 5px;
}

/* Keep titles close to their associated metadata. */
.document-list h2 {
    margin: 9px 0;
}

/* Make result titles the primary reading focus. */
.document-list h2 a {
    color: var(--ink);
    text-decoration: none;
}

/* Expose the result title interaction on pointer hover. */
.document-list h2 a:hover {
    text-decoration: underline;
}

/* Allow long repository paths to wrap without widening result cards. */
.source-path {
    font-family: Consolas,monospace;
    font-size: .8rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* Give empty states enough separation from search controls. */
.empty {
    padding: 48px 0;
}

/* Separate page controls and keep them away from result cards. */
.pagination {
    justify-content: space-between;
    padding: 24px 0;
}

/* Keep the return action distinct from the document heading. */
.back-link {
    display: inline-block;
    margin-bottom: 32px;
}

/* Reserve a metadata column while allowing document content to shrink. */
.reading-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 270px;
    gap: 64px;
}

/* Keep document titles in proportion to the reading column. */
.reading-layout article>h1 {
    font-size: 2.5rem;
}

/* Separate provenance from prose and wrap long source identifiers. */
.reading-layout aside {
    border-left: 1px solid var(--line);
    padding-left: 26px;
    font-size: .9rem;
    overflow-wrap: anywhere;
}

/* Keep sidebar headings subordinate to document headings. */
.reading-layout aside h2 {
    font-size: 1rem;
}

/* Separate metadata fields and distinguish labels from values. */
.reading-layout dt {
    color: var(--muted);
    margin-top: 16px;
}

/* Align provenance values with their labels. */
.reading-layout dd {
    margin: 4px 0 0;
}

/* Keep related links aligned within the narrow sidebar. */
.related-list {
    padding-left: 18px;
}

/* Separate related links for comfortable selection. */
.related-list li {
    margin: 14px 0;
}

/* Keep authored prose readable and prevent long tokens from overflowing. */
.markdown {
    line-height: 1.8;
    overflow-wrap: anywhere;
}

/* Keep headings from authored content below the page title in prominence. */
.markdown h1 {
    font-size: 1.8rem;
}

/* Separate major sections within the document body. */
.markdown h2 {
    font-size: 1.5rem;
    margin-top: 1.8em;
}

/* Make subsections visible without overpowering major sections. */
.markdown h3 {
    font-size: 1.15rem;
    margin-top: 1.6em;
}

/* Keep code formatting intact while containing horizontal scrolling. */
.markdown pre {
    background: #eaf0eb;
    border: 1px solid var(--line);
    padding: 20px;
    overflow: auto;
    font-size: .88rem;
}

/* Distinguish code from surrounding prose with fixed-width type. */
.markdown code {
    font-family: Consolas,monospace;
}

/* Contain wide tables within the document column. */
.markdown table {
    border-collapse: collapse;
    display: block;
    max-width: 100%;
    overflow: auto;
}

/* Keep table cells legible and their boundaries clear. */
.markdown th,.markdown td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

/* Distinguish quoted material from the surrounding document. */
.markdown blockquote {
    margin-left: 0;
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    color: var(--muted);
}

/* Keep the keyboard shortcut available without covering the page at rest. */
.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    background: white;
    padding: 12px;
    z-index: 10;
}

/* Reveal the skip link when a keyboard user reaches it. */
.skip-link:focus {
    top: 10px;
}

/* Reflow the same content for handheld displays without hiding information. */
@media (max-width: 760px) {
    /* Preserve usable header space on narrow screens. */
    .site-header {
        padding: 20px;
    }

    /* Keep the brand and navigation on screen together. */
    .brand {
        font-size: 1.05rem;
    }

    /* Reduce brand spacing where horizontal room is limited. */
    .brand span {
        margin-left: 4px;
    }

    /* Fit navigation targets within the mobile header. */
    nav {
        gap: 16px;
    }

    /* Keep a comfortable reading inset on narrow screens. */
    main {
        padding: 32px 20px;
    }

    /* Reduce introductory whitespace on small displays. */
    .hero {
        padding: 18px 0 40px;
    }

    /* Stack content so every column remains readable on mobile. */
    .features,.document-list,.reading-layout {
        grid-template-columns: 1fr;
    }

    /* Keep stacked feature descriptions close together. */
    .features {
        gap: 16px;
    }

    /* Give each search control the available mobile width. */
    .search-form {
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
    }

    /* Separate the document and provenance when stacked. */
    .reading-layout {
        gap: 30px;
    }

    /* Move the provenance separator above its mobile section. */
    .reading-layout aside {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 20px 0;
    }

    /* Stack service information inside the mobile page inset. */
    footer {
        margin: 0 20px;
        flex-direction: column;
    }

    /* Prevent long document titles from dominating narrow screens. */
    .reading-layout article>h1 {
        font-size: 2rem;
    }

}
