/* =========================================================
   GALLERY PAGE
========================================================= */

/* =========================================================
   GALLERY HERO
========================================================= */

.gallery-page-hero .inner-hero-bg {
  background-image: url("../images/gallery/gallery-hero.jpg");
  background-position: center;
}

/* =========================================================
   GALLERY INTRO
========================================================= */

.gallery-intro {
  position: relative;
  overflow: hidden;
  background: var(--bg-body);
}

/* =========================================================
   FILTERS
========================================================= */

.gallery-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 38px;
}

.gallery-filter {
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 20px;

  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);

  background: var(--text-white);

  color: var(--text-secondary);

  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.gallery-filter:hover {
  color: var(--primary);

  border-color: rgba(201, 151, 46, 0.5);

  transform: translateY(-2px);
}

.gallery-filter.active {
  background: var(--gradient-gold);

  border-color: var(--secondary);

  color: var(--primary-dark);

  box-shadow: var(--shadow-gold);
}

/* =========================================================
   GALLERY GRID
========================================================= */

.gallery-page-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(0, 0.85fr)
    minmax(0, 0.85fr);

  grid-auto-rows: 260px;

  gap: 16px;

  margin-top: 45px;
}

/* =========================================================
   GALLERY ITEM
========================================================= */

.gallery-page-item {
  position: relative;

  display: block;

  overflow: hidden;

  min-width: 0;

  border-radius: var(--radius-md);

  background: var(--bg-soft);

  isolation: isolate;

  box-shadow: var(--shadow-sm);

  cursor: pointer;

  transition:
    transform var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
}

.gallery-page-item:hover {
  transform: translateY(-5px);

  box-shadow: var(--shadow-lg);
}

.gallery-page-item img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gallery-page-item:hover img {
  transform: scale(1.07);
}

/* =========================================================
   SPECIAL GRID ITEMS
========================================================= */

.gallery-large {
  grid-row: span 2;
}

.gallery-tall {
  grid-row: span 2;
}

.gallery-wide {
  grid-column: span 2;
}

/* =========================================================
   OVERLAY
========================================================= */

.gallery-page-overlay {
  position: absolute;

  inset: 0;

  z-index: 2;

  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 15px;

  padding: 25px;

  background: linear-gradient(
    180deg,
    rgba(6, 23, 47, 0) 25%,
    rgba(6, 23, 47, 0.86) 100%
  );

  opacity: 0;

  transition: opacity var(--transition);
}

.gallery-page-item:hover .gallery-page-overlay {
  opacity: 1;
}

/* =========================================================
   INFO
========================================================= */

.gallery-page-info {
  display: flex;

  flex-direction: column;

  gap: 4px;

  transform: translateY(12px);

  transition: transform var(--transition);
}

.gallery-page-item:hover .gallery-page-info {
  transform: translateY(0);
}

.gallery-page-info span {
  color: var(--secondary-light);

  font-size: 0.62rem;

  font-weight: 800;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}

.gallery-page-info h3 {
  margin: 0;

  color: var(--text-white);

  font-family: var(--font-heading);

  font-size: 1rem;

  font-weight: 800;
}

/* =========================================================
   EXPAND ICON
========================================================= */

.gallery-page-icon {
  width: 42px;
  height: 42px;

  flex: 0 0 42px;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 50%;

  background: var(--text-white);

  color: var(--primary);

  transform: translateY(12px);

  transition:
    transform var(--transition),
    background var(--transition),
    color var(--transition);
}

.gallery-page-item:hover .gallery-page-icon {
  transform: translateY(0);
}

.gallery-page-icon:hover {
  background: var(--secondary-light);

  color: var(--primary-dark);
}

.gallery-page-icon i {
  font-size: 0.75rem;
}

/* =========================================================
   FILTER ANIMATION
========================================================= */

.gallery-page-item.gallery-hidden {
  display: none;
}

.gallery-page-item.gallery-filter-out {
  opacity: 0;

  transform: scale(0.96);
}

/* =========================================================
   LIGHTBOX
========================================================= */

.gallery-lightbox {
  position: fixed;

  inset: 0;

  z-index: var(--z-modal);

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 30px;

  background: rgba(4, 13, 28, 0.96);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition:
    opacity var(--transition),
    visibility var(--transition);
}

.gallery-lightbox.active {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;
}

/* =========================================================
   LIGHTBOX CONTENT
========================================================= */

.gallery-lightbox-content {
  position: relative;

  width: min(1100px, 88vw);

  max-height: 88vh;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;
}

