/* ==========================================================================
   PROJECTS / PORTFOLIO PAGE STYLING
   Pure Media-Only Premium Gallery with Strict 16:9 CSS Grid
   Consistent with Seerat Hussain Sial design system:
   Dark navy theme, Plus Jakarta Sans, vibrant gradients, subtle glassmorphism
   ========================================================================== */

/* --- HERO SECTION --- */
.projects-hero {
  padding: 54px 0 36px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.projects-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #45e4ff;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.projects-hero .eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad, linear-gradient(135deg, #45e4ff, #9c76ff));
  box-shadow: 0 0 10px #45e4ff;
}

.projects-hero h1 {
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin: 0 auto 22px;
  max-width: 900px;
  text-wrap: balance;
}

.projects-hero .hero-sub {
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.65;
  color: #94a3b8;
  max-width: 720px;
  margin: 0 auto;
}

/* --- FILTER BAR --- */
.projects-filter-section {
  padding: 12px 0 44px;
  position: relative;
  z-index: 5;
}

.projects-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 12px;
  background: rgba(15, 21, 37, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
  outline: none;
}

.filter-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-btn:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(69, 228, 255, 0.25);
}

.filter-btn.is-active {
  color: #080c16;
  background: var(--grad, linear-gradient(135deg, #45e4ff, #9c76ff));
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(69, 228, 255, 0.32);
}

/* --- SECONDARY SUB-FILTER BAR (Video Editing & Graphic Design) --- */
.projects-subfilter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 16px auto 0;
  padding: 6px 12px;
  background: rgba(12, 17, 30, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fadeInSubfilters 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.projects-subfilter-bar[hidden] {
  display: none !important;
}

@keyframes fadeInSubfilters {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subfilter-btn {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.subfilter-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(69, 228, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 12px rgba(69, 228, 255, 0.15);
}

.subfilter-btn:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(69, 228, 255, 0.25);
}

/* Active Category Button with Cyan-to-Blue-to-Purple-to-Pink gradient */
.subfilter-btn.is-active {
  color: #080c16;
  background: linear-gradient(135deg, #45e4ff 0%, #3b82f6 35%, #8b5cf6 70%, #ec4899 100%);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(69, 228, 255, 0.35),
              0 0 24px rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

/* Mobile & Tablet: horizontally scrollable without breaking page layout */
@media (max-width: 820px) {
  .projects-subfilter-bar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    border-radius: 20px;
    padding: 8px 12px;
    gap: 7px;
  }
  .projects-subfilter-bar::-webkit-scrollbar {
    display: none;
  }
  .projects-subfilter-bar .subfilter-btn {
    flex-shrink: 0;
  }
}

/* --- LOAD MORE BUTTON --- */
.projects-load-more-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 36px;
  padding-bottom: 20px;
  width: 100%;
}

.projects-load-more-wrap[hidden] {
  display: none !important;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 36px;
  background: rgba(14, 20, 36, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(69, 228, 255, 0.35);
  border-radius: 999px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55),
              0 0 20px rgba(69, 228, 255, 0.15);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.3s ease,
              background 0.3s ease,
              color 0.3s ease;
  user-select: none;
}

.btn-load-more svg {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-load-more:hover {
  transform: translateY(-3px) scale(1.02);
  color: #45e4ff;
  border-color: rgba(69, 228, 255, 0.7);
  background: rgba(69, 228, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65),
              0 0 28px rgba(69, 228, 255, 0.35),
              0 0 45px rgba(156, 118, 255, 0.25);
}

.btn-load-more:hover svg {
  transform: translateY(3px);
}

.btn-load-more:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 4px;
}

/* --- STRICT RESPONSIVE CSS GRID --- */
.projects-grid-section {
  padding-bottom: 84px;
}

.projects-gallery {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
  transition: opacity 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.projects-gallery.is-filtering {
  opacity: 0.25;
}

/* --- RATIO GROUP CONTAINERS & DIVIDERS --- */
.media-ratio-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.media-ratio-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 44px 0;
  border: none;
  flex: 0 0 100%;
}

/* --- LETTERHEADS GALLERY (Portrait, Hugging, No 16:9, No Side Grey) --- */
.projects-gallery.is-letterheads-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}

/* 1. Large Desktop (min-width: 1160px): Up to 5 columns */
@media (min-width: 1160px) {
  .projects-gallery.is-letterheads-grid {
    gap: 20px;
  }
  .projects-gallery.is-letterheads-grid .gallery-card.is-letterhead-card {
    flex: 0 0 calc((100% - 80px) / 5);
    width: calc((100% - 80px) / 5);
    max-width: 220px;
  }
}

/* 2. Laptop (820px to 1159px): 3 columns */
@media (min-width: 820px) and (max-width: 1159px) {
  .projects-gallery.is-letterheads-grid {
    gap: 24px;
  }
  .projects-gallery.is-letterheads-grid .gallery-card.is-letterhead-card {
    flex: 0 0 calc((100% - 48px) / 3);
    width: calc((100% - 48px) / 3);
    max-width: 260px;
  }
}

/* 3. Tablet (540px to 819px): 2 columns */
@media (min-width: 540px) and (max-width: 819px) {
  .projects-gallery.is-letterheads-grid {
    gap: 20px;
  }
  .projects-gallery.is-letterheads-grid .gallery-card.is-letterhead-card {
    flex: 0 0 calc((100% - 20px) / 2);
    width: calc((100% - 20px) / 2);
    max-width: 280px;
  }
}

/* 4. Mobile (max-width: 539px): 1 column */
@media (max-width: 539px) {
  .projects-gallery.is-letterheads-grid {
    gap: 18px;
  }
  .projects-gallery.is-letterheads-grid .gallery-card.is-letterhead-card {
    flex: 0 0 100%;
    width: 100%;
    max-width: 320px;
  }
}

/* Individual Letterhead Card: Hugs portrait image precisely, no 16:9, no grey side space */
.gallery-card.is-letterhead-card {
  aspect-ratio: auto !important;
  height: auto !important;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 0 !important;
  display: block !important;
  overflow: hidden;
  line-height: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  position: relative;
  transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s ease;
}

.gallery-card.is-letterhead-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(69, 228, 255, 0.55);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.7),
              0 0 24px rgba(69, 228, 255, 0.3),
              0 0 45px rgba(156, 118, 255, 0.2);
}

.gallery-card.is-letterhead-card .card-main-media.is-letterhead-img {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
  object-fit: contain;
  border-radius: 15px;
  transform: none !important;
  margin: 0;
  padding: 0;
}

.gallery-card.is-letterhead-card .gallery-overlay {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  line-height: normal;
}

/* --- BUSINESS CARDS GALLERY (3:2 Landscape, 3 Desktop / 2 Tablet / 1 Mobile, Centered Row 2) --- */
.projects-gallery.is-business-cards-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 24px;
}

