/* ═══════════════════════════════════════════════════════════
   Charter — self-hosted (Bitstream Charter, see fonts/LICENSE.fonts.txt)
   ═══════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Charter';
  src: url('/fonts/charter_regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charter';
  src: url('/fonts/charter_italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Charter';
  src: url('/fonts/charter_bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charter';
  src: url('/fonts/charter_bold_italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Tokens ───────────────────────────────────────────────── */
:root {
  --paper:     #FEFDF2;
  --ink:       #1C1814;
  --muted:     #6E6455;
  --rule:      #D9CFB6;
  --rule-soft: #EAE2CC;

  --measure:   36rem;   /* reading column */
  --gallery:   64rem;   /* gallery break-out */

  --font: 'Charter', Charter, 'Bitstream Charter', 'Sitka Text',
          Cambria, Georgia, 'Times New Roman', serif;
}

/* ─── Base ─────────────────────────────────────────────────── */
html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.62;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  text-rendering: optimizeLegibility;
}

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

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.95rem, 5.5vw, 2.55rem);
  letter-spacing: -0.014em;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: -0.008em;
  margin-bottom: 0.6rem;
}

h3 {
  font-size: 1.06rem;
  margin-bottom: 0.35rem;
}

p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  -webkit-hyphenate-limit-before: 3;
  -webkit-hyphenate-limit-after: 3;
}

p + p { margin-top: 1.05em; }

/* Opening paragraph — set a touch larger, like a document lead */
.lead {
  font-size: 1.11rem;
  line-height: 1.56;
}

/* Single-line / secondary text — never justified */
.tagline,
.note {
  color: var(--muted);
  text-align: left;
  hyphens: none;
}

.tagline {
  font-size: 0.95rem;
  margin-top: 0.45rem;
}

.note { font-size: 0.9rem; }

em, i { font-style: italic; }
strong, b { font-weight: 700; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--rule-soft);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2.5px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: var(--ink); }

/* ─── Layout ───────────────────────────────────────────────── */
.container {
  max-width: calc(var(--measure) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container {
  padding-top: 3.25rem;
  padding-bottom: 1rem;
  flex: 1 0 auto;
}

/* Break out of the reading column (gallery) */
.bleed {
  width: min(var(--gallery), calc(100vw - 3rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

/* ─── Nav ──────────────────────────────────────────────────── */
nav {
  padding-top: 2.25rem;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}

.nav-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

/* ─── Sections ─────────────────────────────────────────────── */
.section {
  margin-bottom: 2.75rem;
}

.section + .section {
  border-top: 1px solid var(--rule-soft);
  padding-top: 2.5rem;
}

.section-label {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
  text-align: left;
  hyphens: none;
}

/* ─── Prose (long-form pages) ──────────────────────────────── */
.prose h2 {
  margin-top: 2.6rem;
  margin-bottom: 0.7rem;
}

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

.prose > p + p { margin-top: 1.05em; }

/* Closing note — just a little extra air, no rule */
.prose .coda {
  margin-top: 2.25rem;
}

/* ─── Inline figures ───────────────────────────────────────── */
.figure {
  margin: 2rem 0;
}

.figure img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--rule-soft);
}

.figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted);
  text-align: left;
  hyphens: none;
}

/* ─── Photo grid ───────────────────────────────────────────── */
.section-label + .bleed { margin-top: 1.35rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* Photos page: strict 4-across */
.photo-grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--rule-soft);
  cursor: zoom-in;
  transition: opacity 0.35s ease;
}

.photo-grid img:hover { opacity: 0.86; }

/* ─── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 16, 0.94);
  z-index: 100;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

/* Arrows sit either side of the image, not pinned to the screen edges */
.lightbox-stage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 96vw;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  cursor: default;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  font-family: var(--font);
  text-align: center;
  max-width: 44ch;
  color: rgba(254, 253, 242, 0.88);
}

/* Title in even capitals — no raised initial. */
.lb-title {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.86rem;
  line-height: 1.3;
}

.lb-location {
  display: block;
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.35;
  margin-top: 0.2rem;
  color: rgba(254, 253, 242, 0.62);
}

/* ─── Lightbox arrows ──────────────────────────────────────── */
.lightbox-nav {
  flex: 0 0 auto;
  align-self: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--paper);
  font-family: var(--font);
  font-size: 2.4rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.lightbox-nav:hover { opacity: 1; }

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: var(--paper);
  font-family: var(--font);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  opacity: 0.65;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

/* ─── Interests ────────────────────────────────────────────── */
.interests {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  color: var(--muted);
}

.interests li:not(:last-child)::after {
  content: '\00B7';
  margin: 0 0.55rem;
  color: var(--rule);
}

/* ─── Footer ───────────────────────────────────────────────── */
footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--rule-soft);
  padding: 1.4rem 0 3.5rem;
  flex-shrink: 0;
}

footer p {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: left;
  hyphens: none;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  html { font-size: 16px; }

  nav .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .nav-links { gap: 1.1rem; }

  main.container { padding-top: 2.25rem; }
}

@media (max-width: 900px) {
  .photo-grid--four { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  .photo-grid,
  .photo-grid--four {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .lightbox-nav {
    font-size: 1.9rem;
    padding: 0.3rem 0.35rem;
  }
  .lightbox-stage { gap: 0.15rem; }
}
