/* DESIGNDSCHUNGEL
   White gallery wall, black ink, one foliage green.
   Display: Bodoni Moda (set in caps). Text: Instrument Sans. Both SIL OFL, self-hosted. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #161616;
  --mute: #6b6b6b;
  --line: #e2e2e2;
  --wash: #f5f5f3;
  --green: #2f4a3a;

  --display: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --text: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --page: 82rem;
  --wide: 68rem;
  --media: 50rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --gap: clamp(1.25rem, 2.6vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, iframe { max-width: 100%; }
img { height: auto; border: 0; }

a { color: inherit; text-decoration: none; }

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

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -999rem;
  top: 0;
  z-index: 10;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--paper);
}
.skip:focus { left: 0; }

/* Small tracked caps: the one label style used everywhere */
.label,
.site-nav a,
.site-tools a,
.site-footer,
.pager,
.menu-btn {
  font: 500 .6875rem/1.4 var(--text);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.label { color: var(--mute); }
.label a:hover { color: var(--green); }

/* Titles arrive in caps or mixed case; both are set as tracked Bodoni capitals */
.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-optical-sizing: auto;
  text-transform: uppercase;
  letter-spacing: .045em;
  line-height: 1.22;
  overflow-wrap: break-word;
  text-wrap: balance;
}

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

.site-header { border-bottom: 1px solid var(--line); }

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding-block: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.1rem, 2.4vw, 1.75rem);
}

.wordmark {
  grid-column: 2;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 3.6vw, 2.5rem);
  letter-spacing: .3em;
  margin-right: -.3em; /* optically cancel the trailing tracking */
  line-height: 1;
  white-space: nowrap;
}

.site-tools {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.lang { display: flex; gap: .6rem; }
.lang [aria-current] { color: var(--ink); }
.lang a:not([aria-current]) { color: var(--mute); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem clamp(1.25rem, 3vw, 2.75rem);
  margin: 0;
  padding: 0 0 1.15rem;
  list-style: none;
}
.site-nav a,
.site-tools a {
  display: inline-block;
  padding-block: .4rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s ease, color .2s;
}
.site-nav a:hover,
.site-tools a:hover,
.site-nav a[aria-current] { background-size: 100% 1px; }
.site-tools a:hover { color: var(--ink); }

.site-nav .only-small { display: none; }

.menu-btn {
  display: none;
  grid-column: 3;
  justify-self: end;
  margin: 0 -.5rem 0 0;
  padding: .75rem .5rem;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

@media (max-width: 47.99rem) {
  .masthead { grid-template-columns: 1fr auto; padding-block: 1rem; }
  .wordmark { grid-column: 1; justify-self: start; letter-spacing: .22em; }
  .site-tools { display: none; }
  .site-nav .only-small { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 0 .75rem;
    border-top: 1px solid var(--line);
  }
  .site-nav li + li { border-top: 1px solid var(--line); }
  .site-nav a { display: block; padding-block: 1rem; background: none; font-size: .75rem; }
  .site-nav a[aria-current] { color: var(--green); }
  .site-nav .lang-row { display: flex; gap: 1.5rem; }
  .site-nav .lang-row a:not([aria-current]) { color: var(--mute); }
  /* Without JS the list simply stays open */
  .js .menu-btn { display: block; }
  .js .site-nav { display: none; }
  .js .site-header.is-open .site-nav { display: block; }
}

/* ---------- Main ---------- */

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

/* Hero: the latest story, image against type */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
  margin-bottom: clamp(4rem, 9vw, 8rem);
}
.hero-media { display: block; overflow: hidden; background: var(--wash); }
.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 86vh;
  object-fit: cover;
}
.hero-body { padding-bottom: clamp(0rem, 2vw, 2rem); }
.hero .title {
  margin-block: 1.5rem 1.75rem;
  font-size: clamp(1.75rem, 3.5vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: .035em;
}
.hero-excerpt { max-width: 34rem; margin: 0 0 2rem; color: #3d3d3d; }

.more {
  display: inline-block;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--ink);
  font: 500 .6875rem/1.4 var(--text);
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
}
.more:hover { color: var(--green); border-color: var(--green); }

@media (max-width: 47.99rem) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-media { margin-inline: calc(var(--gutter) * -1); }
  .hero-media img { max-height: none; }
}

