/* ============================================
   Work / Gallery Page Styles — work.html
   ============================================ */

/* === MINI-HERO === */
.page-intro {
  position: relative;
  background-color: var(--ink);
  color: var(--text-on-dark);
  padding: 120px 0 80px;
  overflow: hidden;
}

.page-intro-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-intro-bg .img-slot {
  width: 100%;
  height: 100%;
}

.page-intro-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, 
    rgba(21, 32, 25, 0.75) 0%, 
    rgba(21, 32, 25, 0.5) 100%);
}

.page-intro-content {
  position: relative;
  z-index: 1;
}

.page-intro .tag {
  color: var(--grain);
}

.page-intro h1 {
  color: var(--text-on-dark);
  margin-bottom: var(--space-3);
}

.page-intro-supporting {
  font-size: 1.1rem;
  color: var(--text-on-dark-dim);
  max-width: 60ch;
}

/* === FILTER BAR === */
.filter-bar {
  position: sticky;
  top: 58px;
  z-index: 100;
  background-color: var(--paper);
  border-bottom: 1px solid var(--line-on-light);
  padding: var(--space-3) 0;
}

.filter-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  list-style: none;
}

.filter-btn {
  background: none;
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--body-size);
  color: var(--text-ink);
  cursor: pointer;
  padding: var(--space-1) 0;
  position: relative;
  transition: color 0.2s ease;
}

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

.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--grain);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* === GALLERY GRID === */
.gallery-section {
  background-color: var(--paper);
  padding: var(--space-8) 0;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  width: 100%;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item .img-slot {
  aspect-ratio: 4 / 3;
  position: relative;
}

.gallery-item .img-slot::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--clay);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-item:hover .img-slot img {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

.gallery-item:hover .img-slot::after {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* Vary sizes for non-uniform grid */
.gallery-item:nth-child(7n+1) .img-slot,
.gallery-item:nth-child(7n+5) .img-slot {
  aspect-ratio: 1 / 1;
}

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(21, 32, 25, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  color: var(--text-on-dark-dim);
  font-size: var(--small-size);
  text-align: center;
  margin-top: var(--space-2);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-on-dark);
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: var(--space-1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.lightbox-close:hover {
  color: var(--grain);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(21, 32, 25, 0.7);
  border: 1px solid var(--line-on-dark);
  color: var(--text-on-dark);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.lightbox-nav:hover {
  background-color: rgba(21, 32, 25, 0.9);
}

.lightbox-nav:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

.lightbox-prev {
  left: var(--space-3);
}

.lightbox-next {
  right: var(--space-3);
}

/* === TESTIMONIAL === */
.testimonial-section {
  background-color: var(--paper-dim);
}

.testimonial-quote {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}

.testimonial-quote::before {
  content: '"';
  font-family: 'Fraunces', Georgia, serif;
  font-size: 5rem;
  line-height: 1;
  color: var(--grain);
  display: block;
  margin-bottom: var(--space-2);
}

.testimonial-quote blockquote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-ink);
  margin-bottom: var(--space-3);
}

.testimonial-quote cite {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-style: normal;
  font-size: var(--small-size);
  color: var(--text-ink);
}

/* === CLOSING CTA === */
.closing-cta {
  background-color: var(--ink);
  color: var(--text-on-dark);
}

.closing-cta-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.closing-cta h2 {
  color: var(--text-on-dark);
  margin-bottom: var(--space-3);
}

.closing-cta p {
  color: var(--text-on-dark-dim);
  margin-bottom: var(--space-4);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .page-intro {
    padding: 96px 0 64px;
  }
  
  .filter-bar {
    top: 54px;
  }
  
  .filter-buttons {
    gap: var(--space-2);
  }
  
  .filter-btn {
    font-size: var(--small-size);
  }
  
  .gallery-masonry {
    grid-template-columns: 1fr;
  }
  
  .lightbox-content {
    max-width: 95vw;
  }
  
  .lightbox-close {
    top: -40px;
    font-size: 2rem;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .lightbox-prev {
    left: var(--space-1);
  }
  
  .lightbox-next {
    right: var(--space-1);
  }
  
  .testimonial-quote blockquote {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item {
    transition: none;
  }
  
  .gallery-item:hover .img-slot img {
    transform: none;
  }
  
  .lightbox {
    transition: none;
  }
  
  .lightbox-content {
    transform: scale(1);
    transition: none;
  }
  
  .lightbox.active .lightbox-content {
    transform: scale(1);
  }
}