/* 1. Desktop (min-width: 1025px): 3 equal columns, final 2 cards centered on Row 2 */
@media (min-width: 1025px) {
  .projects-gallery.is-business-cards-grid {
    gap: 24px;
  }
  .projects-gallery.is-business-cards-grid .gallery-card.is-business-card {
    flex: 0 0 calc((100% - 48px) / 3);
    width: calc((100% - 48px) / 3);
    max-width: calc((100% - 48px) / 3);
  }
}

/* 2. Tablet (641px to 1024px): 2 equal columns, centered */
@media (min-width: 641px) and (max-width: 1024px) {
  .projects-gallery.is-business-cards-grid {
    gap: 20px;
  }
  .projects-gallery.is-business-cards-grid .gallery-card.is-business-card {
    flex: 0 0 calc((100% - 20px) / 2);
    width: calc((100% - 20px) / 2);
    max-width: calc((100% - 20px) / 2);
  }
}

/* 3. Mobile (max-width: 640px): 1 column, centered */
@media (max-width: 640px) {
  .projects-gallery.is-business-cards-grid {
    gap: 16px;
  }
  .projects-gallery.is-business-cards-grid .gallery-card.is-business-card {
    flex: 0 0 100%;
    width: 100%;
    max-width: 460px;
  }
}

/* Individual Business Card: 3:2 aspect ratio, rounded corners, theme border, soft shadow & hover glow */
.gallery-card.is-business-card {
  aspect-ratio: 3 / 2 !important;
  border-radius: 18px;
  overflow: hidden;
  background: #080c18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  position: relative;
  transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s ease;
}

