/* Art Cross Cultures: Partner, Projects, About, Donate, the donation result pages, the legal pages and the not-found page.
   Extends site.css. No new colours, type steps or line weights. */

/* ---------- the opening band of a subpage ---------- */
.sub.lantern { min-height: clamp(44rem, 100vh, 62.5rem); min-height: clamp(44rem, 100svh, 62.5rem); }
.sub .say h1 { margin-top: var(--h1-top); }
.sub .say .lede { margin-top: 2.25rem; max-width: 36ch; }
.sub .say .facts { margin-top: 2.25rem; }
.sub .say .more { margin-top: 1rem; max-width: 36ch; color: var(--ink-2); }
.sub .say .foot { margin-top: auto; padding-top: 1.75rem; padding-bottom: 1.75rem; }

/* a photograph that fills the height its neighbours set, instead of setting it */
.ph { position: relative; min-height: 0; }
.ph img { position: absolute; inset: 0; }

/* the ask on a lacquer face: a heading, a sentence, the action at the foot */
.band .lacquer { display: flex; flex-direction: column; }
.band .lacquer > .acts-row { margin-top: auto; padding-top: 2rem; }

/* ---------- Partner: three encounters and the open face ---------- */
.so-far { flex: 0 0 clamp(20rem, 29vw, 28rem); display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); }
.so-far > .lit { border-bottom: var(--rib); }
.so-far > .lit:last-child { border-bottom: 0; }
.so-far > .lit > img { height: 0; min-height: 100%; }   /* fills its third of the column, never sets it */
.so-far .cap { min-height: 0; }
.open { flex: 1 1 0; display: flex; flex-direction: column; padding: calc(var(--top-h) + 1rem) clamp(1.5rem, 3.3vw, 3rem) 2rem; }
.open h2 { font-size: var(--fs-display); line-height: .98; letter-spacing: -0.02em; }
.open h2 span { display: block; }
.open .t { margin-top: 2.5rem; max-width: 30ch; color: var(--ink-2); }
.open .acts-row { margin-top: 1.75rem; }
.open .state { margin-top: auto; padding-top: 2rem; }

/* ---------- the bands of About, Partner and Donate: the grid of the home page ----------
   A band's heading stands in the first column, which continues the rib of the statement face above; what the
   band holds stands on four equal parts. Photographs fill whole parts and keep their own proportions; every
   text begins the same short step after a part's edge. */
.subpage .grid > .head > p:not(.acts-row) { color: var(--ink-2); }
.subpage .grid > .head > .acts-row { margin-top: auto; padding-top: 2rem; }
.institution .prose, .method .prose { color: var(--ink-2); }
.method .prose { display: flex; flex-direction: column; }
.method .prose .acts-row { margin-top: auto; padding-top: 2rem; }
.method > .lit { grid-template-rows: 1fr auto; }   /* at least its own proportions; taller where the text beside it is */
.uses > .lit { grid-template-rows: auto 1fr; }
.method > .lit img, .uses > .lit img { aspect-ratio: 3 / 2; height: auto; }
.method > .lit img { object-position: 20% 50%; }   /* the guide who speaks stays in the picture */
.basel .facts { margin-top: 1.5rem; }
.band .list > h3 + .ruled { margin-top: 1.375rem; }
.lacquer .reach { line-height: 2; }

/* About, looking ahead: one paragraph beside the ask; the years stand on Projects */
.future > .list > p { max-width: 46ch; color: var(--ink-2); }
/* About's four people: portrait, name, role and one small line each, one to a part */
.person .cap .bio { margin-top: .625rem; font-size: var(--fs-data); line-height: 1.5; letter-spacing: .01em; color: var(--ink-2); }

