/* "+" — a REGULAR GRID: 4 columns of the same width (2 on a phone), rows aligned (CSS grid; plus.js chooses --cols and hides the photos that would leave the
   last row incomplete). Every cell is a square photo (aspect-ratio 1/1, object-fit: cover, centred) and, under it, a caption area of FIXED height (the
   same for all the cells, also when the caption is empty), so every row stays perfectly aligned. The text cell (title + text together) is as big as a
   photo and sits among the photos. Square corners, no border, no shadow, no hover, no zoom, no transform, no transition; only the fading in when they
   come into view (500 ms, off with reduced motion). The side margins are --space-margin, the same variable as the top bar, About and Contact (the first
   column starts at the x of "01/Works" and the last one ends at the x of "04/+"; the same margin under the last row). The gap between the columns and
   between the rows is --plus-gap (0.55vw, min 4 px; phone 1vw), on top of the caption area. */
#plus { --plus-gap: max(4px, 0.55vw); --cap-h: max(40px, 3.4vw); }                              /* --cap-h: the height of the caption area */
#plus.sec-page {
  padding-top: var(--section-top);                                                             /* the first row starts where the title of Contact does: the bar + --space-margin (the shared variable) */
  padding-left: var(--space-margin); padding-right: var(--space-margin);                        /* the same side margins as the bar */
  padding-bottom: var(--space-margin);                                                         /* and the same margin under the last row */
}

.masonry {
  display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  column-gap: var(--plus-gap); row-gap: var(--plus-gap); align-items: start;
}
.shot, .plus-cell { margin: 0; min-width: 0; cursor: default; border-radius: 0; border: 0; box-shadow: none; }
.shot[hidden] { display: none; }                                                               /* a photo hidden to keep the last row straight: not removed, nothing loaded */
.shot-img {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 0;
  background: var(--ph, var(--ink));                                                            /* the dominant colour until the photo is there */
}
.shot-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 0; }   /* cover: a photo that is not square is cut in the centre */

/* The captions: real text in an area of fixed height under the square, left aligned, white; the text starts about 0.6vw under the photo. Level 1 (the
   place): Instrument Serif italic; level 2 (the film): Inter Tight 400, a little smaller and lighter (opacity 0.8), about 0.25vw under level 1. */
.shot figcaption { height: var(--cap-h); box-sizing: border-box; margin: 0; padding: 0.6vw 0 0; overflow: visible; color: var(--text); text-align: left; }
.cap1 {
  display: block; font-family: var(--font-display); font-style: italic; font-weight: var(--fw-display);
  font-size: clamp(15px, 1.3vw, 22px); line-height: 1.1; letter-spacing: -0.01em;
}
.cap2 {
  display: block; font-family: var(--font-body); font-weight: var(--fw-body);
  font-size: clamp(11px, 0.85vw, 15px); line-height: 1.3; letter-spacing: 0; opacity: var(--soft-a, 0.8);
}
.cap1 + .cap2 { margin-top: 0.25vw; }

/* The text cell: as big as a photo (the square, then an empty caption area of the same height). Transparent, white text from the top left, no padding.
   The title: Instrument Serif, about 4.6vw (28-80 px), on one line (plus.js makes it smaller, --title-k, if it would not fit), line-height 0.95; under it,
   about 1.2vw, the text with the size of the description of About (--fs-body, --lh-body, --ls-body, --fw-body; plus.js makes it a little smaller,
   --body-k, only if it would not fit in the square). plus-fx.js splits both into letters (span.pw = a word, which is never broken; span.pl = a letter)
   and moves them with the cursor: only transform, will-change only while they move. */
.plus-cell::after { content: ""; display: block; height: var(--cap-h); }                       /* the empty caption area */
.plus-cell-box { position: relative; aspect-ratio: 1 / 1; min-height: 0; box-sizing: border-box; margin: 0; padding: 0; background: transparent; color: var(--text); text-align: left; }
.plus-title {
  margin: 0; font-family: var(--font-display); font-weight: var(--fw-display); white-space: nowrap;
  font-size: calc(clamp(28px, 4.6vw, 80px) * var(--title-k, 1)); line-height: 0.95; letter-spacing: -0.03em;
}
.plus-text {
  margin: 1.2vw 0 0; font-family: var(--font-body); font-weight: var(--fw-body);
  font-size: calc(var(--fs-body) * var(--body-k, 1)); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  text-align: justify; text-justify: inter-word; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; word-break: normal;     /* justified, like the descriptions of the projects: no hyphens */
}
.plus-text em { font-family: var(--font-display); font-style: italic; font-weight: 400; }     /* "square" in Instrument Serif italic */
.pw { display: inline-block; white-space: nowrap; }
.pl { display: inline-block; }
.masonry.is-moving .pl { will-change: transform; }

/* a sober entrance: only the fading, nothing moves */
html.js .masonry .shot[data-enter], html.js .masonry .plus-cell[data-enter] { transform: none; will-change: opacity; transition: opacity 500ms ease var(--enter-delay, 0ms); }
html.js .masonry .shot[data-enter].is-entered, html.js .masonry .plus-cell[data-enter].is-entered { transform: none; }