.gallery-card.is-business-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: rgba(69, 228, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65),
              0 0 24px rgba(69, 228, 255, 0.28),
              0 0 45px rgba(156, 118, 255, 0.2);
}

.gallery-card.is-business-card .card-main-media.is-business-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gallery-card.is-business-card:hover .card-main-media.is-business-card-img {
  transform: scale(1.03);
}

/* Individual 16:9 Media Card */
.gallery-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #080c18;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateZ(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: rgba(69, 228, 255, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65),
              0 0 24px rgba(69, 228, 255, 0.28),
              0 0 45px rgba(156, 118, 255, 0.2);
}

.gallery-card:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 4px;
}

/* Specific Aspect Ratios for Groups (Desktop default: min-width: 1025px) */
/* 1. 16:9 Landscape (3 cols) */
.media-ratio-group.is-ratio-16-9 .gallery-card,
.media-ratio-group.is-ratio-16-10 .gallery-card {
  aspect-ratio: 16 / 9;
  flex: 0 0 calc((100% - 2 * 24px) / 3);
  width: calc((100% - 2 * 24px) / 3);
  max-width: calc((100% - 2 * 24px) / 3);
}

.media-ratio-group.is-ratio-16-10 .gallery-card {
  aspect-ratio: 16 / 10;
}

