/* ==========================================================================
   Individual gallery pages (stories/<slug>.html), after
   twks.ch/en/projects/academie-de-sertissage: a big title at the top of a
   paper page, the gallery beginning in the lower third of the first screen,
   then the rhythm landscape → two portraits → black box with a centred
   photo, repeated, and the shared contact form to finish.
   ========================================================================== */

:root { --gallery-gap: 12px; }

.story-head {
  background: var(--paper);
  color: var(--ink);
  padding: calc(var(--nav-h) + 12vh) var(--page-margin) var(--s-6);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--s-1);
}
.story-head__title {
  font-size: var(--fs-h3);
  white-space: nowrap;
  max-width: 100%;
  margin-bottom: var(--s-3);
}
/* the note sits straight here; on the homepage it is tilted */
.story-head .note__figure { transform: none; }
@media (max-width: 734px) {
  .story-head { padding-top: calc(var(--nav-h) + 8vh); }
  .story-head__title { white-space: normal; text-wrap: balance; margin-bottom: var(--s-2); }
}

/* ---------- gallery ---------- */
.gallery {
  background: var(--paper);
  padding: 0 var(--page-margin) var(--s-7);
  display: grid;
  gap: var(--gallery-gap);
}
.tile--land, .tile--box, .tile--pair > *, .tile--trio > * {
  position: relative;
  overflow: hidden;
  background: var(--ink-10);
}
.tile--land { aspect-ratio: 3 / 2; }
.tile--land img, .tile--pair img, .tile--trio img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gallery-gap);
}
.tile--pair > * { aspect-ratio: 3 / 4; }
/* three portraits across */
.tile--trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gallery-gap);
}
.tile--trio > * { aspect-ratio: 3 / 4; }
.tile--box {
  aspect-ratio: 3 / 2;
  background: #000;
  display: grid;
  place-items: center;
}
.tile--box img {
  width: 64%;
  height: auto;
  max-height: 86%;
  object-fit: contain;
}
@media (max-width: 734px) {
  .tile--pair, .tile--trio { grid-template-columns: 1fr; }
}

/* ---------- more galleries (partials/more.html) ----------
   The other three category tiles above the contact form. The partial holds
   all four; the page's own tile is hidden by data-gallery on <main>. */
.more {
  background: var(--paper);
  color: var(--ink);
  padding: 0 var(--page-margin) var(--s-7);
}
.more__head {
  text-align: center;
  font-size: var(--fs-h2);
  margin-bottom: var(--s-5);
  text-wrap: balance;
}
.more__grid {
  display: grid;
  /* two visible tiles while Weddings is hidden; repeat(3, 1fr) at 1040px
     once it is back */
  grid-template-columns: repeat(2, 1fr);
  gap: var(--tile-gap);
  align-items: start;
  max-width: 692px; /* same tile size as three at 1040px */
  margin: 0 auto;
}
/* the weddings page itself still shows the other three */
[data-gallery="weddings"] .more__grid { grid-template-columns: repeat(3, 1fr); max-width: 1040px; }
.more .tile { margin-top: 0; }
/* the middle visible tile drops, echoing the staggered tiles on /galleries */
[data-gallery="weddings"] .more .tile:nth-child(2 of :not([data-slug="weddings"])),
[data-gallery="couples"] .more .tile:nth-child(2 of :not([data-slug="couples"])),
[data-gallery="families"] .more .tile:nth-child(2 of :not([data-slug="families"])),
[data-gallery="maternity"] .more .tile:nth-child(2 of :not([data-slug="maternity"])) { margin-top: var(--s-4); }
[data-gallery="weddings"] .more .tile[data-slug="weddings"],
[data-gallery="couples"] .more .tile[data-slug="couples"],
[data-gallery="families"] .more .tile[data-slug="families"],
[data-gallery="maternity"] .more .tile[data-slug="maternity"] { display: none; }
@media (max-width: 734px) {
  .more__head { margin-bottom: var(--s-4); }
  .more .tile__title { font-size: 18px; left: 12px; right: 12px; bottom: 12px; }
}
