/* axython.com - darkroom journal
   One theme (dark), one accent, photos undecorated. */

@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/eb-garamond-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('/fonts/eb-garamond-italic-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #141210;
  --bg-scrim: rgb(20 18 16 / 0.96);
  --ink: #e9e3d7;
  --ink-2: #c9c1b2;
  --muted: #978d7e;
  --accent: #d09a58;
  --line: rgb(233 227 215 / 0.14);
  --gap: 6px;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

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

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

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* ---------- header / footer ---------- */

.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.1;
  padding-bottom: 2px; /* italic descender reserve */
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }

.site-nav { display: flex; gap: 1.75rem; }
.site-nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }

.site-foot {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- shared type ---------- */

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- homepage stream ---------- */

.stream { padding-block: 1.5rem 0; }

.entry { padding-block: 2.75rem; }
.entry + .entry { border-top: 1px solid var(--line); }

.entry h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
.entry h2 a { text-decoration: none; }
.entry .meta { margin: 0 0 0.6rem; }
.entry .excerpt {
  margin: 0.7rem 0 0;
  max-width: 62ch;
  color: var(--ink-2);
}

/* strip fills the row exactly: same aspect-ratio flex trick as .jrow */
.entry--book .strip {
  display: flex;
  gap: var(--gap);
  margin-top: 1.4rem;
}
.strip img {
  flex: var(--ar) 1 0%;
  min-width: 0;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
}
@media (max-width: 640px) {
  .strip img:nth-child(n+4) { display: none; }
}
a.striplink { display: block; text-decoration: none; }
a.striplink:hover img { opacity: 0.88; }

/* ---------- photobook ---------- */

.book-head { padding-block: 2.5rem 2rem; max-width: 46rem; }
.book-head h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); }
.book-head .meta { margin: 1rem 0 0; }
.standfirst {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 1.1rem 0 0;
  padding-bottom: 2px; /* italic descender reserve */
}

/* justified rows: flex-grow proportional to aspect ratio equalises heights */
.jrow { display: flex; gap: var(--gap); margin-block: var(--gap); }
.jrow .ph { flex: var(--ar) 1 0%; min-width: 0; display: block; }
.jrow .ph img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
}
.jrow .ph:hover img { opacity: 0.88; }

.note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  max-width: 46ch;
  margin: 0 auto;
  padding-block: 3rem;
}

.book-foot { padding-block: 3rem 0; }
.book-foot a { font-size: 0.95rem; color: var(--muted); text-decoration: none; }

@media (max-width: 640px) {
  .jrow { flex-direction: column; }
  .jrow .ph { flex: none; }
}

/* ---------- prose (posts, about) ---------- */

.prose {
  max-width: 42rem;
  padding-block: 2.5rem 0;
}
.prose h1 { font-size: clamp(2.1rem, 5.5vw, 3rem); margin-bottom: 1rem; }
.prose .meta { display: block; margin-bottom: 2.2rem; }
.prose p {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.72;
  color: var(--ink-2);
  margin: 0 0 1.4rem;
}
.prose blockquote {
  margin: 2.2rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
}
.prose blockquote p { margin: 0; color: inherit; }
.prose .backlink { font-size: 0.95rem; color: var(--muted); text-decoration: none; }
.prose footer { margin-top: 3rem; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg-scrim);
  display: grid;
  place-items: center;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}
.lightbox img {
  max-inline-size: 94vw;
  max-block-size: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-2);
  text-align: center;
  max-width: 60ch;
  padding-inline: 1rem;
  padding-bottom: 3px; /* italic descender reserve */
}
.lb-caption[hidden] { display: none; }
.lb-close {
  position: absolute;
  top: 0.75rem;
  right: 1.1rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem;
}
.lb-close:hover { color: var(--ink); }

/* ---------- motion ---------- */

a, .jrow .ph img, .strip img, .lb-close { transition: color 0.2s ease, opacity 0.25s ease; }

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