/* Gallery. Desktop boxes from Flow E2E v13, 022 (1600×1200), in --hd.
   Header, isotipo and menu come from models.css; the sort button sits where
   Models has its filter button.
   Slots are laid out in justified rows by gallery.js: every row fills the
   width from x 153 to x 1446, keeps each cover's own shape, and aims at
   about 440 px high (the mockup rows are 424 and 340). Gaps 56 / 70. */
.gl-main {
  --gl-gap: calc(56 * var(--hd));
  --gl-row-gap: calc(70 * var(--hd));
  padding: calc(209 * var(--hd)) calc(154 * var(--hd)) calc(140 * var(--hd)) calc(153 * var(--hd));
}

html.fp-nav-open .gl-main { padding-right: calc(var(--nav-pw) + 66 * var(--hd)); }

.gl-grid {
  display: flex;
  flex-direction: column;
  row-gap: var(--gl-row-gap);
  column-gap: var(--gl-gap);
}

.gl-row {
  display: flex;
  gap: var(--gl-gap);
}

.gl-row.is-last { justify-content: flex-start; }

/* A slot: the cover of one shoot. */
.gl-slot {
  position: relative;
  flex: none;
  overflow: hidden;
  background: #d9d6cf;
  color: #fff;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gl-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%; /* faces near the top: heads never cut */
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gl-slot:focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }

/* Badge: stills, videos and type, bottom left (164,598 / h 24). */
.gl-badge {
  position: absolute;
  left: calc(10 * var(--hd));
  bottom: calc(12 * var(--hd));
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--hd));
  height: calc(24 * var(--hd));
  min-height: 20px;
  padding: 0 calc(15 * var(--hd)) 0 calc(13 * var(--hd));
  border-radius: 999px;
  background: rgba(240, 240, 240, 0.92);
  color: var(--ink);
  font-size: max(10px, calc(11 * var(--hd)));
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 0.2s linear;
}

.gl-badge > * { flex: none; }
.gl-badge > b { flex: 0 1 auto; min-width: 0; }

.gl-badge [data-icon] {
  width: max(12.6px, calc(14.9 * var(--hd)));
  height: max(12.6px, calc(14.9 * var(--hd)));
}

.gl-badge { max-width: calc(100% - 2 * max(8px, calc(10 * var(--hd)))); overflow: hidden; }
.gl-badge b { margin-left: calc(9 * var(--hd)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }

/* Hover sheet, as on the model page (024): name, type, count, date and
   actions over a dark veil. */
.gl-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(34 * var(--hd));
  background: rgba(8, 8, 9, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s linear;
}

.gl-slot.is-open .gl-info,
.gl-slot:focus-within .gl-info { opacity: 1; pointer-events: auto; }
.gl-slot.is-open .gl-badge,
.gl-slot:focus-within .gl-badge { opacity: 0; }

@media (hover: hover) {
  .gl-slot:hover .gl-info { opacity: 1; pointer-events: auto; }
  .gl-slot:hover .gl-badge { opacity: 0; }
  .gl-slot:hover img { transform: scale(1.03); }
}

.gl-info p { margin: 0; }
.gl-name a { color: inherit; text-decoration: none; }
.gl-name a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.gl-name {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--hd));
  margin-top: calc(38 * var(--hd)) !important;
  font-size: max(15px, calc(25 * var(--hd)));
  font-weight: 500;
  line-height: 1.1;
}

.gl-name [data-icon] { flex: none; width: calc(20.7 * var(--hd)); height: calc(20.7 * var(--hd)); min-width: 14.9px; min-height: 14.9px; }

.gl-meta {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  font-size: max(10px, calc(12 * var(--hd)));
  font-weight: 500;
  line-height: 1;
}

.gl-meta li {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--hd));
  height: calc(25 * var(--hd));
  min-height: 18px;
}

.gl-meta [data-icon] { flex: none; width: calc(17.2 * var(--hd)); height: calc(17.2 * var(--hd)); min-width: 13.8px; min-height: 13.8px; }

.gl-actions {
  display: flex;
  justify-content: flex-end;
  gap: calc(22 * var(--hd));
  margin-top: calc(18 * var(--hd));
}

.gl-actions button,
.gl-top {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gl-actions button { width: calc(27.6 * var(--hd)); height: calc(27.6 * var(--hd)); min-width: 20.7px; min-height: 20.7px; }

.gl-actions button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.gl-actions [data-icon],
.gl-top [data-icon],
.gl-sort [data-icon] { display: block; width: 100%; height: 100%; }

.gl-fav[aria-pressed="true"] svg path,
.sh-fav[aria-pressed="true"] svg path { fill: currentColor; }

/* Sort: the arrow turns when the order flips. */
.gl-sort [data-icon] { transition: transform 0.25s ease; }
.gl-sort[aria-pressed="true"] [data-icon] { transform: scaleY(-1); }

/* Back to top, as on 024. */
.gl-top {
  position: fixed;
  right: calc(50 * var(--hd));
  bottom: calc(50 * var(--hd));
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.14);
}

.gl-top[hidden] { display: none; }
.gl-top [data-icon] { width: 23px; height: 23px; }

/* The opened shoot lives in shoot.css (shared with the model page). */

@media (prefers-reduced-motion: reduce) {
  .gl-slot img,
  .gl-info { transition: none; }
  .gl-slot:hover img { transform: none; }
}

/* Tablet and phone. */
@media (max-width: 800px) {
  .gl-main {
    --gl-gap: calc(10 * var(--m));
    --gl-row-gap: calc(10 * var(--m));
    padding: calc(158 * var(--m)) calc(28 * var(--m)) calc(60 * var(--m));
  }

  html.fp-nav-open .gl-main { padding-right: calc(28 * var(--m)); }
  html.fp-nav-open { overflow: hidden; }

  .gl-badge { left: 8px; bottom: 8px; height: 22px; padding: 0 10px; gap: 5px; font-size: 10px; }
  .gl-badge b { margin-left: 4px; }
  .gl-badge [data-icon] { width: 12.6px; height: 12.6px; }

  .gl-info { padding: 14px; }
  .gl-name { margin-top: 4px !important; font-size: 16px; gap: 6px; }
  .gl-name [data-icon] { width: 14.9px; height: 14.9px; }
  .gl-meta { font-size: 11px; }
  .gl-meta li { gap: 8px; height: 20px; }
  .gl-meta [data-icon] { width: 13.8px; height: 13.8px; }
  .gl-actions { gap: 22px; margin-top: 10px; }
  .gl-actions button { width: 23px; height: 23px; }

  .gl-top { right: calc(24 * var(--m)); bottom: calc(24 * var(--m)); }
}

/* Portrait tablet: side margins as on desktop, rows a little lower. */
@media (min-width: 561px) and (max-width: 800px) {
  .gl-main { --gl-gap: 14px; --gl-row-gap: 14px; }
}
