/*
 * Styling matched to the published DCF page on Hwb: Arial stack, #1f1f1f body
 * text, #0360a6 accordion headings, #215b57 element bands on #efefef, #e5e5e5
 * rules, 320px progression step columns.
 */

:root {
    --ink: #1f1f1f;
    --ink-muted: #737373;
    --link: #0360a6;
    --element: #215b57;
    --band: #efefef;
    --rule: #e5e5e5;
    --brand: #c73333;
    --error: #8c2222;
    --column: 320px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, "Nimbus Sans L", sans-serif;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--ink);
    background: #fff;
}

a {
    color: var(--link);
}

:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 0;
    box-shadow: 0 0 0 5px var(--ink);
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    position: static;
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #ffbf47;
    color: var(--ink);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.wrap {
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Masthead */

.masthead {
    background: var(--brand);
    color: #fff;
}

.masthead .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    min-height: 4.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
    text-decoration: none;
}

.wordmark span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}

.lang-switch {
    color: #fff;
    font-weight: 700;
    text-underline-offset: 0.2em;
}

.masthead__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.masthead__nav form {
    margin: 0;
}

.masthead__user {
    font-weight: 700;
    opacity: 0.85;
}

/* Nav items are plain links; the one action, sign in or out, gets the box. */

.masthead__link {
    font: inherit;
    font-weight: 700;
    padding: 0.35rem 0;
    border: 0;
    background: none;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.masthead__link:hover {
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

.masthead__link[aria-current="page"],
.masthead__link--current {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 0.4em;
}

.masthead__button {
    font: inherit;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border: 2px solid #fff;
    background: none;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.masthead__button:hover {
    background: #fff;
    color: var(--brand);
}

/* Student work menu: a native <details> disclosure, so no JavaScript. */

.menu {
    position: relative;
}

.menu > summary {
    display: inline-block;
    list-style: none;
}

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

.menu > summary::after {
    content: " \25be";
}

.menu[open] > summary {
    text-decoration: underline;
    text-underline-offset: 0.4em;
}

.menu > ul {
    position: absolute;
    right: 0;
    z-index: 10;
    width: max-content;
    max-width: 17rem;
    margin: 0.35rem 0 0;
    padding: 0.35rem 0;
    list-style: none;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.menu > ul a {
    display: block;
    padding: 0.5rem 0.9rem;
    color: var(--ink);
    text-decoration: none;
}

.menu > ul a:hover {
    background: var(--band);
    text-decoration: underline;
}

/* Login */

.login {
    max-width: 27rem;
    padding: 3rem 0 4rem;
}

.login h1 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
}

.login__lede {
    margin: 0 0 1.5rem;
    color: var(--ink-muted);
}

.login__provider {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--link);
    border: 2px solid var(--link);
}

.login__provider:hover {
    background: #024b83;
    border-color: #024b83;
}

.login__error {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--error);
    background: var(--band);
}

/* Local password sign-in, below the providers. */

.login__divider {
    margin: 2rem 0 1rem;
    font-size: 1.125rem;
}

.login__form {
    display: grid;
    gap: 1rem;
}

.login__form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.login__form input {
    width: 100%;
    padding: 0.5rem;
    font: inherit;
    border: 1px solid var(--ink-muted);
    border-radius: 0;
    background: #fff;
}

.login__form button {
    padding: 0.85rem 1rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--link);
    border: 2px solid var(--link);
    cursor: pointer;
}

.login__form button:hover {
    background: #024b83;
    border-color: #024b83;
}

.login__back {
    margin: 1.5rem 0 0;
    font-size: 0.875rem;
}

/* Page heading */

.page-head {
    padding: 2.5rem 0 1.5rem;
}

.page-head h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 5vw, 2.875rem);
    line-height: 1.1;
}

.part-of {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.part-of strong {
    display: block;
    color: var(--ink);
}

/* Toolbar */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
}