/* Page heading for category, tag, archive and static pages */
.page-head {
  max-width: var(--wide);
  margin: clamp(.5rem, 3vw, 2.5rem) auto clamp(3rem, 7vw, 5.5rem);
  text-align: center;
}
.page-head .title { font-size: clamp(2rem, 5.5vw, 4rem); line-height: 1.1; letter-spacing: .06em; }
.page-head .label { display: block; margin-bottom: 1.25rem; }
.page-head .intro { max-width: var(--measure); margin: 1.75rem auto 0; color: #3d3d3d; }

/* Post grid: three columns, the middle one hung lower */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 5.5rem) var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 62rem) {
  .grid--hung > :nth-child(3n + 2) { margin-top: 5rem; }
}
@media (max-width: 61.99rem) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 35.99rem) { .grid { grid-template-columns: 1fr; } }

.card-media { display: block; overflow: hidden; background: var(--wash); }
.card-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2, .6, .2, 1);
}
.card:hover .card-media img { transform: scale(1.025); }
.card-media--empty { aspect-ratio: 4 / 5; }

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
}
.meta .cats { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--ink); }
.card .meta { margin-top: 1.1rem; }

.ad { color: var(--mute); }

.card .title { margin-top: .7rem; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.3; }
.card .title a,
.neighbours .title {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .45s ease;
}
.card .title a:hover,
.neighbours a:hover .title { background-size: 100% 1px; }

