/* Spectrum Impact. Journal pages: essays, press, events.
   Built on the tokens and parts in site.css (rows, chips, facts, doors, footer).
   The homepage does not load this file. */

/* ----------------------------------------------------------- page head */

.pg-head { padding-top: calc(var(--nav-h) + clamp(16px, 3.4vh, 44px)); }
.pg-head h1 { margin-top: clamp(18px, 2.6vw, 40px); }
.pg-meta { margin-top: clamp(22px, 2.4vw, 36px); font: 400 0.75rem/1.5 var(--num); color: var(--fg3); }
.pg-meta b { font-weight: 500; color: var(--fg); }

/* The switch. Essays, press and events are three shelves of one journal. "Journal" is a plain label now:
   the journal has no page of its own, its three shelves are the pages. */
.jn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 clamp(16px, 1.8vw, 28px); font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.005em; }
.jn a, .jn-root { display: inline-block; padding-block: 10px; color: var(--fg3); transition: color 0.3s var(--ease-q); }
.jn a span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 3px; transition: background-size 0.45s var(--ease); }
.jn a[aria-current="page"] { color: var(--fg); }
.jn a[aria-current="page"] span { background-size: 100% 1px; }
.jn sup { top: 0.2em; margin-left: 0.3em; }
.jn-root::after { content: "/"; display: inline-block; margin-left: clamp(16px, 1.8vw, 28px); color: var(--fg3); font-weight: 400; pointer-events: none; }
@media (hover: hover) {
  .jn a:hover { color: var(--fg); }
  .jn a:hover span { background-size: 100% 1px; }
}

/* ----------------------------------------------------------- portfolio */

/* portfolio.html. One wall, two groups: investments, then partner organizations, led by the two initiatives
   the team runs itself. Tiles, chips and the grid are the home page parts from site.css. New here: the
   segmented control, the group heads, the two initiative entries, the empty state, the deep link mark. */
.pf-tools { align-items: flex-end; }
.pf-filters { display: grid; gap: 10px; justify-items: end; min-width: 0; }
.pf-filters .chips { justify-content: flex-end; }
/* All, Investments, Partner organizations: one control, so one outline around the three. On a phone the
   third reads "Partners", and the control is a plain full width row, never a scroller: all three show whole. */
.seg-in { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg-in .chip { border-color: transparent; }
.seg-s { display: none; }
.pf-body { padding-bottom: var(--sec); }
.pf-group + .pf-group { margin-top: clamp(72px, 9vw, 160px); }
.pf-gh { display: grid; gap: 14px 40px; align-items: end; padding-block: clamp(8px, 1vw, 16px) clamp(22px, 2.6vw, 40px); }
.pf-gh h2 { font-size: clamp(2.25rem, 5.4vw, 5.75rem); text-wrap: balance; }
.pf-gh p { max-width: 31rem; font-size: clamp(1rem, 1.25vw, 1.25rem); line-height: 1.42; color: var(--fg2); text-wrap: pretty; }

/* The initiatives. Two black panels at the head of the partner group, each a link to its own site. */
.pf-flags { display: grid; gap: 1px; margin-bottom: clamp(28px, 3.4vw, 56px); }
.pf-flag {
  position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr auto;
  gap: 18px 24px; min-height: clamp(300px, 31vw, 460px); padding: clamp(18px, 2vw, 32px) clamp(18px, 2vw, 32px) clamp(22px, 2.2vw, 36px);
}
.pf-flag-k, .pf-flag-go { font: 400 0.75rem/1.3 var(--num); color: var(--fg3); }
.pf-flag-go { grid-area: 1 / 2; color: var(--fg); }
.pf-flag-go::after { content: "\2197"; content: "\2197" / ""; display: inline-block; margin-left: 0.5em; font-family: var(--sans); transition: transform 0.45s var(--ease); }
.pf-flag-t { --t: clamp(4.5rem, 11.4vw, 12rem); grid-area: 2 / 1 / auto / -1; align-self: start; margin-top: clamp(28px, 3.6vw, 64px); font-weight: 600; font-size: var(--t); letter-spacing: -0.055em; line-height: 0.8; margin-left: calc(var(--t) * -0.04); }
/* The official name under the short one, in the small type the home and events pages give it. */
.pf-flag-exp { display: block; max-width: 34rem; margin: clamp(14px, 1.4vw, 20px) 0 0 calc(var(--t) * 0.04); font: 400 0.75rem/1.45 var(--num); letter-spacing: 0.01em; color: var(--fg2); text-wrap: balance; }
.pf-flag-b { grid-area: 3 / 1 / auto / -1; display: grid; gap: 6px; max-width: 31rem; font-size: clamp(1rem, 1.2vw, 1.1875rem); line-height: 1.4; color: var(--fg2); text-wrap: pretty; }
.pf-flag-b b { font-weight: 500; color: var(--fg); }
.pf-flag::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--spectrum); transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease); }
.pf-flag:focus-visible::after, .pf-flag.is-lit::after, .pf-flag.is-target::after { transform: scaleX(1); }
.pf-flag:focus-visible { outline-offset: -4px; }
@media (hover: hover) {
  .pf-flag:hover::after { transform: scaleX(1); }
  .pf-flag:hover .pf-flag-go::after { transform: translate(3px, -3px); }
}

