/* Gallery page */
.gallery-hero {
  min-height: 490px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 3rem;
  padding-top: 7rem;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}
.gallery-hero::before {
  content: "";
  position: absolute;
  width: 44vw;
  height: 44vw;
  max-width: 540px;
  max-height: 540px;
  right: -12vw;
  top: 2rem;
  border: 1px solid rgba(103, 232, 249, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(103, 232, 249, .035), 0 0 0 80px rgba(103, 232, 249, .025);
}
.gallery-hero__copy { position: relative; z-index: 1; max-width: 700px; }
.gallery-hero h1 { margin: .8rem 0 1.25rem; font-size: clamp(3rem, 8vw, 6.8rem); letter-spacing: 0; line-height: .98; }
.gallery-hero h1 em { font-style: normal; color: var(--color-accent); }
.gallery-hero__copy > p:last-child { max-width: 540px; color: var(--color-text-muted); font-size: 1.08rem; }
.gallery-hero__stamp { display: grid; gap: .35rem; width: 128px; flex: 0 0 auto; padding: 1rem; color: var(--color-accent-light); border: 1px solid rgba(103, 232, 249, .35); transform: rotate(7deg); position: relative; z-index: 1; }
.gallery-hero__stamp span { font: 600 .75rem var(--font-body); letter-spacing: .18em; }
.gallery-hero__stamp b { color: #fff; font: 700 3.4rem/1 var(--font-heading); letter-spacing: 0; }
.gallery-hero__stamp small { font-size: .55rem; letter-spacing: .14em; }
.gallery-hero h1 { color: var(--color-text); }
.gallery-hero__stamp b { color: var(--color-text); }
.gallery-section { padding-top: 1.5rem; padding-bottom: var(--section-padding); }
.gallery-section__topline { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(148, 163, 184, .25); padding-bottom: 1rem; }
.gallery-section__label { color: var(--color-text); font: 700 .78rem var(--font-body); letter-spacing: .16em; text-transform: uppercase; }
.gallery-status { margin: 0; color: var(--color-text-muted); font-size: .85rem; }
.public-gallery { display: grid; gap: 4.5rem; margin-top: 2rem; }
.gallery-group { display: grid; gap: 1rem; }
.gallery-group--reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.gallery-group--reveal.is-visible { opacity: 1; transform: none; }
.gallery-group--reveal:nth-child(2) { transition-delay: .08s; }
.gallery-group--reveal:nth-child(3) { transition-delay: .16s; }
.gallery-group__heading { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 1rem; padding-bottom: .9rem; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.gallery-group__heading span { color: var(--color-accent); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gallery-group__heading h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.gallery-group__heading p { margin: 0; color: var(--color-text-muted); font-size: .82rem; }
.gallery-group__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 72px; gap: 1rem; }
.gallery-card { position: relative; grid-column: span 4; grid-row: span 4; overflow: hidden; min-width: 0; min-height: 0; background: #101b2c; border-radius: 5px; box-shadow: 0 14px 32px rgba(0, 0, 0, .18); isolation: isolate; }
.gallery-card:nth-child(5n + 1) { grid-column: span 6; grid-row: span 6; }
.gallery-card:nth-child(5n + 2) { border-radius: 5px 24px 5px 5px; }
.gallery-card:nth-child(5n + 4) { grid-row: span 5; }
.gallery-card__image { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .55s ease, filter .55s ease; }
.gallery-card__image:focus-visible { outline: 3px solid var(--color-accent-light); outline-offset: -5px; }
.gallery-card.is-broken { background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(15, 23, 42, .8)); }
.gallery-card.is-broken .gallery-card__image, .gallery-card__fallback { display: none; }
.gallery-card.is-broken .gallery-card__fallback { display: grid; place-items: center; height: 100%; color: var(--color-text-muted); font-size: .85rem; }
.gallery-card__body { position: absolute; inset: auto 0 0; padding: 4.5rem 1.1rem 1.1rem; color: #fff; background: linear-gradient(transparent, rgba(4, 10, 20, .92)); pointer-events: none; }
.gallery-card__body h3 { margin: 0; color: #fff; font-size: 1.05rem; }
.gallery-card__body p { margin: .25rem 0 0; color: rgba(255, 255, 255, .72); font-size: .82rem; }
.gallery-card::after { content: "↗"; position: absolute; top: .8rem; right: .8rem; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(255, 255, 255, .38); border-radius: 50%; color: #fff; background: rgba(4, 10, 20, .42); opacity: 0; transform: translateY(-5px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.gallery-card:hover, .gallery-card:focus-within { box-shadow: 0 22px 42px rgba(0, 0, 0, .3); }
.gallery-card:hover .gallery-card__image { transform: scale(1.045); filter: saturate(1.12); }
.gallery-card:hover::after, .gallery-card:focus-within::after { opacity: 1; transform: none; }
.gallery-empty { padding: 4rem 1rem; text-align: center; color: var(--color-text-muted); }
.gallery-empty strong { display: block; margin-bottom: .45rem; color: var(--color-text); font-size: 1.1rem; }
.gallery-error { white-space: pre-wrap; }
html[data-theme="light"] .gallery-hero h1 em { color: #087f98; }
html[data-theme="light"] .gallery-hero__stamp { color: #087f98; border-color: rgba(8, 127, 152, .35); }
html[data-theme="light"] .gallery-hero__stamp b { color: var(--color-primary); }
html[data-theme="dark"] .gallery-hero h1 em { color: var(--color-accent-light); }
@media (prefers-reduced-motion: reduce) {
  .gallery-group--reveal, .gallery-card__image, .gallery-card::after { transition: none; }
}
@media (max-width: 620px) {
  .gallery-hero { min-height: 500px; display: block; padding-top: 5rem; }
  .gallery-hero__stamp { margin: 3rem 0 0 auto; }
  .gallery-section__topline { align-items: flex-start; flex-direction: column; gap: .35rem; }
  .gallery-group__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 86px; gap: .7rem; }
  .gallery-card:nth-child(5n + 1) { grid-column: span 2; }
  .gallery-card { grid-column: span 1; grid-row: span 2; }
  .gallery-card:nth-child(5n + 1) { grid-row: span 3; }
  .gallery-card:nth-child(5n + 4) { grid-row: span 2; }
  .gallery-card__body { padding: 2.5rem .7rem .7rem; }
  .gallery-card__body h3 { font-size: .9rem; }
  .gallery-group__heading { grid-template-columns: 1fr auto; gap: .3rem .7rem; }
  .gallery-group__heading h2 { grid-column: 1 / -1; grid-row: 2; }
  .gallery-group__heading p { grid-column: 2; grid-row: 1; }
}