/* 2. 9:16 Portrait (4 cols) */
.media-ratio-group.is-ratio-9-16 .gallery-card {
  aspect-ratio: 9 / 16;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

/* 3. 1:1 Square (3 cols) */
.media-ratio-group.is-ratio-1-1 .gallery-card {
  aspect-ratio: 1 / 1;
  flex: 0 0 calc((100% - 2 * 24px) / 3);
  width: calc((100% - 2 * 24px) / 3);
  max-width: calc((100% - 2 * 24px) / 3);
}

/* 4. 4:5 Portrait (4 cols) */
.media-ratio-group.is-ratio-4-5 .gallery-card {
  aspect-ratio: 4 / 5;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

/* 5. 3:4 Portrait (4 cols) */
.media-ratio-group.is-ratio-3-4 .gallery-card {
  aspect-ratio: 3 / 4;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

/* 6. A4 / Letterhead proportions (4 cols) */
.media-ratio-group.is-ratio-a4 .gallery-card,
.gallery-card.is-letterhead-card {
  aspect-ratio: 1 / 1.414;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

/* 7. Other formats: 3:2 Business Cards (3 cols) */
.media-ratio-group.is-ratio-3-2 .gallery-card,
.gallery-card.is-business-card {
  aspect-ratio: 3 / 2;
  flex: 0 0 calc((100% - 2 * 24px) / 3);
  width: calc((100% - 2 * 24px) / 3);
  max-width: calc((100% - 2 * 24px) / 3);
}

/* 2:3 Posters & 5:8 Artwork (4 cols) */
.media-ratio-group.is-ratio-2-3 .gallery-card {
  aspect-ratio: 2 / 3;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

.media-ratio-group.is-ratio-5-8 .gallery-card {
  aspect-ratio: 5 / 8;
  flex: 0 0 calc((100% - 3 * 24px) / 4);
  width: calc((100% - 3 * 24px) / 4);
  max-width: calc((100% - 3 * 24px) / 4);
}

/* Hide blurred filler backgrounds - frames natively fit media proportions */
.card-backdrop-blur {
  display: none !important;
}

/* Main Sharp Centered Media */
.card-main-media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-main-media.is-cover {
  object-fit: cover;
}

.card-main-media.is-contain {
  object-fit: contain;
}

.gallery-card:hover .card-main-media {
  transform: scale(1.045);
}

/* Video Cards Inline Hover Preview Layer (YouTube and Local Videos) */
.card-video-preview-container,
.card-yt-preview-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: #000000;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-video-preview-container.is-active,
.card-yt-preview-container.is-active {
  opacity: 1;
}

.card-video-preview-container iframe,
.card-video-preview-container video,
.card-yt-preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  pointer-events: none;
  display: block;
  object-fit: cover;
}

/* 9:16 portrait card hover preview: preserve full player interface without cropping */
.gallery-card.is-portrait .card-video-preview-container iframe,
.gallery-card.is-portrait .card-yt-preview-container iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  transform: none;
}

.gallery-card.is-portrait .card-video-preview-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card.is-preview-playing .card-main-media {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-card.is-preview-playing .gallery-overlay {
  background: radial-gradient(circle at center, rgba(6, 9, 18, 0.12) 0%, rgba(6, 9, 18, 0.45) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Soft Dark Overlay with Centered Icon */
.gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(6, 9, 18, 0.46);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  cursor: pointer;
}

.gallery-card:hover .gallery-overlay,
.gallery-card:focus-visible .gallery-overlay {
  opacity: 1;
}

/* Action Icon (Play or Expand) */
.gallery-action-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(15, 21, 37, 0.88);
  border: 1px solid rgba(69, 228, 255, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55),
              0 0 20px rgba(69, 228, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.82);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

.gallery-card:hover .gallery-action-icon {
  transform: scale(1);
}

.gallery-action-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.gallery-action-icon.is-play svg {
  margin-left: 2px;
}

/* Empty State */
.projects-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(15, 21, 37, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 500px;
  margin: 30px auto;
}

.projects-empty-state h3 {
  font-size: 20px;
  color: #ffffff;
  margin: 0 0 10px;
}

.projects-empty-state p {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 20px;
}

/* ==========================================================================
   MEDIA LIGHTBOX
   Clean, responsive, full-screen media viewer
   ========================================================================== */
.media-lightbox {
  position: fixed;
  inset: 0;
  max-width: 100vw;
  overflow-x: clip;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0.3s ease;
}

.media-lightbox[hidden] {
  display: none !important;
}

.media-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

body.lightbox-is-open {
  overflow: hidden;
}

/* Dark Backdrop */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
}

/* Stage */
.lightbox-stage {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  animation: lightboxScaleUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes lightboxScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Lightbox Media Elements */
.lightbox-img {
  max-width: 90vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85),
              0 0 35px rgba(69, 228, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: block;
}

/* 16:9 Landscape Video */
.lightbox-video-wrap {
  width: min(1080px, 90vw);
  aspect-ratio: 16 / 9;
  max-height: 86vh;
  border-radius: 18px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9),
              0 0 40px rgba(69, 228, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  position: relative;
}

.lightbox-video-wrap video,
.lightbox-video-wrap iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  border: none;
  outline: none;
  display: block;
}

/* 9:16 Vertical Reel Player - strictly within viewport height without stretching */
.lightbox-reel-wrap {
  height: min(84vh, calc(90vw * 16 / 9));
  max-height: 84vh;
  max-width: min(90vw, calc(84vh * 9 / 16));
  aspect-ratio: 9 / 16;
  width: auto;
  border-radius: 24px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.92),
              0 0 40px rgba(156, 118, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  position: relative;
}

.lightbox-reel-wrap video,
.lightbox-reel-wrap iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  border: none;
  outline: none;
  display: block;
}

/* Lightbox Unmute / Play Overlay */
.lightbox-unmute-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: rgba(8, 12, 24, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-unmute-overlay[hidden] {
  display: none !important;
}

.btn-lightbox-unmute {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(69, 228, 255, 0.25) 0%, rgba(156, 118, 255, 0.35) 100%);
  border: 1px solid rgba(69, 228, 255, 0.65);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.65), 0 0 24px rgba(69, 228, 255, 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease;
  user-select: none;
}

.btn-lightbox-unmute:hover {
  transform: scale(1.04);
  background: linear-gradient(135deg, rgba(69, 228, 255, 0.42) 0%, rgba(156, 118, 255, 0.52) 100%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 32px rgba(69, 228, 255, 0.5);
}

.btn-lightbox-unmute svg {
  width: 22px;
  height: 22px;
}

/* Close Button */
.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 24, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: background 0.22s ease,
              border-color 0.22s ease,
              transform 0.22s ease;
}

.lightbox-close-btn:hover {
  background: #ff4766;
  border-color: #ff4766;
  transform: rotate(90deg);
}

.lightbox-close-btn:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 2px;
}

/* Prev / Next Nav Buttons */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 24, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-nav-btn.prev-btn {
  left: 28px;
}

.lightbox-nav-btn.next-btn {
  right: 28px;
}

.lightbox-nav-btn:hover {
  background: rgba(69, 228, 255, 0.2);
  border-color: #45e4ff;
  color: #45e4ff;
  box-shadow: 0 0 20px rgba(69, 228, 255, 0.35);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 2px;
}

/* --- LIGHTBOX MULTI-IMAGE CAROUSEL --- */
.lightbox-carousel-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 86vh;
}

.lightbox-carousel-controls {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  background: rgba(14, 20, 36, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6),
              0 0 20px rgba(69, 228, 255, 0.15);
  z-index: 10;
  user-select: none;
}

.lightbox-carousel-counter {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c9d5ea;
  white-space: nowrap;
}

.lightbox-carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-carousel-dot:hover {
  background: rgba(69, 228, 255, 0.7);
}

.lightbox-carousel-dot.is-active {
  background: #45e4ff;
  width: 22px;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(69, 228, 255, 0.6);
}

.lightbox-subnav-btn {
  background: transparent;
  border: none;
  color: #9cb3d9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.lightbox-subnav-btn:hover {
  color: #45e4ff;
  transform: scale(1.18);
}

.lightbox-subnav-btn:focus-visible {
  outline: 2px solid #45e4ff;
  outline-offset: 2px;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1024px) {
  .media-ratio-group {
    gap: 20px;
  }
  .media-ratio-divider {
    margin: 34px 0;
  }
  .media-ratio-group .gallery-card {
    flex: 0 0 calc((100% - 20px) / 2) !important;
    width: calc((100% - 20px) / 2) !important;
    max-width: calc((100% - 20px) / 2) !important;
  }
  .media-ratio-group.is-ratio-9-16 .gallery-card {
    max-width: 360px !important;
  }
  .lightbox-nav-btn.prev-btn {
    left: 16px;
  }
  .lightbox-nav-btn.next-btn {
    right: 16px;
  }
}

@media (max-width: 640px) {
  .projects-hero {
    padding: 38px 0 24px;
  }
  .projects-filter-section {
    padding: 8px 0 32px;
  }
  .projects-filter-bar {
    gap: 6px;
    padding: 6px 8px;
    border-radius: 20px;
  }
  .filter-btn {
    font-size: 12px;
    padding: 7px 14px;
  }
  .projects-subfilter-bar {
    gap: 5px;
    padding: 6px 8px;
    border-radius: 18px;
    margin-top: 12px;
  }
  .subfilter-btn {
    font-size: 11px;
    padding: 5px 11px;
  }
  .media-ratio-group {
    gap: 16px;
  }
  .media-ratio-divider {
    margin: 24px 0;
  }
  .media-ratio-group .gallery-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px;
  }
  .media-ratio-group.is-ratio-9-16 .gallery-card {
    max-width: 320px !important;
    margin: 0 auto;
  }
  .media-ratio-group.is-ratio-4-5 .gallery-card,
  .media-ratio-group.is-ratio-3-4 .gallery-card,
  .media-ratio-group.is-ratio-a4 .gallery-card,
  .media-ratio-group.is-ratio-2-3 .gallery-card,
  .media-ratio-group.is-ratio-5-8 .gallery-card {
    max-width: 340px !important;
    margin: 0 auto;
  }
  .media-lightbox {
    padding: 14px;
  }
  .lightbox-close-btn {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }
  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
  }
  .lightbox-nav-btn.prev-btn {
    left: 10px;
  }
  .lightbox-nav-btn.next-btn {
    right: 10px;
  }
  .lightbox-reel-wrap {
    height: 76vh;
    border-radius: 18px;
  }
  .lightbox-carousel-controls {
    bottom: -40px;
    padding: 4px 12px;
    gap: 8px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .projects-subfilter-bar {
    animation: none !important;
  }
  .filter-btn,
  .subfilter-btn,
  .gallery-card,
  .lightbox-nav-btn,
  .lightbox-close-btn {
    transition: none !important;
    transform: none !important;
  }
  .subfilter-btn:hover,
  .subfilter-btn.is-active {
    transform: none !important;
  }
}