.step-filter {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.step-filter label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.step-filter select {
    font: inherit;
    padding: 0.55rem 0.6rem;
    border: 2px solid var(--ink);
    background: #fff;
    color: inherit;
}

.step-filter button {
    font: inherit;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    border: 2px solid var(--link);
    background: var(--link);
    color: #fff;
    cursor: pointer;
}

.step-filter button:hover {
    background: #024b83;
    border-color: #024b83;
}

.accordion-controls {
    display: flex;
    gap: 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
}

.accordion-controls button {
    font: inherit;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    color: var(--ink-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.accordion-controls button:hover {
    color: var(--ink);
}

/* Strand accordions */

.strand {
    border-bottom: 1px solid var(--rule);
}

.strand > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--link);
    cursor: pointer;
    list-style: none;
}

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

.chevron {
    flex: none;
    width: 0.6rem;
    height: 0.9rem;
    fill: var(--ink);
    transition: transform 150ms ease;
}

.strand[open] > summary .chevron {
    transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
    .chevron {
        transition: none;
    }
}

.strand__intro {
    max-width: 60rem;
    margin: 0 0 1.5rem;
}

.strand__intro p {
    margin: 0 0 1rem;
}

.strand__body {
    padding-bottom: 2rem;
}

/* Framework table */

.scroller {
    position: relative;
}

.scroller__hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.scroller__hint[hidden] {
    display: none;
}

.scroller__hint button {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: var(--link);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.scroller__hint button:hover {
    background: #024b83;
}

.scroller__viewport {
    overflow-x: auto;
    scrollbar-color: var(--link) var(--band);
}

table.framework {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

table.framework thead th {
    width: var(--column);
    min-width: var(--column);
    padding: 1.25rem 1.7rem 1.25rem 0;
    text-align: left;
    vertical-align: bottom;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--rule);
}

table.framework .element-row th {
    padding: 1.3rem 0 1.05rem 0.95rem;
    text-align: left;
    font-size: 1.3125rem;
    color: var(--element);
    background: var(--band);
    border-bottom: 1px solid var(--rule);
}

/* Keep the element name in view while the statements scroll sideways. */
table.framework .element-row th span {
    position: sticky;
    left: 0.95rem;
    display: inline-block;
}

table.framework td {
    padding: 0.9rem 1.7rem 0.9rem 0;
    vertical-align: top;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--rule);
}

table.framework td p {
    margin: 0;
}

table.framework td p + ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

table.framework td li + li {
    margin-top: 0.35rem;
}

table.framework em {
    font-style: italic;
}

table.framework .example-task-row td {
    padding: 1rem 1.25rem;
    border-top: 3px solid var(--element);
    background: #f2f8f7;
    font-size: 1rem;
}

table.framework .example-task-row .example-task__label {
    margin-bottom: 0.35rem;
    color: var(--element);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Footer */

.page-foot {
    margin-top: 3rem;
    padding: 2rem 0 3rem;
    border-top: 4px solid var(--brand);
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.page-foot p {
    max-width: 48rem;
    margin: 0 0 0.5rem;
}

/* Dashboard and super admin */

.panel {
    max-width: 40rem;
    padding: 3rem 0 4rem;
}

.panel--wide {
    max-width: none;
}

.panel h1 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
}

.panel__lede {
    max-width: 40rem;
    margin: 0 0 1.5rem;
    color: var(--ink-muted);
}

.panel__lede p {
    margin: 0 0 1rem;
}

.panel__lede p:last-child {
    margin-bottom: 0;
}

/* Strand intro (wide + tight): let the description prose fill the width, but
   keep the empty-state note a comfortable reading width. */
.panel--wide.panel--tight .panel__lede {
    max-width: none;
}

.panel--wide.panel--tight .empty {
    max-width: 40rem;
}

.panel__links {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.panel__links li + li {
    margin-top: 0.5rem;
}

.panel--tight {
    padding-bottom: 1.5rem;
}

.section-heading {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
}

.empty {
    margin: 0 0 2rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--rule);
    background: var(--band);
    color: var(--ink-muted);
}

/* Pupils' work element page: statements grouped by progression step. */

.step-outcomes h3 {
    margin: 1.75rem 0 0.25rem;
    font-size: 1rem;
    color: var(--element);
}

.step-grid {
    columns: 26rem;
    column-gap: 2.5rem;
    padding-bottom: 4rem;
}

/* Keep each step whole in its column and carry the spacing on the section, so
   a step that starts a column is not pushed down by the h3 top margin. */
.step-grid .step-outcomes {
    break-inside: avoid;
    margin-bottom: 1.75rem;
}

.step-grid .step-outcomes h3 {
    margin-top: 0;
}

.outcome-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.outcome-list > li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rule);
}