/* Pagination */
.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(4rem, 9vw, 7.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.pager .count { grid-column: 2; color: var(--mute); }
.pager .next { grid-column: 3; justify-self: end; text-align: right; }
.pager a { padding-block: .5rem; transition: color .2s; }
.pager a:hover { color: var(--green); }

/* ---------- Post ---------- */

.post-head {
  max-width: var(--wide);
  margin: clamp(.5rem, 3vw, 2.5rem) auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}
.post-head .title { font-size: clamp(1.75rem, 4.6vw, 3.5rem); line-height: 1.14; margin-block: 1.5rem; }
.post-head .label { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; }
.post-head .cats { display: contents; color: var(--ink); }

.post-lead { max-width: var(--media); margin: 0 auto clamp(2.5rem, 5vw, 4rem); }
.post-lead img { display: block; width: 100%; }

/* Running text holds a reading measure; pictures may run wider */
.prose { max-width: var(--wide); margin-inline: auto; }
.prose :where(p, h2, h3, h4, h5, ul, ol, dl, blockquote, figcaption, table, pre) {
  max-width: var(--measure);
  margin-inline: auto;
}
.prose p { margin-block: 0 1.5em; }
.prose br + br { display: none; }
.prose > br, .prose div > br { display: none; }
.prose div:empty { display: none; }

.prose :where(h2, h3, h4, h5) {
  margin-block: 2.6em .9em;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.3;
  text-wrap: balance;
}
.prose h2 { font-size: 1.625rem; }
.prose h3 { font-size: 1.375rem; }
.prose h4, .prose h5 { font-size: 1.125rem; letter-spacing: .06em; }

.prose strong, .prose b { font-weight: 600; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: #9a9a9a;
  transition: color .2s, text-decoration-color .2s;
}
.prose a:hover { color: var(--green); text-decoration-color: currentColor; }

.prose :where(ul, ol) { margin-block: 0 1.5em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; padding-left: .3em; }
.prose li::marker { color: var(--mute); }

.prose blockquote {
  margin-block: 2.75em;
  padding: 0;
  font-family: var(--display);
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  line-height: 1.4;
  text-align: center;
}
.prose blockquote p { margin: 0; }

.prose img { display: block; margin-inline: auto; }
.prose a:has(> img) { display: block; }
.prose p:has(img) { max-width: var(--media); }
.prose > img,
.prose figure,
.prose p:has(img) { margin-block: clamp(2rem, 4.5vw, 3.5rem); }
.prose > img, .prose div > img { max-width: min(100%, var(--media)); }
.prose figure { margin-inline: auto; max-width: var(--media); }
.prose figure img { width: 100%; }
.prose figcaption,
.prose .caption {
  margin-top: .9rem;
  color: var(--mute);
  font-size: .8125rem;
  line-height: 1.5;
  text-align: center;
}

/* Galleries: explicit .gallery, or any div holding several figures */
.prose .gallery,
.prose div:has(> figure + figure) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(.5rem, 1.4vw, 1rem);
  align-items: start;
  margin-block: clamp(2rem, 4.5vw, 3.5rem);
}
.prose .gallery > *,
.prose div:has(> figure + figure) > figure { margin: 0; max-width: none; }
@media (max-width: 35.99rem) {
  .prose .gallery,
  .prose div:has(> figure + figure) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.prose iframe,
.prose video {
  display: block;
  width: 100%;
  max-width: var(--media);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: clamp(2rem, 4.5vw, 3.5rem) auto;
  border: 0;
  background: var(--wash);
}
.prose hr { max-width: var(--measure); margin: 3em auto; border: 0; border-top: 1px solid var(--line); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.post-foot {
  max-width: var(--measure);
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.tags { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0; padding: 0; list-style: none; }

/* Previous / next */
.neighbours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(4rem, 9vw, 7rem);
  border-block: 1px solid var(--line);
}
.neighbours a { display: block; padding: clamp(1.5rem, 4vw, 3rem) 0; }
.neighbours .next { grid-column: 2; padding-left: var(--gap); border-left: 1px solid var(--line); text-align: right; }
.neighbours .prev { padding-right: var(--gap); }
.neighbours .title { display: inline; font-size: clamp(1rem, 1.6vw, 1.3125rem); line-height: 1.4; }
.neighbours .label { display: block; margin-bottom: .8rem; }
@media (max-width: 35.99rem) {
  .neighbours { grid-template-columns: 1fr; }
  .neighbours .next { grid-column: 1; padding-left: 0; border-left: 0; text-align: left; }
  .neighbours .prev + .next { border-top: 1px solid var(--line); }
}

.related { margin-top: clamp(4rem, 9vw, 7rem); }
.section-title {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  text-align: center;
  color: var(--ink);
}

/* ---------- Archive: a typographic index ---------- */

.year {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 1rem var(--gap);
  padding-block: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--ink);
}
.year h2 {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  margin: 0;
  font: 400 clamp(2.5rem, 6vw, 4.5rem)/1 var(--display);
  letter-spacing: .02em;
  font-variant-numeric: lining-nums;
}
.year h2 small {
  display: block;
  margin-top: .9rem;
  color: var(--mute);
  font: 500 .6875rem/1.4 var(--text);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.index { margin: 0; padding: 0; list-style: none; }
.index li + li { border-top: 1px solid var(--line); }
.index a {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding-block: .8rem;
  transition: color .2s;
}
.index a:hover { color: var(--green); }
.index .t {
  font-family: var(--display);
  font-size: 1.0625rem;
  letter-spacing: .045em;
  text-transform: uppercase;
  line-height: 1.4;
}
.index .label { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 47.99rem) {
  .year { grid-template-columns: 1fr; }
  .year h2 { position: static; }
  .index a { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .index .c { display: none; }
}

/* ---------- 404 ---------- */

.lost { padding-block: clamp(2rem, 8vw, 6rem); text-align: center; }
.lost .title { font-size: clamp(5rem, 18vw, 11rem); line-height: 1; letter-spacing: .04em; }
.lost p { max-width: 30rem; margin: 2rem auto 2.5rem; }

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

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--mute);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem 2.5rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-block; padding-block: .35rem; color: var(--ink); transition: color .2s; }
.site-footer a:hover { color: var(--green); }
.site-footer p { margin: 0; padding-block: .35rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .card:hover .card-media img { transform: none; }
}

@media print {
  .site-nav, .site-tools, .menu-btn, .pager, .neighbours, .related, .site-footer ul { display: none; }
}
