/*
  Lightweight site stylesheet.
  4-column grid on desktop, 2 columns on mobile. The top menu uses the same 4 columns.
*/

/* ---------- Fonts (files go in /fonts) ---------- */

@font-face {
  font-family: "GrotesqueMTStd";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: local("GrotesqueMTStd"),
       url("fonts/GrotesqueMTStd.woff2") format("woff2"),
       url("fonts/GrotesqueMTStd.woff") format("woff"),
       url("fonts/GrotesqueMTStd.otf") format("opentype"),
       url("fonts/GrotesqueMTStd.ttf") format("truetype");
}

@font-face {
  font-family: "GrotesqueMTStd";
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: local("GrotesqueMTStd-Black"),
       url("fonts/GrotesqueMTStd-Black.woff2") format("woff2"),
       url("fonts/GrotesqueMTStd-Black.woff") format("woff"),
       url("fonts/GrotesqueMTStd-Black.otf") format("opentype"),
       url("fonts/GrotesqueMTStd-Black.ttf") format("truetype");
}

@font-face {
  font-family: "GrotesqueMTStd";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: local("GrotesqueMTStd-Italic"),
       url("fonts/GrotesqueMTStd-Italic.woff2") format("woff2"),
       url("fonts/GrotesqueMTStd-Italic.woff") format("woff"),
       url("fonts/GrotesqueMTStd-Italic.otf") format("opentype"),
       url("fonts/GrotesqueMTStd-Italic.ttf") format("truetype");
}

/* ---------- Basics ---------- */

:root {
  --ink: #000;
  --paper: #fff;
  --hover: #a9a9a9;
  --gap: 18px;         /* ONE distance used everywhere: between columns, sides, top and bottom */
  --indent: calc(var(--gap) * 3);   /* first-line indent of a new paragraph: 3 gaps (change the 3 to taste) */
  --pad: var(--gap);   /* page padding left and right (same as the gap) */
  /* space reserved above the first row of images: gap + two menu lines + gap */
  --bar-top: calc(var(--gap) * 2 + 35px);
  --font: "GrotesqueMTStd", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* One grid column. Used only inside "left: calc(...)" below. */
  --colw: calc((100% - 2 * var(--pad) - 3 * var(--gap)) / 4);
}

/* Dark mode: same site, colours swapped (switch: the icon next to the copyright) */
/* soft dark: off-black page, off-white text (pure white on pure black glares) */
:root[data-theme="dark"] {
  --ink: #d8d8d8;
  --paper: #121212;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.4 var(--font);
}

p { margin: 7px 0 0; }
li { font-size: 13px; margin-top: 7px; }

h1, h2, h3, h4, h5, h6 { font-size: 15px; font-weight: 400; line-height: 1.2; margin: 27px 0 6px; }

/* Your three faces */
strong, b, .black { font-weight: 900; }                      /* GrotesqueMTStd-Black */
em, i, .italic    { font-weight: 400; font-style: italic; }  /* GrotesqueMTStd-Italic */

a { color: inherit; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

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

/* No saving by right click, drag or long press; no selecting or copying text */
html, body { -webkit-user-select: text; user-select: text; }      /* text can be selected and copied */
figure, .lb-img, .lb-vid, .slide, video, .nav, button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }   /* pictures and films cannot */
figcaption { -webkit-user-select: text; user-select: text; }
img { pointer-events: none; -webkit-user-drag: none; user-drag: none; }

/* ---------- Menu ---------- */

/* No white bands: the menu and copyright are transparent and sit over the images. */

.nav a,
.project-title,
.copyright,
.m-menu summary {
  position: fixed;
  z-index: 200;
  height: 15px;
  font-size: 13px;
  line-height: 15px;
  letter-spacing: 0.04rem;
  white-space: nowrap;
  text-decoration: none;
}

.nav a:hover,
.m-menu a:hover,
.nav a.is-current,
.m-menu a.is-current { color: var(--hover); }   /* the page you are on keeps the hover colour */

/* Columns: exactly the same 4 columns as the image grid */
.c1 { left: var(--pad); }
.c2 { left: calc(var(--pad) + (var(--colw) + var(--gap)) * 1); }
.c3 { left: calc(var(--pad) + (var(--colw) + var(--gap)) * 2); }
.c4 { left: calc(var(--pad) + (var(--colw) + var(--gap)) * 3); }
.c-right { right: var(--pad); }


