/**
 * ============================================================================
 * COPYRIGHT & LICENSE NOTICE
 * Designed and Developed by Mahendra Mali (Max)
 * Website: https://ohhmax.github.io | Contact: ohmaxgit@gmail.com
 *
 * This portfolio code and all script/style code was created and developed by
 * Mahendra Mali (Max). If you are using, referencing, or copying this code,
 * please pay a license fee via UPI: 9824584454@ybl
 *
 * Unauthorized copying or plagiarism is prohibited and subject to legal action.
 * Copyright (c) 2026 Mahendra Mali (Max). All rights reserved.
 * ============================================================================
 */

/* ==========================================================================
   PORTFOLIO GALLERY CSS
   Clean Mobirise-Inspired Photo-First Grid with Dedicated Lightbox & Video Player
   Mahendra Mali (Max) Portfolio (Cybernetic Dark & Light Theme)
   Strict Zero Em-Dash / En-Dash Contract Verified
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Gallery Header & Category Filter Bar
   -------------------------------------------------------------------------- */
.gallery header {
  margin-bottom: 24px;
}

.gallery-filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px 2px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) transparent;
  -webkit-overflow-scrolling: touch;
}

.gallery-filters-bar::-webkit-scrollbar {
  height: 4px;
}

.gallery-filters-bar::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 4px;
}

.gallery-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 30px;
  background: rgba(18, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-filter-pill:hover {
  color: #ffffff;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-1px);
}

.gallery-filter-pill.active {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.28);
}

.gallery-filter-pill i {
  font-size: 0.85rem;
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.gallery-filter-pill.active .filter-count-badge {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

body.light-theme .gallery-filter-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .gallery-filter-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.light-theme .gallery-filter-pill.active {
  background: #fef3c7;
  border-color: #d97706;
  color: #b45309;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

/* --------------------------------------------------------------------------
   2. Search Toolbar & Counter
   -------------------------------------------------------------------------- */
/* Search Toolbar Removed as per Specification */
.gallery-search-toolbar {
  display: none !important;
}

body.light-theme .gallery-counter-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

/* --------------------------------------------------------------------------
   3. Mobirise-Inspired Photo Grid (Clean, Photo-First, Zero Clutter)
   Strictly Two Rows Display on All Screen Viewports
   -------------------------------------------------------------------------- */
.gallery-media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .gallery-media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.portfolio-media-card {
  display: block !important;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), 
              border-color 0.25s ease, 
              box-shadow 0.28s ease;
}

.portfolio-media-card.is-hidden {
  display: none !important;
}

.portfolio-media-card.anim-enter {
  animation: gallery-card-enter 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portfolio-media-card.anim-exit {
  animation: gallery-card-exit 0.18s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes gallery-card-enter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gallery-card-exit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
}

.portfolio-media-card:hover {
  transform: translateY(-3px) scale(1.015);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(245, 158, 11, 0.25);
  z-index: 2;
}

/* Futuristic Cyber Skeleton Shimmer (Instant Load on Slow Internet) */
.gallery-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    110deg,
    #0c1322 0%,
    #16233b 25%,
    rgba(245, 158, 11, 0.16) 50%,
    #16233b 75%,
    #0c1322 100%
  );
  background-size: 200% 100%;
  animation: gallery-skeleton-shimmer 1.8s infinite linear;
  overflow: hidden;
}

.gallery-card-inner.has-loaded {
  animation: none;
  background: #0f172a;
}

@keyframes gallery-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

body.light-theme .gallery-card-inner {
  background: linear-gradient(
    110deg,
    #e2e8f0 0%,
    #f1f5f9 25%,
    #fef3c7 50%,
    #f1f5f9 75%,
    #e2e8f0 100%
  );
  background-size: 200% 100%;
  animation: gallery-skeleton-shimmer 1.8s infinite linear;
}

body.light-theme .gallery-card-inner.has-loaded {
  animation: none;
  background: #f1f5f9;
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s ease;
}

.gallery-card-img.img-loaded {
  opacity: 1;
}

.portfolio-media-card:hover .gallery-card-img.img-loaded {
  transform: scale(1.06);
}

/* Video Badge indicator */
.gallery-card-badge.video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Hover Overlay (Clean Focus Icon Only, Zero Captions / Zero Details) */
.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.35);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.22s ease;
  z-index: 2;
  pointer-events: none;
}

