/* Fontmorand - memoir stylesheet. Palette and type per the 2026-07-20 reimagining spec. */
:root {
  --paper: #faf8f3;
  --ink: #26221c;
  --ink-soft: #4a443a;
  --muted: #8a8272;
  --hairline: #e6e1d5;
  --accent: #8c2f24;
  --mount: #ffffff;
  --band: #f3f0e9;
  --measure: 620px;
  --plate-max: 820px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.8;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.4rem 2.5rem;
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.masthead-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.masthead-nav a {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.masthead-nav a:hover, .masthead-nav a.is-active { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font: inherit;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: .4rem .8rem;
  cursor: pointer;
}

/* ---------- Openings and prose ---------- */
.kicker {
  font-size: .72rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-opening {
  max-width: 660px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  text-align: center;
}
.page-opening .kicker { margin-bottom: 1.2rem; }
.chapter-title {
  font-size: 3.2rem;
  line-height: 1.1;
  font-weight: normal;
  margin: 0 0 1.2rem;
}
.page-opening p { font-size: 1.08rem; color: var(--ink-soft); margin: 0; }
.prose { max-width: var(--measure); margin: 0 auto; padding: 0 2rem; }
.prose + .prose { margin-top: 1.2rem; }
.prose h2 {
  font-size: 1.6rem;
  font-weight: normal;
  margin: 3rem 0 .8rem;
}
.prose .kicker { display: block; margin: 3rem 0 .4rem; }
.prose .kicker + h2 { margin-top: 0; }
.dropcap::first-letter {
  float: left;
  font-size: 3.3rem;
  line-height: .85;
  padding: 5px 10px 0 0;
  color: var(--accent);
}

/* ---------- Plates ---------- */
.plate {
  background: var(--mount);
  padding: 16px 16px 14px;
  box-shadow: 0 8px 24px rgba(38, 34, 28, .12);
  max-width: var(--plate-max);
  margin: 2.5rem auto;
  transition: transform .2s ease, box-shadow .2s ease;
}
.plate:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(38, 34, 28, .16); }
.plate-wrap { padding: 0 2rem; }
.plate-narrow { max-width: 480px; }
.plate img { width: 100%; }
.plate-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
  color: var(--muted);
  padding-top: 10px;
}
.plate-caption em, .plate-caption .cap { font-style: italic; }
a.plate-link { text-decoration: none; color: inherit; display: block; }

/* Small historical artefacts (tiny source images shown at natural size) */
.artefact-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2.5rem auto;
  padding: 0 2rem;
}
.artefact { margin: 0; }
.artefact .plate { margin: 0; padding: 12px 12px 10px; }
.artefact img { width: auto; }

/* ---------- Album grid (The Photographs) ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1080px;
  margin: 2.5rem auto;
  padding: 0 2rem;
}
.album-grid .plate { margin: 0; max-width: none; }
/* Uniform 4:3 windows so mixed-orientation photos sit calmly in the grid;
   the lightbox still shows each photograph uncropped. */
.album-grid .plate img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Film plate ---------- */
.film-plate .film-poster { position: relative; }
.film-play {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.film-play span {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(38, 34, 28, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
.film-play:hover span { transform: scale(1.06); }
.film-play span::after {
  content: '';
  border-left: 22px solid var(--paper);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  margin-left: 6px;
}
.film-plate iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }

/* ---------- Bands and chapter index ---------- */
.band {
  border-top: 1px solid var(--hairline);
  background: var(--band);
  padding: 3rem 2.5rem;
  margin-top: 3.5rem;
}
.chapter-index {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 2.5rem;
}
.chapter-card { text-decoration: none; color: inherit; display: block; }
.chapter-card .kicker { letter-spacing: .25em; }
.chapter-card h3 { font-size: 1.35rem; font-weight: normal; margin: .3rem 0; }
.chapter-card p { font-size: .92rem; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.chapter-card:hover h3 { color: var(--accent); }

/* ---------- Colophon ---------- */
.colophon {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 1.5rem 2rem 0;
  border-top: 1px solid var(--hairline);
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
  margin-top: 3.5rem;
}
.band + .site-footer { margin-top: 0; }
.site-footer a { color: var(--muted); }

/* ---------- Lightbox (markup created by js/lightbox.js) ---------- */
/* .gallery and .gallery-item are the lightbox's JS hooks (see js/lightbox.js);
   their visual styling comes from .album-grid, .plate and .plate-link. */
.gallery-item { cursor: pointer; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 34, 28, .92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-image { max-width: 88vw; max-height: 82vh; width: auto; height: auto; }
.lightbox-caption {
  position: absolute;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--paper);
  font-style: italic;
  font-size: .95rem;
  margin: 0;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: none;
  border: 0;
  color: var(--paper);
  font-size: 2.4rem;
  font-family: Georgia, serif;
  cursor: pointer;
  padding: 1rem;
}
.lightbox-close { top: .5rem; right: 1rem; }
.lightbox-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .5rem; top: 50%; transform: translateY(-50%); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .masthead { padding: 1rem 1.2rem; flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .masthead-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: .9rem;
    padding-top: 1rem;
  }
  .masthead-nav.is-open { display: flex; }
  .chapter-title { font-size: 2.2rem; }
  .page-opening { padding: 2.5rem 1.2rem 2rem; }
  .prose, .plate-wrap, .artefact-row { padding-left: 1.2rem; padding-right: 1.2rem; }
  .chapter-index { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: 1fr; padding: 0 1.2rem; }
}