/* Rows: first row is one gap from the top edge */
.r1 { top: var(--gap); }
.r2 { top: calc(var(--gap) + 20px); }

/* Dark mode icon, right after the copyright text */
.mode { display: inline-block; vertical-align: middle; margin: -2px 0 0 8px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; line-height: 0; }
.mode:hover { color: var(--hover); }
.mode svg { display: block; }
.mode .i-sun { display: none; }                                   /* light mode: half-circle icon */
:root[data-theme="dark"] .mode .i-moon { display: none; }       /* dark mode: sun icon, click for daylight */
:root[data-theme="dark"] .mode .i-sun { display: block; }

/* Copyright: one gap from the bottom and left edges */
.copyright { bottom: var(--gap); left: var(--pad); }

/* ---------- Content ---------- */

main {
  /* top and bottom space mirror each other (the last row's margin is one gap of the bottom space) */
  padding: var(--bar-top) var(--pad) calc(var(--gap) * 4 + 30px);   /* room at the end for the arrow to the top (and a gap above it) */
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));   /* four equal columns, whatever the picture or title size */
  column-gap: var(--gap);
}

figure { margin: 0 0 var(--gap); }
figure > a { display: block; text-decoration: none; }
figcaption a, .text a, figcaption a:visited, .text a:visited, figcaption a:hover, .text a:hover { display: inline; color: #318ce7; text-decoration: underline; }

figure img,
.placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;          /* whole picture, never cropped */
  object-position: left bottom; /* sits right above its title */
}