.portfolio-media-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-card-overlay .icon-focus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.65);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  transform: scale(0.85);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.portfolio-media-card:hover .gallery-card-overlay .icon-focus {
  transform: scale(1);
}

/* Zero Details / Zero Captions on Hover */
.gallery-card-hover-meta,
.gallery-hover-tag,
.gallery-hover-title {
  display: none !important;
}

body.light-theme .portfolio-media-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .portfolio-media-card:hover {
  border-color: #d97706;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), 0 0 12px rgba(217, 119, 6, 0.25);
}

/* --------------------------------------------------------------------------
   4. High-Resolution Full-Screen Media Lightbox (Photos & Videos)
   Pure Immersive Presentation: Overlay Controls Only, Zero Text/Captions
   -------------------------------------------------------------------------- */
.fullscreen-photo-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s ease;
}

.fullscreen-photo-lightbox.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: #090a0f;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 1.2px, transparent 1.6px),
    radial-gradient(circle at 50% 0%, #151926 0%, #090a0f 75%);
  background-size: 16px 16px, 100% 100%;
  background-position: 0 0, center top;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  overflow: hidden;
}

.lightbox-backdrop::after {
  display: none !important;
}

@keyframes milkyFlow {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(-4%, 3%) rotate(2deg) scale(1.06); }
  100% { transform: translate(3%, -5%) rotate(-3deg) scale(1.02); }
}

.lightbox-dialog {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
  pointer-events: none;
}

.lightbox-dialog > * {
  pointer-events: auto;
}

/* Direct Overlaid Floating Glass Buttons */
.lightbox-overlay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  z-index: 50;
  outline: none;
}

/* Close Button strictly anchored at Top-Right on all viewports */
.lightbox-overlay-btn.btn-close {
  position: absolute;
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 12px));
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
  z-index: 50;
}

.lightbox-overlay-btn.btn-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* --------------------------------------------------------------------------
   Full-Screen Capsule Navigation Controls
   Previous: Top-Left (Unified across Desktop and Mobile)
   Next: Bottom-Right (Unified across Desktop and Mobile)
   -------------------------------------------------------------------------- */
.lightbox-capsule-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(12, 18, 32, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  z-index: 50;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(245, 158, 11, 0.25);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: absolute;
  overflow: hidden;
}

/* Animated Flowing Gradient Border on all Capsules */
.lightbox-capsule-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  padding: 1.5px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #d97706, #f59e0b);
  background-size: 300% 300%;
  animation: capsuleGradientRotate 3.5s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.lightbox-capsule-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  transform: scale(1.06);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.5);
}

.lightbox-capsule-btn:active {
  transform: scale(0.96);
}

/* Previous Capsule strictly at Top-Left */
.desktop-capsule-prev,
.mobile-capsule-prev,
.capsule-prev {
  top: max(16px, calc(env(safe-area-inset-top, 0px) + 12px)) !important;
  left: max(16px, calc(env(safe-area-inset-left, 0px) + 12px)) !important;
  bottom: auto !important;
  right: auto !important;
  display: inline-flex !important;
}

/* Next Capsule strictly at Bottom-Right */
.desktop-capsule-next,
.mobile-capsule-next,
.capsule-next {
  bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 16px)) !important;
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px)) !important;
  top: auto !important;
  left: auto !important;
  display: inline-flex !important;
}

.lightbox-mobile-arrow {
  display: none;
}

@media (max-width: 640px) {
  .lightbox-overlay-btn.btn-close {
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 10px));
    right: max(12px, calc(env(safe-area-inset-right, 0px) + 10px));
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .desktop-only-btn {
    display: none !important;
  }

  .lightbox-capsule-btn {
    padding: 7px 15px;
    font-size: 0.8rem;
  }
}

