/* GALLERY — numbered contact sheet */
.gl-head { padding-bottom: clamp(28px, 4vw, 48px); }
.gl-head__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px clamp(24px, 4vw, 64px); align-items: end; padding-block: clamp(36px, 6vw, 88px) clamp(28px, 4vw, 48px); }
.gl-head__title { display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 28px); font-size: clamp(1.6rem, 3.6vw, 3.4rem); line-height: .9; }
.gl-head__count { font-size: clamp(6rem, 19vw, 17rem); line-height: .74; color: var(--orange); font-variation-settings: "wdth" 62; font-stretch: 62%; letter-spacing: -.04em; }
.gl-head__copy { display: grid; gap: 14px; }

.gl-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid rgba(247, 246, 240, .3); padding-top: 20px; }
.gl-filter button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px;
  background: transparent; color: var(--paper); border: 1px solid rgba(247, 246, 240, .45); border-radius: 99px; font-size: .92rem;
}
.gl-filter button i { font-style: normal; font-family: var(--mono); font-size: 11px; color: #b9bbb6; }
.gl-filter button .mono { background: var(--paper); color: var(--ink); padding: 2px 6px; border-radius: 99px; font-size: 10.5px; }
.gl-filter button:hover { border-color: var(--orange); }
.gl-filter button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.gl-filter button[aria-pressed="true"] i { color: var(--ink); }
.gl-filter button[aria-pressed="true"] .mono { background: var(--ink); color: var(--paper); }
.gl-filter__status { margin-left: auto; color: #b9bbb6; }

.gl-seq { padding-block: clamp(48px, 7vw, 104px); border-bottom: 1px solid var(--ink); }
.gl-seq[hidden] { display: none; }
.gl-seq--prints { background: #fff; }
.gl-seq--details { background: var(--lav); }
.gl-seq--half-sleeves { background: var(--mint); }
.gl-seq__head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(18px, 3vw, 40px); align-items: end; margin-bottom: clamp(24px, 3vw, 40px); padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.gl-seq__letter { font-size: clamp(5rem, 11vw, 10rem); line-height: .72; background: var(--ink); color: var(--paper); padding: .1em .12em 0; }
.gl-seq__head .mono { margin-bottom: 8px; }
.gl-seq__note { color: var(--graphite); max-width: 46ch; font-size: .97rem; }
.gl-seq--details .gl-seq__note, .gl-seq--half-sleeves .gl-seq__note { color: #33363a; }

.gl-grid { display: grid; gap: clamp(8px, 1vw, 14px); grid-auto-flow: dense; }
.gl-item { position: relative; aspect-ratio: 1; background: var(--paper); }
.gl-item a { display: block; height: 100%; position: relative; outline-offset: 2px; }
.gl-item .ph { height: 100%; }
.gl-item img { width: 100%; height: 100%; object-fit: contain; padding: clamp(6px, .8vw, 12px); transition: transform .5s var(--ease); }
.gl-item a:hover img, .gl-item a:focus-visible img { transform: scale(1.03); }
.gl-item__code { position: absolute; left: 0; top: 0; background: var(--ink); color: var(--paper); padding: 4px 7px; font-size: 10.5px; }
.gl-item a:hover .gl-item__code, .gl-item a:focus-visible .gl-item__code { background: var(--orange); color: var(--ink); }

/* A — large opening frame then a 4-column run */
.gl-seq--checks .gl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gl-seq--checks .gl-item:first-child { grid-column: span 2; grid-row: span 2; background: var(--lemon); }
/* B — 5 columns, every seventh frame enlarged */
.gl-seq--prints .gl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.gl-seq--prints .gl-item { background: var(--paper); }
.gl-seq--prints .gl-item:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; background: var(--mint); }
/* C — narrow portrait strips */
.gl-seq--details .gl-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gl-seq--details .gl-item { aspect-ratio: 3 / 5; }
.gl-seq--details .gl-item:nth-child(odd) { transform: translateY(clamp(0px, 2.4vw, 32px)); }
.gl-seq--details .gl-grid { padding-bottom: clamp(0px, 2.4vw, 32px); }
/* D — dense contact sheet */
.gl-seq--half-sleeves .gl-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.gl-seq--half-sleeves .gl-item:nth-child(13n + 5) { grid-column: span 2; grid-row: span 2; background: var(--lemon); }

.gl-end__in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 40px; }
.gl-end__in .hd { max-width: 22ch; }

@media (max-width: 1023px) {
  .gl-head__grid { grid-template-columns: 1fr; }
  .gl-seq__head { grid-template-columns: auto 1fr; }
  .gl-seq__note { grid-column: 1 / -1; }
  .gl-seq--prints .gl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gl-seq--details .gl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gl-seq--half-sleeves .gl-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .gl-head__title { flex-direction: column; align-items: flex-start; }
  .gl-filter__status { margin-left: 0; width: 100%; }
  .gl-seq--checks .gl-grid, .gl-seq--prints .gl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gl-seq--details .gl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gl-seq--half-sleeves .gl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gl-seq--half-sleeves .gl-item:nth-child(13n + 5) { grid-column: span 3; grid-row: span 3; }
}