/* Partner, where support goes: the four uses as one row of name and text; no boxes, no blank picture places */
.four { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem var(--pad); }
.four dt { font-family: var(--display); font-weight: 380; font-size: var(--fs-sub); line-height: 1.2; font-variation-settings: "opsz" 48; letter-spacing: -0.005em; }
.four dd { margin-top: .625rem; color: var(--ink-2); }
.band .face.four > div { margin-top: 0; }   /* the four stand level */

/* Partner's closing band: the portrait stands in a square as wide as the statement face, so head, hands and table stay in frame */
.connect { grid-template-columns: var(--say) 1fr; }
.connect .ph { aspect-ratio: 1 / 1; }
.connect .lit img { object-position: 50% 12%; }
.band.connect .face.mid-only { display: none; }

@media (width >= 62.5em) {
  .institution > .prose, .method > .prose { grid-column: 2 / span 2; padding: var(--head) var(--in); }
  .band.institution .prose > p:first-child, .band.method .prose > p:first-child { margin-top: var(--drop); }   /* on the baseline of the heading beside it */
  .institution > .basel { grid-column: 4 / span 2; display: flex; flex-direction: column; padding: var(--head) var(--in); }
  .band.institution .basel > h3 { margin-top: var(--drop-sub); }
  .method > .lit { grid-column: 4 / span 2; }

  /* a ruled list on the grid: the name on the first part, its text from the second part on.
     Its hair rules run from the rib of the first column to the edge of the list */
  .grid > .list { padding: var(--head) 0; }
  .case > .list { grid-column: 2 / -1; }
  .future > .list { grid-column: 2 / span 2; padding: var(--head) var(--in); }
  .list > .ruled > div { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem 0; }
  .list > .ruled dt { padding-inline: var(--in) 1rem; }
  .list > .ruled dd { grid-column: 2 / -1; max-width: none; padding-inline: var(--in) var(--pad); }
  .band .list > .ruled > div:first-child { padding-top: var(--drop-sub); }
  .case .list > h3 { margin-top: var(--drop-sub); padding-inline: var(--in); }
  .band.case .list > h3 + .ruled > div:first-child { padding-top: 0; }
  .band.future .list > p:first-child { margin-top: var(--drop); }   /* on the baseline of the heading beside it */
  .future > .lacquer { grid-column: 4 / span 2; padding: var(--head) var(--in); }

  /* where support goes: the two photographs on two parts each, the four uses below them, one to a part */
  .uses > .head { grid-row: 1 / span 2; }
  .uses > .lit { grid-column: span 2; }
  .uses > .lit + .lit { border-right: 0; }
  .uses > .four { grid-column: 2 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 3rem 0 var(--head); }
  .four > div { padding-inline: var(--in) 1rem; }

  .connect > .lacquer { padding: var(--head) var(--in); }
}

/* ---------- Projects: one cycle is open, the others stand beside it as spines ----------
   The page is one band. Its base is plain: the four cycles follow one another, each on its own paper.
   From 1000px, with scripting, they share one stage: the open cycle fills it, the others are the spines
   of the home page, and a spine opens its cycle. Paper stays, the writing changes (as with the sheets). */
.lantern.cycles > .spines { display: none; }
.stage { min-width: 0; }
.leaf { background: var(--unlit); border-top: var(--rib); }
.leaf.now { display: flex; flex-direction: column; background: var(--day); border-top: 0; }
.leaf .words { display: flex; flex-direction: column; padding: clamp(3rem, 9vw, 4.75rem) var(--pad) var(--pad); }
.leaf h2 + .meta { margin-top: 1rem; }
.leaf .d { margin-top: 1.75rem; max-width: 46ch; color: var(--ink-2); }
.leaf .acts-row { margin-top: 2.25rem; }
.leaf .state { margin-top: 1.75rem; }
.leaf.now > .lit { order: -1; }
.leaf.now > .lit img { aspect-ratio: 4 / 5; height: auto; object-position: 50% 60%; }
.ask-row { padding: clamp(3rem, 9vw, 4.75rem) var(--pad); }
.ask-row > .acts-row { margin-top: 2rem; }

