/* Album pages load site.css first. Only what differs from the sheet layout
   lives here. */

:root {
    --plate-w: 1100px;
}

body {
    margin: 0;
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.masthead,
.album,
.sitefoot {
    width: 100%;
    max-width: calc(var(--plate-w) + (var(--pad-x) * 2));
}

/* ---- Masthead ---------------------------------------------------------- */
/* The album is a viewing surface, so the rail lies down into a band above it
   at every width rather than only on narrow screens. */

.masthead {
    position: static;
    padding-right: 0;
    margin-bottom: 1.5rem;
}

.masthead nav {
    margin-top: 1.25rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem 2.5ch;
}

/* ---- Album ------------------------------------------------------------- */

.album {
    background: var(--paper);
    border: 1px solid var(--frame);
    border-radius: 4px;
    padding: var(--pad-y) var(--pad-x);
}

.album-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2rem;
    padding-bottom: 1.25rem;
}

.album-head h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.album-head time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted);
}

/* The album head already carries the space the sheet rule gets from margin. */
.album .rule {
    margin-top: 0;
}

/* ---- Album prose ------------------------------------------------------- */
/* Both the header note and the interstitials sit on the site measure, so all
   album prose shares one column width with the rest of the site. */

.standfirst {
    margin: 0 0 2rem;
    max-width: var(--measure);
}

.album>p:not(.standfirst) {
    position: relative;
    max-width: var(--measure);
    margin: 0 0 3.5rem;
    padding-top: 1.3rem;
}

/* A short stub of the album's 2px stroke. A full-width rule beside a photo
   would read as a section break and cut the sequence. */
.album>p:not(.standfirst)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6ch;
    height: 2px;
    background: var(--ink);
}

/* ---- Plates ------------------------------------------------------------ */

.plate {
    margin: 0 0 3.5rem;
}

.plate:last-of-type {
    margin-bottom: 0;
}

.plate-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2ch;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.3rem;
    margin-bottom: 0.9rem;
}

.plate-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.plate-n {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.plate-frame {
    display: flex;
    justify-content: center;
    line-height: 0;
}

/* Remove <picture> from the box tree so block layout reaches the img. */
.plate-frame picture {
    display: contents;
}

.plate-frame img {
    max-width: 100%;
    max-height: var(--plate-w);
    width: auto;
    height: auto;
    box-sizing: border-box;
    border: 1px solid var(--edge);
}

/* ---- Caption row ------------------------------------------------------- */
/* Spec left, button right. flex-end keeps the button on the last spec line
   when the strip wraps. */

.plate figcaption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem 2rem;
    margin-top: 1.4rem;
}

/* ---- Full resolution link ---------------------------------------------- */
/* A .btn that has to sit in a flex row and stay smaller than the prose. */

.plate figcaption .btn {
    flex: 0 0 auto;
    min-width: 0;
    font-size: 0.85rem;
}

.plate figcaption .marker {
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

/* ---- Narrow screens ---------------------------------------------------- */

@media (max-width: 46rem) {
    html {
        font-size: max(15px, 88%);
    }

    body {
        padding: 1rem 0.5rem;
    }

    .album {
        --pad-x: 1rem;
        --pad-y: 1.25rem;
    }

    .album-head {
        flex-direction: column;
        gap: 0.25rem;
    }

    .plate {
        margin-bottom: 2.5rem;
    }

    .plate figcaption {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }
}
