.gallery {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 86% 8%, rgba(45, 93, 162, .24), transparent 28rem),
    radial-gradient(circle at 5% 82%, rgba(177, 77, 44, .13), transparent 30rem),
    #101b43;
}

.gallery::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  top: 150px;
  right: -310px;
  border: 1px solid rgba(224, 179, 41, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(224, 179, 41, .025), 0 0 0 110px rgba(224, 179, 41, .02);
  pointer-events: none;
}

.gallery-shell {
  position: relative;
  padding-top: 106px;
  padding-bottom: 112px;
}

.gallery-heading {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 80px;
  align-items: end;
}

.gallery-heading h2 {
  max-width: 680px;
}

.gallery-heading > p {
  max-width: 420px;
  margin: 0 0 8px;
  color: #c8cede;
  font-size: .98rem;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 54px 0 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-filters button {
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: 9px 15px;
  background: transparent;
  color: #d8dcea;
  font: 600 .68rem var(--body);
  letter-spacing: .05em;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}

.gallery-filters button:hover,
.gallery-filters button:focus-visible {
  color: #fff;
  border-color: rgba(224, 179, 41, .8);
  transform: translateY(-1px);
}

.gallery-filters button.active {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

.gallery-total {
  flex: 0 0 auto;
  margin: 0;
  color: #fff;
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.gallery-total b {
  color: var(--gold);
  font: 500 1.25rem var(--display);
  letter-spacing: 0;
}

.gallery-total span {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .25);
  color: #9fa8c0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: 104px;
  gap: 14px;
}

.gallery-card {
  grid-column: span 4;
  grid-row: span 3;
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px;
  background: #080e27;
  color: #fff;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}

.gallery-card.gallery-feature {
  grid-column: span 8;
  grid-row: span 5;
}

.gallery-card.gallery-wide {
  grid-column: span 8;
}

.gallery-card.gallery-tall {
  grid-row: span 4;
}

.gallery-card:nth-child(2) {
  grid-column: span 4;
  grid-row: span 2;
}

.gallery-card[hidden] {
  display: none;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.2, .7, .2, 1), filter .3s;
}

.gallery-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(180deg, transparent 37%, rgba(5, 9, 25, .16) 53%, rgba(5, 9, 25, .94) 100%);
  transition: background .25s;
}

.gallery-card::before {
  content: "+";
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 14, 39, .36);
  backdrop-filter: blur(8px);
  font: 300 1.15rem var(--body);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s, transform .25s, background .25s;
}

.gallery-card-copy {
  position: absolute;
  z-index: 1;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: grid;
  gap: 5px;
}

.gallery-card-copy small {
  color: var(--gold);
  font-size: .57rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
}

.gallery-card-copy strong {
  font: 500 1.05rem/1.15 var(--display);
}

.gallery-feature .gallery-card-copy strong {
  max-width: 480px;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
}

.gallery-card-copy i {
  max-height: 0;
  overflow: hidden;
  color: #dfe3ec;
  font: 500 .63rem var(--body);
  opacity: 0;
  transform: translateY(5px);
  transition: max-height .25s, opacity .25s, transform .25s;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  z-index: 3;
  border-color: rgba(224, 179, 41, .8);
  box-shadow: 0 18px 45px rgba(2, 5, 17, .36);
  transform: translateY(-3px);
  outline: none;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.gallery-card:hover::before,
.gallery-card:focus-visible::before {
  opacity: 1;
  transform: none;
  background: rgba(224, 179, 41, .92);
  color: var(--navy);
}

.gallery-card:hover .gallery-card-copy i,
.gallery-card:focus-visible .gallery-card-copy i {
  max-height: 20px;
  opacity: 1;
  transform: none;
}

.gallery-footnote {
  margin: 28px 0 0;
  color: #9099b2;
  font: italic 400 .78rem var(--display);
  text-align: right;
}

.lightbox {
  width: min(1160px, 94vw);
  height: auto;
  max-height: 92vh;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 16px;
  background: #080d25;
  color: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.lightbox::backdrop {
  background: rgba(2, 4, 13, .9);
  backdrop-filter: blur(7px);
}

.lightbox-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  position: relative;
  min-height: min(760px, 86vh);
}

.lightbox-media {
  display: grid;
  place-items: center;
  min-width: 0;
  background: #030611;
}

.lightbox .lightbox-media img {
  width: 100%;
  height: min(760px, 86vh);
  object-fit: contain;
}

.lightbox-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding: 72px 28px 28px;
  border-left: 1px solid rgba(255, 255, 255, .12);
}

.lightbox-details span {
  display: block;
  margin-bottom: 15px;
  color: var(--gold);
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
}

.lightbox-details h3 {
  font-size: 1.55rem;
}

.lightbox-details p {
  margin: 0;
  color: #aeb6ca;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.lightbox .lightbox-close {
  z-index: 5;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(8, 13, 37, .72);
  color: #fff;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.lightbox .lightbox-nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(8, 13, 37, .72);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.lightbox .lightbox-prev { left: 18px; }
.lightbox .lightbox-next { right: 268px; }

.lightbox .lightbox-nav:hover,
.lightbox .lightbox-nav:focus-visible,
.lightbox .lightbox-close:hover,
.lightbox .lightbox-close:focus-visible {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
  outline: none;
}

@media (max-width: 900px) {
  .gallery-heading { grid-template-columns: 1fr; gap: 24px; }
  .gallery-heading > p { max-width: 620px; }
  .gallery-toolbar { align-items: flex-start; flex-direction: column; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 180px; }
  .gallery-card,
  .gallery-card.gallery-feature,
  .gallery-card.gallery-wide,
  .gallery-card.gallery-tall,
  .gallery-card:nth-child(2) { grid-column: span 1; grid-row: span 2; }
  .gallery-card.gallery-feature,
  .gallery-card:nth-child(2),
  .gallery-card.gallery-wide { grid-column: span 2; }
  .gallery-card:nth-child(2) { grid-row: span 2; }
  .lightbox-frame { grid-template-columns: 1fr; min-height: 0; }
  .lightbox .lightbox-media img { height: min(68vh, 620px); }
  .lightbox-details { padding: 22px 72px 23px 24px; border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .lightbox .lightbox-next { right: 18px; }
}

@media (max-width: 620px) {
  .gallery-shell { padding-top: 82px; padding-bottom: 85px; }
  .gallery-toolbar { margin-top: 38px; }
  .gallery-filters { gap: 6px; }
  .gallery-filters button { padding: 8px 11px; }
  .gallery-total { display: none; }
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 265px; gap: 11px; }
  .gallery-card,
  .gallery-card.gallery-feature,
  .gallery-card.gallery-wide,
  .gallery-card.gallery-tall,
  .gallery-card:nth-child(2) { grid-column: span 1; grid-row: span 1; }
  .gallery-card.gallery-feature { min-height: 380px; }
  .gallery-card-copy { left: 16px; right: 16px; bottom: 15px; }
  .gallery-footnote { text-align: left; }
  .lightbox { width: 96vw; max-height: 94vh; }
  .lightbox .lightbox-media img { height: min(64vh, 520px); }
  .lightbox-details { padding: 19px 60px 20px 18px; }
  .lightbox-details h3 { font-size: 1.2rem; }
  .lightbox .lightbox-nav { top: 34%; width: 38px; height: 38px; }
  .lightbox .lightbox-prev { left: 10px; }
  .lightbox .lightbox-next { right: 10px; }
  .lightbox .lightbox-close { top: 10px; right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card img,
  .gallery-card::before,
  .gallery-card-copy i { transition: none !important; }
}