.outcome-list p {
    margin: 0;
}

.outcome-list p + ul {
    margin: 0.35rem 0 0;
    padding-left: 1.25rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.5rem;
    padding: 0 0 4rem;
}

.card {
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 4px solid var(--element);
    background: var(--band);
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.card p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--ink-muted);
}

.card__links {
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}

.card__links li + li {
    margin-top: 0.35rem;
}

.panel__action {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    margin: 0 0 2rem;
    padding: 1rem;
    background: var(--band);
}

.panel__action span {
    max-width: 32rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

.flash {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--element);
    background: var(--band);
}

.flash--error {
    border-left-color: var(--error);
}

.panel__action button,
.admin-form button,
table.records button {
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--link);
    border: 2px solid var(--link);
    cursor: pointer;
}

.panel__action button:hover,
.admin-form button:hover,
table.records button:hover {
    background: #024b83;
    border-color: #024b83;
}

.panel__action button:disabled {
    color: var(--ink-muted);
    background: #fff;
    border-color: var(--rule);
    cursor: not-allowed;
}

table.records {
    width: 100%;
    border-collapse: collapse;
}

table.records th,
table.records td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--rule);
}

table.records thead th {
    color: #fff;
    background: var(--element);
}

.records__thumb {
    display: block;
    width: 5rem;
    height: auto;
}

/* Admin forms: evidence upload and the progression step switches. */

.admin-form {
    display: grid;
    gap: 1rem;
    max-width: 34rem;
    margin: 0 0 2rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.admin-form select,
.admin-form textarea,
.admin-form input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    font: inherit;
    border: 1px solid var(--ink-muted);
    border-radius: 0;
    background: #fff;
}

.admin-form .steps {
    margin: 0;
    padding: 0;
    border: 0;
}

.admin-form .steps label {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    margin: 0 0 0.5rem;
    font-weight: 400;
}

.admin-form .steps span {
    color: var(--ink-muted);
    font-size: 0.875rem;
}

.admin-form__note {
    margin: 0;
    max-width: 34rem;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

/* File drop zones: the native input does the work, script adds the drop. */

.dropper {
    padding: 1rem;
    border: 2px dashed var(--ink-muted);
    background: #fff;
}

.dropper--over {
    border-color: var(--link);
    background: var(--band);
}

.dropper input {
    font: inherit;
    max-width: 100%;
}

.dropper p {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--ink-muted);
}

/* Evidence of pupils' work: thumbnail beside a titled narration, the way
   the old YGACS site presented each piece. */

.evidence {
    display: grid;
    gap: 1.5rem;
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
    max-width: 48rem;
}

.evidence li {
    display: flex;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--band);
    border-top: 4px solid var(--element);
}

.evidence__media {
    flex: 0 0 14rem;
}

.evidence__media img {
    display: block;
    width: 100%;
    height: auto;
}

.evidence__tile {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 6rem;
    font-weight: 700;
    color: #fff;
    background: var(--element);
}

.evidence__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.evidence__body p {
    margin: 0;
}

@media (max-width: 40rem) {
    .evidence li {
        flex-direction: column;
    }

    .evidence__media {
        flex-basis: auto;
    }
}

@media (max-width: 40rem) {
    :root {
        --column: 17rem;
    }

    .toolbar {
        align-items: stretch;
    }
}
