/* Gallery */
.fx-gal__head { align-items: flex-end; }
.fx-gal__intro { max-width: 720px; }
.fx-gal__aside { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fx-gal__item { position: relative; margin: 0; min-width: 0; }
.fx-gal__link { position: relative; display: block; color: inherit; text-decoration: none; border-radius: var(--fx-radius-lg); }
.fx-gal__media { display: block; }
.fx-gal__media > img { width: 100%; height: 100%; object-fit: cover; }

/* zoom cue */
.fx-gal__zoom { position: absolute; top: 14px; right: 14px; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #111; opacity: 0; transform: scale(.6) rotate(-45deg); transition: opacity .45s var(--fx-ease), transform .55s var(--fx-ease); pointer-events: none; }
.fx-gal__zoom .fx-icon { width: 1.05rem; height: 1.05rem; }
.fx-gal__link:hover .fx-gal__zoom, .fx-gal__link:focus-visible .fx-gal__zoom { opacity: 1; transform: none; }
.fx-gal__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45)); opacity: 0; transition: opacity .5s var(--fx-ease); pointer-events: none; }
.fx-gal__link:hover::after { opacity: 1; }

/* caption (masonry & grid: overlaid on hover, visible below on touch) */
.fx-gal__cap { margin-top: .75rem; font-size: .86rem; color: var(--fx-muted); line-height: 1.45; display: flex; gap: .9em; align-items: baseline; }
@media (hover: hover) {
  .fx-s-gallery--masonry .fx-gal__item:has(.fx-gal__link) .fx-gal__cap,
  .fx-s-gallery--grid .fx-gal__item:has(.fx-gal__link) .fx-gal__cap {
    position: absolute; left: 18px; right: 64px; bottom: 16px; margin: 0; color: #fff; font-size: .92rem; z-index: 1; pointer-events: none;
    opacity: 0; transform: translateY(10px); transition: opacity .45s var(--fx-ease), transform .55s var(--fx-ease); }
  .fx-s-gallery--masonry .fx-gal__item:hover .fx-gal__cap,
  .fx-s-gallery--grid .fx-gal__item:hover .fx-gal__cap,
  .fx-s-gallery--masonry .fx-gal__item:focus-within .fx-gal__cap,
  .fx-s-gallery--grid .fx-gal__item:focus-within .fx-gal__cap { opacity: 1; transform: none; }
}

/* ---- masonry ---- */
.fx-gal__masonry { columns: 2; column-gap: clamp(10px, 1.6vw, 22px); }
.fx-gal__masonry .fx-gal__item { break-inside: avoid; margin-bottom: clamp(10px, 1.6vw, 22px); }
.fx-gal__masonry .fx-gal__media > img { height: auto; }
.fx-gal__masonry .fx-gal__media > .fx-ph { min-height: 0; }
.fx-gal__media--r0 > .fx-ph { aspect-ratio: 4 / 5; }
.fx-gal__media--r1 > .fx-ph { aspect-ratio: 1; }
.fx-gal__media--r2 > .fx-ph { aspect-ratio: 3 / 4; }
.fx-gal__media--r3 > .fx-ph { aspect-ratio: 4 / 3; }
.fx-gal__media--r4 > .fx-ph { aspect-ratio: 2 / 3; }
@media (min-width: 861px) {
  .fx-gal--cols-3 .fx-gal__masonry { columns: 3; }
  .fx-gal--cols-4 .fx-gal__masonry { columns: 4; }
}

/* ---- grid ---- */
.fx-gal__grid { display: grid; gap: clamp(10px, 1.6vw, 22px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 861px) {
  .fx-gal--cols-3 .fx-gal__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fx-gal--cols-4 .fx-gal__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.fx-gal__item[hidden] { display: none; }
.fx-gal__item.is-entering { animation: fx-gal-in .6s var(--fx-ease) both; }
@keyframes fx-gal-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.fx-gal__filter { display: flex; flex-wrap: wrap; gap: 8px; margin: calc(clamp(36px, 5vw, 72px) * -.45) 0 clamp(24px, 3vw, 40px); }
html:not(.fx-js) .fx-gal__filter { display: none; }
.fx-gal__chip { min-height: 2.6rem; padding: .55em 1.2em; border-radius: 999px; border: 1px solid var(--fx-line); background: transparent; color: var(--fx-ink);
  font-size: .82rem; font-weight: 500; letter-spacing: .02em; transition: background .3s var(--fx-ease), color .3s var(--fx-ease), border-color .3s var(--fx-ease); }
.fx-gal__chip:hover { border-color: var(--fx-ink); }
.fx-gal__chip[aria-pressed="true"] { background: var(--fx-ink); color: var(--fx-bg); border-color: var(--fx-ink); }

/* ---- carousel ---- */
.fx-gal__track { --fx-slide: min(80%, 520px); }
.fx-s-gallery--carousel .fx-gal__item:nth-child(even) .fx-gal__media { transform: translateY(clamp(0px, 3vw, 40px)); }
.fx-s-gallery--carousel .fx-gal__item:nth-child(even) .fx-gal__cap { transform: translateY(clamp(0px, 3vw, 40px)); }
.fx-s-gallery--carousel .fx-gal__track { padding-bottom: clamp(8px, 3.4vw, 48px); }
.fx-gal__num { font-size: .78rem; letter-spacing: .08em; color: var(--fx-accent); flex: none; }
.fx-tone-accent .fx-gal__num { color: inherit; }
.fx-gal__cap-text { color: var(--fx-ink); }
.fx-gal__dots { margin-top: 2rem; }

@media (max-width: 560px) {
  .fx-gal__zoom { width: 2.2rem; height: 2.2rem; top: 10px; right: 10px; }
  .fx-gal__cap { font-size: .8rem; }
  .fx-s-gallery--carousel .fx-gal__item:nth-child(even) .fx-gal__media,
  .fx-s-gallery--carousel .fx-gal__item:nth-child(even) .fx-gal__cap { transform: none; }
}

/* Captioned tiles (grid & masonry, hover devices): a light wash rises from the bottom on hover so the
   ink-coloured caption stays legible over dark photos. */
@media (hover: hover) {
  .fx-s-gallery--masonry .fx-gal__item:has(.fx-gal__cap-text) .fx-gal__link::after,
  .fx-s-gallery--grid .fx-gal__item:has(.fx-gal__cap-text) .fx-gal__link::after {
    background: linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--fx-bg) 60%, transparent) 78%, color-mix(in srgb, var(--fx-bg) 94%, transparent));
  }
  .fx-s-gallery--masonry .fx-gal__item:has(.fx-gal__link) .fx-gal__cap,
  .fx-s-gallery--grid .fx-gal__item:has(.fx-gal__link) .fx-gal__cap { color: var(--fx-ink); font-weight: 500; }
  .fx-s-gallery--masonry .fx-gal__item:has(.fx-gal__link) .fx-gal__cap-text,
  .fx-s-gallery--grid .fx-gal__item:has(.fx-gal__link) .fx-gal__cap-text { color: var(--fx-ink); }
  .fx-gal__item:focus-within .fx-gal__link::after { opacity: 1; }
}
