/* ============================================================
   PORTFOLIO — Rabbit & Sparrow
   ============================================================ */

/* ---------- Filter bar ---------- */
.portfolio-filters {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: var(--charcoal-deep);
  border-bottom: 1px solid rgba(196, 162, 101, 0.3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.portfolio-filters-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  white-space: nowrap;
}
.filter-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(245, 240, 232, 0.2);
  border-radius: 2px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.3s var(--ease-lux), border-color 0.3s var(--ease-lux), color 0.3s var(--ease-lux);
}
.filter-btn:hover {
  border-color: rgba(245, 240, 232, 0.5);
}
.filter-btn.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--cream);
}

/* ---------- Gallery grid ---------- */
.gallery-section {
  background: var(--cream);
  padding: 48px 24px 80px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
}
.gallery-item {
  transition: opacity 0.4s var(--ease-lux), transform 0.4s var(--ease-lux);
}
.gallery-item.hidden {
  display: none;
}
.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s var(--ease-lux);
}
.gallery-item:hover .gallery-thumb,
.gallery-item:focus-within .gallery-thumb {
  transform: scale(1.05);
}

/* ---------- Gallery overlay ---------- */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 16px 14px;
  background: linear-gradient(0deg, rgba(35, 33, 32, 0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-lux);
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay,
.gallery-item:focus-within .gallery-overlay {
  opacity: 1;
}
.gallery-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-lux);
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--cream);
  cursor: pointer;
  transition: color 0.25s var(--ease-lux);
  font-family: var(--font-body);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--gold);
}
.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 40px;
  line-height: 1;
}
.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 52px;
  line-height: 1;
}
.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 52px;
  line-height: 1;
}
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--cream);
}

/* ---------- Video section ---------- */
.video-section {
  padding: 100px 0 110px;
  background: var(--cream);
}
.video-section h2 {
  margin-bottom: 48px;
}
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 2px;
  background: var(--charcoal);
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---------- Featured projects ---------- */
.featured-projects {
  padding: 80px 24px 0;
  background: var(--cream);
}
.featured-projects h2 {
  margin-bottom: 48px;
}
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.featured-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
  overflow: hidden;
  background: var(--charcoal-deep);
  transition: transform 0.4s var(--ease-lux);
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.featured-card-img {
  position: relative;
  overflow: hidden;
}
.featured-card-img img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.6s var(--ease-lux);
}
.featured-card:hover .featured-card-img img {
  transform: scale(1.05);
}
.featured-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(35, 33, 32, 0.6) 100%);
}
.featured-card-info {
  padding: 28px 24px 32px;
}
.featured-card-info h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  color: var(--cream);
  margin: 0 0 4px;
}
.featured-card-tagline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--gold);
  margin: 0 0 16px;
}
.featured-card-cost {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--terracotta);
  margin: 0 0 12px;
}
.featured-card-link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color 0.25s var(--ease-lux);
}
.featured-card:hover .featured-card-link {
  color: var(--cream);
}

/* ---------- Project page hero ---------- */
.project-hero {
  position: relative;
  height: 70vh;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.project-hero-bg {
  position: absolute;
  inset: 0;
}
.project-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(35, 33, 32, 0.2) 0%, rgba(35, 33, 32, 0.7) 100%);
}
.project-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 60px;
}
.project-back {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.25s var(--ease-lux);
}
.project-back:hover {
  color: var(--cream);
}
.project-hero h1 {
  color: var(--cream);
}
.project-hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-style: italic;
  color: var(--gold);
  margin-top: 8px;
}

/* ---------- Project split layout ---------- */
.project-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.project-split-video {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

/* ---------- Project details ---------- */
.project-details {
  padding: 80px 24px;
  background: var(--cream);
}
.project-meta {
  display: flex;
  gap: 48px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(44, 44, 44, 0.15);
}
.project-meta-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}
.project-meta-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--charcoal);
}
.project-cost {
  color: var(--terracotta);
  font-size: 1.5rem;
  font-weight: 600;
}
.project-description {
  margin-bottom: 48px;
}
.project-description p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--charcoal);
  margin-bottom: 16px;
}
.project-features h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 24px;
}
.project-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.project-features li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--charcoal);
  padding: 12px 0;
  border-bottom: 1px solid rgba(44, 44, 44, 0.08);
}
.project-features li strong {
  color: var(--charcoal-deep);
}
.project-sign-off {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--sage);
  margin-top: 24px;
}

/* ---------- Project gallery ---------- */
.project-gallery {
  padding: 80px 24px;
  background: var(--stone);
}
.project-gallery h2 {
  text-align: center;
  margin-bottom: 48px;
}
.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.project-gallery-grid .gallery-item:first-child {
  grid-column: 1 / -1;
}
.project-gallery-grid .gallery-item:first-child .gallery-thumb {
  aspect-ratio: 16 / 7;
}

/* ---------- Project CTA ---------- */
.project-cta {
  padding: 80px 24px;
  background: var(--charcoal-deep);
}
.project-cta-inner {
  text-align: center;
}
.project-cta h2 {
  color: var(--cream);
  margin-bottom: 16px;
}
.project-cta p {
  color: rgba(245, 240, 232, 0.7);
  font-size: 17px;
  margin-bottom: 32px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-filters-inner {
    justify-content: flex-start;
  }
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .project-split {
    grid-template-columns: 1fr;
  }
  .project-split-video {
    position: static;
  }
  .project-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-gallery-grid .gallery-item:first-child {
    grid-column: 1 / -1;
  }
  .project-meta {
    gap: 32px;
  }
}

@media (max-width: 580px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .project-gallery-grid {
    grid-template-columns: 1fr;
  }
  .project-gallery-grid .gallery-item:first-child .gallery-thumb {
    aspect-ratio: 4 / 3;
  }
  .project-hero {
    height: 55vh;
  }
  .project-meta {
    flex-direction: column;
    gap: 20px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .gallery-thumb,
  .gallery-overlay,
  .gallery-item,
  .lightbox,
  .featured-card,
  .featured-card-img img {
    transition: none;
  }
  .featured-card:hover,
  .gallery-item:hover .gallery-thumb {
    transform: none;
  }
}
