.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.gallery-heading { align-items: center; flex-wrap: wrap; }
.gallery-heading .button { color: #fff; }
.gallery-card { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 1px solid #373b42; background: #181a1e; color: #f3f3f1; cursor: pointer; font: inherit; text-align: start; }
.gallery-card:hover, .gallery-card:focus-visible { border-color: var(--red); }
.gallery-card:focus-visible, .gallery-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.gallery-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; }
.gallery-cover img { object-position: center 42%; }
.gallery-type { position: absolute; inset: auto auto 10px 10px; padding: 6px 9px; background: #111e; color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.gallery-caption { padding: 14px; font-size: clamp(13px, 1.25vw, 17px); font-weight: 800; line-height: 1.35; }
.gallery-archive { padding: clamp(42px, 7vw, 96px) 0; }
.gallery-archive h1 { margin: 12px 0 26px; }
.gallery-archive .gallery-link { display: inline-block; margin-bottom: 30px; }
.gallery-link { color: #ff777c; font-weight: 700; }
.gallery-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 25px; width: auto; }
.gallery-pages a { padding: 10px 12px; border: 1px solid #50545a; }
.gallery-pages [aria-current=page] { background: #a2262b; color: white; }
.gallery-dialog { width: min(920px, calc(100% - 24px)); max-height: 90dvh; padding: 0; color: #f3f3f1; background: #181a1e; border: 1px solid #50545a; border-top: 4px solid var(--red); }
.gallery-dialog::backdrop { background: #050609d9; }
body:has(.gallery-dialog[open]) { overflow: hidden; }
.gallery-dialog-panel { position: relative; padding: clamp(16px, 3vw, 30px); }
.gallery-dialog h2 { padding-right: 50px; font-size: clamp(21px, 3vw, 32px); }
.gallery-dialog img, .gallery-dialog video { display: block; width: 100%; height: auto; max-height: 62dvh; object-fit: contain; background: #101114; }
.gallery-dialog p { margin-top: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.gallery-dialog .gallery-link { display: inline-block; margin-top: 16px; }
.gallery-close { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border: 1px solid #ff777c; background: #a2262b; color: #fff; font-size: 25px; cursor: pointer; }
@media (max-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-gallery=home] > :nth-child(n+5) { display: none; }
}

#media { scroll-margin-top: 82px; }
