:root {
    --line: #bbb;
    --line-strong: #000;
    --bg: #fff;
    --fg: #000;
    --muted: #666;
    --accent: #ffeb3b;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font:
        17px/1.55 system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        sans-serif;
    color: var(--fg);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--accent);
    border-bottom: 1px solid var(--line-strong);
    padding: 0.875rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: baseline;
}

header .brand {
    font-weight: 700;
    text-decoration: none;
}

header nav {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    align-items: baseline;
}

.nav-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-group--right {
    margin-left: auto;
}

header a {
    text-decoration: none;
}
header a:hover {
    text-decoration: underline;
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
}

.intro {
    margin: 0 0 2rem;
    /*max-width: 50em;*/
}

section {
    margin-top: 2.5rem;
}

section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.grid a {
    display: block;
    aspect-ratio: 220 / 290;
    overflow: hidden;
    border: 1px solid var(--line);
}

.grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid a:hover img {
    opacity: 0.7;
}

.featured {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.75rem;
    align-items: start;
}

.featured .cover {
    display: block;
    border: 1px solid var(--line);
    aspect-ratio: 220 / 290;
    overflow: hidden;
}

.featured .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured p {
    margin: 0 0 0.75rem;
}
.featured p:last-child {
    margin-bottom: 0;
}

/* page intro — used on subpages, allows natural cover aspect */
.page-intro .cover {
    aspect-ratio: auto;
}
.page-intro .cover img {
    height: auto;
    object-fit: contain;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.byline {
    font-size: 0.9375rem;
    color: var(--muted);
    margin: 0 0 1rem;
}

.downloads {
    font-size: 0.9375rem;
    margin: 1rem 0 0;
}

/* collapsible historical text */
details.story {
    margin: 1.25rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

details.story > summary {
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    list-style: none;
    padding: 0.625rem 0;
    user-select: none;
}

details.story > summary::-webkit-details-marker {
    display: none;
}
details.story > summary::before {
    content: "▸  ";
}
details.story[open] > summary::before {
    content: "▾  ";
}
details.story[open] > summary {
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}

.story-body {
    padding-bottom: 1rem;
    max-width: 50em;
}
.story-body h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 1.75rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.story-body h3:first-child {
    margin-top: 0;
}
.story-body p {
    margin: 0 0 0.75rem;
}

/* Q&A list (progetto) */
.qa {
    max-width: 50em;
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}
.qa > li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}
.qa > li:last-child {
    border-bottom: 0;
}
.qa figure {
    margin: 0.75rem 0 0;
    max-width: 360px;
}
.qa figure img {
    border: 1px solid var(--line);
}

.prose {
    max-width: 50em;
}
.prose p {
    margin: 0 0 0.75rem;
}

/* webarchive table */
table.archives {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    margin-top: 1rem;
}
table.archives th,
table.archives td {
    text-align: left;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}
table.archives th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}
table.archives td.url {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--muted);
}
table.archives td.date {
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.8125rem;
}
table.archives .actions {
    white-space: nowrap;
}
table.archives .actions a {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--line);
    text-decoration: none;
    font-size: 0.8125rem;
    margin-right: 0.25rem;
}
table.archives .actions a:hover {
    background: var(--accent);
}

ul.simple {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    max-width: 50em;
}
ul.simple li {
    margin-bottom: 0.5rem;
}

hr.rule {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.5rem 0 1.5rem;
}

@media (max-width: 720px) {
    table.archives th.url,
    table.archives td.url,
    table.archives th.date,
    table.archives td.date {
        display: none;
    }

    header {
        padding: 0.75rem 1rem;
    }
    header nav {
        flex-basis: 100%;
        gap: 0.25rem 0.9rem;
    }
    .nav-group {
        gap: 0.9rem;
    }
    .nav-group--right {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
    }
    main {
        padding: 1rem 0.75rem 3rem;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 6px;
    }
    .featured {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .featured .cover {
        max-width: 240px;
    }
    section {
        margin-top: 2rem;
    }
    .page-title {
        font-size: 1.5rem;
    }
}
