/* Ravensmoor Museum ------------------------------------------------------- */

:root {
    --ink: #14161a;
    --ink-soft: #4c5058;
    --paper: #fbf9f5;
    --paper-shade: #f1ebe0;
    --rule: #d5cdbd;
    /* Used wherever a border is the boundary of a control, so it has to clear 3:1. */
    --rule-strong: #8a8578;
    --brass: #75530f;
    --brass-bright: #d9a63c;
    --flag: #7a1f1f;
    --measure: 34rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
}

a {
    color: var(--brass);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Skip link ---------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* Focus -------------------------------------------------------------------- */

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

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    background: var(--ink);
    color: var(--paper);
    outline: 3px solid var(--ink);
    outline-offset: 2px;
    text-decoration: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    background: var(--paper);
    color: var(--ink);
}

/* Layout ------------------------------------------------------------------- */

.shell {
    width: min(72rem, 100%);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.shell--narrow {
    width: min(48rem, 100%);
}

main {
    display: block;
    padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* Typography --------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.01em;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

h3 {
    font-size: 1.2rem;
}

p,
ul,
ol {
    margin: 0 0 1.1em;
}

.prose {
    max-width: var(--measure);
}

.prose a,
.rich-text a {
    color: var(--brass);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.lede {
    font-family: var(--serif);
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    line-height: 1.45;
    color: var(--ink-soft);
    max-width: 40rem;
}

.eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    margin: 0 0 0.6rem;
}

/* Header ------------------------------------------------------------------- */

.site-header {
    background: var(--ink);
    color: var(--paper);
    border-bottom: 4px solid var(--brass-bright);
}

.site-header a {
    color: inherit;
}

.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.1rem;
}

.wordmark {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.1;
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
}

.wordmark span {
    font-family: var(--sans);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass-bright);
    margin-top: 0.25rem;
}

.header-meta {
    font-size: 0.85rem;
    color: #d8d3c8;
    text-align: right;
}

.nav {
    border-top: 1px solid #2c2f36;
}

.nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0.6rem 0;
}

.nav a {
    display: inline-block;
    padding: 0.35rem 0;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    border-bottom-color: var(--brass-bright);
}

.nav .current > a,
.nav .section > a {
    border-bottom-color: var(--brass-bright);
    font-weight: 600;
}

@media (max-width: 46rem) {
    .nav ul {
        gap: 0 1.1rem;
        font-size: 0.9rem;
    }
}

/* Hero --------------------------------------------------------------------- */

.hero {
    background: var(--ink);
    color: var(--paper);
    padding-block: clamp(3rem, 8vw, 5.5rem);
    /* The hero always opens the page, so it cancels main's top padding. */
    margin-top: calc(-1 * clamp(2rem, 5vw, 3.5rem));
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
    position: relative;
    overflow: hidden;
}

.hero .button {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.hero .button:hover {
    background: var(--brass-bright);
    border-color: var(--brass-bright);
    color: var(--ink);
}

.hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
}

/* Scrim over the hero image. Without it a light photograph lifts the background
   far enough that the text over it drops below 4.5:1. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(20, 22, 26, 0.88) 0%, rgba(20, 22, 26, 0.72) 55%, rgba(20, 22, 26, 0.62) 100%);
}

.hero .shell {
    position: relative;
    z-index: 1;
}

.hero h1 {
    max-width: 18ch;
}

/* Brass on the hero only clears 4.5:1 against a reasonably dark image, and an editor
   can upload anything, so the eyebrow uses paper here instead. */
.hero .eyebrow {
    color: var(--paper);
}

.hero p {
    max-width: 44ch;
    font-family: var(--serif);
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    color: #ece7dc;
}

/* Cards -------------------------------------------------------------------- */

.grid {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    list-style: none;
    margin: 0 0 2.5rem;
    padding: 0;
}

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--rule);
}

/* The lead item in a listing spans two columns on wide screens. */
@media (min-width: 52rem) {
    .card--lead {
        grid-column: span 2;
    }

    .card--lead .card__media {
        aspect-ratio: 21 / 9;
    }

    .card--lead h3 {
        font-size: 1.5rem;
    }
}

