/* ============================================================
   GREEN LABEL SERVICES — GALLERY PAGE
   gallery.css
   ============================================================ */


/* ─── SHARED ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}

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

@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 80px 80px; }
}

/* Reveal on scroll */
.reveal {
  opacity:    0;
  transform:  translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible      { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }


/* ─── HERO ──────────────────────────────────────────────────── */
.gallery-hero {
  position: relative;
  background: var(--color-dark);
  overflow: hidden;
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3.5rem, 8vw, 6rem);
}

/* Radial glow */
.gallery-hero::before {
  content:  '';
  position: absolute;
  inset:    0;
  background:
    radial-gradient(ellipse 60% 90% at 5%   45%, rgba(0,128,0,.11) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 98%  10%, rgba(0,128,0,.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 30% at 50% 120%, rgba(255,107,0,.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Scrolling grid overlay */
.gallery-hero::after {
  content:    '';
  position:   absolute;
  inset:      0;
  background-image:
    linear-gradient(rgba(0,128,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,128,0,.05) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events:  none;
  animation:       gridScroll 28s linear infinite;
}

.gallery-hero__inner {
  position:  relative;
  z-index:   1;
  max-width: var(--container-max);
  margin:    0 auto;
  padding:   0 var(--container-pad);
}

.gallery-hero__breadcrumb {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  font-size:   0.8rem;
  font-weight: 500;
  color:       rgba(255,255,255,.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease both;
}

.gallery-hero__breadcrumb a {
  color:           rgba(255,255,255,.45);
  text-decoration: none;
  transition:      color var(--ease-fast);
}
.gallery-hero__breadcrumb a:hover { color: var(--color-primary); }

.gallery-hero__breadcrumb i {
  font-size: 0.65rem;
  opacity:   0.5;
}

.gallery-hero__eyebrow {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  font-size:   0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:       var(--color-primary);
  margin-bottom: 1rem;
  animation: fadeUp 0.55s ease both;
}

.gallery-hero__eyebrow::before {
  content:          '';
  display:          block;
  width:            2.5rem;
  height:           2px;
  background:       var(--color-primary);
  border-radius:    2px;
  flex-shrink:      0;
}

.gallery-hero__title {
  font-size:   clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  color:       var(--color-white);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  animation: fadeUp 0.65s ease 0.08s both;
}

.gallery-hero__title span {
  color: var(--color-primary);
}

.gallery-hero__desc {
  font-size:   clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 400;
  color:       rgba(255,255,255,.6);
  max-width:   560px;
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fadeUp 0.65s ease 0.16s both;
}

.gallery-hero__meta {
  display:     flex;
  align-items: center;
  gap:         1rem;
  flex-wrap:   wrap;
  animation: fadeUp 0.65s ease 0.24s both;
}

.gallery-hero__badge {
  display:      inline-flex;
  align-items:  center;
  gap:          0.4rem;
  background:   rgba(0,128,0,.15);
  border:       1px solid rgba(0,128,0,.25);
  color:        var(--color-primary);
  font-size:    0.8rem;
  font-weight:  600;
  padding:      0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}


/* ─── FILTER BAR ─────────────────────────────────────────────── */
.gallery-filter {
  background:    var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position:      sticky;
  top:           var(--nav-height);
  z-index:       40;
}

.gallery-filter__inner {
  max-width:   var(--container-max);
  margin:      0 auto;
  padding:     0.875rem var(--container-pad);
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  overflow-x:  auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-filter__inner::-webkit-scrollbar {
  display: none;
}

/* On desktop, show a thin scrollbar so users know the list is scrollable */
@media (min-width: 1025px) {
  .gallery-filter__inner {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) transparent;
    padding-bottom: calc(0.875rem + 4px);
  }

  .gallery-filter__inner::-webkit-scrollbar {
    display: block;
    height: 4px;
  }

  .gallery-filter__inner::-webkit-scrollbar-track {
    background: transparent;
  }

  .gallery-filter__inner::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 2px;
  }
}

.gallery-filter__label {
  font-size:   0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:       var(--color-text-muted);
  margin-right: 0.25rem;
  white-space: nowrap;
}

.filter-btn {
  display:      inline-flex;
  align-items:  center;
  gap:          0.35rem;
  padding:      0.45rem 1rem;
  border-radius: var(--radius-pill);
  border:       1px solid var(--color-border);
  background:   transparent;
  color:        var(--color-text-muted);
  font-family:  var(--font);
  font-size:    0.82rem;
  font-weight:  600;
  cursor:       pointer;
  transition:   color var(--ease-fast), background var(--ease-fast),
                border-color var(--ease-fast), box-shadow var(--ease-fast);
  white-space:  nowrap;
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color:        var(--color-primary);
}

.filter-btn.active {
  background:   var(--color-primary);
  border-color: var(--color-primary);
  color:        var(--color-white);
  box-shadow:   0 2px 12px rgba(0,128,0,.3);
}

.filter-btn__count {
  background:  rgba(0,0,0,.08);
  border-radius: var(--radius-pill);
  padding:     0 0.45rem;
  font-size:   0.72rem;
  line-height: 1.6;
}

.filter-btn.active .filter-btn__count {
  background: rgba(255,255,255,.25);
}


/* ─── GALLERY MAIN ───────────────────────────────────────────── */
.gallery-main {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 6rem);
}

.gallery-main__inner {
  max-width: var(--container-max);
  margin:    0 auto;
  padding:   0 var(--container-pad);
}

/* Masonry via CSS columns */
.gallery-masonry {
  columns:       3;
  column-gap:    1.25rem;
}

.gallery-figure {
  break-inside:  avoid;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  overflow:      hidden;
  position:      relative;
  cursor:        pointer;
  display:       block;
  background:    var(--color-border);

  /* Fade-out for filtered items */
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-figure.filtered-out {
  display: none;
}

.gallery-figure img {
  display:    block;
  width:      100%;
  height:     auto;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-figure:hover img {
  transform: scale(1.04);
}

/* Caption overlay */
.gallery-figure__caption {
  position:   absolute;
  bottom:     0;
  left:       0;
  right:      0;
  padding:    1.25rem 1rem 1rem;
  background: linear-gradient(to top, rgba(7,15,7,.88) 0%, transparent 100%);
  opacity:    0;
  transform:  translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-figure:hover .gallery-figure__caption,
.gallery-figure:focus-within .gallery-figure__caption {
  opacity:   1;
  transform: translateY(0);
}

.gallery-figure__service {
  display:     inline-flex;
  align-items: center;
  gap:         0.35rem;
  font-size:   0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:       var(--color-primary);
  margin-bottom: 0.3rem;
}

.gallery-figure__text {
  font-size:   0.85rem;
  font-weight: 400;
  color:       rgba(255,255,255,.85);
  line-height: 1.4;
}

/* Zoom icon */
.gallery-figure__zoom {
  position:     absolute;
  top:          0.75rem;
  right:        0.75rem;
  width:        2.25rem;
  height:       2.25rem;
  border-radius: 50%;
  background:   rgba(0,128,0,.85);
  display:      flex;
  align-items:  center;
  justify-content: center;
  color:        var(--color-white);
  font-size:    0.85rem;
  opacity:      0;
  transform:    scale(0.7);
  transition:   opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.gallery-figure:hover .gallery-figure__zoom {
  opacity:   1;
  transform: scale(1);
}


/* ─── EMPTY STATE ────────────────────────────────────────────── */
.gallery-empty-state {
  text-align:  center;
  padding:     5rem 1rem;
}

.gallery-empty-state i {
  font-size:  3.5rem;
  color:      var(--color-border);
  margin-bottom: 1.25rem;
  display:    block;
}

.gallery-empty-state h3 {
  font-size:   1.4rem;
  font-weight: 700;
  color:       var(--color-text);
  margin-bottom: 0.5rem;
}

.gallery-empty-state p {
  color:       var(--color-text-muted);
  font-size:   0.95rem;
  margin-bottom: 1.5rem;
}


/* ─── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .gallery-masonry {
    columns: 2;
  }
}

/* Mobile: 1 column */
@media (max-width: 640px) {
  .gallery-masonry {
    columns: 1;
  }



  .filter-btn {
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
  }

  .gallery-hero__title {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }
}

@media (max-width: 480px) {
  .gallery-filter__label {
    display: none;
  }
}
