.page-banner--gallery {
  background:
    linear-gradient(105deg, rgba(7, 15, 28, 0.92) 0%, rgba(15, 39, 68, 0.86) 48%, rgba(39, 108, 245, 0.4) 100%),
    url("../img/sub-banner-2.png") center / cover no-repeat;
}

.gallery-body .nav-menu {
  gap: 24px;
}

.gallery-page {
  padding: 40px 6% 76px;
  background: #f8f9fc;
}

.gallery-intro {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.gallery-intro h2 {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: clamp(23px, 3.4vw, 32px);
  line-height: 1.28;
}

.gallery-intro p {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.75;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
}

.gallery-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #e8eef8;
  box-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(39, 108, 245, 0.28);
  box-shadow: 0 16px 34px rgba(39, 108, 245, 0.14);
}

.gallery-card__button {
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.gallery-card__media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card__media {
  transform: scale(1.06);
}

.gallery-card__shade {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  min-height: 46%;
  background: linear-gradient(180deg, rgba(7, 15, 28, 0) 0%, rgba(7, 15, 28, 0.8) 100%);
  pointer-events: none;
}

.gallery-card__content {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  gap: 8px;
  color: #fff;
  pointer-events: none;
}

.gallery-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.gallery-card__type {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.gallery-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary);
  font-size: 30px;
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

.gallery-modal.is-open {
  display: block;
}

.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 20, 0.82);
  backdrop-filter: blur(8px);
}

.gallery-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: #07101f;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

.gallery-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.gallery-modal__top h2 {
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.35;
}

.gallery-modal__type {
  color: #9dbbff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gallery-modal__close,
.gallery-modal__nav,
.gallery-modal__tools button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

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

.gallery-modal__close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 24px;
}

.gallery-modal__stage {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    #050b15;
  background-size: 24px 24px;
}

.gallery-modal__media {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.gallery-modal__media img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  display: block;
  object-fit: contain;
  transform: scale(var(--gallery-zoom, 1));
  transform-origin: center;
  transition: transform 0.2s ease;
}

.gallery-modal__media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 150px);
  border: 0;
}

.gallery-modal__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 28px;
  transform: translateY(-50%);
}

.gallery-modal__nav--prev {
  left: 18px;
}

.gallery-modal__nav--next {
  right: 18px;
}

.gallery-modal__close:hover,
.gallery-modal__nav:hover,
.gallery-modal__tools button:hover {
  background: var(--primary);
}

.gallery-modal__tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gallery-modal__tools button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 20px;
}

.gallery-modal__tools span {
  min-width: 58px;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

body.gallery-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) and (min-width: 993px) {
  .gallery-body .nav-menu {
    gap: 18px;
  }

  .gallery-body .nav-link {
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .gallery-page {
    padding: 28px 5% 56px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .gallery-card {
    border-radius: 14px;
  }

  .gallery-card__content {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .gallery-card__title {
    font-size: 12px;
  }

  .gallery-card__type {
    padding: 5px 8px;
    font-size: 9px;
  }

  .gallery-card__play {
    width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .gallery-modal__dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    margin: 9px auto;
    border-radius: 14px;
  }

  .gallery-modal__top {
    padding: 14px;
  }

  .gallery-modal__top h2 {
    font-size: 16px;
  }

  .gallery-modal__stage,
  .gallery-modal__media {
    min-height: 300px;
  }

  .gallery-modal__nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .gallery-modal__nav--prev {
    left: 10px;
  }

  .gallery-modal__nav--next {
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-card__media,
  .gallery-modal__media img {
    transition: none;
  }
}