@media (min-width: 641px) {
  .mobile-capsule-prev,
  .mobile-capsule-next {
    display: none !important;
  }
}

@keyframes capsuleGradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes mobileCapsuleBorderPulse {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 12px rgba(245, 158, 11, 0.35);
  }
  50% {
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 158, 11, 0.6);
  }
}

/* First-Time Swipe Gesture Animated Hint */
.lightbox-swipe-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 20px;
  background: rgba(10, 15, 28, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.22);
  color: #fff;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.lightbox-swipe-hint.active {
  display: flex !important;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.swipe-hint-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fbbf24;
  animation: hintIconBounce 1.4s infinite ease-in-out;
}

@keyframes hintIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.swipe-hint-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.swipe-hint-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Full-Screen Media Stage (Zero Captions, Zero Text Clutter, Zero Outer Box) */
.lightbox-media-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 0 auto;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  will-change: transform, opacity;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-media-wrap:active {
  cursor: grabbing;
}

/* Full Width Hardware-Accelerated Real-Time Swipe Animations (Mobile & Desktop) */
.lightbox-media-wrap.slide-out-left {
  transform: translate3d(-100vw, 0, 0) scale(0.96) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease !important;
}
.lightbox-media-wrap.slide-out-right {
  transform: translate3d(100vw, 0, 0) scale(0.96) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease !important;
}
.lightbox-media-wrap.slide-in-from-right {
  transform: translate3d(100vw, 0, 0) scale(0.96) !important;
  opacity: 0 !important;
}
.lightbox-media-wrap.slide-in-from-left {
  transform: translate3d(-100vw, 0, 0) scale(0.96) !important;
  opacity: 0 !important;
}

/* Desktop Video Fit: Maximize vertical space and minimize empty letterbox padding */
.lightbox-video-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  max-width: 95vw;
  max-height: 94vh;
}

/* Video Countdown Timer at Top-Right Inset (Clear of Close Button) */
.video-countdown-scrim {
  position: absolute;
  top: 18px;
  right: 76px;
  z-index: 25;
  pointer-events: none;
  user-select: none;
  font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  border: none !important;
  box-shadow: none !important;
  transition: opacity 0.2s ease;
}

.lightbox-fullscreen-media {
  max-width: 92vw;
  max-width: 92dvw;
  max-height: 88vh;
  max-height: 88dvh;
  width: auto;
  height: auto;
  margin: auto !important;
  display: block;
  object-fit: contain;
  object-position: center;
  align-self: center;
  justify-self: center;
  border-radius: 16px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85);
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  pointer-events: auto;
  transform: translateZ(0);
}

/* Desktop Video Player: Fits height closely to avoid excessive empty space above and below */
video.lightbox-fullscreen-media {
  max-width: 94vw;
  max-width: 94dvw;
  max-height: 92vh;
  max-height: 92dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: #000;
  border-radius: 16px !important;
  overflow: hidden !important;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.12);
  cursor: pointer;
}

@media (max-width: 640px) {
  .fullscreen-photo-lightbox {
    height: 100dvh;
    max-height: 100dvh;
  }

  .fullscreen-photo-lightbox .lightbox-dialog,
  .lightbox-dialog {
    height: 100dvh;
    max-height: 100dvh;
  }

  .lightbox-media-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 38px);
    padding-left: 6px;
    padding-right: 6px;
    box-sizing: border-box;
  }

  .lightbox-fullscreen-media {
    max-width: 95vw;
    max-width: 95dvw;
    max-height: 84dvh;
    max-height: 84vh;
    margin: auto !important;
  }

  /* 9:16 Video Reels and Portrait Media Optical Centering */
  video.lightbox-fullscreen-media {
    max-width: 94vw;
    max-width: 94dvw;
    max-height: 84dvh;
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
  }
}

