/* Field (source: /stills): a filter column at the right edge (mirrored) and a photo grid in three rows that scrolls
   sideways. Hover darkens a photo and shows its category; click opens the lightbox. "הסתר סינון" gives the grid the full width. */
.field { display: flex; padding-top: 90px; padding-bottom: 80px; }
.field .homelink { top: 90px; bottom: 80px; } /* the full height of the grid, like the source */
.filters { position: absolute; right: 40px; top: 0; bottom: 0; width: 230px; display: flex; flex-direction: column; justify-content: center; padding-inline: 46px 20px; transition: opacity .3s ease-in-out; z-index: 4; }
.filters p { margin: 0 0 10px; font-size: 15px; color: var(--support); text-decoration: underline; text-underline-offset: 4px; }
.filters ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
/* the chosen filter fills with ink from the right, like the menu (no strike line) */
.filters button { font-size: 15px; letter-spacing: .02em; --base: var(--faint); --fill: var(--ink); color: transparent; -webkit-text-fill-color: transparent;
  background: linear-gradient(to left, var(--fill) 50%, var(--base) 50%) 0 0 / 200% 100% no-repeat; -webkit-background-clip: text; background-clip: text;
  transition: background-position .45s var(--swing); }
.filters button:hover, .filters button:focus-visible, .filters button[aria-pressed="true"] { background-position: 100% 0; }
.filters button[aria-pressed="true"] { --fill: var(--accent); }   /* the chosen one stays filled, in the brand colour (Shahar 29.11) */
.grid { position: absolute; top: 90px; bottom: 80px; right: 270px; left: 0; display: flex; flex-flow: column wrap; align-content: flex-start; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; transition: right .5s ease-in-out; perspective: 3000px; }
.grid::-webkit-scrollbar { display: none; }
.no-filter .filters { opacity: 0; pointer-events: none; }
.no-filter .grid { right: 60px; }
.ph { position: relative; height: calc((100% - 8px) / 3); flex: none; overflow: hidden; cursor: zoom-in; background: var(--surface); }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; } /* a portrait in a landscape column fills its tile instead of leaving a gap */
.ph .cover { position: absolute; inset: 0; background: rgba(38, 32, 28, .5); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s ease-in-out; }
.ph .cover b { font-family: var(--display); font-size: 24px; letter-spacing: .2em; padding-inline-start: .2em; transform: translateY(5px); transition: transform .3s ease-in-out; }
.ph:hover .cover, .ph:focus-visible .cover { opacity: 1; }
.ph:hover .cover b, .ph:focus-visible .cover b { transform: none; }
.ph[hidden] { display: none; }
.field .foot { position: absolute; bottom: 40px; left: 60px; display: flex; gap: 26px; align-items: center; z-index: 5; }
.field .foot button { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); letter-spacing: .06em; }
.field .foot button:hover { color: var(--ink); }
.field .foot svg { width: 18px; height: 12px; stroke: currentColor; fill: none; }
.mfilter { display: none; }
/* a back-scroll hint at the filter side, shown (1s fade) only while the filters are hidden */
.field .go-back { position: absolute; bottom: 30px; right: 60px; z-index: 5; opacity: 0; pointer-events: none; transition: opacity 1s var(--swing); }
.no-filter .go-back { opacity: 1; pointer-events: auto; }

@media (max-width: 1024px) {
  .field { display: block; padding: 74px 0 30px; }
  .filters, .field .foot, .field .go-back { display: none; }
  /* the filter and the layout switch stay at the top while the photos scroll under them */
  .mfilter { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; padding: 4px 20px;
    background: linear-gradient(var(--rule), var(--rule)) 50% 100% / calc(100% - 40px) 1px no-repeat, var(--ground); color: var(--support); font-size: 15px; }
  /* the layout switch: the grid icon in the one-row view, the rows icon in the grid */
  .mfilter .layout { display: grid; place-items: center; width: 44px; height: 44px; margin-inline-end: -12px; color: var(--ink); }
  .mfilter .layout svg { width: 19px; height: 19px; fill: currentColor; transition: transform .45s var(--swing); }
  .mfilter .layout:active svg { transform: scale(.86); }
  .mfilter .i-list, .dense .mfilter .i-grid { display: none; }
  .dense .mfilter .i-list { display: block; }
  .mfilter select { font: inherit; color: var(--ink); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
  .grid { position: static; display: block; overflow: visible; padding: 0 12px; }
  .ph { height: auto; margin-bottom: 6px; }
  .ph img { width: 100%; height: auto; max-width: 100%; }
  /* the dense view: three square tiles a row, more photos on the screen (site.js morphs between the two) */
  .dense .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
  .dense .ph { aspect-ratio: 1 / 1 !important; margin: 0; }
  .dense .ph img { height: 100%; object-fit: cover; }
  .dense .ph .cover b { font-size: 15px; letter-spacing: .12em; }
}
/* the morph between the views (a same-page view transition): each photo travels from its old box to its new one,
   cropped to the box the whole way, so a wide photo closes into its square instead of stretching */
.field-vt::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
.field-vt::view-transition-image-pair(*) { overflow: hidden; }
.field-vt::view-transition-old(*), .field-vt::view-transition-new(*) { height: 100%; width: 100%; object-fit: cover; }
.field-vt::view-transition-old(root), .field-vt::view-transition-new(root) { animation-duration: .35s; }
