/* Hallie Lartius — site styles. No framework, no build step. */

:root {
  --ink: #1a1b1f;
  --text: #33343a;
  --muted: #5d6068;
  --line: #e4e7ec;
  --paper: #fff;
  --veil: rgb(255 255 255 / 0.86);
  --link: #1a1b1f;
  --focus: #0050bd;

  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max: 940px;
  --gutter: clamp(16px, 4vw, 30px);
  --gap: 5px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  overflow-x: hidden;
}

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

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--muted); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

strong { font-weight: 600; color: var(--ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 760px; }

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

.site-header { position: relative; z-index: 10; }
.header-inner {
  max-width: 1140px; margin: 0 auto; padding: 20px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  font: 500 35px/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: opacity .2s;
}
.brand:hover { color: var(--ink); opacity: .6; }

.site-nav { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: space-between; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0; padding: 0; list-style: none; }
.site-nav ul a {
  display: block; padding: 5px 10px; font-size: 14px; line-height: 20px; letter-spacing: .25px;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent;
}
.site-nav ul a:hover { color: var(--muted); }
.site-nav ul a[aria-current="page"] { border-bottom-color: currentColor; }

.button {
  display: inline-block; padding: 12px 25px; border: 1px solid #000; background: transparent;
  color: #000; font: 600 12px/20px var(--sans); letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; transition: background-color .2s, color .2s; white-space: nowrap;
}
.button:hover { background: #32343a; color: #fff; }

.menu-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px; padding: 0;
  border: 0; background: none; cursor: pointer; color: var(--ink);
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 20px; height: 2px; margin: 0 auto; background: currentColor;
  position: relative; transition: transform .2s, background-color .2s;
}
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 991px) {
  .js .menu-toggle { display: block; }
  .header-inner { flex-wrap: wrap; }
  .js .site-nav {
    display: none; flex-basis: 100%; flex-direction: column; align-items: center; gap: 16px;
    padding: 8px 0 20px; border-top: 1px solid var(--line);
  }
  .js .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; align-items: center; }
  .site-nav ul a { font-size: 16px; padding: 10px; }
  .site-nav { flex-direction: column; }
}
@media (max-width: 479px) { .brand { font-size: 30px; } }

/* ---------- views (one section shown at a time once JS runs) ---------- */

main { min-height: 60vh; }
.view { padding: 30px 0 20px; }
.js main > .view:not(.is-active) { display: none; }
/* Without JS every section stays on the page, one after another. */
.view + .view { border-top: 1px solid var(--line); }
.js .view + .view { border-top: 0; }

.view-title, .sub-title, .coop-h2, .coop-title {
  font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -0.005em;
}
.view-title { font-size: 40px; line-height: 1.1; margin: 10px 0 24px; }
.view-title:focus, .coop-title:focus { outline: none; }
.sub-title { font-size: 26px; margin: 40px 0 12px; }

/* ---------- home ---------- */

.intro { font-size: 15px; font-weight: 300; margin: 20px 0 10px; color: var(--ink); }
.intro strong { font-weight: 700; }
.intro-note { font-size: 15px; font-weight: 300; margin: 0 0 28px; color: var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { position: relative; display: block; overflow: hidden; background: #fafafa; color: #000; }
.tile img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s ease; }
.tile-wide { grid-column: 1 / -1; background: none; }
.tile-wide img { aspect-ratio: auto; object-fit: contain; max-width: 820px; margin: 0 auto; }
.tile-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; background: var(--veil);
  font: 300 30px/1.2 var(--sans); color: #000;
  opacity: 0; transition: opacity .25s ease;
}
.tile:hover .tile-label, .tile:focus-visible .tile-label { opacity: 1; }
.tile:hover img { transform: scale(1.02); }
.ext { font-size: .6em; vertical-align: .35em; }
/* Touch screens can't hover, so their labels always show (lighter veil, as on the original). */
@media (hover: none) {
  .tile-label { opacity: 1; background: rgb(255 255 255 / 0.6); text-shadow: 0 1px 2px #fff; font-size: 22px; }
}
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile-label { font-size: 20px; }
}

/* ---------- research & writing lists ---------- */

