/* =========================
   GALLERY (Premium Editorial)
   ========================= */

.gallery-category {
  margin-bottom: 3.6rem;
}

.gallery-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.15rem;
}

.category-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-primary);
}

.category-title::before {
  content: "";
  width: 1.9rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
}

.category-count {
  margin: 0;
  padding: 0.36rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(32, 47, 78, 0.2);
  color: rgba(32, 47, 78, 0.8);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 255, 0.88));
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  gap: 0.95rem;
}

.mosaic-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(32, 47, 78, 0.12);
  background: linear-gradient(150deg, #eef3fb, #dfe8f7);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

.mosaic-item.main {
  grid-column: span 2;
  grid-row: span 2;
}

.mosaic-item.thumb {
  grid-column: span 1;
  grid-row: span 1;
}

.mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition:
    transform 0.55s cubic-bezier(0.2, 0.6, 0.2, 1),
    filter 0.35s ease;
}

.mosaic-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(12, 20, 37, 0.08), rgba(12, 20, 37, 0));
  pointer-events: none;
}

.mosaic-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(8, 14, 28, 0.12), rgba(8, 14, 28, 0.62)),
    linear-gradient(180deg, rgba(12, 20, 37, 0), rgba(12, 20, 37, 0.68));
}

.mosaic-overlay span {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  background: rgba(14, 22, 40, 0.36);
}

.mosaic-overlay small {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.mosaic-item:hover img,
.mosaic-item:focus-visible img {
  transform: scale(1.08);
  filter: saturate(1.08);
}

.mosaic-item:hover .mosaic-overlay,
.mosaic-item:focus-visible .mosaic-overlay {
  opacity: 1;
  transform: translateY(0);
}

.mosaic-item:focus-visible {
  outline: 3px solid rgba(211, 44, 67, 0.42);
  outline-offset: 3px;
}

.mosaic-item.pdf {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.92)),
    radial-gradient(circle at 14% 16%, rgba(211, 44, 67, 0.12), transparent 45%);
  border-color: rgba(32, 47, 78, 0.18);
}

.pdf-card {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 0.58rem;
  padding: 1rem;
  text-align: center;
}

.pdf-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-primary);
}

.pdf-action {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
}

/* =========================
   LIGHTBOX (Premium + A11y)
   ========================= */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 2vw, 1.6rem);
  background:
    radial-gradient(circle at 18% 14%, rgba(29, 78, 216, 0.16), transparent 40%),
    radial-gradient(circle at 82% 86%, rgba(211, 44, 67, 0.18), transparent 42%),
    rgba(6, 11, 22, 0.92);
  backdrop-filter: blur(7px);
  animation: lightboxFadeIn 0.22s ease;
}

.lightbox-shell {
  position: relative;
  width: min(95vw, 1320px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-figure {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  min-width: 0;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(17, 26, 43, 0.94), rgba(10, 18, 32, 0.96));
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: min(78vh, 860px);
  object-fit: contain;
  background: rgba(9, 15, 27, 0.8);
}

.lightbox-caption {
  margin: 0;
  padding: 0.72rem 1rem 0.82rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.1), rgba(8, 14, 24, 0.7));
}

.lightbox-counter {
  grid-column: 2;
  grid-row: 2;
  margin: 0.05rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 800;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  background: linear-gradient(160deg, rgba(25, 39, 63, 0.9), rgba(16, 27, 46, 0.9));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lightbox-close {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-prev {
  grid-column: 1;
  grid-row: 1;
}

.lightbox-next {
  grid-column: 3;
  grid-row: 1;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.34);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 3px solid rgba(211, 44, 67, 0.7);
  outline-offset: 2px;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

  .lightbox-shell {
    width: min(96vw, 1080px);
    gap: 0.6rem;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

@media (max-width: 720px) {
  .gallery-category {
    margin-bottom: 2.6rem;
  }

  .gallery-category-head {
    margin-bottom: 0.75rem;
  }

  .gallery-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 150px;
    gap: 0.58rem;
  }

  .mosaic-item.main {
    grid-column: span 2;
    grid-row: span 2;
  }

  .mosaic-overlay span {
    font-size: 0.66rem;
    padding: 0.4rem 0.7rem;
  }

  .lightbox-overlay {
    padding: 0.55rem;
  }

  .lightbox-shell {
    width: 100%;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: stretch;
  }

  .lightbox-close {
    position: static;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .lightbox-prev,
  .lightbox-next {
    grid-row: 1;
    width: 40px;
    height: 40px;
    justify-self: end;
  }

  .lightbox-prev {
    grid-column: 1;
    justify-self: start;
  }

  .lightbox-next {
    grid-column: 2;
  }

  .lightbox-figure {
    grid-column: 1 / -1;
    grid-row: 2;
    border-radius: 14px;
  }

  .lightbox-image {
    max-height: 69vh;
  }

  .lightbox-caption {
    font-size: 0.84rem;
    padding: 0.6rem 0.7rem 0.72rem;
  }

  .lightbox-counter {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.69rem;
    letter-spacing: 0.1em;
    padding-bottom: 0.2rem;
  }
}
