/* DMT Mate Technologies — Gallery (Phase 5) */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; }
.gallery-item { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--mist); cursor: pointer; border: 1px solid var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item__cap { position: absolute; inset: auto 0 0 0; background: linear-gradient(transparent, rgba(15,23,41,.85)); color: #fff; padding: 1.4rem .9rem .8rem; font-size: var(--step--1); opacity: 0; transition: opacity .25s var(--ease); }
.gallery-item:hover .gallery-item__cap { opacity: 1; }
.gallery-item video { width: 100%; height: 100%; object-fit: cover; display: block; background: #071a4b; }
.gallery-item .ph { width: 100%; height: 100%; display: grid; place-items: center; background: #071a4b; }

/* Video / YouTube affordances */
.gallery-item__play { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(7,26,75,.32); transition: background .25s var(--ease); pointer-events: none; }
.gallery-item:hover .gallery-item__play { background: rgba(7,26,75,.14); }
.gallery-item__play svg { width: 22px; height: 22px; margin-left: 2px; color: var(--royal); }
.gallery-item__play::before { content: ""; position: absolute; width: 54px; height: 54px;
  border-radius: 50%; background: rgba(255,255,255,.94); box-shadow: 0 8px 26px rgba(0,0,0,.3); }
.gallery-item__play svg { position: relative; z-index: 1; }
.gallery-item__tag { position: absolute; top: .6rem; left: .6rem; z-index: 2; padding: .2rem .6rem;
  border-radius: 999px; background: rgba(7,26,75,.82); color: #fff; font-size: .66rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }

/* Media type filters */
.media-filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.media-filter { padding: .42rem 1.1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--slate); font: inherit; font-size: .86rem; font-weight: 500;
  cursor: pointer; transition: all .18s var(--ease); }
.media-filter:hover { border-color: var(--royal); color: var(--royal); }
.media-filter.is-on { background: var(--royal); border-color: var(--royal); color: #fff; }

/* Lightbox: video + YouTube */
.lightbox__stage { text-align: center; max-width: min(1100px, 92vw); }
.lightbox__stage video { max-width: 100%; max-height: 82vh; border-radius: var(--radius); display: block; }
.lightbox__frame { position: relative; width: min(1100px, 92vw); aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden; background: #000; }
.lightbox__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.album-card { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.album-card__media { aspect-ratio: 16/10; background: var(--mist); overflow: hidden; }
.album-card__media img { width: 100%; height: 100%; object-fit: cover; }
.album-card__media .ph { display: grid; place-items: center; height: 100%; font-size: 2.6rem; color: var(--steel); }
.album-card__body { padding: 1rem 1.1rem 1.2rem; }
.album-card__body h3 { font-size: var(--step-1); margin: 0 0 .2rem; }
.album-card__body .meta { color: var(--steel); font-size: var(--step--1); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,24,.94); display: none; place-items: center; padding: 2rem; }
.lightbox.is-open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; }
.lightbox__cap { color: #cdd6ec; text-align: center; margin-top: .8rem; font-size: var(--step--1); }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: grid; place-items: center; }
.lightbox__close { top: 1.2rem; right: 1.2rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 1.2rem; }
.lightbox__next { right: 1.2rem; }
.lightbox__nav:hover, .lightbox__close:hover { background: var(--signal); color: #06270a; }
@media (max-width:520px){ .lightbox__nav{width:40px;height:40px} }