.plus-cell-box { display: flex; flex-direction: column; justify-content: center; }              /* like the phone: the block stands in the middle of the square, like the photo it replaces */
.plus-text { margin-top: 1.5vw; line-height: 1.38; padding-right: 7%; box-sizing: border-box; }
@media (max-width: 720px) {
  #plus { --plus-gap: 1vw; }                                                                   /* phone: gap 1vw; the side margins stay --space-margin */
  .plus-cell-box { display: flex; flex-direction: column; justify-content: center; }          /* the block stands in the middle of the square, like the photo it replaces */
  .plus-text { margin-top: 2.4vw; line-height: 1.38; padding-right: 7%; box-sizing: border-box; }   /* and a little air on the right, towards the next photo */
}
@media (prefers-reduced-motion: reduce) {
  html.js .masonry .shot[data-enter], html.js .masonry .plus-cell[data-enter] { transition: none; }
}

/* Computer: the text cell speaks the same language as the captions around it (Instrument Serif italic for the title, Inter Tight for the text), only a step bigger */
@media (min-width: 721px) {
  .plus-title { font-style: italic; font-size: calc(clamp(24px, 2.6vw, 44px) * var(--title-k, 1)); letter-spacing: -0.02em; line-height: 1; }
  .plus-text { margin-top: 0.9vw; }
}

/* The letters of the title are moved on their own layers (will-change: transform): a layer is cut at the box of the letter, and the italic letters (g, p, y, the slant of h and P) go out of it.
   Padding and the opposite margin: the layer is bigger, the layout does not change. */
.plus-title .pl { padding: 0.16em 0.14em 0.3em 0.14em; margin: -0.16em -0.14em -0.3em -0.14em; }

/* Bricolage Grotesque (no italic): the Photography title, the captions and the word "square" stay upright; sizes re-tuned for the wider letters */
.big-title, .plus-title, .cap1 { font-synthesis: none; font-optical-sizing: auto; }
.plus-title, .cap1, .plus-text em { font-style: normal !important; }
.plus-text em { font-weight: 500; }
.cap1 { font-size: clamp(13px, 1vw, 17px) !important; letter-spacing: -0.02em !important; line-height: 1.15 !important; }
@media (min-width: 721px) {
  .plus-title { font-size: calc(clamp(22px, 2.25vw, 38px) * var(--title-k, 1)) !important; letter-spacing: -0.03em !important; line-height: 1.05 !important; }
}
.sig { letter-spacing: -0.03em; line-height: 1; }

/* ---- Plus on a phone: the carousel of the photos (plus-viewer.js) ---- */
html.pz-on #app { overscroll-behavior: none; }                                                 /* the page is not locked with overflow:hidden (the browser would stop painting it under the bars); the overlay takes all the touches */
@media (max-width: 720px) { .masonry .shot { cursor: pointer; -webkit-tap-highlight-color: transparent; } }
#pz { position: absolute; left: 0; right: 0; top: 0; width: 100%; z-index: 9000; overflow: hidden; overscroll-behavior: contain; touch-action: none; color: var(--text); }
#pz .pz-bg { position: absolute; inset: 0; background: var(--bg); }                     /* bigger than the screen: the strips under the status bar and the browser bar are covered too */
#pz .pz-blur { position: absolute; inset: 0; }                                              /* the frosted page (the blur is set by the script while the photo moves) */
#pz { --pz-d: 14px; --pz-cap: 62px; }                                                      /* d: the distance of Close, the count and the caption from the photo, the same for all; cap: the height of the caption area (d included) */
#pz .pz-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; touch-action: pan-x; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#pz .pz-track::-webkit-scrollbar { display: none; }
#pz .pz-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
#pz .pz-in { height: 100%; display: flex; flex-direction: column; justify-content: center; }
#pz .pz-media { flex: none; width: 100%; aspect-ratio: 1 / 1; }                     /* every photo is the same square, the whole width: like the grid */
#pz .pz-media img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--ph, transparent); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#pz .pz-cap { flex: none; padding: var(--pz-d) var(--space-margin) 0; box-sizing: border-box; text-align: left; height: var(--pz-cap); }                /* the caption is always under the photo, at the same distance, on the same left line as Close */
#pz .pz-c1 { display: block; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; }
#pz .pz-c2 { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: var(--fw-body); font-size: 14px; line-height: 1.3; opacity: var(--soft-a, 0.8); }
#pz .pz-close, #pz .pz-count { position: absolute; z-index: 2; margin: 0; border: 0; background: none; color: inherit; font-family: var(--font-mono); font-weight: var(--nav-fw); text-transform: uppercase; letter-spacing: var(--ls-label); font-size: var(--fs-label); line-height: 1;
  bottom: calc(50% + (100vw + var(--pz-cap)) / 2 + var(--pz-d)); }                           /* just above the photo, as far from it as the caption is under it */
#pz .pz-close { left: var(--space-margin); padding: 14px 18px 14px 0; margin: 0 0 -14px; cursor: pointer; }
#pz .pz-count { right: var(--space-margin); pointer-events: none; }