@media (width >= 62.5em) {
  .js .cycles > .stage { order: 2; flex: 1 1 0; display: grid; background: var(--unlit); border-right: var(--rib); }
  .js .lantern.cycles > .spines { order: 3; display: flex; }
  .js .spines > .spine { border: 0; border-right: var(--rib); border-radius: 0; font: inherit; text-align: left; cursor: pointer; }
  .js .spines > .spine:last-child { border-right: 0; }
  .js .spine[aria-expanded="true"] { background: var(--ink); color: #fff; }
  .js .spine[aria-expanded="true"] .y, .js .spine[aria-expanded="true"] .s { color: var(--on-night-2); }
  .js .leaf { grid-area: 1 / 1; min-width: 0; display: grid; border-top: 0; background: none; opacity: 0; visibility: hidden; transition: opacity .25s var(--calm), visibility 0s .25s; }
  .js .leaf.is-open { opacity: 1; visibility: visible; transition: opacity .6s var(--calm) .2s, visibility 0s; }
  .js .leaf.now { background: var(--day); }
  .js .leaf .words { padding: var(--name-top) 1.5rem 1.75rem var(--in); }   /* a cycle's name on the baseline of the page's h1, on the text edge */
  .js .leaf .state { margin-top: auto; padding-top: 1.75rem; }
  .js .leaf.now > .lit img { aspect-ratio: auto; height: 0; min-height: 100%; }
  .js .leaf.now .cap { padding-inline: var(--in); }

  .ask-row { grid-template-columns: var(--say) repeat(4, minmax(0, 1fr)); align-items: start; padding: var(--head) 0; }
  .ask-row > h2 { grid-column: 1 / span 3; padding-inline: var(--pad); }
  .ask-row > .acts-row { grid-column: 4 / -1; margin-top: calc(var(--drop) - .75rem); padding-inline: var(--in); }   /* its label on the baseline of the heading */
}
/* 1000 to 1279: the open cycle's photograph above its words, at its own proportions so the figure stays whole */
@media (width >= 62.5em) and (width < 80em) {
  .js .leaf.now { grid-template-rows: auto minmax(0, 1fr); }
  .js .leaf.now > .lit { border-bottom: var(--rib); }
  .js .leaf.now > .lit img { aspect-ratio: 1; height: auto; min-height: 0; object-position: 50% 60%; }
  .js .leaf.now .words { padding-top: 1.75rem; }
}
/* from 1280px: its words beside its photograph */
@media (width >= 80em) {
  .js .leaf.now { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .js .leaf.now > .lit { order: 0; border-left: var(--rib); }
  .ask-row > .acts-row { grid-column: 5; }
}
@media (prefers-reduced-motion: reduce) { .js .leaf, .js .leaf.is-open { transition: none; } }

/* ---------- About ---------- */
.about .team img { object-position: 42% 100%; }   /* the four stand left of the middle, feet on the lower edge */

/* ---------- Donate: the one lacquer face is the page ----------
   The lacquer face is the widest face of the opening. Below it the photograph stands in the first column, as wide
   as the statement face above, so that face's line runs on down the page; the notes stand beside it. */
.donate .lit { flex: 1 1 0; }
.give-face { flex: 1.35 1 0; display: flex; flex-direction: column; padding: calc(var(--top-h) + 1rem) clamp(1.5rem, 3.3vw, 3rem) 2rem; }
.give-face h2 { font-size: var(--fs-display); line-height: .98; letter-spacing: -0.02em; }
.give-face h2 span { display: block; }
.give-face .fine { margin-top: 2.25rem; max-width: 40ch; }
.give-face .acts-row { margin-top: 2.5rem; }
.terms { grid-template-columns: var(--say) 1fr; }
.terms > .lit { min-height: 24rem; }
.terms .lit img { object-position: 38% 50%; }   /* keeps the tassel in frame */
.terms > .notes { padding-block: var(--head); }
@media (width >= 62.5em) { .terms > .notes { padding-inline: var(--in) var(--pad); } }

/* ---------- the donation result pages and the not-found page ---------- */
.result .lit { flex: 1.6 1 0; }
.result .lit img { object-position: 50% 50%; }
.result h1 { text-wrap: balance; }
/* where there is no photograph to show, the statement is the whole band and the band is as tall as it needs */
.result.alone.lantern { min-height: 0; }
.result.alone > .say { flex: 1 1 auto; border-right: 0; }
.result.alone .say .foot { margin-top: 2.5rem; padding-bottom: var(--head); }

/* ---------- legal pages: one long ruled text ---------- */
.legal.lantern { min-height: clamp(40rem, 100vh, 62.5rem); min-height: clamp(40rem, 100svh, 62.5rem); }
.legal .law { flex: 1 1 0; min-width: 0; padding: calc(var(--top-h) + 1rem) clamp(1.5rem, 3.3vw, 3rem) clamp(2.5rem, 5vw, 4.5rem) var(--in); }
.legal .law .ruled { margin-top: 2.5rem; }
.legal .law .ruled:first-child { margin-top: 0; }
.legal .say h1 { font-size: var(--fs-title); line-height: 1.06; letter-spacing: -0.015em; hyphens: manual; }
.legal .law .ruled dd { max-width: 66ch; text-wrap: pretty; }
.legal .law .ruled > div { grid-template-columns: minmax(15rem, .5fr) 1fr; }

/* ---------- from 1000: beside a band that is longer than the screen, the statement face stays in view ---------- */
@media (width >= 62.5em) {
  .legal .say { align-self: flex-start; position: sticky; top: var(--top-h); height: clamp(30rem, calc(100vh - var(--top-h)), 62.5rem); height: clamp(30rem, calc(100svh - var(--top-h)), 62.5rem); border-right: 0; }
  .legal .law { border-left: var(--line); padding-left: calc(var(--in) - 1px); }   /* the line is its own here: the text keeps the edge */
}
@media (width >= 80em) {
  .legal .say { top: 0; height: clamp(44rem, 100vh, 62.5rem); height: clamp(44rem, 100svh, 62.5rem); }
  .long .top { position: fixed; background: var(--day); }   /* the navigation stays with the statement it sits in */
  .legal .law { padding-top: calc(var(--top-h) + var(--h1-top) + var(--drop-sub)); }   /* its first name on the baseline of the page's h1 */
  /* the large heading of an opening's big face stands on the line of the page's h1 beside it */
  .open, .give-face { padding-top: calc(var(--top-h) + var(--h1-top)); }
}

/* ---------- 760 to 1279 ---------- */
@media (width < 80em) {
  .subpage { --say: clamp(20rem, 38vw, 27rem); }
  .subpage:has(.donate) { --say: clamp(17rem, 30vw, 22rem); }   /* the lacquer face stays the widest */
  .sub.lantern { min-height: clamp(33.5rem, calc(100vh - var(--top-h)), 62.5rem); min-height: clamp(33.5rem, calc(100svh - var(--top-h)), 62.5rem); }
  .legal.lantern { min-height: clamp(30rem, calc(100vh - var(--top-h)), 62.5rem); min-height: clamp(30rem, calc(100svh - var(--top-h)), 62.5rem); }
  .sub .say h1 { margin-top: 0; }
  .sub .say .lede, .sub .say .facts { margin-top: 1.5rem; }
  .sub .say .foot { padding-bottom: 0; }
  .open, .give-face { padding-top: var(--h1-top); padding-bottom: 1.5rem; }
  .legal .law { padding-top: calc(var(--h1-top) + var(--drop-sub)); padding-bottom: 1.5rem; }   /* its first name on the baseline of the page's h1 */
  .result.alone .say .foot { padding-bottom: 1rem; }
  .legal .law .ruled > div { grid-template-columns: 1fr; }
  .donate .give-face { flex: 1.6 1 0; }
}
@media (width >= 62.5em) and (width < 80em) {
  /* About: the group photograph keeps its proportions, so all four people stay in frame */
  .about.lantern { min-height: 0; }
  .about .team img { aspect-ratio: 3 / 2; height: auto; }
  /* About, our approach: the text across the four parts in two columns, the photograph under it on all four at its
     own proportions. On two parts it would be a tall strip that cuts the guide out of the picture */
  .method > .head { grid-row: 1 / span 2; }
  .method > .prose { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--in) * 2); align-content: start; border-right: 0; }
  .band.method .prose > p:not(.acts-row) { margin-top: var(--drop); }
  .method .prose .acts-row { margin-top: 1.5rem; padding-top: 0; }
  .method > .lit { grid-column: 2 / -1; grid-row: 2; }
  /* the four parts pair up: the four uses stand two by two */
  .uses > .four { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.75rem; }
}