.works { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.works li { margin: 0 0 14px; padding-left: 0; }
.works li > a:first-child { text-decoration: none; }
.works li > a:first-child strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: #b9bcc4; }
.works li > a:first-child:hover strong { text-decoration-color: currentColor; color: var(--muted); }

/* ---------- galleries ---------- */

/* Galleries: an even grid of cropped thumbnails for a quick scan; the viewer shows each
   photo whole. Per gallery, set --cols (desktop), --cols-sm (phones) and --cell (thumbnail
   shape, e.g. 1 for square or 3/4 for posters) in its style attribute. */
.gallery {
  display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 6px; margin: 16px 0 0;
}
.row { display: contents; }
.ph {
  position: relative; display: block; aspect-ratio: var(--cell, 1); overflow: hidden;
  background: #f2f2f2; cursor: zoom-in;
}
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .25s; }
.ph:hover img, .ph:focus-visible img { transform: scale(1.04); filter: brightness(.92); }
.ph:focus-visible { outline-offset: -2px; }
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(var(--cols-sm, 3), minmax(0, 1fr)); gap: 4px; }
}

.series { margin: 0 0 48px; }
.series-title { font: 600 15px/1.4 var(--sans); color: var(--ink); margin: 0 0 4px; }
.series-title .amp { font-weight: 400; }
.series-note { font-size: 15px; font-weight: 300; margin: 0 0 12px; }
.prose { font-size: 15px; font-weight: 300; max-width: 72ch; }
.prose p { margin: 0 0 10px; }
.prose .meta { margin-bottom: 14px; }

/* A series whose text sits beside its photos on wide screens. */
@media (min-width: 860px) {
  .series-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; align-items: start; }
  .series-feature .series-title { grid-column: 1; }
  .series-feature .prose { grid-column: 1; }
  .series-feature .gallery { grid-column: 2; grid-row: 1 / span 2; margin-top: 4px; }
}

/* ---------- cooperative model ---------- */

.coop { padding-top: 0; }
.coop-hero { position: relative; max-width: 1400px; margin: 0 auto; }
.coop-hero-text {
  text-align: right; padding: 40px var(--gutter) 0; position: absolute; right: 0; top: 0; z-index: 1;
  max-width: 60%;
}
.coop-title { font-size: clamp(34px, 4.2vw, 50px); line-height: 1.05; margin: 30px 0 14px; }
.coop-tagline { font-size: clamp(16px, 1.6vw, 20px); margin: 0; color: var(--ink); }
.coop-hero > img { width: 100%; padding-top: 110px; }

.lede { font: italic 600 20px/1.5 var(--serif); color: var(--ink); margin: 16px 0 22px; }
.coop-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-around; margin-bottom: 40px; }

.coop-h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; margin: 0 0 16px; }
.pull { font: italic 600 20px/1.5 var(--serif); color: var(--ink); }
.pull-sans { font-size: 20px; line-height: 1.5; color: var(--ink); }
.split p, .narrow p, .steps { font-size: 17px; font-weight: 300; line-height: 1.75; }
.split .pull, .narrow .pull { font-size: 20px; font-weight: 600; line-height: 1.5; }
.split .pull-sans { font-size: 19px; font-weight: 400; }

.split {
  max-width: 1400px; margin: 40px auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.split-reverse .split-art { order: -1; }
.align-end { text-align: right; }

.steps { padding-left: 1.4em; margin: 0 0 18px; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { font-family: var(--serif); font-weight: 600; color: var(--ink); }

.coop-closer { max-width: 1400px; margin: 20px auto 0; padding: 0 var(--gutter); }
.mirror { transform: scaleX(-1); }

@media (max-width: 767px) {
  .coop-hero-text { position: static; max-width: none; text-align: left; padding-top: 10px; }
  .coop-hero > img { padding-top: 0; }
  .split { grid-template-columns: 1fr; gap: 16px; margin: 32px auto; }
  .split-reverse .split-art { order: 0; }
  .align-end { text-align: left; }
  .coop-actions { justify-content: flex-start; }
}

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

.site-footer { padding: 60px 0 40px; }
.site-footer .container {
  border-top: 1px solid var(--line); padding-top: 32px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font: 14px/1.4 var(--serif); color: #3a4554;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

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

.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgb(0 0 0 / 0.92); color: #fff;
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.6); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 64px 48px; max-width: 100%; max-height: 100%; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 140px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-caption { font-size: 14px; color: #d6d6d6; text-align: center; max-width: 70ch; min-height: 1.4em; }
.lb-btn {
  position: absolute; border: 0; background: rgb(0 0 0 / 0.35); color: #fff; cursor: pointer;
  font: 300 40px/1 var(--sans); width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: background-color .2s;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.18); }
.lb-close { top: 10px; right: 10px; font-size: 34px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 14px; left: 0; right: 0; margin: 0; text-align: center; font-size: 13px; color: #bdbdbd; pointer-events: none; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }
@media (max-width: 600px) {
  .lb-figure { padding: 56px 8px 40px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}
