/* Publications (/publications/): loaded on those pages only, after site.css, on its tokens. One accent, as everywhere:
   orange marks the reader's pointer and, in the figures, false positions. Nothing else is coloured. */

/* ------------------------------------------------------------------------------------------------- on the painting */
/* a post title is a sentence, not a name: set smaller than a page name, still stencilled, still on the painting */
.hero__h:has(> .t-long) { font-size: min(6.2vw, 10.5vh); line-height: .9; max-width: 15em; }
.hero__h:has(> .t-long) + .hero__line { max-width: 40em; }
@media (orientation: portrait) { .hero__h:has(> .t-long) { font-size: min(10.5vw, 6.4vh); } }
/* Friedrich's ice is pale all over: a deeper shade under the words, and less glow, so the title reads */
.hero:has(img[src*="/pub-gulf-"])::before { background: linear-gradient(to top, rgba(10, 10, 10, .92) 0%, rgba(10, 10, 10, .66) 34%, rgba(10, 10, 10, 0) 64%),
  linear-gradient(to bottom, rgba(10, 10, 10, .4) 0%, rgba(10, 10, 10, 0) 16%); }
.js .hero:has(img[src*="/pub-gulf-"]) .hero__glow.is-in { opacity: .3; }

/* ------------------------------------------------------------------------------------------------- the list */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 28px; margin-bottom: clamp(36px, 4vw, 56px);
  padding-bottom: 18px; border-bottom: 1px solid var(--line); font: 400 12px/1 var(--mono); }
.filters__kind { display: flex; gap: 22px; }
.filters button, .filters select, .filters input { min-height: 44px; background: none; border: 0; border-radius: 0; color: var(--dim); font: inherit; letter-spacing: .02em; }
.filters button { position: relative; padding: 0; cursor: pointer; transition: color .25s; }
.filters button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.filters button:hover, .filters button[aria-pressed="true"] { color: var(--white); }
.filters button[aria-pressed="true"]::after { transform: none; }
.filters select { padding: 0 22px 0 0; cursor: pointer; appearance: none;
  background: linear-gradient(45deg, transparent 50%, var(--dim) 50%) right 6px center / 5px 5px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--dim) 50%) right 1px center / 5px 5px no-repeat; }
.filters select:hover, .filters select:focus { color: var(--white); }
.filters select option { background: var(--black); color: var(--white); }
.filters__q { margin-left: auto; }
.filters input { width: 12rem; padding: 0; border-bottom: 1px solid var(--line); color: var(--white); outline: none; transition: border-color .3s; }
.filters input::placeholder { color: var(--dim); }
.filters input:focus { border-bottom-color: var(--orange); }
.filters input::-webkit-search-cancel-button { filter: invert(.6); }

.pubs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 5vw, 72px) var(--into); }
.pubs__none { grid-column: 1 / -1; color: var(--dim); }
.pub[hidden] { display: none; }
/* a card is one link: no underline anywhere on it; the painting leans in and only the title turns orange */
.folio__col .pub__a { display: grid; text-decoration: none !important; color: var(--white) !important; }
/* the post's own painting, framed; it leans in a little under the pointer and never leaves its frame */
.pub__img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--panel); }
.pub__img picture, .pub__img img { width: 100%; height: 100%; }
.pub__img img { object-fit: cover; transform: scale(1.001); transition: transform 1.2s var(--ease), filter 1.2s var(--ease); filter: saturate(.92); }
.pub__a:hover .pub__img img, .pub__a:focus-visible .pub__img img { transform: scale(1.03); filter: saturate(1); }
.pub__t { margin-top: 22px; font: 800 clamp(28px, 2.5vw, 40px)/.94 var(--display); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance;
  color: var(--ink-h); }
