/* ==========================================================================
   Long Exposure — stylesheet
   A quiet, monochrome, print-led design. No JavaScript.
   Type:  Libre Caslon Text (display / titles) + EB Garamond (body)
   Edit the tokens in :root to retune the whole site from one place.
   ========================================================================== */

/* ---- Fonts ------------------------------------------------------------- */
@font-face {
  font-family: "Caslon";
  src: url("../fonts/LibreCaslonText-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Caslon";
  src: url("../fonts/LibreCaslonText-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Caslon";
  src: url("../fonts/LibreCaslonText-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Garamond";
  src: url("../fonts/EBGaramond-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Garamond";
  src: url("../fonts/EBGaramond-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Garamond";
  src: url("../fonts/EBGaramond-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Garamond";
  src: url("../fonts/EBGaramond-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Garamond";
  src: url("../fonts/EBGaramond-SemiBoldItalic.woff2") format("woff2");
  font-weight: 600; font-style: italic; font-display: swap;
}

/* ---- Design tokens ----------------------------------------------------- */
:root {
  /* Palette — quiet, warm-neutral. The photographs carry the contrast. */
  --paper:     #f5f3ee;   /* page background: pulled-back paper, low chroma */
  --ink:       #232220;   /* primary text: warm near-black                 */
  --ink-soft:  #4c4a45;   /* secondary text                                */
  --muted:     #8c887e;   /* dates, captions, meta                         */
  --line:      #ddd8cd;   /* hairlines and rules                           */
  --accent:    #a6443a;   /* muted brick — used with great restraint       */

  /* Type */
  --display: "Caslon", Georgia, "Times New Roman", serif;
  --body:    "Garamond", Georgia, "Times New Roman", serif;

  /* Measure & rhythm */
  --measure: 40rem;       /* reading column (~64 characters)               */
  --wide:    54rem;       /* outer bound: masthead, footer, wide figures   */
  --gutter:  clamp(1.25rem, 5vw, 2.5rem);
  --step:    1.7rem;      /* vertical rhythm unit                          */
}

/* ---- Reset & base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1.62;
  font-feature-settings: "liga" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--ink); color: var(--paper); }

/* ---- Layout shell ------------------------------------------------------ */
.page {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---- Masthead ---------------------------------------------------------- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding: clamp(1.75rem, 5vw, 3rem) 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.masthead__brand { text-decoration: none; color: inherit; }
.masthead__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.5vw, 1.7rem);
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
}
.masthead__tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
}
.masthead__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.masthead__nav a {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible { color: var(--ink); border-color: var(--ink); }

/* ---- Content grid -----------------------------------------------------
   Most elements sit in a centered reading column (--measure); figures and
   other ".bleed" elements break out to the full width (--wide).          */
.prose {
  display: grid;
  grid-template-columns:
    1fr
    min(var(--measure), 100%)
    1fr;
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 1rem;
}
.prose > * { grid-column: 2; }
.prose > .bleed,
.prose > figure { grid-column: 1 / -1; }

/* ---- Article header ---------------------------------------------------- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.article-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}
.article-meta {
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

/* ---- Body typography --------------------------------------------------- */
.prose p { margin: 0 0 var(--step); }
.prose p:first-of-type { margin-top: 0; }

/* A quiet lead/standfirst for the opening paragraph (opt-in). */
.prose .lead {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.prose h2 {
  font-family: var(--body);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: calc(var(--step) * 1.8) 0 0.8rem;
}
.prose h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.005em;
  margin: calc(var(--step) * 1.3) 0 0.5rem;
}

.prose h4 {
  font-family: var(--body);
  font-weight: 600;
  font-style: italic;
  font-size: 1.06rem;
  color: var(--ink-soft);
  margin: calc(var(--step) * 1.1) 0 0.3rem;
}

.prose sup { line-height: 0; }
.prose sup a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.72em;
  padding: 0 0.12em;
}
.prose sup a:hover { text-decoration: underline; }

.footnotes {
  margin-top: calc(var(--step) * 2);
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}
.footnotes__heading {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.footnotes ol { margin: 0; padding-left: 1.4rem; }
.footnotes li {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0.5rem 0;
}
.footnotes li::marker { color: var(--muted); }
.footnotes .fn-back { margin-left: 0.35rem; color: var(--muted); text-decoration: none; }
.footnotes .fn-back:hover { color: var(--ink); }

.prose a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--muted), var(--muted));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 1px;
  transition: background-size 0.15s ease, color 0.15s ease;
}
.prose a:hover,
.prose a:focus-visible {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
}

.prose ul, .prose ol { margin: 0 0 var(--step); padding-left: 1.3rem; }
.prose li { margin: 0.25rem 0; }
.prose li::marker { color: var(--muted); }

.prose blockquote {
  margin: var(--step) 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--line);
  font-style: italic;
  color: var(--ink-soft);
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: calc(var(--step) * 1.6) 0;
}

.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: rgba(35, 34, 32, 0.05);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05em 0.35em;
}
.prose pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: var(--step) 0;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---- Figures: the "print" signature ----------------------------------
   Default = framed like an exhibition print: matting, hairline keyline,
   gallery caption. Swap the class on <figure> to change the treatment
   (see frame-options.html).                                              */
figure { margin: clamp(2rem, 5vw, 3.2rem) auto; }

figure img { margin: 0 auto; }

figcaption {
  font-style: italic;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
  margin-top: 0.9rem;
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
figcaption .label {
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
}

/* (1) PRINT — matted, hairline keyline, centered. The default. */
.frame-print img {
  max-width: min(46rem, 100%);
  padding: clamp(0.8rem, 2.5vw, 1.6rem);
  background: #fbfaf7;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(35, 34, 32, 0.04);
}

/* (2) PLAIN — photo leads, edge to edge, no border. */
.frame-plain img { max-width: min(48rem, 100%); }

/* (3) OFFSET · INK — homage to the original double-square, in quiet ink. */
.frame-offset-ink img {
  max-width: min(42rem, 86%);
  box-shadow:
    -34px -34px 0 -29px var(--muted),
     34px  34px 0 -29px var(--muted);
}

/* (4) OFFSET · RED — the original idea, muted and subtler. */
.frame-offset-red img {
  max-width: min(42rem, 86%);
  box-shadow:
    -34px -34px 0 -29px var(--accent),
     34px  34px 0 -29px var(--accent);
}

/* ---- Homepage: intro, feature, archive --------------------------------- */
.intro {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.feature {
  display: block;
  text-decoration: none;
  color: inherit;
  margin: clamp(2rem, 5vw, 3.2rem) 0;
}
.feature figure { margin-top: 0; margin-bottom: 1.4rem; }
.feature .frame-print img { max-width: min(33rem, 100%); }
.feature__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.12;
  margin: 0 0 0.4rem;
  max-width: var(--measure);
  transition: color 0.15s ease;
}
.feature:hover .feature__title { color: var(--accent); }
.feature__dek {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0 0 0.5rem;
}
.feature__date {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

.archive { margin: clamp(1.5rem, 4vw, 2.5rem) 0 0; }
.archive__heading {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
  margin: 2.2rem 0 0;
  border-bottom: 1px solid var(--line);
}
.archive__list { list-style: none; margin: 0; padding: 0; }
.archive__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.archive__date {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  flex: 0 0 auto;
  min-width: 7rem;
}
.archive__link {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.archive__link:hover,
.archive__link:focus-visible { color: var(--accent); border-color: var(--accent); }

/* ---- Footer ------------------------------------------------------------ */
.footer {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer p { margin: 0 0 0.4rem; }
.footer a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { color: var(--ink); }

/* ---- Back link --------------------------------------------------------- */
.backlink {
  display: inline-block;
  margin-top: var(--step);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.backlink:hover, .backlink:focus-visible { color: var(--ink); }

/* ---- Accessibility & motion ------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 34rem) {
  body { font-size: 19px; }
  .archive__date { min-width: 100%; }
  .frame-offset-ink img,
  .frame-offset-red img { max-width: 90%; }
}