/* Video Radius & Clipping directly on the video element itself */
video.lightbox-fullscreen-media {
  background: #000;
  border-radius: 16px !important;
  overflow: hidden !important;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

video.lightbox-fullscreen-media::-webkit-media-controls,
video.lightbox-fullscreen-media::-webkit-media-controls-enclosure,
video.lightbox-fullscreen-media::-webkit-media-controls-panel,
video.lightbox-fullscreen-media::-webkit-media-controls-play-button,
video.lightbox-fullscreen-media::-webkit-media-controls-timeline,
video.lightbox-fullscreen-media::-webkit-media-controls-current-time-display,
video.lightbox-fullscreen-media::-webkit-media-controls-time-remaining-display,
video.lightbox-fullscreen-media::-webkit-media-controls-mute-button,
video.lightbox-fullscreen-media::-webkit-media-controls-volume-slider {
  display: none !important;
  -webkit-appearance: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Loading Spinner */
.lightbox-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  pointer-events: none;
}

.lightbox-loading-spinner .spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-right-color: #fbbf24;
  border-radius: 50%;
  animation: spinner-rotate 0.75s linear infinite;
}

/* --------------------------------------------------------------------------
   6. Next / Previous Arrow Pagination & Empty State (Warm Portfolio Accent)
   -------------------------------------------------------------------------- */
.gallery-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 0 12px 0;
  width: 100%;
}

.gallery-page-arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-sizing: border-box;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 10px rgba(245, 158, 11, 0.15);
}

.gallery-page-arrow-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

body.light-theme .gallery-page-arrow-btn {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  color: #d97706 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 10px rgba(217, 119, 6, 0.12) !important;
}

body.light-theme .gallery-page-arrow-btn:hover:not(:disabled) {
  background: rgba(217, 119, 6, 0.12) !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

.gallery-page-arrow-btn:disabled,
.gallery-page-arrow-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.08);
  color: #64748b;
  transform: none !important;
  box-shadow: none !important;
}

.gallery-page-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
  cursor: pointer;
}

.gallery-page-dot.active {
  width: 22px;
  border-radius: 10px;
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* Dynamic Active Page Position Capsule */
.gallery-page-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 20px;
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
  user-select: none;
}

body.light-theme .gallery-page-capsule {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
  color: #d97706;
}

@media (max-width: 640px) {
  .gallery-pagination-bar {
    gap: 8px;
    padding: 16px 0 10px 0;
  }

  .gallery-page-arrow-btn {
    flex: 0 0 42px !important;
    flex-shrink: 0 !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    font-size: 0.95rem;
  }

  .gallery-page-capsule {
    max-width: 190px;
    font-size: 0.72rem;
    padding: 5px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
  }
}

/* Last Opened Capsule Badge on Media Card */
.gallery-last-opened-capsule {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.95);
  color: #0b1120;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px rgba(245, 158, 11, 0.6);
  pointer-events: none;
  animation: capsuleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-media-card.is-last-opened {
  border-color: rgba(245, 158, 11, 0.85) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
}

@keyframes capsuleFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gallery-empty-state {
  width: 100%;
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.gallery-empty-state .empty-state-icon {
  font-size: 2.2rem;
  color: #64748b;
  margin-bottom: 12px;
}

.gallery-empty-state h4 {
  font-size: 1.15rem;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.gallery-empty-state p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0 0 16px 0;
}

.gallery-reset-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-reset-filter-btn:hover {
  background: #f59e0b;
  color: #0b1120;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

body.light-theme .gallery-page-arrow-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #d97706;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .gallery-page-arrow-btn:hover:not(:disabled) {
  background: #fef3c7;
  border-color: #d97706;
  color: #b45309;
}

body.light-theme .gallery-page-dot {
  background: #cbd5e1;
}

body.light-theme .gallery-page-dot.active {
  background: #d97706;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
}

body.light-theme .gallery-empty-state h4 {
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   Distinct Gallery Creative Studio Atmosphere (Amber Signature)
   -------------------------------------------------------------------------- */
#gallery {
  position: relative;
}

#gallery::before {
  content: '';
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 980px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.04) 45%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