/* A deep link (portfolio.html#<org id>) opens its tile and rings it in the tile's own color for a moment. */
.tile.is-target { z-index: 2; outline: 2px solid var(--tc, currentColor); outline-offset: -2px; }

.pf-empty { padding-block: clamp(48px, 8vw, 128px); border-top: 1px solid var(--line); font-size: clamp(1.5rem, 3vw, 2.75rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.pf-empty .link-arrow { font-size: 1.0625rem; letter-spacing: 0; margin-left: 0.6em; vertical-align: middle; }

@media (min-width: 700px) {
  .pf-flags { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .pf-gh { grid-template-columns: minmax(0, 1fr) minmax(0, 31rem); }
}
@media (max-width: 699px) {
  /* Each control is one sideways row with the fade from site.css. The segment outline travels with its row. */
  .pf-filters { width: 100%; justify-items: start; gap: 8px; }
  .pf-filters .chips { justify-content: flex-start; }
  .chips.seg { overflow: visible; width: auto; margin-inline: 0; padding-inline: 0; -webkit-mask-image: none; mask-image: none; }
  .seg-in { flex: 1 1 auto; display: flex; width: 100%; }
  .seg-in .chip { flex: 1 1 auto; justify-content: center; padding: 0 10px; gap: 6px; }
  .seg-l { display: none; }
  .seg-s { display: inline; }
  .pf-flag { min-height: 300px; grid-template-columns: minmax(0, 1fr); }
  /* The label keeps its one line: the address steps down under the text, where the way out reads last. */
  .pf-flag-go { grid-area: 4 / 1; justify-self: start; }
}

/* --------------------------------------------------------------- press */

.pg-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 22px 40px; margin-top: clamp(40px, 5.4vw, 88px); padding-bottom: clamp(22px, 2.2vw, 32px); }
.pg-tools .pg-meta { margin-top: 0; padding-bottom: 13px; }

.ledger { padding-bottom: var(--sec); }
.lg-list { border-bottom: 1px solid var(--line); }
.ledger.is-swap .lg-year { animation: lg-swap 0.7s var(--ease); }
@keyframes lg-swap { from { opacity: 0; transform: translateY(14px); } }

.lg-year { position: relative; border-top: 1px solid var(--line); }
.lg-year .jr-list { border-top: 0; }
.lg-year .jr:last-child { border-bottom: 0; }

/* The year. A small pinned label on narrow screens, a numeral at poster scale beside the rows on wide ones. */
.lg-num {
  position: sticky; top: var(--nav-h); z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline;
  margin-inline: calc(-1 * var(--gut)); padding: 14px var(--gut) 13px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  font: 500 0.75rem/1.3 var(--num); letter-spacing: 0; color: var(--fg);
  transition: top 0.6s var(--ease);
}
.lg-num .ln { display: flex; flex: 1; justify-content: space-between; align-items: baseline; }
.lg-num .ln-in { display: flex; flex: 1; justify-content: space-between; align-items: baseline; }
.lg-num sup { position: static; margin: 0; font: inherit; font-weight: 400; color: var(--fg3); }
/* The nav steps aside on the way down. The label takes its place. */
body:has(.nav.is-hidden) .lg-num { top: 0; }

.ledger .jr { row-gap: 8px; padding-block: 26px; }
.ledger .jr-title { font-size: 1.25rem; line-height: 1.18; letter-spacing: -0.02em; text-wrap: pretty; }
/* A record that is not press coverage says what it is under its title (js/pages.js). */
.ledger .jr-own { display: block; margin-top: 8px; font: 400 0.75rem/1.5 var(--num); letter-spacing: 0; color: var(--fg3); }
.ledger .jr-date sup, .pg-meta sup { position: static; margin-left: 0.1em; font: inherit; color: inherit; vertical-align: baseline; }

/* The rows are pure type at every width (js/pages.js). With a mouse a story's picture travels with the cursor
   (js/motion.js, data-follow); on a touch screen there is no picture at all. */
@media (min-width: 700px) {
  .ledger .jr { padding-block: clamp(18px, 1.7vw, 26px); grid-template-columns: 5.25rem minmax(0, 1fr) minmax(0, 10.5rem) 1.5rem; column-gap: 22px; align-items: baseline; }
  .ledger .jr-title { font-size: clamp(1.25rem, 1.85vw, 1.8125rem); line-height: 1.12; letter-spacing: -0.026em; }
  .ledger .jr-arrow { font-size: 1.25rem; }
}

/* The lit hairline and the hover floor for these rows live with .jr in css/site.css. A list this long is
   never dimmed on a phone (js/motion.js), so there the spectrum rule is the whole lit state. */

@media (min-width: 900px) {
  .lg-year { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); column-gap: clamp(24px, 3vw, 56px); }
  .lg-num {
    top: calc(var(--nav-h) + 8px); z-index: auto; align-self: start; display: block;
    margin: 0; padding: clamp(14px, 1.4vw, 22px) 0 clamp(20px, 2vw, 32px); background: none; border: 0;
    font: 500 clamp(4rem, 7.4vw, 8.25rem)/0.94 var(--sans); letter-spacing: -0.05em;
    transition: none;
  }
  body:has(.nav.is-hidden) .lg-num { top: calc(var(--nav-h) + 8px); }
  .lg-num .ln, .lg-num .ln-in { display: block; }
  .lg-num .ln-in { display: inline-block; }
  .lg-num sup { position: relative; top: 0.62em; margin-left: 0.3em; font: 500 max(0.13em, 11px)/1 var(--num); letter-spacing: 0; vertical-align: top; }
  /* The count stands alone under the numeral; "stories" is still there for a screen reader. */
  .lg-num .lg-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* The press list in two parts, each named in words (js/pages.js): a label bar on a phone, a heading beside the
   rows on a wide screen, with a line on what the part holds over its first row. */
.lg-note { padding-block: 18px 4px; font: 400 0.8125rem/1.5 var(--num); letter-spacing: 0; color: var(--fg2); max-width: 40rem; text-wrap: pretty; }
@media (max-width: 899px) { .lg-word em { font: inherit; letter-spacing: inherit; } }
@media (min-width: 900px) {
  .lg-num.lg-word { font-size: clamp(2.25rem, 3.5vw, 3.75rem); line-height: 1; letter-spacing: -0.04em; text-wrap: balance; }
  .lg-word sup { top: 0.3em; font-size: 11px; }
  .lg-note { padding-top: clamp(20px, 1.9vw, 30px); }
}

/* A year of two rows has no column left under its numeral, so the mouse preview takes the numeral's place
   and the numeral steps out while it is there (js/motion.js, aimFollow). */
.lg-num .ln-in { transition: opacity 0.3s linear; }
.lg-num.is-under .ln-in { opacity: 0; }


/* -------------------------------------------------------------- essays */

/* The essays are rows of the press ledger (.ledger .jr above, js/pages.js): date, title with what the essay
   argues under it, where it is published. The page opens with a little more air than the press list. */
.essays { padding-top: clamp(44px, 6vw, 96px); }
.essays .jr-list { border-bottom: 1px solid var(--line); }
.essays .jr:last-child { border-bottom: 0; }
.essays .jr-ex { font-size: clamp(1rem, 1.2vw, 1.125rem); }

.byline { display: grid; gap: 14px; justify-items: start; margin-top: clamp(64px, 8vw, 128px); }
.byline p { font-size: clamp(1.5rem, 2.9vw, 3rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.032em; max-width: 22em; text-wrap: balance; }

/* -------------------------------------------------------------- events */

.ev-scale { padding-top: clamp(56px, 8vw, 128px); padding-bottom: var(--sec); overflow: hidden; }
.ev-scale-top { border-top: 1px solid var(--line); padding-top: clamp(28px, 3vw, 48px); }
.ev-scale .scale-word { font-size: clamp(5.4rem, 27.5vw, 30rem); }
.ev-side { display: grid; gap: 40px; margin-top: clamp(36px, 4.6vw, 76px); }
.ev-lede { display: grid; gap: 14px; justify-items: start; max-width: 30rem; }
.ev-lede p { font-size: clamp(1.25rem, 1.9vw, 1.875rem); line-height: 1.24; letter-spacing: -0.02em; font-weight: 500; text-wrap: pretty; }
.ev-scale .facts { margin-top: 0; }
.nb { white-space: nowrap; }

.ev-gallery { margin-top: clamp(56px, 7vw, 120px); }
.ev-rail {
  display: flex; gap: clamp(10px, 1.1vw, 18px); overflow-x: auto; overflow-y: hidden;
  padding-inline: var(--gut); scroll-padding-inline: var(--gut);
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ev-rail::-webkit-scrollbar { display: none; }
.ev-rail::after { content: ""; flex: none; width: 1px; margin-left: calc(var(--gut) - clamp(10px, 1.1vw, 18px) - 1px); }
.ev-rail:focus-visible { outline-offset: -2px; }
.ev-shot { position: relative; flex: none; margin: 0; width: 84vw; aspect-ratio: 4 / 5; overflow: hidden; background: oklch(0.19 0.01 260); scroll-snap-align: start; }
.ev-shot img { width: 100%; height: 112%; object-fit: cover; object-position: var(--ox, 50%) 50%; filter: grayscale(1) contrast(1.1); -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.ev-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(14px, 1.6vw, 24px); font: 400 0.75rem/1.4 var(--num); color: var(--fg3); }
.ev-bar b { font-weight: 500; color: var(--fg); }
.ev-ctl { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.ev-ctl b { min-width: 3.2em; text-align: right; }
.ev-btn { display: none; width: 44px; height: 44px; border-radius: 50%; place-items: center; font: 400 1.125rem/1 var(--sans); color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fg) 55%, transparent); transition: background-color 0.3s var(--ease-q), color 0.3s var(--ease-q), opacity 0.3s linear; }
.ev-btn[disabled] { opacity: 0.32; cursor: default; }

@media (hover: hover) and (pointer: fine) {
  .ev-rail { cursor: grab; }
  .ev-rail.is-drag { cursor: grabbing; scroll-snap-type: none; }
  .ev-btn { display: grid; }
  .ev-btn:not([disabled]):hover { background: var(--fg); color: var(--bg); }
}

.ev-more { padding-block: var(--sec); }
/* Cards are articles; a talk row also carries .ev-item (it is an event) but keeps its .jr row. */
article.ev-item { display: grid; gap: 28px; padding-block: 0; }
article.ev-item + article.ev-item { margin-top: clamp(56px, 7vw, 112px); }
.ev-item-media { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; background: var(--black); }
.ev-item-media img { width: 100%; height: 112%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.ev-item-body { display: grid; gap: 20px; justify-items: start; align-content: start; }
.ev-item-t { font-size: clamp(1.75rem, 3.5vw, 3.5rem); line-height: 1.02; letter-spacing: -0.036em; text-wrap: balance; }
.ev-item-body p { font-size: clamp(1.0625rem, 1.45vw, 1.4375rem); line-height: 1.4; color: var(--fg2); max-width: 31rem; text-wrap: pretty; }
.ev-item-body .ev-item-meta { font: 400 0.75rem/1.5 var(--num); color: var(--fg3); }

/* "Other rooms" on events: one plain heading, then the rows. */
.ev-more-t { font-size: clamp(2rem, 4.2vw, 4.25rem); line-height: 1; letter-spacing: -0.04em; text-wrap: balance; }
.ev-more-t { margin-bottom: clamp(28px, 3.5vw, 56px); }
.ev-item + .ev-talks { margin-top: clamp(56px, 7vw, 112px); }
.ev-talks .jr-title { font-size: clamp(1.1875rem, 1.6vw, 1.5625rem); line-height: 1.16; letter-spacing: -0.022em; }

@media (min-width: 700px) {
  .ev-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .ev-scale .facts { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
  .ev-scale .facts li { grid-template-columns: 8.5rem 1fr; gap: 16px; border-top: 0; border-bottom: 1px solid var(--line); padding-block: 16px; }
  .ev-shot { width: min(58vw, 60rem); aspect-ratio: 3 / 2; }
  article.ev-item { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
  .ev-item-media { grid-column: 1 / span 5; }
  .ev-item-body { grid-column: 7 / -1; }
}
@media (min-width: 1000px) {
  .ev-talks .jr { grid-template-columns: 8.5rem minmax(0, 1fr) 15rem 2rem; }
}

/* --------------------------------------------------------- breakpoints */

@media (max-width: 699px) {
  .pg-head { padding-top: calc(var(--nav-h) + 12px); }
  .pg-head h1 { margin-top: 26px; }
  .jn { font-size: 1rem; gap: 0 18px; }
  .jn-root::after { margin-left: 18px; }
  .pg-tools { display: grid; gap: 18px; margin-top: 44px; padding-bottom: 28px; }
  .pg-tools .pg-meta { padding-bottom: 0; }
  .essays { padding-top: 56px; }
  .byline { margin-top: 72px; }
  .ev-side { margin-top: 44px; gap: 44px; }
  .ev-gallery { margin-top: 72px; }
}

/* On wide screens the 12px mono reads thin beside the titles, so dates, outlets and count lines step up on all three pages. */
@media (min-width: 1200px) {
  .pg-meta, .ledger .jr-date, .ledger .jr-kind, .ledger .jr-own, .ev-talks .jr-date, .ev-talks .jr-kind, .ev-bar, .ev-item-body .ev-item-meta { font-size: clamp(0.8125rem, 0.9vw, 0.875rem); }
}

@media (prefers-reduced-motion: reduce) {
  .ledger.is-swap .lg-year { animation: none; }
  .ev-rail { scroll-behavior: auto; }
}
