/* NN Gallery - the hero, the wall and the two paging links (ticket 08).
   The wall's cards, the four/three/two column grid and the type are the
   child theme's house rules; nothing is restated here. Every value below is
   read from the theme's own tokens, so Gallery matches the other worlds. */

/* --- 1. The hero -------------------------------------------------------
   The whole canvas, never a crop: the photograph keeps its own shape and is
   only ever scaled down, so nothing is cut at the top or the sides. On a
   tall desktop window a tall painting is capped by height and centred. */

.nn-gal-hero {
  margin: 0;
  background: var(--color-ivory);
}

/* The block is one link, but the house does not underline a picture's
   caption: the underline the theme gives every link is switched off here
   and comes back only on the name, as a hover mark. */
.nn-gal-hero a.nn-gal-hero__link {
  display: block;
  text-decoration: none !important;
  color: var(--color-charcoal);
}

.nn-gal-hero a.nn-gal-hero__link:hover .nn-gal-hero__name,
.nn-gal-hero a.nn-gal-hero__link:focus-visible .nn-gal-hero__name {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.nn-gal-hero__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78vh;
  margin-inline: auto;
}

.nn-gal-hero__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem 1rem;
  padding: 24px 20px 0;
  text-align: center;
}

.nn-gal-hero__name {
  font-family: var(--font-english);
  font-size: var(--type-body-lg-size);
  font-weight: 600;
  line-height: var(--type-body-lg-leading);
  letter-spacing: var(--type-body-lg-tracking);
}

.nn-gal-hero__price {
  font-family: var(--font-english);
  font-size: var(--type-body-md-size);
  font-weight: 600;
  line-height: var(--type-body-md-leading);
  letter-spacing: var(--type-body-md-tracking);
}

/* --- 2. The wall -------------------------------------------------------
   The grid itself is the house product grid; only its first row is pulled
   up so the wall sits the same distance under its label as in the other
   worlds.

   The wall wraps as a centred row of paintings instead of fixed columns, so
   a short last page sits in the middle of the screen rather than hanging off
   the left with a gap beside it. Thirty-six to a page keeps every full page
   whole in four, three and two columns alike. */

.nn-gallery-wall ul.products {
  --nn-gal-cols: 2;
  margin-block-start: 0;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.75rem;
  row-gap: 3rem;
  grid-template-columns: none;
}

.nn-gallery-wall ul.products li.product {
  flex: 0 0 calc((100% - (var(--nn-gal-cols) - 1) * 1.75rem) / var(--nn-gal-cols));
  max-width: calc((100% - (var(--nn-gal-cols) - 1) * 1.75rem) / var(--nn-gal-cols));
}

@media (min-width: 768px) {
  .nn-gallery-wall ul.products {
    --nn-gal-cols: 3;
  }
}

@media (min-width: 1200px) {
  .nn-gallery-wall ul.products {
    --nn-gal-cols: 4;
  }
}

/* A world holding one painting only: the hero is that painting, and the
   wall's whole band steps aside instead of naming an empty shelf. The
   browser closes the wall's empty paragraph early, so the marker is a
   direct child of the band. */
div:has(> .nn-gallery-wall--hero-only) {
  display: none !important;
}

/* --- 3. The strip under the wall ---------------------------------------
   Arrows and numbers are the shop's one pager module; only the wall's own
   space above it belongs here. */

.nn-gal-pager {
  margin-block-start: 56px;
  padding-block-start: 28px;
  border-top: 1px solid var(--color-border);
}

@media (max-width: 767px) {
  .nn-gal-hero__text {
    padding-block-start: 16px;
  }

  .nn-gal-pager {
    margin-block-start: 40px;
    padding-block-start: 20px;
  }
}