body.light-theme #gallery::before {
  background: radial-gradient(ellipse at center, rgba(217, 119, 6, 0.06) 0%, rgba(180, 83, 9, 0.03) 45%, transparent 75%);
}

/* --------------------------------------------------------------------------
   Light Theme Support for Full-Screen Media Lightbox
   -------------------------------------------------------------------------- */
body.light-theme .lightbox-backdrop {
  background-color: #eef2f6 !important;
  background-image: 
    radial-gradient(circle, rgba(71, 85, 105, 0.38) 1.2px, transparent 1.6px),
    radial-gradient(ellipse at 50% -10%, rgba(245, 158, 11, 0.16) 0%, transparent 65%),
    radial-gradient(circle at 90% 85%, rgba(203, 213, 225, 0.5) 0%, transparent 55%) !important;
  background-size: 16px 16px, 100% 100%, 100% 100% !important;
  background-position: 0 0, center top, center bottom !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

body.light-theme .lightbox-backdrop::after {
  display: none !important;
}

body.light-theme .lightbox-overlay-btn.btn-close {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(203, 213, 225, 0.85) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .lightbox-overlay-btn.btn-close:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35) !important;
}

body.light-theme .lightbox-capsule-btn {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #b45309 !important;
  border: 1px solid rgba(217, 119, 6, 0.45) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 14px rgba(217, 119, 6, 0.18) !important;
}

body.light-theme .lightbox-capsule-btn:hover {
  background: #fffbeb !important;
  color: #d97706 !important;
  border-color: #d97706 !important;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.28) !important;
}

body.light-theme .lightbox-capsule-btn.mobile-capsule-prev::after,
body.light-theme .lightbox-capsule-btn.mobile-capsule-next::after {
  background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24, #d97706) !important;
  background-size: 300% 300% !important;
}

body.light-theme .lightbox-swipe-hint {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 25px rgba(217, 119, 6, 0.15) !important;
  color: #0f172a !important;
}

body.light-theme .swipe-hint-icon-box {
  background: rgba(217, 119, 6, 0.12) !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  color: #d97706 !important;
}

body.light-theme .swipe-hint-title {
  color: #0f172a !important;
}

body.light-theme .swipe-hint-sub {
  color: #64748b !important;
}

body.light-theme video.lightbox-fullscreen-media {
  border-color: rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .lightbox-fullscreen-media {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}


/* Instagram Reel-Style Vertical Slide Animations (Mobile & Desktop) */
.lightbox-media-wrap.slide-out-up {
  transform: translate3d(0, -100vh, 0) scale(0.96) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease !important;
}
.lightbox-media-wrap.slide-out-down {
  transform: translate3d(0, 100vh, 0) scale(0.96) !important;
  opacity: 0 !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease !important;
}
.lightbox-media-wrap.slide-in-from-down {
  transform: translate3d(0, 100vh, 0) scale(0.96) !important;
  opacity: 0 !important;
}
.lightbox-media-wrap.slide-in-from-up {
  transform: translate3d(0, -100vh, 0) scale(0.96) !important;
  opacity: 0 !important;
}

@media (max-width: 768px) {
  .lightbox-media-wrap {
    touch-action: none !important;
  }
}


/* ==========================================================================
   INSTAGRAM REELS SEAMLESS VERTICAL CAROUSEL TRACK (ZERO BLANK SCREEN)
   ========================================================================== */
.lightbox-carousel-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-carousel-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  cursor: grab;
}

.lightbox-carousel-track:active {
  cursor: grabbing;
}

.lightbox-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}

.lightbox-slide.slide-prev {
  transform: translate3d(0, -100%, 0);
}

.lightbox-slide.slide-current {
  transform: translate3d(0, 0, 0);
}

.lightbox-slide.slide-next {
  transform: translate3d(0, 100%, 0);
}

@media (max-width: 640px) {
  .lightbox-slide {
    height: 100dvh;
    max-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 38px);
    padding-left: 6px;
    padding-right: 6px;
  }
}
