/* Preview only (CLAUDE.md rule 5): Projects grouped into projects, Claes's e-mail of 2026-11-09.
   /projects becomes an overview with one row of four images per project; /projects?projekt=<slug> shows one
   project's images in order. Written for this Webflow template: the grid, tiles and crop are the
   template's own (.collection-wrap, .collection-archive-iimg); only the labels and the header are new.
   Breakpoints follow the template: 991, 767, 479. Everything is scoped to the Projects page id, as
   this file is linked on every page. */

html[data-wf-page="63f8b498b4a7486e49ba2d18"] {
  --pj-gap-label: 8px;
  --pj-gap: 16px; /* the template grid's own gap */
}

/* No flash of the mixed grid before polish.js has grouped it. If the script never runs, the grid
   shows anyway after 2.5 s; without JS (no w-mod-js) it is never hidden. */
@keyframes pj-show { to { visibility: visible; } }
html.w-mod-js[data-wf-page="63f8b498b4a7486e49ba2d18"] .collection-wrap:not(.pj-done) {
  visibility: hidden;
  animation: pj-show 0s 2.5s forwards;
}

/* ---- overview: one row per project, four images, the whole row one link (Claes, 2026-11-24) ----
   The row lies across the template's grid and takes over its columns, so the 28 images stand exactly as
   a plain grid would: 4 in a row, 3 from 991 px (the fourth image waits on the project page), and a block
   of 2 x 2 from 767 px. */
.pj-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--pj-gap);
  color: var(--black);
  text-decoration: none;
}
@supports not (grid-template-columns: subgrid) {
  .pj-row { grid-template-columns: inherit; column-gap: var(--pj-gap); }
}
.pj-cell { display: block; overflow: hidden; }
.pj-cell .collection-archive-iimg { display: block; }
.pj-row:focus-visible { outline: 1px solid var(--black); outline-offset: 4px; }

/* What shows that four images are one project (Nils, 2026-11-24): on hover the whole row fades the way a
   product image on /collection does, measured on the live page: the image goes to .85 at once and its link
   fades to .9 over .6 s. The name takes the hover colour every link on the site has. */
.pj-cell { transition: opacity .6s; }
@media (hover: hover) {
  .pj-row:hover .pj-cell { opacity: .9; }
  .pj-row:hover .pj-cell .collection-archive-iimg { opacity: .85; }
  .pj-row:hover .pj-label { color: var(--black70); }
}
.pj-row:focus-visible .pj-cell { opacity: .9; }
.pj-row:focus-visible .pj-cell .collection-archive-iimg { opacity: .85; }
.pj-row:focus-visible .pj-label { color: var(--black70); }

/* The names under the rows are .footer-link: the footer's type, sizes, hover colour and its .2 s colour
   fade at every width. Only their place is set here. Sticky is the footer's own and means nothing here.
   All in small letters, like the menu (Nils, 2026-11-24; this replaces the initial capitals of
   2026-11-09). */
.pj-label { position: static; text-transform: lowercase; }
/* The name under its row, 8 px from the images, with the menu's 20 px line height. 28 px below it to the
   next project. The grid's own gap already lies above the name and below the row, so only the difference
   is set. (12 and 44 px at first, then 12 and 36; Nils asked twice for closer and tighter, 2026-11-24.) */
.pj-label {
  grid-column: 1 / -1;
  display: block;
  margin-top: calc(var(--pj-gap-label) - var(--pj-gap));
  margin-bottom: calc(28px - var(--pj-gap));
  line-height: 20px;
}

/* ---- versions 2 and 3 (?version=2, ?version=3; Nils 2026-11-24): no names by the images, the projects are
   named only in the subcategory lists. The projects stay 28 px apart (20 px at 479 px and down). ---- */
html[data-pj^="utan"] .pj-row .pj-label { display: none; }
html[data-pj^="utan"] .pj-row + .pj-row { margin-top: calc(28px - var(--pj-gap)); }
@media screen and (max-width: 479px) {
  html[data-pj^="utan"] .pj-row + .pj-row { margin-top: calc(20px - var(--pj-gap)); }
}

/* Version 3 keeps the hover of version 1 (the /collection fade on the row), so it needs nothing more.

   Version 2: only a slow zoom, like a subtle Ken Burns (1.05 over 6 s, back in 1.2 s), and nothing fades
   (Nils, 2026-11-24: the light hover taken out again). On the overview the row's four images drift closer
   together inside their frames; on a project page each image does so on its own, in place of the
   template's fade to .85. */
html[data-pj="utan2"] .pj-cell { transition: none; }
html[data-pj="utan2"] .collection-wrap > a.w-lightbox { overflow: hidden; }
html[data-pj="utan2"] .pj-cell .collection-archive-iimg,
html[data-pj="utan2"] .collection-wrap > a.w-lightbox .collection-archive-iimg { transition: transform 1.2s cubic-bezier(.3, .1, .3, 1); }
@media (hover: hover) {
  html[data-pj="utan2"] .pj-row:hover .pj-cell,
  html[data-pj="utan2"] .pj-row:hover .pj-cell .collection-archive-iimg,
  html[data-pj="utan2"] .collection-wrap > a.w-lightbox:hover .collection-archive-iimg { opacity: 1; }
  html[data-pj="utan2"] .pj-row:hover .pj-cell .collection-archive-iimg,
  html[data-pj="utan2"] .collection-wrap > a.w-lightbox:hover .collection-archive-iimg { transform: scale(1.05); transition: transform 6s cubic-bezier(.2, .5, .3, 1); }
}
html[data-pj="utan2"] .pj-row:focus-visible .pj-cell,
html[data-pj="utan2"] .pj-row:focus-visible .pj-cell .collection-archive-iimg { opacity: 1; }
html[data-pj="utan2"] .pj-row:focus-visible .pj-cell .collection-archive-iimg,
html[data-pj="utan2"] .collection-wrap > a.w-lightbox:focus-visible .collection-archive-iimg { transform: scale(1.05); transition: transform 6s cubic-bezier(.2, .5, .3, 1); }
@media (prefers-reduced-motion: reduce) {
  html[data-pj="utan2"] .collection-archive-iimg { transition: none !important; transform: none !important; }
}