/* the title underlines itself from the left when pointed at: the one orange on the card */
.pub__t { transition: color .35s ease; }
.pub__a:hover .pub__t, .pub__a:focus-visible .pub__t { color: var(--orange); }
.pub__meta { margin-top: 14px; font: 400 11.5px/1.5 var(--mono); color: var(--dim); letter-spacing: .02em; }
.pub__meta b { font-weight: 600; color: var(--white); margin-right: .5em; }
.pub__sub { margin-top: 10px; font-size: var(--s-small); line-height: 1.5; color: var(--text); max-width: 30em; }
.pub__a:focus-visible { outline-offset: 6px; }

/* ------------------------------------------------------------------------------------------------- a post */
.pubmeta { font: 400 12px/1.5 var(--mono) !important; color: var(--dim) !important; margin-bottom: 18px !important; letter-spacing: .02em; }

/* footnote markers: small, quiet, orange only under the pointer */
sup.fn { line-height: 0; font-size: 1em; vertical-align: baseline; }
sup.fn a { position: relative; top: -.55em; margin-left: 1px; padding: 0 1px; font: 500 .62em/1 var(--mono); color: var(--dim) !important; text-decoration: none !important; }
sup.fn a:hover, sup.fn a:focus-visible, sup.fn a[aria-expanded="true"] { color: var(--orange) !important; }
.folio__col code { font: 400 .82em/1 var(--mono); color: var(--white); overflow-wrap: anywhere; }

.folio__col > .list { margin: 4px 0 22px; }
.folio__col > .list li { max-width: 34em; }


/* tables in the text */
.dt--pub table, .dt--daily table { font-variant-numeric: tabular-nums; }
.dt--pub td:first-child { min-width: 0; }
.dt--daily td:not(:first-child), .dt--daily th:not(:first-child) { text-align: right; }
.dt--daily td.dt__bar { width: 40%; text-align: left; }
.dt__bar span { display: inline-block; vertical-align: middle; width: calc(100% - 3.4em); height: 6px; background: #1b1b1a; }
.dt__bar i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--white); opacity: .82; }
.dt__bar small { display: inline-block; width: 3.2em; text-align: right; font: 400 12px/1 var(--mono); color: var(--dim); }

/* figures */
.pfig { margin: clamp(36px, 4vw, 56px) 0; }
.pfig--wide { margin-right: calc(var(--m) * -.5); }
.pfig__map + .pfig__sub, .bars + .pfig__sub { margin-top: 28px; }
.pfig__sub { margin-bottom: 10px; font: 400 11.5px/1.4 var(--mono); color: var(--dim); }
.pfig figcaption { margin-top: 14px; max-width: 44em; font-size: var(--s-small); line-height: 1.55; color: var(--dim); text-wrap: pretty; }
.pfig figcaption b { font-weight: 600; color: var(--white); }
.pfig__data { margin-left: .4em; font: 400 12px/1 var(--mono); color: var(--white) !important; }
.pf { display: block; width: 100%; height: auto; }
/* Maps (docs/DESIGN.md, Maps): water a cool blue-grey, land a lighter neutral grey, a crisp pale coastline; the data
   on top in white (true) and orange (no ship could be there). Nothing else is coloured. */
