/* =========================================================
   GALLERY PAGE - SMART MARKETING & EVENTS
   ========================================================= */


/* =========================================================
   PAGE HERO
   ========================================================= */

.page-hero {
  min-height: 300px;
}

.page-hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.page-hero p {
  margin-bottom: 0;
}


/* =========================================================
   BREADCRUMB
   ========================================================= */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  font-weight: 500;
  font-size: 0.95rem;

  margin-bottom: 1rem;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span[aria-current] {
  opacity: 0.85;
}


/* =========================================================
   GALLERY FILTER BUTTONS
   ========================================================= */

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;

  margin-bottom: 2.2rem;
}

.gallery-filters button {
  font: 600 1rem 'Outfit', sans-serif;

  padding: 0.6rem 1.2rem;

  border-radius: 999px;

  border: 2px solid var(--red);

  background: transparent;

  color: var(--red);

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.gallery-filters button:hover {
  background: var(--red);
  color: var(--white);

  transform: translateY(-2px);
}

.gallery-filters button[aria-pressed="true"] {
  background: var(--red);
  color: var(--white);
}


/* =========================================================
   MAIN GALLERY CONTAINER
   ========================================================= */

.gallery-grid {
  display: block;
}


/* =========================================================
   EACH PROJECT SECTION
   ========================================================= */

.gallery-project {
  margin-bottom: 4rem;
}


/* =========================================================
   PROJECT HEADING
   ========================================================= */

.gallery-project-title {
  position: relative;

  margin: 0 0 1.4rem;

  padding-left: 18px;

  color: var(--red);

  font-size: 1.8rem;
  font-weight: 700;

  line-height: 1.3;
}


/* Red vertical line beside project heading */

.gallery-project-title::before {
  content: "";

  position: absolute;

  left: 0;
  top: 50%;

  width: 5px;
  height: 30px;

  transform: translateY(-50%);

  background: var(--red);

  border-radius: 5px;
}


/* =========================================================
   4 IMAGES PER ROW
   ========================================================= */

.gallery-project-grid {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 1.2rem;
}


/* =========================================================
   INDIVIDUAL IMAGE CARD
   ========================================================= */

.gallery-image-card {
  position: relative;

  display: block;

  width: 100%;

  padding: 0;

  border: 0;

  border-radius: var(--radius);

  overflow: hidden;

  background: var(--white);

  cursor: pointer;

  box-shadow:
    0 6px 18px rgba(120, 30, 25, 0.12);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


/* =========================================================
   IMAGE
   ========================================================= */

.gallery-image-card img {
  display: block;

  width: 100%;

  height: 240px;

  object-fit: cover;

  background: var(--pink-deep);

  transition:
    transform 0.4s ease;
}


/* =========================================================
   IMAGE CARD HOVER
   ========================================================= */

.gallery-image-card:hover {
  transform: translateY(-5px);

  box-shadow:
    0 12px 28px rgba(120, 30, 25, 0.22);
}

.gallery-image-card:hover img {
  transform: scale(1.05);
}


/* =========================================================
   IMAGE ZOOM ICON
   ========================================================= */

.gallery-image-card::after {
  content: "⌕";

  position: absolute;

  right: 12px;
  bottom: 12px;

  width: 40px;
  height: 40px;

  display: grid;

  place-items: center;

  border-radius: 50%;

  background: var(--red);

  color: var(--white);

  font-size: 24px;
  font-weight: 700;

  opacity: 0;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.gallery-image-card:hover::after {
  opacity: 0.95;

  transform: scale(1.05);
}


/* =========================================================
   EMPTY GALLERY MESSAGE
   ========================================================= */

.gallery-empty {
  text-align: center;

  font-weight: 500;

  margin-inline: auto;
}


/* =========================================================
   LOAD MORE
   ========================================================= */

.gallery-more {
  text-align: center;

  margin-top: 2rem;
}

#galleryMore[hidden] {
  display: none;
}


/* =========================================================
   CALL TO ACTION
   ========================================================= */

.cta-actions {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 0.9rem;
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

body.lb-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;

  inset: 0;

  z-index: 100;

  background: rgba(40, 10, 8, 0.94);

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 4.5rem 4.5rem 1rem;
}


/* =========================================================
   LIGHTBOX IMAGE AREA
   ========================================================= */

.lb-figure {
  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 0.8rem;

  max-width: 100%;
  max-height: 100%;

  min-height: 0;

  margin: 0;
}


/* =========================================================
   LIGHTBOX IMAGE
   ========================================================= */

.lb-figure img {
  max-width: 100%;

  max-height: calc(100vh - 11rem);

  max-height: calc(100dvh - 11rem);

  object-fit: contain;

  border-radius: var(--radius);

  background: var(--ink);
}


/* =========================================================
   LIGHTBOX CAPTION
   ========================================================= */

.lb-figure figcaption {
  display: flex;

  flex-direction: column;

  align-items: center;

  color: var(--white);

  text-align: center;
}

.lb-count {
  font-weight: 700;

  font-size: 1.05rem;
}

.lb-title {
  font-weight: 500;

  opacity: 0.9;
}


/* =========================================================
   LIGHTBOX BUTTONS
   ========================================================= */

.lb-btn {
  position: absolute;

  width: 52px;
  height: 52px;

  border-radius: 50%;

  border: 2px solid var(--white);

  background: var(--red);

  color: var(--white);

  font: 600 1.6rem/1 'Outfit', sans-serif;

  cursor: pointer;

  display: grid;

  place-items: center;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.lb-btn:hover {
  background: var(--red-dark);
}


/* Keyboard focus */

.lb-btn:focus-visible {
  outline: 2px solid var(--white);

  outline-offset: 3px;
}


/* Close */

.lb-close {
  top: 0.9rem;

  right: 0.9rem;

  font-size: 2rem;
}


/* Previous */

.lb-prev {
  left: 0.9rem;

  top: 50%;

  transform: translateY(-50%);
}


/* Next */

.lb-next {
  right: 0.9rem;

  top: 50%;

  transform: translateY(-50%);
}


/* =========================================================
   HIDDEN ELEMENTS
   ========================================================= */

.lightbox[hidden],
#galleryMore[hidden] {
  display: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

  .gallery-project-grid {
    grid-template-columns: repeat(2, 1fr);

    gap: 1.1rem;
  }

  .gallery-image-card img {
    height: 260px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 520px) {

  .page-hero {
    min-height: 260px;
  }


  /* Project heading */

  .gallery-project-title {
    font-size: 1.5rem;

    padding-left: 14px;
  }

  .gallery-project-title::before {
    width: 4px;

    height: 24px;
  }


  /* One image per row */

  .gallery-project-grid {
    grid-template-columns: 1fr;

    gap: 1rem;
  }


  .gallery-project {
    margin-bottom: 2.8rem;
  }


  .gallery-image-card img {
    height: 240px;
  }


  /* Horizontal filter scrolling */

  .gallery-filters {
    flex-wrap: nowrap;

    overflow-x: auto;

    padding-bottom: 0.4rem;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
  }

  .gallery-filters::-webkit-scrollbar {
    display: none;
  }


  .gallery-filters button {
    flex: none;

    white-space: nowrap;
  }


  /* Lightbox mobile */

  .lightbox {
    padding: 4.2rem 0.5rem 8.5rem;
  }

  .lb-figure img {
    max-height: calc(100vh - 14rem);

    max-height: calc(100dvh - 14rem);
  }


  /* Move arrows to bottom */

  .lb-prev,
  .lb-next {
    top: auto;

    bottom: 0.9rem;

    transform: none;
  }

  .lb-prev {
    left: calc(50% - 5.2rem);
  }

  .lb-next {
    right: calc(50% - 5.2rem);
  }


  .lb-figure figcaption {
    position: absolute;

    bottom: 5rem;

    left: 0;

    right: 0;

    pointer-events: none;
  }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  .gallery-image-card,
  .gallery-image-card img,
  .gallery-image-card::after,
  .gallery-filters button,
  .lb-btn {
    transition: none;
  }

}