/* Dorset Gallery. A bright, light-only gallery wall: near-white ground,
   each picture on a white mount with a hairline edge, a small museum label
   under it, and sea blue for links. No web fonts: the CSP allows nothing
   off-site, so the serif is whatever the reader already has. */

:root {
  --wall: #fbfaf7;
  --mount: #ffffff;
  --edge: #e4e0d6;
  --ink: #1d2830;
  --muted: #5f6c75;
  --rule: #e4e0d6;
  --sea: #16688f;
  --focus: #16688f;
  color-scheme: light;
}

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

html,
body {
  margin: 0;
}

body {
  background: var(--wall);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sea);
  text-underline-offset: 0.15em;
}

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

/* ---- masthead ------------------------------------------------------------ */

.masthead {
  max-width: 1112px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 104px) 16px clamp(32px, 5vw, 56px);
  text-align: center;
}

.masthead h1,
.masthead .title {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.masthead .title a {
  color: inherit;
  text-decoration: none;
}

.masthead .lede {
  margin: 14px 0 0;
  color: var(--sea);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-style: italic;
  font-weight: 400;
}

.masthead .title + .lede {
  color: var(--ink);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-style: normal;
}

.rooms ul {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 0.95rem;
}

.rooms a {
  text-decoration: none;
  border-bottom: 1px solid var(--edge);
}

.rooms a:hover {
  border-bottom-color: var(--sea);
}

.rooms a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.masthead .area-count,
.masthead .area-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.masthead .area-note {
  font-style: italic;
}

/* A picture's own page: a short masthead with the way back. */
.masthead-small {
  padding-bottom: clamp(20px, 3vw, 32px);
}

.masthead-small .title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

.masthead .crumb {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- the rooms and their walls ------------------------------------------- */

.room {
  max-width: 1112px;
  margin: 0 auto;
  padding: 0 16px;
}

.room + .room {
  margin-top: clamp(64px, 10vw, 112px);
}

.room h2,
.room h3 {
  margin: 0 0 clamp(24px, 4vw, 36px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 400;
  text-align: center;
}

.room .section-note {
  margin: -16px auto 32px;
  max-width: 520px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
}

/* ---- front page cards ---------------------------------------------------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px);
}

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

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  padding: clamp(8px, 1.4vw, 14px);
  background: var(--mount);
  border: 1px solid var(--edge);
  box-shadow: 0 1px 2px rgb(29 40 48 / 0.05), 0 10px 24px -14px rgb(29 40 48 / 0.25);
}

.card-title {
  display: block;
  margin-top: 14px;
  color: var(--sea);
  font-size: 1.25rem;
}

.card a:hover .card-title {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.card-count {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- a picture's own page ------------------------------------------------ */

.piece {
  max-width: 1112px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

.piece img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 78vh;
  padding: clamp(8px, 1.4vw, 16px);
  background: var(--mount);
  border: 1px solid var(--edge);
  box-shadow: 0 1px 2px rgb(29 40 48 / 0.05), 0 14px 32px -16px rgb(29 40 48 / 0.3);
}

.label-large {
  margin-top: 22px;
  justify-items: center;
  font-size: 1rem;
}

.label-large h1 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 400;
}

.label-large h1 cite {
  font-size: inherit;
}

.label-large .links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  font-size: 0.9rem;
}

/* ---- next and previous --------------------------------------------------- */

.pager {
  max-width: 1112px;
  margin: clamp(48px, 8vw, 88px) auto 0;
  padding: 20px 16px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px 24px;
}

.pager a {
  max-width: 40ch;
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
}

.pager span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager-prev {
  grid-column: 1;
  justify-self: start;
}

.pager-up {
  grid-column: 2;
  text-align: center;
}

.pager-next {
  grid-column: 3;
  justify-self: end;
  text-align: right;
}

.wall {
  display: grid;
  gap: clamp(36px, 5vw, 56px) clamp(20px, 3vw, 36px);
  align-items: start;
}

.wall-short {
  max-width: 1112px;
  margin: 0 auto;
  padding: 0 16px 96px;
  text-align: center;
}

.work {
  margin: 0;
}

.work a {
  display: block;
  padding: clamp(8px, 1.4vw, 14px);
  background: var(--mount);
  border: 1px solid var(--edge);
  box-shadow: 0 1px 2px rgb(29 40 48 / 0.05), 0 10px 24px -14px rgb(29 40 48 / 0.25);
  line-height: 0;
}

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

.label {
  margin-top: 14px;
  display: grid;
  gap: 1px;
  font-size: 0.95rem;
}

.label cite {
  font-style: italic;
  font-size: 1.05rem;
}

.label .collection {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  .wall,
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .wall,
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work-wide {
  grid-column: 1 / -1;
}

/* ---- footer and prose ---------------------------------------------------- */

.colophon {
  max-width: 640px;
  margin: clamp(64px, 12vw, 120px) auto 0;
  padding: 24px 16px 56px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.colophon p {
  margin: 0 0 10px;
}

.note {
  margin: 0;
}

.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 96px;
}

.prose h2 {
  margin: 2.2em 0 0.4em;
  font-size: 1.2rem;
  font-weight: 600;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  margin: 0 0 0.9em;
}

.prose ul {
  padding-left: 1.2em;
}

.prose code {
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.prose .meta {
  margin-top: 2.4em;
  color: var(--muted);
  font-size: 0.875rem;
}
