/* Aligned with apps/main hub theme — light surface for grid, cinematic overlay for fullscreen */
:root {
  --stan-gallery-bg: transparent;
  --stan-gallery-panel: rgb(255 255 255 / 0.88);
  --stan-gallery-panel-border: rgb(181 207 229 / 0.95);
  --stan-gallery-text: #152533;
  --stan-gallery-muted: #39556c;
  --stan-gallery-accent: #0d6eb8;
  --stan-gallery-media-bg: linear-gradient(
    155deg,
    #dfeef8,
    #f4f9fc
  );

  --stan-gallery-dialog-scrim: rgb(21 37 51 / 0.78);
  --stan-gallery-dialog-bg: #152633;
  --stan-gallery-dialog-border: rgb(130 167 204 / 0.35);
  --stan-gallery-dialog-text: #f4f9fc;
  --stan-gallery-dialog-muted: #9db5cc;
}

.stan-gallery {
  width: min(1120px, calc(100% - 32px));
  margin: 48px auto;
  color: var(--stan-gallery-text);
  font-family: inherit;
}

.stan-gallery[hidden] {
  display: none !important;
}

.stan-gallery__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.stan-gallery__eyebrow {
  margin: 0 0 6px;
  color: var(--stan-gallery-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stan-gallery__title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
}

.stan-gallery__status {
  color: var(--stan-gallery-muted);
  font-size: 14px;
}

.stan-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.stan-gallery__card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--stan-gallery-panel-border);
  border-radius: 12px;
  background: var(--stan-gallery-panel);
  box-shadow:
    0 1px 2px rgb(21 54 91 / 0.05),
    0 10px 28px rgb(21 54 91 / 0.07);
  color: var(--stan-gallery-text);
  text-align: left;
}

.stan-gallery__button:focus-visible {
  outline: 2px solid var(--stan-gallery-accent);
  outline-offset: 3px;
}

.stan-gallery__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.stan-gallery__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stan-gallery-media-bg);
}

.stan-gallery__media img,
.stan-gallery__media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.stan-gallery__play {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.88);
  color: var(--stan-gallery-accent);
  font-size: 22px;
  border: 1px solid rgb(181 207 229 / 0.9);
  box-shadow: 0 6px 20px rgb(21 54 91 / 0.12);
  transform: translate(-50%, -50%);
}

.stan-gallery__body {
  padding: 12px 13px 14px;
}

.stan-gallery__item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.stan-gallery__caption {
  margin: 7px 0 0;
  color: var(--stan-gallery-muted);
  font-size: 13px;
  line-height: 1.45;
}

.stan-gallery__dialog {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--stan-gallery-dialog-scrim);
}

.stan-gallery__dialog[aria-hidden="false"] {
  display: flex;
}

.stan-gallery__dialog-panel {
  width: min(1080px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--stan-gallery-dialog-border);
  border-radius: 12px;
  background: var(--stan-gallery-dialog-bg);
  color: var(--stan-gallery-dialog-text);
}

.stan-gallery__dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stan-gallery-dialog-border);
}

.stan-gallery__close {
  border: 1px solid var(--stan-gallery-dialog-border);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.06);
  color: var(--stan-gallery-dialog-text);
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
}

.stan-gallery__close:focus-visible {
  outline: 2px solid var(--stan-gallery-accent);
  outline-offset: 2px;
}

.stan-gallery__dialog-media img,
.stan-gallery__dialog-media iframe {
  display: block;
  width: 100%;
  max-height: 76dvh;
  border: 0;
  object-fit: contain;
  background: #0d1520;
}

.stan-gallery__dialog-media iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}

@media (max-width: 640px) {
  .stan-gallery {
    width: min(100% - 24px, 1120px);
    margin: 36px auto;
  }

  .stan-gallery__header {
    display: block;
  }

  .stan-gallery__grid {
    grid-template-columns: 1fr;
  }
}
