/* ============================================================
   HEJ NYKÖPING — Gallery & lightbox bundle
   ------------------------------------------------------------
   Publik galleri-/lightbox-komponent. Bygger på native <dialog>
   för fokusfälla och Esc. Klassnamnen är temats publika namn.

   Konsumerar BARA tokens från ../tokens.css.
   ============================================================ */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gallery-gap);
}
@media (min-width: 40rem) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

.gallery__item {
  padding: 0;
  border: 0;
  background: var(--color-surface-subtle);
  border-radius: var(--gallery-radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item:focus-visible {
  outline: 3px solid var(--color-border-focus);
  outline-offset: 2px;
}

.gallery__thumbs {
  display: flex;
  gap: var(--gallery-gap);
  margin-top: var(--gallery-gap);
}
.gallery__thumb {
  width: var(--gallery-thumb-size);
  height: var(--gallery-thumb-size);
  padding: 0;
  border: 2px solid var(--gallery-thumb-border);
  border-radius: var(--gallery-radius);
  overflow: hidden;
  background: var(--color-surface-subtle);
  cursor: pointer;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb[aria-current="true"] { border-color: var(--gallery-thumb-border-active); }
.gallery__thumb:focus-visible { outline: 3px solid var(--color-border-focus); outline-offset: 2px; }

/* Native <dialog> lightbox */
.lightbox {
  max-width: min(92vw, 60rem);
  padding: 0;
  border: none;
  background: transparent;
}
.lightbox::backdrop { background: var(--color-scrim); }
.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
}
.lightbox__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-foreground);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:focus-visible { outline: 3px solid var(--color-border-focus); outline-offset: 2px; }

/* Video/embed-yta */
.video-embed {
  aspect-ratio: var(--card-media-aspect);
  border-radius: var(--gallery-radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  color: var(--color-foreground-muted);
}