.placeholder { background: #eee; }
:root[data-theme="dark"] .placeholder { background: #222; }

/* Exhibitions: four columns, rows in order. Every picture sits whole (never cut) in an invisible 2:3 panel. */
.rows { row-gap: var(--gap); }
.rows figure { margin: 0; display: flex; flex-direction: column; }
.rows .pic { position: relative; height: 0; padding-bottom: 150%; }   /* invisible 2:3 panel (150% = 3 / 2 * 100) */
.rows .pic img {                                                       /* picture centred in the panel, as wide as the column: every space on this page is one gap (18px) */
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  aspect-ratio: auto; object-fit: contain; object-position: center;
}
/* titles of one row start on one line (browsers with subgrid) */
@supports (grid-template-rows: subgrid) {
  .rows { row-gap: 0; }
  .rows figure { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
  .rows figcaption { margin-bottom: var(--gap); }
}

figcaption {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 21px;
}

/* Project page: bands on the 4-column grid, images at their natural proportions */
.band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  row-gap: var(--gap);
  align-items: start;
  margin-bottom: var(--gap);
}
.band figure { margin: 0; }
/* different shapes in one row: shared bottom edge */
.band.align-bottom { align-items: end; }
.band.align-bottom figure img { object-position: left bottom; }
/* never cropped: the whole picture is shown; very tall pictures stop at the window height */
.band figure img { width: 100%; height: auto; aspect-ratio: auto; max-height: 92vh; object-fit: contain; object-position: left top; }

/* text blocks fill exactly 2 grid columns; size scales with the window (17px to 21px) */
.tb { font-size: clamp(17px, 1.3vw, 21px); line-height: 1.4; }
.tb p { margin: 0 0 0.75em; }
.tb p.ind, .lb-col p.ind { text-indent: var(--indent); }   /* every paragraph of running text starts with an indent (the first one too); short lines do not */
.cap { font-size: 15px; line-height: 21px; }
.band-caption.tight { margin-top: calc(var(--gap) * -1 + 8px); }

/* Free placement (project pages): columns fixed, rows free. A small script positions the items. */
.free { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: var(--gap); row-gap: var(--gap); align-items: start; grid-auto-flow: row dense; }
.free.placed { display: block; }
.free.placed > * { position: absolute; margin: 0; }
.free figure { margin: 0; }
.free figure img { width: 100%; height: auto; max-height: none; }   /* fills its columns completely, never cropped */
.free .tb p:last-child { margin-bottom: 0; }

/* Folders with several pictures: click or swipe for the next one; the box keeps the shape of the first picture */
.slide { position: relative; width: 100%; height: 0; cursor: pointer; }
.free figure .slide img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; object-position: left bottom; }
.count { display: block; opacity: 0.45; }   /* 1 / 3 under the title */

/* Text pages (About, Press) */
.text { max-width: 60ch; padding-top: var(--gap); }

/* ---------- Utilities kept from the old theme ---------- */
.just      { text-align: justify; }
.radius    { border-radius: 15px; }
.bd1       { border: 1px solid; }
.pa-top    { padding-top: 45px; }
.imgborder { border: 30px solid var(--paper); }

/* ---------- Mobile: 2-column grid, everything in one collapsible menu ---------- */

.m-menu { display: none; }

@media (max-width: 767px) {
  :root { --gap: 14px; --bar-top: calc(var(--gap) * 2 + 15px); }

  .nav a:not(.pos-name) { display: none; }

  /* copyright stays fixed at the bottom of the screen, like on desktop (the base .copyright rule) */

  main { padding-bottom: calc(var(--gap) * 4 + 30px); }   /* room for the fixed copyright line and the arrow to the top */

  /* project pages show the project name on a second line, so reserve that space */
  .is-project { --bar-top: calc(var(--gap) * 2 + 35px); }

  .m-menu { display: block; }
  .m-menu summary {
    top: var(--gap);
    right: var(--pad);
    list-style: none;
    cursor: pointer;
  }
  .m-menu summary::-webkit-details-marker { display: none; }

  .m-menu ul {
    position: fixed;
    top: calc(var(--gap) + 24px);
    left: var(--pad);                 /* same gap on the left as on the right */
    right: var(--pad);
    z-index: 200;
    margin: 0;
    padding: 0 0 var(--gap);
    list-style: none;
    text-align: left;
    background: var(--paper);
  }
  .is-project .m-menu ul { top: calc(var(--gap) + 44px); }   /* below the project name line */
  .m-menu li { font-size: 13px; letter-spacing: 0.04rem; margin: 0 0 6px; }
  .m-menu a { text-decoration: none; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* project page on mobile: 2 columns; landscape images, text and captions go full width */
  .band { grid-template-columns: repeat(2, 1fr); }
  .band > * { grid-column: auto !important; }
  .band > .m-full { grid-column: 1 / -1 !important; }
  .free { grid-template-columns: repeat(2, 1fr); }
  .free > * { grid-column: auto !important; }
  .free > .m-full { grid-column: 1 / -1 !important; }
  .tb { font-size: 16px; }
  figcaption { font-size: 13px; line-height: 18px; margin: 8px 0 0; }
}


/* Lightbox: a text opened from a link in Publications. Full screen, same grid, scrolls by itself */
.lb { position: fixed; inset: 0; z-index: 300; padding: var(--gap) 0; background: rgba(0, 0, 0, .35); color: var(--ink); }
:root[data-theme="dark"] .lb { background: rgba(0, 0, 0, .6); }
.lb-body { width: 70%; height: 100%; margin: 0 auto; overflow-y: auto; background: var(--paper); padding: var(--gap); }
.lb[hidden], .lb article[hidden] { display: none; }
.lb-on, .lb-on body { overflow: hidden; }
.lb-close { position: fixed; top: calc(var(--gap) * 2); right: calc(15% + var(--gap) * 2); z-index: 301; background: none; border: 0; padding: 0;
            font: inherit; font-size: 13px; letter-spacing: .04rem; color: inherit; cursor: pointer; }
.lb-close:hover { color: var(--hover); }
.lb h2 { margin: 0 0 var(--gap); font: inherit; font-size: 15px; line-height: 21px; font-weight: 400; padding-right: 60px; }
.lb-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); align-items: start; grid-auto-flow: row dense; }
.lb-col { position: relative; font-size: 13px; line-height: 18px; text-align: justify; hyphens: auto; }
.lb-col p, .lb-credits p { margin: 0; }
.lb-num { display: block; font-size: 11px; line-height: 14px; margin-bottom: 4px; opacity: .6; }
.lb-credits { margin-top: calc(var(--gap) * 2); padding-top: var(--gap); border-top: 1px solid var(--ink); font-size: 13px; line-height: 18px; }
.lb a { color: #318ce7; text-decoration: underline; }
@media (max-width: 800px) { .lb-cols { grid-template-columns: 1fr; } .lb-body { width: calc(100% - var(--gap) * 2); } .lb-close { right: calc(var(--gap) * 2); } }

.lb-img { margin: 0; }
.lb-img img { display: block; width: 100%; height: auto; }
.lb-img.s2 { grid-column: span 2; }
@media (max-width: 800px) { .lb-img.s2 { grid-column: auto; } }

.lb-img { cursor: zoom-in; }
/* big picture: over the lightbox, 60% of its width */
.lb-zoom { position: fixed; top: var(--gap); bottom: var(--gap); left: 15%; right: 15%; z-index: 305; background: var(--paper);
           display: flex; align-items: center; justify-content: center; padding: var(--gap) 0; cursor: zoom-out; }
.lb-zoom[hidden] { display: none; }
.lb-zoom img { pointer-events: none; display: block; width: 60%; max-width: 60%; height: auto; max-height: 100%; object-fit: contain; }
@media (max-width: 800px) { .lb-zoom { left: var(--gap); right: var(--gap); } .lb-zoom img { width: 100%; max-width: 100%; } }

/* films (Publications) */
video { display: block; width: 100%; height: auto; pointer-events: none; }

/* About: the cv, smaller text, 2 columns wide, lines stay lines */
.cv { font-size: 15px; line-height: 21px; text-align: left; }   /* same as the material descriptions (.cap) */
.cv p { margin: 0 0 1.2em; }
.free .cv p:last-child { margin-bottom: 0; }

.cv-btn { display: block; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.cv-btn:hover { color: var(--hover); }
.cv-body { margin-top: 1.2em; }
.cv-body[hidden] { display: none; }

.cv-r, .cv-l { display: block; white-space: pre-line; }
.cv-y { white-space: pre; }

/* Arrow to the top: bottom left above the copyright, only visible at the end of the page */
.to-top { position: fixed; z-index: 200; left: var(--pad); bottom: calc(var(--gap) * 2 + 15px); padding: 0; border: 0; background: none; color: inherit; line-height: 0; cursor: pointer;
          opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.to-top.on { opacity: 1; visibility: visible; }
.to-top:hover { color: var(--hover); }
.to-top svg { display: block; }
.lb-on .to-top { display: none; }

/* About: the section "pen" is invisible until you scroll down to it, then it fades in */
[data-sec] { opacity: 0; transition: opacity 1.4s ease; }
[data-sec].seen { opacity: 1; }

/* Film Series: the statement at the top, 2 columns wide, running text */
.stmt { width: calc((100% - 3 * var(--gap)) / 2 + var(--gap)); margin: 0 0 calc(var(--gap) * 3); }
@media (max-width: 767px) { .stmt { width: 100%; } }

.lb-vid { margin: 0; }
.lb-vid video { display: block; width: 100%; height: auto; pointer-events: auto; }
.free figure[data-lb] { cursor: pointer; }

/* Film page inside its lightbox (an iframe): only the page itself */
.embed .nav, .embed .m-menu, .embed .project-title, .embed .copyright, .embed .to-top { display: none !important; }
.embed main { padding-top: var(--gap); }
/* Film Series: the lightbox (70% of the width, same gap as the other lightbox) */
.fl { position: fixed; inset: 0; z-index: 300; padding: var(--gap) 0; background: rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .fl { background: rgba(0, 0, 0, .6); }
.fl[hidden] { display: none; }
.fl iframe { display: block; width: 70%; height: 100%; margin: 0 auto; border: 0; background: var(--paper); }
.fl-close { position: fixed; top: calc(var(--gap) * 2); right: calc(15% + var(--gap) * 2); z-index: 301; background: none; border: 0; padding: 0; font: inherit; color: #000; cursor: pointer; letter-spacing: .04rem; }
@media (max-width: 1100px) { .fl iframe { width: calc(100% - var(--gap) * 2); } .fl-close { right: calc(var(--gap) * 2); } }      /* narrower windows: the box takes the width, so the page keeps its 4 columns as long as the site does */
.fl-close:hover { color: var(--hover); }

/* Film page: text as large and loose as on the reference (scales with the width), no first-line indent */
.embed .tb { font-size: 1.857vw; line-height: 1.4; }   /* the text scales with the width of the box, so the page looks the same at every window size */
@media (max-width: 767px) { .embed .tb { font-size: 16px; } }
.embed .tb p.ind { text-indent: 0; }
.embed .tb p { margin: 0; }

/* Pictures appear slowly, when they have loaded */
main img, .lb img { opacity: 0; transition: opacity 1.4s ease; }
main img.in, .lb img.in { opacity: 1; }

/* headline for search engines and screen readers, not shown */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Links inside any text block (Film pages, Film Series, Press ...) */
.tb a, .tb a:visited, .tb a:hover, a.film-open, a.film-open:visited { color: #318ce7; text-decoration: underline; }

/* Publications lightbox: cream paper, black type (in light and dark mode) */
.lb { color: #000; }
.lb-body, .lb-zoom { background: #f1e9d6; color: #000; }
.lb-credits { border-top-color: #000; }
.lb-close:hover { color: #777; }

/* Film Series lightbox: cream paper, black type (a film page's own background / color lines still win) */
body.embed { --ink: #000; --paper: #f1e9d6; --hover: #777; }
.fl iframe { background: #f1e9d6; }

/* [small]...[/small] in a text file */
.sm { font-size: 15px; }                                  /* the same size as the material information (.cap) */
.tb p.smp { font-size: 15px; line-height: 21px; }

.shuffle[hidden] { display: none; }

/* [vimeo 123456789] in a text file: a black box with a play button; Vimeo loads only after the click */
.vm { position: relative; width: 100%; background: #000; margin: 0 0 0.75em; }
.vm button { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vm button:hover { color: var(--hover); }
.vm iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vm button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vm button .vp { position: relative; z-index: 1; filter: drop-shadow(0 0 6px rgba(0, 0, 0, .55)); transition: transform .25s ease; }
.vm button:hover .vp { transform: scale(1.08); }

/* Exhibitions without text: no title rows, one gap between the panels */
.rows.nocap { row-gap: var(--gap); }
.rows.nocap figure { display: block; grid-row: auto; margin: 0; }

/* ---- Article page in the lightbox ---- */
.ar { margin: calc(var(--gap) * -1); }
.ar-head { position: relative; margin: 0; }
.ar-hero { margin: 0; }
.ar-hero img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: cover; }
.ar-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0) 55%); pointer-events: none; }
.ar-title { position: absolute; left: var(--gap); right: var(--gap); bottom: calc(var(--gap) * 1.5); z-index: 2; color: #fff; }
.ar-head.nohero .ar-title { position: static; color: #000; padding: calc(var(--gap) * 3) var(--gap) 0; }
.ar-head.nohero::after { display: none; }
.ar-cat { font-size: 13px; line-height: 18px; margin-bottom: 6px; }
.ar-title h2 { margin: 0; font-weight: normal; text-transform: uppercase; font-size: clamp(32px, 6.5vw, 96px); line-height: 1; }
.ar-date { text-align: right; font-size: 13px; line-height: 18px; padding: var(--gap) var(--gap) 0; }
.ar-lede, .ar-body, .ar-credits { padding: 0 var(--gap); }
.ar-lede { width: 66.6%; margin-top: var(--gap); font-size: 22px; line-height: 28px; }
.ar-lede p, .ar-body p, .ar-credits p { margin: 0 0 18px; }
.ar-body { width: 66.6%; margin-top: calc(var(--gap) * 2); font-size: 15px; line-height: 21px; }
.ar-pics { display: grid; gap: var(--gap); margin: calc(var(--gap) * 1.5) 0; }
.ar-pics.n1 { grid-template-columns: 50%; justify-content: center; }
.ar-pics.n2 { grid-template-columns: 1fr 1fr; }
.ar-pics.n3 { grid-template-columns: 1fr 1fr 1fr; }
.ar-pics figure { margin: 0; }
.ar-pics img { display: block; width: 100%; height: auto; }
.ar-body .ar-pics { width: 150%; max-width: calc(100vw * .7 - var(--gap) * 4); }
.ar-credits { width: 66.6%; margin: calc(var(--gap) * 2) 0 var(--gap); padding-top: var(--gap); font-size: 13px; line-height: 18px; }
.ar-credits::before { content: ""; display: block; width: 40px; border-top: 1px solid currentColor; margin-bottom: var(--gap); }
@media (max-width: 800px) { .ar-lede, .ar-body, .ar-credits { width: 100%; } .ar-body .ar-pics { width: 100%; max-width: none; } .ar-pics.n1 { grid-template-columns: 1fr; } .ar-lede { font-size: 18px; line-height: 24px; } }

.cap p { margin: 0; }