.card__media {
    aspect-ratio: 3 / 2;
    background: var(--paper-shade);
    overflow: hidden;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card__body {
    padding: 1.1rem 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card h3 {
    margin-bottom: 0.35rem;
}

.card h3 a {
    color: inherit;
    text-decoration: none;
}

.card h3 a:hover {
    text-decoration: underline;
}

.card p {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.card .meta {
    margin-top: auto;
}

.meta {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin: 0;
}

/* Flags -------------------------------------------------------------------- */

.flag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 1px solid currentColor;
    margin-bottom: 0.6rem;
}

.flag--open {
    color: var(--flag);
}

.flag--free {
    color: var(--brass);
}

/* Sections ----------------------------------------------------------------- */

.band {
    border-top: 1px solid var(--rule);
    padding-block: clamp(2rem, 5vw, 3.25rem);
}

.band--shade {
    background: var(--paper-shade);
    border-top: none;
}

.band__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.band__head h2 {
    margin: 0;
}

/* Definition lists --------------------------------------------------------- */

.record {
    border-top: 1px solid var(--rule);
    margin: 0 0 2rem;
}

.record > div {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) 1fr;
    gap: 0 1.5rem;
    border-bottom: 1px solid var(--rule);
    padding: 0.7rem 0;
}

.record dt {
    font-weight: 600;
    font-size: 0.9rem;
}

.record dd {
    margin: 0;
    color: var(--ink-soft);
}

@media (max-width: 32rem) {
    .record > div {
        grid-template-columns: 1fr;
    }
}

/* Buttons ------------------------------------------------------------------ */

.button,
.btn-toolbar input[type="submit"],
.btn-toolbar button {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    border: 2px solid var(--ink);
    padding: 0.6rem 1.25rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.btn-toolbar input[type="submit"]:hover,
.btn-toolbar button:hover {
    background: var(--brass);
    border-color: var(--brass);
}

.button--ghost {
    background: transparent;
    color: var(--ink);
}

.button--ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

/* Forms -------------------------------------------------------------------- */

form {
    max-width: 34rem;
}

form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

form .field {
    margin-bottom: 1.15rem;
}

form label.left,
form legend {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

form input[type="text"],
form input[type="email"],
form input[type="number"],
form input[type="date"],
form input[type="search"],
form select,
form textarea {
    width: 100%;
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid #8a8578;
    background: #fff;
    color: var(--ink);
}

form .description {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 0.3rem;
}

form .message {
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--flag);
    background: var(--paper-shade);
    margin-bottom: 1rem;
}

form .message.good {
    border-left-color: var(--brass);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: none;
    margin-bottom: 2rem;
}

@media (min-width: 42rem) {
    .search-form {
        grid-template-columns: 2fr 1fr auto;
        align-items: end;
    }

    .search-form .btn-toolbar {
        padding-bottom: 0.05rem;
    }
}

/* Pagination --------------------------------------------------------------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--rule-strong);
    text-decoration: none;
    color: var(--brass);
    min-width: 2.5rem;
    text-align: center;
}

.pagination .current span {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
    font-weight: 600;
}

/* Breadcrumbs -------------------------------------------------------------- */

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--rule);
}

.breadcrumbs a {
    color: var(--brass);
}

/* Plate images ------------------------------------------------------------- */

.plate {
    background: var(--paper-shade);
    border: 1px solid var(--rule);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

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

.plate figcaption {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 0.75rem;
}

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

/* Split layout ------------------------------------------------------------- */

.split {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

@media (min-width: 52rem) {
    .split {
        grid-template-columns: 1.6fr 1fr;
    }
}

.aside {
    background: var(--paper-shade);
    border: 1px solid var(--rule);
    padding: 1.25rem 1.4rem;
}

.aside h2 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

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

.aside li + li {
    border-top: 1px solid var(--rule);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
    background: var(--ink);
    color: #ddd8cd;
    padding-block: 2.5rem 2rem;
    font-size: 0.92rem;
}

.site-footer a {
    color: var(--brass-bright);
}

.footer-cols {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.site-footer h2 {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: var(--sans);
    color: #fff;
    margin-bottom: 0.6rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li + li {
    margin-top: 0.3rem;
}

.colophon {
    border-top: 1px solid #2c2f36;
    margin-top: 2rem;
    padding-top: 1.25rem;
    color: #b9b3a6;
    font-size: 0.85rem;
}

/* Utilities ---------------------------------------------------------------- */

.stack > * + * {
    margin-top: 1rem;
}

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

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1.5rem;
}

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

th {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
