@font-face {
    font-family: "Atkinson Hyperlegible";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-400.woff2") format("woff2");
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/atkinson-hyperlegible-700.woff2") format("woff2");
}

/* The accent is #589548 adjusted in lightness only (hue 107.5°) so text on or in it meets WCAG AA. */
:root {
    color-scheme: light;
    --bg: #fbfaf9;
    --surface: #ffffff;
    --ink: #1b1f24;
    --muted: #535b66;
    --line: #d3d8de;
    --accent: #3d6732;
    --on-accent: #ffffff;
    --soft: #e7efe4;
    --danger: #9b1c1c;
    --focus: #b35c00;
    --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #14171b;
        --surface: #1d2127;
        --ink: #e7eaee;
        --muted: #a6aeb8;
        --line: #3a4049;
        --accent: #8ac07c;
        --on-accent: #10200c;
        --soft: #213020;
        --danger: #f3a0a0;
        --focus: #ffb454;
    }
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
    line-height: 1.5;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

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

h1, h2 {
    line-height: 1.25;
    margin: 0;
    text-wrap: balance;
}

h1 {
    font-size: 1.625rem;
}

h2 {
    font-size: 1.125rem;
}

img {
    max-width: 100%;
}

/* Header and navigation */

.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem 0.25rem;
}

/* The logo is square; rem units keep it in proportion with the user's font size. */
.brand {
    display: block;
    width: 5rem;
    height: 5rem;
    object-fit: contain;
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
}

.site-header nav a,
.site-header nav button {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.875rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.site-header nav a:hover,
.site-header nav button:hover {
    text-decoration: underline;
}

.site-header nav a[aria-current="page"] {
    background: var(--accent);
    color: var(--on-accent);
}

.site-header nav form {
    display: contents;
}

/* Page structure */

main {
    display: grid;
    gap: 1.5rem;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.narrow {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.page-header {
    text-align: center;
}

.lede {
    margin: 0.375rem 0 0;
    color: var(--muted);
}

.panel {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.panel p {
    margin: 0;
}

.callout {
    margin: 0;
    padding: 0.75rem 1rem;
    background: var(--soft);
    border-radius: var(--radius);
}

.errors {
    padding: 0.75rem 1rem;
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger);
}

.errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Forms */

.field {
    display: grid;
    gap: 0.25rem;
}

.field label {
    font-weight: 700;
}

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

input, select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--muted);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.copy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.copy input {
    flex: 1 1 14rem;
    width: auto;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.875rem;
}

.btn {
    min-height: 2.75rem;
    padding: 0.5rem 1.125rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn.quiet {
    background: transparent;
    color: var(--accent);
}

.btn.danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn.small {
    min-height: 2.5rem;
    padding: 0.25rem 0.875rem;
    font-size: 0.875rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Lists of menus, links and users */

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

.list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
}

.list li > div {
    display: grid;
    gap: 0.125rem;
    justify-items: start;
    min-width: 0;
    overflow-wrap: anywhere;
}

.status {
    margin-top: 0.25rem;
    padding: 0 0.5rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.status.on {
    background: var(--soft);
    color: var(--accent);
}

.status.off {
    border-style: dashed;
    color: var(--muted);
}

.status.bad {
    color: var(--danger);
}

.qr {
    display: block;
    width: 14rem;
    margin: 0 auto;
    border-radius: 0.5rem;
}

/* Public menu page */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-card {
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

.menu-card a:has(img) {
    cursor: zoom-in;
}

.menu-card img,
.pdf-badge {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top;
    background: var(--soft);
}

.pdf-badge {
    aspect-ratio: 3 / 1;
    display: grid;
    place-content: center;
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.menu-card-text {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 1rem 1rem;
}

.menu-card-text a {
    font-weight: 700;
}