/* ---------- below 1000: bands stack ---------- */
@media (width < 62.5em) {
  .connect { grid-template-columns: 1fr 1fr; }
  .sub .say .facts dl { display: block; }
  .sub .say .facts dl > div { padding: .5rem 0 .625rem; }
  .sub .say .facts dl > div:first-child { padding-top: 0; }
  .sub .say .facts dl > div:nth-child(2) { border-top: 1px solid var(--hair); padding-top: .5rem; }
  .band .lacquer > .acts-row, .method .prose .acts-row, .subpage .grid > .head > .acts-row { margin-top: 2rem; padding-top: 0; }
  .connect .lit img { aspect-ratio: 1 / 1; height: auto; object-position: 50% 0; }
  .ph img { position: static; }

  /* a band's heading and what it holds stay one block: no rule falls between them */
  .institution > .head, .method > .head, .future > .head, .case > .head { border-bottom: 0; padding-bottom: 0; }
  .board > .head { border-bottom: 0; }   /* the portraits follow: their edge divides */
  .institution > .prose, .method > .prose, .grid > .list { padding-top: 1.5rem; }
  .uses > .lit { grid-column: auto; }
  .uses > .lit:nth-of-type(1) { border-right: var(--rib); }
  /* Donate: the photograph keeps its proportions above the notes */
  .terms { grid-template-columns: 1fr 1fr; }
  .terms > .lit { min-height: 0; }
  .terms .lit img { aspect-ratio: 3 / 2; height: auto; }

  /* Partner: the statement and the open face share the first row, the three encounters stand below */
  .partner.lantern { display: grid; grid-template-columns: var(--say) 1fr; min-height: 0; }
  .partner .say { grid-column: 1; grid-row: 1; }
  .partner .open { grid-column: 2; grid-row: 1; min-height: 22rem; }
  .partner .so-far { grid-column: 1 / -1; grid-row: 2; grid-template-rows: none; grid-template-columns: repeat(3, 1fr); border-right: 0; border-top: var(--rib); }
  .so-far > .lit { grid-template-rows: auto 1fr; border-bottom: 0; border-right: var(--rib); }
  .so-far > .lit:last-child { border-right: 0; }
  .so-far > .lit > img { aspect-ratio: 3 / 2; height: auto; min-height: 0; }

  /* Projects: the statement, then the four cycles one after another */
  .cycles.lantern { display: block; min-height: 0; }
  .cycles .say { border-right: 0; border-bottom: var(--rib); }
  .ask-row { display: block; }
  .legal .say { position: static; height: auto; border-right: 0; border-bottom: var(--rib); }
  .legal .law { border-left: 0; }

  /* About: the statement, then the photograph at its own proportions */
  .about.lantern { display: block; min-height: 0; }
  .about .say { border-right: 0; border-bottom: var(--rib); }
  .about .team { border-right: 0; }
  .about .team img { aspect-ratio: 3 / 2; height: auto; }

  .donate .lit { flex: .8 1 0; }
  .donate .give-face { flex: 1.5 1 0; padding-inline: 1.5rem; }

  .legal.lantern { display: block; min-height: 0; }
}