.pf-water { fill: #17202a; }
.pf-water--key { stroke: #8b8880; stroke-width: .8; }
.pf-land { fill: #34332f; stroke: #8b8880; stroke-width: .8; stroke-linejoin: round; }
.pf-lake { fill: #17202a; stroke: #8b8880; stroke-width: .7; stroke-linejoin: round; }
.pf-water-t { font-style: italic; fill: #7f93a6; font-family: var(--sans); font-size: 12.5px; letter-spacing: .02em; }
.pf-key { fill: rgba(10, 10, 10, .72); }
.pf-arrow { fill: none; stroke: rgba(244, 242, 238, .7); stroke-width: 1.1; stroke-dasharray: 4 4; }
.pf-arrow--on { stroke: var(--orange); stroke-width: 1.4; }
.pf-ah { fill: rgba(244, 242, 238, .8); }
.pf-leader { fill: none; stroke: rgba(244, 242, 238, .75); stroke-width: 1; }
.pf-ah--on { fill: var(--orange); }
.pf-t--lead { fill: var(--white); font-weight: 600; }
.pf .pf-t--on, .pf .pf-t--lead { paint-order: stroke; stroke: rgba(10, 10, 10, .85); stroke-width: 3px; stroke-linejoin: round; }
.pf-frame { fill: none; stroke: var(--line); }
.pf-box { fill: none; stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.pf-box--on { stroke: var(--white); stroke-dasharray: none; }
.pf-zone { fill: rgba(244, 242, 238, .12); stroke: var(--white); stroke-width: 1.2; }
.pf-hit { fill: rgba(255, 79, 0, .14); stroke: var(--orange); stroke-width: 1.2; }
.pf-x { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: square; }
.pf-jump { fill: none; stroke: rgba(244, 242, 238, .4); stroke-width: 1; stroke-dasharray: 2 4; }
.pf-jump--on { stroke: var(--orange); stroke-dasharray: 3 4; stroke-width: 1.4; }
.pf-town { fill: var(--dim); }
.pf-t { font: 400 11px var(--mono); fill: var(--dim); letter-spacing: .02em; }
.pf-t--town { fill: rgba(244, 242, 238, .62); }
.pf-t--on { fill: var(--white); }
.pf-t--dim { fill: #77736d; }
.pf-scale { fill: none; stroke: var(--dim); stroke-width: 1; }
.pf-track { fill: none; stroke: rgba(244, 242, 238, .5); stroke-width: .9; stroke-linejoin: round; }
.pf-dot { fill: rgba(244, 242, 238, .55); }
.pf-flag { fill: var(--black); stroke: var(--orange); stroke-width: 1.6; }
.pf-flag--fill { fill: var(--orange); }
.pf-tick { stroke: rgba(244, 242, 238, .42); stroke-width: 1; }
.pf-false { fill: var(--orange); }
.pf-false--big { stroke: var(--black); stroke-width: 1; }
.pf-dot--big { fill: rgba(244, 242, 238, .8); stroke: var(--black); stroke-width: 1; }
.pf-zero { stroke: rgba(244, 242, 238, .55); stroke-width: 1; }
.pf-med { stroke: var(--white); stroke-width: 1.4; }
.pf-step { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linejoin: miter; }
.pf--chart .pf-t { font-size: 12px; }
.pf-grid { stroke: #1e1e1d; stroke-width: 1; }

/* bars: drawn in HTML so their words stay text on a phone */
.bars { display: grid; gap: 10px; font-variant-numeric: tabular-nums; }
.bar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) minmax(0, 9.5rem); align-items: center; gap: 18px; font-size: 15px; }
.bar__l { color: var(--text); }
.bar__t { height: 22px; background: #151514; }
.bar__t i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--white); opacity: .86; transform-origin: left;
  transition: transform 1.2s var(--ease) .2s; }
.js .pfig.reveal:not(.is-in) .bar__t i { transform: scaleX(0); }
.bar__v { font: 500 15px/1.2 var(--mono); color: var(--white); }
.bar__v small { display: block; margin-top: 3px; font: 400 11.5px/1.3 var(--mono); color: var(--dim); }
.bars__axis { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) minmax(0, 9.5rem); gap: 18px; margin-top: 2px; }
.bars__ticks { position: relative; height: 16px; border-top: 1px solid var(--line); }
.bars__ticks span { position: absolute; left: calc(var(--v) * 100%); top: 5px; transform: translateX(-50%); font: 400 10.5px/1 var(--mono); color: #77736d; }
.bars__ticks span:first-child { transform: none; }
.pfig--pairs .bar:nth-child(odd) .bar__t i { background: var(--dim); opacity: .55; }
.pfig--pairs .bar:nth-child(odd) { margin-top: 10px; }
.pfig--pairs .bar:first-child { margin-top: 0; }

/* a figure whose data is not in hand: marked, never drawn from guesses */
.need { padding: clamp(22px, 2.6vw, 36px); border: 1px dashed #4a4844; background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(244, 242, 238, .018) 14px 15px); }
.need p { max-width: 38em; color: var(--text); font-size: 15.5px; }
.need__tag { margin-bottom: 12px; font: 600 12px/1 var(--mono) !important; letter-spacing: .06em; color: var(--white) !important; }
.need__what { margin-top: 12px; font-size: var(--s-small) !important; color: var(--dim) !important; }

/* data, citation, notes */
.files { display: grid; border-top: 1px solid var(--line); margin: 6px 0 16px; }
.files li { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); font: 400 13px/1.3 var(--mono); }
.files a { flex: 1; min-height: 44px; display: grid; align-content: center; gap: 4px; padding: 12px 0; min-width: 0; overflow-wrap: anywhere;
  text-decoration: none !important; color: var(--white) !important; transition: color .25s, padding .45s var(--ease); }
.files a:hover { color: var(--orange) !important; padding-left: 8px; }
.files__w { font: 400 var(--s-small)/1.45 var(--sans); color: var(--dim); }
.files li > span { align-self: center; color: var(--dim); white-space: nowrap; }
.fns__method { margin-top: 22px; max-width: 44em; font-size: var(--s-small) !important; color: var(--dim) !important; }
.fns__method b { font-weight: 600; color: var(--white); }
.cite-plain { font-size: 15.5px !important; }
.fns { counter-reset: fn; display: grid; gap: 10px; max-width: 44em; }
.fns li { counter-increment: fn; position: relative; padding-left: 2.6em; font-size: var(--s-small); line-height: 1.55; color: var(--dim); scroll-margin-top: 30vh; overflow-wrap: anywhere; }
.fns li::before { content: counter(fn); position: absolute; left: 0; top: .1em; font: 500 11.5px/1.4 var(--mono); color: var(--dim); }
.fns li:target span { color: var(--white); }
.fns li:target::before { color: var(--orange); }
.fns a { color: var(--text) !important; }
.fn__back { text-decoration: none !important; color: var(--dim) !important; padding: 0 4px; }

/* a note opened from its marker: beside the text on a wide screen, a sheet from the bottom on a phone */
.fn-tip { position: fixed; z-index: 40; max-width: min(26rem, calc(100vw - 32px)); padding: 16px 18px; background: #141413; border: 1px solid #2f2e2c;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); font-size: 14px; line-height: 1.5; color: var(--text); opacity: 0; transform: translateY(4px);
  transition: opacity .25s ease, transform .35s var(--ease); pointer-events: none; }
.fn-tip.is-on { opacity: 1; transform: none; pointer-events: auto; }
.fn-tip b { display: block; margin-bottom: 6px; font: 500 11px/1 var(--mono); color: var(--orange); }
.fn-tip a { color: var(--white); text-decoration-color: var(--orange); text-underline-offset: .2em; overflow-wrap: anywhere; }
@media (max-width: 900px), (pointer: coarse) {
  .fn-tip { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; padding: 20px var(--m) calc(22px + env(safe-area-inset-bottom));
    border-width: 1px 0 0; transform: translateY(100%); }
  .fn-tip.is-on { transform: none; }
}

/* ------------------------------------------------------------------------------------------------- smaller screens */
@media (max-width: 900px) {
  .pfig--wide { margin-right: 0; }
}
/* phones: a map or chart keeps a readable size and scrolls sideways inside its own frame, never the page */
@media (max-width: 640px) {
  .pfig__map { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #333 transparent; }
  .pfig__map .pf { width: 620px; max-width: none; }
}
@media (max-width: 640px) {
  .pubs { grid-template-columns: minmax(0, 1fr); }
  .pub__img { aspect-ratio: 4 / 3; }
  .filters { gap: 4px 22px; }
  .filters__q { margin-left: 0; flex-basis: 100%; }
  .filters input { width: 100%; }
  .bar, .bars__axis { grid-template-columns: minmax(0, 1fr) minmax(0, 6.8rem); gap: 6px 14px; }
  .bar__l { grid-column: 1 / -1; font-size: 14px; }
  .bars__axis > span:first-child { display: none; }
  .bar__t { height: 16px; }
  .dt--daily td.dt__bar { width: auto; }
  .dt--daily td:not(:first-child) { text-align: left; }
  .dt--daily td[data-label] { display: flex; justify-content: space-between; gap: 12px; }
  .dt--daily td[data-label]::before { margin: 0 !important; font-weight: 400 !important; }
  .dt--daily td.dt__bar::before { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .pub__img img, .pub__t, .bar__t i, .fn-tip { transition: none; }
  .js .pfig.reveal:not(.is-in) .bar__t i { transform: none; }
}

/* ------------------------------------------------------------------------------------------------- the top of a post */
/* what the piece found, before the story: a few numbers set large, each with one plain sentence (as on /research/) */
.stats--pub { margin: clamp(8px, 1vw, 16px) 0 clamp(28px, 3vw, 40px); }
.stats--pub > div { grid-template-columns: minmax(0, 12.5rem) minmax(0, 1fr); padding: 18px 0; }
.stats--pub dt { font-size: clamp(38px, 3.9vw, 64px); white-space: nowrap; }
.stats--pub dd { max-width: 28em; }

/* the parts of the piece, as links: quiet, numbered, two columns where there is room */
.pubindex { margin: 0 0 clamp(36px, 4vw, 56px); }
.pubindex ol { counter-reset: part; columns: 2 16rem; column-gap: var(--into); }
.pubindex li { counter-increment: part; break-inside: avoid; }
.pubindex a { display: flex; gap: 12px; min-height: 40px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 15px; line-height: 1.35; text-decoration: none !important; color: var(--text) !important; transition: color .25s, padding .45s var(--ease); }
.pubindex a::before { content: counter(part, decimal-leading-zero); font: 400 11px/1.6 var(--mono); color: var(--dim); }
.pubindex a:hover, .pubindex a:focus-visible { color: var(--white) !important; padding-left: 6px; }

/* Contents, from anywhere in the piece: a small button at the bottom right once the index has scrolled away; it opens the
   same list, the part being read marked. A panel by the button on a wide screen, a sheet from the bottom on a phone. */
.pubnav { position: fixed; z-index: 30; right: max(16px, calc(var(--m) * .5)); bottom: 18px; }
.pubnav__btn { min-height: 44px; padding: 0 16px; background: rgba(10, 10, 10, .9); border: 1px solid #3a3936; color: var(--white);
  font: 500 12px/1 var(--mono); letter-spacing: .03em; cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .35s ease, transform .45s var(--ease), border-color .25s; }
.pubnav.is-on .pubnav__btn { opacity: 1; transform: none; pointer-events: auto; }
.pubnav__btn:hover, .pubnav__btn[aria-expanded="true"] { border-color: var(--orange); }
.pubnav__panel { position: absolute; right: 0; bottom: 56px; width: min(22rem, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  padding: 10px 18px 12px; background: #121211; border: 1px solid #2f2e2c; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); }
.pubnav__panel[hidden] { display: none; }
.pubnav__panel a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.35; text-decoration: none; color: var(--text); }
.pubnav__panel li:last-child a { border-bottom: 0; }
.pubnav__panel a:hover { color: var(--white); }
.pubnav__panel a[aria-current] { color: var(--orange); }
@media (max-width: 640px) {
  .pubnav { left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; }
  .pubnav__panel { left: -16px; right: -16px; bottom: -14px; width: auto; max-height: 72vh; padding: 14px var(--m) calc(64px + env(safe-area-inset-bottom)); border-width: 1px 0 0; }
  .stats--pub > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .pubnav__btn { transition: none; } }