/* ---- the projects as subcategories (polish.js builds them from the template's own /collection markup) ----
   Only one thing is added: on /collection the row above the images holds five short words, seven project
   names do not fit on a phone, so here the row may wrap instead of running off the screen. */
/* The row of projects above the images (up to 991 px): one line, always (Nils, 2026-11-30). Where the
   names do not fit (below about 575 px) it scrolls sideways and runs out to the edge of the screen, fading
   out towards it, so it shows there is more. The names keep the template's type, gaps and line
   height. At rest the first name stands where the logo and the images start; scrolled, the names pass under
   a fade on the left too. The fade is a mask, so it is the names that fade, not a white layer. On a
   project page polish.js scrolls the open project into view. (Same day, replaced: two balanced lines.)
   The list's 3 px above and below keep a focus ring inside the scroller; the wrapper gives them back.
   The fade (Nils, same day: stronger, and starting earlier): over the last 15vw on a side where more names
   hide, fully gone 2vw before the edge. polish.js marks the sides (pj-more-left, pj-more-right), so at rest
   only the right side fades, at the end only the left, and nothing where all names fit; the first and last
   names are never faded. The change eases in as the row is scrolled (where @property is supported). */
@property --pj-fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --pj-fade-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
@media screen and (max-width: 991px) {
  .pj-sub-row.store-categories-wrap.no-show { margin-left: 0; margin-right: 0; }
  .pj-sub-row .collection-list-wrapper {
    display: block;
    width: auto;
    margin: -3px 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    --pj-fade-l: 0px;
    --pj-fade-r: 0px;
    -webkit-mask-image: linear-gradient(to right, transparent calc(var(--pj-fade-l) * .13), rgba(0, 0, 0, .45) calc(var(--pj-fade-l) * .5), #000 var(--pj-fade-l), #000 calc(100% - var(--pj-fade-r)), rgba(0, 0, 0, .45) calc(100% - var(--pj-fade-r) * .5), transparent calc(100% - var(--pj-fade-r) * .13));
    mask-image: linear-gradient(to right, transparent calc(var(--pj-fade-l) * .13), rgba(0, 0, 0, .45) calc(var(--pj-fade-l) * .5), #000 var(--pj-fade-l), #000 calc(100% - var(--pj-fade-r)), rgba(0, 0, 0, .45) calc(100% - var(--pj-fade-r) * .5), transparent calc(100% - var(--pj-fade-r) * .13));
    transition: --pj-fade-l .35s ease, --pj-fade-r .35s ease;
  }
  .pj-sub-row .collection-list-wrapper.pj-more-left { --pj-fade-l: 15vw; }
  .pj-sub-row .collection-list-wrapper.pj-more-right { --pj-fade-r: 15vw; }
  .pj-sub-row .collection-list-wrapper::-webkit-scrollbar { display: none; }
  .pj-sub-row .collection-list { flex-wrap: nowrap; justify-content: flex-start; width: max-content; min-width: 0; padding: 3px 5vw; }
  .pj-sub-row .collection-list > .w-dyn-item { flex: none; white-space: nowrap; }
}

/* ---- one project ----
   Nothing above the images, which start at the same height as on the overview (Nils, 2026-11-24). The
   project name is a heading only for screen readers and search. */
.pj-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
@media screen and (max-width: 991px) and (min-width: 768px) {
  .pj-row .pj-cell:nth-child(4) { display: none; }
}
@media screen and (max-width: 767px) {
}
@media (prefers-reduced-motion: reduce) {
  .pj-cell { transition: none; }
}

@media screen and (max-width: 479px) {
  html[data-wf-page="63f8b498b4a7486e49ba2d18"] { --pj-gap-label: 6px; --pj-gap: 10px; }
  .pj-label { margin-bottom: calc(20px - var(--pj-gap)); line-height: 18px; }
}

/* ---- versions 2 and 3 below 992 px (Nils, 2026-11-25) ----
   No names under the rows here either: a wider gap between projects than between the images of one project
   shows what belongs together. 40 px against 16 px inside a row, 32 px against 10 px at 479 px and below.
   The row of projects above the images stays, so the names are still on the page, as the left menu does
   on wider screens. (2026-11-24 had the names under the rows and no menu row; replaced.) */
@media screen and (max-width: 991px) {
  html[data-pj^="utan"] .pj-row + .pj-row { margin-top: calc(40px - var(--pj-gap)); }
}
@media screen and (max-width: 479px) {
  html[data-pj^="utan"] .pj-row + .pj-row { margin-top: calc(32px - var(--pj-gap)); }
}