/* ---------- 760 to 999: some bands keep columns ---------- */
@media (width >= 47.5em) and (width < 62.5em) {
  /* Projects: the open cycle's photograph beside its words */
  .leaf.now { display: grid; grid-template-columns: 1fr 1fr; }
  .leaf.now > .lit { order: 0; border-right: var(--rib); }
  .ask-row { display: grid; align-items: center; }
  .ask-row > .acts-row { margin-top: 0; justify-self: end; }
  /* Partner: the legal facts leave the statement so the encounters reach the first screen; they stand beside the ask instead */
  .partner .say .facts { display: none; }
  /* the portrait keeps the left half; the facts stand over the ask on the right */
  .band.connect .face.mid-only { display: flex; }
  .connect { grid-template-rows: auto 1fr; }
  .connect > .lit { grid-column: 1; grid-row: 1 / span 2; border-right: var(--rib); border-bottom: 0; }
  .connect .ph img { position: absolute; aspect-ratio: auto; height: 100%; }
  .connect .mid-only { grid-column: 2; grid-row: 1; }
  .connect .lacquer { grid-column: 2; grid-row: 2; }
  /* About: the text beside the seat, the outlook beside the ask */
  .institution > .prose, .future > .list { grid-column: 1; border-right: var(--rib); border-bottom: 0; }
  .institution > .basel, .future > .lacquer { grid-column: 2; }
  /* a fact list in a half-width face stands in one column, every row under its own hair rule */
  .basel .facts dl, .connect .facts dl { display: block; }
  .basel .facts dl > div:nth-child(2), .connect .facts dl > div:nth-child(2) { border-top: 1px solid var(--hair); padding-top: .75rem; }
  .uses > .four { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1.25rem; }
  .result { --say: clamp(22rem, 44vw, 27rem); }
}