.gallery-lightbox-content img {
  max-width: 100%;

  max-height: 76vh;

  display: block;

  object-fit: contain;

  border-radius: var(--radius-sm);

  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-caption {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 5px;

  margin-top: 18px;

  text-align: center;
}

.gallery-lightbox-caption span {
  color: var(--secondary-light);

  font-size: 0.65rem;

  font-weight: 800;

  letter-spacing: 0.14em;

  text-transform: uppercase;
}

.gallery-lightbox-caption strong {
  color: var(--text-white);

  font-family: var(--font-heading);

  font-size: 1rem;
}

/* =========================================================
   LIGHTBOX BUTTONS
========================================================= */

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: absolute;

  z-index: 5;

  width: 48px;
  height: 48px;

  display: flex;

  align-items: center;

  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.16);

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);

  color: var(--text-white);

  cursor: pointer;

  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition);
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: var(--secondary);

  color: var(--primary-dark);
}

.gallery-lightbox-close {
  top: 25px;

  right: 25px;
}

.gallery-lightbox-prev {
  left: 30px;

  top: 50%;

  transform: translateY(-50%);
}

.gallery-lightbox-next {
  right: 30px;

  top: 50%;

  transform: translateY(-50%);
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  transform: translateY(-50%) scale(1.05);
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1199px) {
  .gallery-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    grid-auto-rows: 250px;
  }

  .gallery-large {
    grid-column: span 2;

    grid-row: span 1;
  }

  .gallery-tall {
    grid-row: span 2;
  }

  .gallery-wide {
    grid-column: span 2;
  }
}

/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 991px) {
  .gallery-page-grid {
    grid-auto-rows: 230px;

    gap: 12px;

    margin-top: 35px;
  }

  .gallery-page-overlay {
    opacity: 1;

    padding: 18px;

    background: linear-gradient(
      180deg,
      transparent 30%,
      rgba(6, 23, 47, 0.78) 100%
    );
  }

  .gallery-page-info {
    transform: none;
  }

  .gallery-page-icon {
    transform: none;

    width: 38px;
    height: 38px;

    flex-basis: 38px;
  }

  .gallery-lightbox {
    padding: 20px;
  }

  .gallery-lightbox-content {
    width: 90vw;
  }

  .gallery-lightbox-prev {
    left: 15px;
  }

  .gallery-lightbox-next {
    right: 15px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
  .gallery-filters {
    justify-content: flex-start;

    flex-wrap: nowrap;

    overflow-x: auto;

    padding: 4px 2px 10px;

    margin-top: 30px;

    scrollbar-width: none;
  }

  .gallery-filters::-webkit-scrollbar {
    display: none;
  }

  .gallery-filter {
    flex: 0 0 auto;

    min-height: 40px;

    padding: 0 16px;

    font-size: 0.7rem;
  }

  .gallery-page-grid {
    grid-template-columns: 1fr;

    grid-auto-rows: 235px;

    gap: 10px;
  }

  .gallery-large,
  .gallery-tall,
  .gallery-wide {
    grid-column: auto;

    grid-row: auto;
  }

  .gallery-page-item {
    border-radius: 10px;
  }

  .gallery-page-overlay {
    padding: 15px;
  }

  .gallery-page-info span {
    font-size: 0.56rem;
  }

  .gallery-page-info h3 {
    font-size: 0.82rem;
  }

  .gallery-page-icon {
    width: 34px;
    height: 34px;

    flex-basis: 34px;
  }

  .gallery-lightbox {
    padding: 15px;
  }

  .gallery-lightbox-content {
    width: 100%;
  }

  .gallery-lightbox-content img {
    max-height: 68vh;

    border-radius: 6px;
  }

  .gallery-lightbox-close {
    top: 15px;

    right: 15px;

    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    top: auto;

    bottom: 75px;

    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-prev {
    left: 25%;
  }

  .gallery-lightbox-next {
    right: 25%;
  }

  .gallery-lightbox-caption {
    margin-top: 15px;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .gallery-page-grid {
    grid-auto-rows: 210px;
  }

  .gallery-filter {
    min-height: 38px;

    padding: 0 14px;
  }

  .gallery-page-info h3 {
    font-size: 0.76rem;
  }

  .gallery-page-icon {
    width: 32px;
    height: 32px;

    flex-basis: 32px;
  }

  .gallery-lightbox-prev {
    left: 20%;
  }

  .gallery-lightbox-next {
    right: 20%;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .gallery-page-item,
  .gallery-page-item img,
  .gallery-page-overlay,
  .gallery-page-info,
  .gallery-page-icon,
  .gallery-lightbox {
    transition: none;
  }
}
