/* ─────────────────────────────────────────────────────────────
   PeTSA — Untitled-2 layout
   - Sticky black topbar with overlapping logo
   - Page-wide gutter so single + multi-image rows align edge-to-edge
   - row2: same-height pair, 30px inner gap
   - tall4col: tall left image + 4 stacked uniform postcards right
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Barlow:wght@400;500;600;700&family=Crimson+Pro:wght@400;600&family=Archivo+Black&display=swap');

:root {
  --ink:        #141110;
  --paper:      #f1e3c7;
  --paper-deep: #e7d5b0;

  /* page-wide horizontal gutter */
  --pad-x: clamp(1.25rem, 5vw, 4rem);
  /* maximum content width — caps how wide rows stretch */
  --content-max: 1400px;

  /* spacing between rows (vertical) */
  --row-gap: clamp(2rem, 5vw, 4.5rem);
  /* spacing inside multi-image rows (per spec: 30px) */
  --inner-gap: 30px;

  /* topbar */
  --topbar-h: 64px;
  --topbar-logo-h: 132px; /* logo extends below the bar (was 110, +20%) */
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.32  0 0 0 0 0.22  0 0 0 0 0.1  0 0 0 0.55 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Sticky topbar ─────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--ink);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  /* the bottom edge — the "black line" the logo overlaps */
  border-bottom: 1px solid var(--ink);
}

.topbar__mark {
  display: block;
  /* push the logo to span above + below the bar */
  align-self: flex-start;
  position: relative;
  z-index: 1;
}

.topbar__logo {
  display: block;
  height: var(--topbar-logo-h);
  width: auto;
  /* Logo top sits flush with bar top; logo extends below bar bottom.
     White 5px frame on left, right, and bottom (none on top so the
     logo card meets the topbar cleanly). */
  margin-top: 0;
  border: 5px solid #fff;
  border-top: 0;
  background: #fff;
  box-sizing: content-box;
}

.topbar__tag {
  font-family: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(0.7rem, 1vw, 0.95rem);
  color: #fff;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

@media (max-width: 680px) {
  :root {
    --topbar-h: 48px;
    --topbar-logo-h: 96px; /* 80 * 1.2 */
  }
  .topbar__tag {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    max-width: 55%;
  }
}

/* clear the topbar so first row sits below it */
main {
  padding-top: calc(var(--topbar-h) + var(--row-gap));
  padding-bottom: var(--row-gap);
  position: relative;
  z-index: 2;
}

/* ─── Rows container ────────────────────────────────────────── */

#rows {
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ─── Row: intro (mission statement) ────────────────────────── */

.row--intro {
  max-width: 920px;
  margin: 0 auto;
  color: #8b2e1f; /* burgundy / brick */
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.45;
  text-align: left;
  padding: 1rem 0 0;
}

.row--intro p {
  margin: 0 0 1.1em;
}

.row--intro p:last-child {
  margin-bottom: 0;
}

.row--intro strong {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.row--intro .clap-line {
  display: block;
  text-align: center;
  margin: 0.4em 0;
  letter-spacing: 0.05em;
}

.callout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 1.4rem);
  margin: 1.6em 0;
  color: #8b2e1f;
}

.callout__lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  text-align: center;
  font-family: 'Anton', 'Archivo Black', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1.05;
  padding: 0.4em 0.6em;
  flex: 0 1 auto;
}

.callout::before,
.callout::after {
  content: '[';
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: clamp(5rem, 13vw, 9.5rem);
  line-height: 0.85;
  display: flex;
  align-items: center;
  color: #8b2e1f;
}
.callout::after { content: ']'; }

/* ─── Row: full ─────────────────────────────────────────────── */

.row { width: 100%; }

.row--full .tile {
  display: block;
  cursor: zoom-in;
  background: var(--ink);
}
.row--full .tile img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Row: 2-up (same height, 30px gap) ─────────────────────── */
/*
  Each child gets `flex: var(--ar) 0 0`, so its grow factor equals
  its aspect ratio. With identical heights, widths are proportional
  to aspect — exactly what same-height layout requires.
*/
.row--row2 {
  display: flex;
  flex-direction: row;
  gap: var(--inner-gap);
  align-items: stretch;
}

.row--row2 .tile {
  flex: var(--ar) 0 0;
  cursor: zoom-in;
  background: var(--ink);
  min-width: 0;
}

.row--row2 .tile img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Row: tall + 4-col postcards ───────────────────────────── */
/*
  Math (postcard aspect A, page width W, gap G=30):
    wL × 2 = 4 × wR/A + 3G   (heights match)
    wL + G + wR = W
  Solving for typical W ~1200–1400 with A ~1.485 yields a
  ~59 / 41 split, which we hard-code as fr units. The drift at
  smaller widths is ≤1.5 % — invisible.
*/
.row--tall4col {
  display: grid;
  grid-template-columns: 59fr 41fr;
  gap: var(--inner-gap);
  align-items: start;
}

.row--tall4col__left {
  cursor: zoom-in;
  background: var(--ink);
}
.row--tall4col__left img {
  width: 100%;
  height: auto;
  display: block;
}

.row--tall4col__right {
  display: grid;
  grid-template-rows: repeat(4, auto);
  gap: var(--inner-gap);
}

.row--tall4col__right .tile {
  cursor: zoom-in;
  /* Tile bg matches the page so any aspect-mismatch letter-boxing
     blends invisibly with the surrounding paper. */
  background: var(--paper);
  /* Force uniform aspect so all 4 postcards are the same size. */
  aspect-ratio: var(--postcard-ar, 1.4853);
  overflow: hidden;
}

.row--tall4col__right .tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: var(--paper);
}

/* Stack on narrow screens */
@media (max-width: 720px) {
  .row--row2,
  .row--tall4col {
    display: flex;
    flex-direction: column;
    gap: var(--inner-gap);
  }
  .row--row2 .tile { flex: none; }
}

/* ─── Lightbox ───────────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0;
  z-index: 200;
  display: none;
  background: var(--paper);
  overflow: auto;
  /* Bottom padding leaves room for the fixed caption to sit clear of the image */
  padding: 2rem 0 5rem;
}
.lightbox.open { display: block; }

.lightbox__img {
  display: block;
  margin: 0 auto;
  /* Show at native pixel dimensions (full resolution). The lightbox
     container scrolls vertically/horizontally for images larger than
     the viewport. max-width keeps very wide banners from overflowing
     horizontally on small screens. */
  max-width: 100%;
  height: auto;
}

.lightbox__caption {
  position: fixed;
  left: 50%; bottom: 1.25rem;
  transform: translateX(-50%);
  text-align: center;
  color: var(--ink);
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  background: var(--paper);
  padding: 0.4rem 1rem;
  z-index: 1;
}

.lightbox__counter {
  display: block;
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  color: rgba(20, 17, 16, 0.55);
  margin-top: 0.4rem;
  text-transform: uppercase;
}

.lb-btn {
  position: absolute;
  background: none; border: none; cursor: pointer;
  color: rgba(20, 17, 16, 0.5);
  padding: 1rem;
  transition: color 0.15s ease;
}
.lb-btn:hover { color: var(--ink); }
.lb-btn svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 520px) {
  .lb-prev, .lb-next { padding: 0.65rem; }
  .lb-btn svg { width: 28px; height: 28px; }
}

/* ─── A11y ───────────────────────────────────────────────────── */

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.4rem 0.8rem;
  z-index: 300;
}
.skip-link:focus { top: 0; }