/* ---------- phone ---------- */
@media (width < 47.5em) {
  .sub.lantern { min-height: 0; }
  .sub .say .foot { padding-bottom: 0; margin-top: 2rem; }
  .result.alone .say .foot { padding-bottom: .5rem; }

  .partner.lantern { grid-template-columns: 1fr; }
  .partner .say, .partner .open, .partner .so-far { grid-column: 1; grid-row: auto; }
  .partner .so-far { grid-template-columns: 1fr; border-top: 0; }
  .so-far > .lit { border-right: 0; border-bottom: var(--rib); }
  .so-far > .lit > img { aspect-ratio: 16 / 9; }
  .open, .give-face, .legal .law { grid-column: 1 / -1; padding: 2rem 1rem 1.5rem; border-right: 0 !important; }
  .partner .open { min-height: 21rem; }
  .leaf .words { padding-inline: 1rem; }   /* the one inset of a phone */
  .four { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

  .donate .lit, .result .lit { grid-column: 1 / -1; border-right: 0; }
  .donate .lit img { aspect-ratio: 4 / 5; height: auto; }
  .result .lit img { aspect-ratio: 4 / 3; height: auto; }
  .donate .give-face { order: 1; }
  .terms > .lit { order: 1; border-bottom: 0; }   /* the notes stand between the two photographs */
  .band.terms > .notes { border-bottom: var(--rib); }
}

@media (width > 120em) { .long .top { left: calc(50% - 60rem + 1px); } }

@media print {
  .js .cycles > .spines { display: none; }
  .js .cycles > .stage { display: block; background: none; }
  .js .leaf { opacity: 1; visibility: visible; }
  .long .top { position: static; }
  .sub.lantern, .about.lantern, .legal.lantern { min-height: 0; }
  .legal .say { position: static; height: auto; }
}
