@font-face {
    font-family: 'ubu';
    src: url('fonts/Ubuntu-R.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'ubu';
    src: url('fonts/Ubuntu-B.ttf') format('truetype');
    font-weight: bold;
    font-display: swap;
}

@font-face {
    font-family: 'ubu';
    src: url('fonts/Ubuntu-RI.ttf') format('truetype');
    font-style: italic;
    font-display: swap;
}

:root {
    --blue: #473ba9;
    --deep: #362c86;
    --light: #867cdf;
    --pale: #d6d2f7;
    --accent: #f0b35a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--blue);
    color: #fff;
    font-family: 'ubu', sans-serif;
    font-size: 17px;
    line-height: 1.55;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3, .brand, .topbar nav, .boot, .basic, .button, button, .count, .noimg {
    font-family: 'ubu', sans-serif;
    font-weight: bold;
}

h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 1rem;
    overflow-wrap: anywhere;
}

h2 {
    font-size: 1.15rem;
    line-height: 1.35;
    margin: 2.5rem 0 1rem;
    color: var(--accent);
}

h3 {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: var(--accent);
}

/* Top bar */

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--light);
    color: #000;
}

.topbar a {
    color: #000;
    text-decoration: none;
}

.topbar a:hover {
    color: #fff;
}

.brand {
    font-size: 1.05rem;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    font-size: 0.8rem;
}

.clock {
    margin-left: auto;
    font-size: 0.85rem;
    white-space: nowrap;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* Home */

.boot {
    padding: 1.5rem 0 0.5rem;
    color: var(--pale);
    font-size: 1.1rem;
    line-height: 1.5;
}

.boot p {
    margin: 0 0 0.6rem;
}

.boot p:first-child {
    font-size: 1.5rem;
    color: #fff;
}

.cursor {
    display: inline-block;
    width: 0.8em;
    height: 1em;
    margin-left: 0.3em;
    vertical-align: -0.12em;
    background: var(--pale);
    animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
}

.basic {
    color: var(--pale);
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
}

/* Buttons and forms */

.button,
button[type=submit] {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border: 0;
    background: var(--light);
    color: #000;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button[type=submit]:hover {
    background: #fff;
}

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.filters label {
    display: block;
    font-size: 0.85rem;
    color: var(--pale);
}

.filters input,
.filters select {
    display: block;
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.5rem;
    border: 2px solid var(--light);
    border-radius: 0;
    background: var(--deep);
    color: #fff;
    font: inherit;
}

.filters input::placeholder {
    color: var(--pale);
}

.count {
    font-size: 0.85rem;
    color: var(--pale);
}

/* Cards */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--deep);
    color: #fff;
    text-decoration: none;
}

.card:hover {
    outline: 2px solid var(--accent);
}

.card .picture {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #000;
    overflow: hidden;
}

.card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card .name {
    padding: 0.5rem 0.6rem 0;
    font-size: 0.92rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.card .meta {
    padding: 0.2rem 0.6rem 0.6rem;
    font-size: 0.78rem;
    color: var(--pale);
}

.noimg {
    color: var(--light);
    font-size: 0.7rem;
}

.noimg.large {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: #000;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Item page */

.crumbs {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}

.item {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
    gap: 1.5rem;
}

.gallery #photo {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    background: #000;
}

.strip {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    overflow-x: auto;
}

.strip button {
    flex: none;
    width: 84px;
    height: 84px;
    padding: 0;
    border: 2px solid var(--light);
    background: #000;
    cursor: pointer;
}

.strip img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.facts {
    margin: 0;
}

.facts dt {
    color: var(--pale);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.facts dd {
    margin: 0 0 0.8rem;
    overflow-wrap: anywhere;
}

/* Text pages */

.text,
.news {
    max-width: 46rem;
}

.text .lead {
    font-size: 1.15rem;
    color: var(--accent);
}

.text .book h2 {
    margin-top: 1.5rem;
}

.news {
    margin-bottom: 2rem;
}

.news h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

@media (max-width: 760px) {
    body {
        font-size: 16px;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
    }

    .filters label:first-child,
    .filters button {
        grid-column: 1 / -1;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .item {
        grid-template-columns: minmax(0, 1fr);
    }

    .clock {
        display: none;
    }

    .boot,
    .boot p:first-child {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.25rem;
    }
}

/* Admin */

.adminbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light);
}

.adminbar form {
    margin-left: auto;
}

.editor {
    display: grid;
    gap: 1rem;
    max-width: 46rem;
}

.editor label {
    display: block;
    font-size: 0.85rem;
    color: var(--pale);
}

.editor input,
.editor select,
.editor textarea {
    display: block;
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.5rem;
    border: 2px solid var(--light);
    border-radius: 0;
    background: var(--deep);
    color: #fff;
    font: inherit;
}

.editor textarea {
    min-height: 18rem;
    resize: vertical;
}

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

.alert {
    max-width: 46rem;
    padding: 0.6rem 0.8rem;
    background: #000;
    color: var(--accent);
}

.rows {
    max-width: 46rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rows li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light);
}

button.danger {
    background: var(--accent);
}

.editor label.check {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.editor label.check input {
    width: auto;
    margin: 0;
}

.editor h2 {
    margin: 1rem 0 0;
}

.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    max-width: 46rem;
    margin-bottom: 1rem;
}

.photos img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #000;
}

.photos button {
    width: 100%;
    padding: 0.35rem;
    border: 0;
    cursor: pointer;
}
