/* ========================================
   PORTFOLIO GALLERY — Premium Redesign
   Split-screen slideshow (desktop) + 3D card stack (mobile)
   ======================================== */

/* Section override — standard overlay */
.portfolio-section.np-gal-wrap {
  padding: 0 !important;
  overflow: hidden;
}

.np-gal {
  --np-cream: var(--color-gray-100);
  --np-dark: #0f0e0c;
  --np-gold: var(--color-accent);
  --np-warm: var(--color-primary);
  --np-cream-dark: var(--color-gray-200);

  font-family: 'Golos Text', sans-serif;
  color: var(--np-dark);
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

/* ================================================================
   HEADER — title above gallery
   ================================================================ */
.np-gal-head {
  padding: 48px 48px 28px;
  text-align: center;
}

.np-gal-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--np-warm);
  margin-bottom: 10px;
  display: block;
}

.np-gal-h {
  font-family: 'Lora', serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 8px;
}
.np-gal-h em { font-style: italic; color: var(--np-warm); }

.np-gal-sub {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 0;
}
.np-gal-sub-bar { width: 24px; height: 1px; background: var(--np-warm); }
.np-gal-sub-txt { font-size: 13px; color: rgba(15,14,12,0.38); font-weight: 300; }

/* ================================================================
   DESKTOP — CLEAN SPLIT
   ================================================================ */
.np-gal-dk {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 460px;
  max-height: 600px;
  height: 60vh;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

/* LEFT — tabs only */
.np-gal-left {
  display: flex;
  flex-direction: column;
  padding: 20px 28px 20px;
  border-right: 1px solid rgba(140,123,99,0.08);
  overflow: hidden;
  min-height: 0;
}

/* Tabs */
.np-gal-tabs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.np-gal-tab {
  padding: 11px 16px;
  border: none;
  background: transparent;
  color: rgba(15,14,12,0.35);
  font-family: 'Golos Text', sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}
.np-gal-tab:hover { color: var(--np-dark); background: rgba(255,255,255,0.3); }
.np-gal-tab.active { color: var(--np-dark); font-weight: 500; background: rgba(255,255,255,0.5); }
.np-gal-tab.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; background: var(--np-warm); border-radius: 0 3px 3px 0;
}

/* Bottom link */
.np-gal-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 14px 24px; flex-shrink: 0;
  border-radius: 100px; background: var(--np-dark); color: var(--np-cream);
  font-size: 13px; font-weight: 500; text-decoration: none; border: none; cursor: pointer;
  transition: all 0.35s ease; align-self: flex-start;
  font-family: 'Golos Text', sans-serif;
}
.np-gal-link:hover { background: var(--np-warm); }
.np-gal-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s ease; }
.np-gal-link:hover svg { transform: translateX(3px); }

/* RIGHT — STAGE */
.np-gal-stage {
  position: relative;
  overflow: hidden;
  background: #1a1917;
}

.np-gal-slide {
  position: absolute; inset: 0; opacity: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.np-gal-slide.active { opacity: 1; z-index: 2; }
.np-gal-slide.leaving { z-index: 3; opacity: 1; animation: np-wipe 0.8s cubic-bezier(0.77,0,0.175,1) forwards; }

.np-gal-slide img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
  transition: transform 8s ease-out;
}
.np-gal-slide.active img { transform: scale(1.02); }

/* Info overlay ON the photo */
.np-gal-overlay {
  position: absolute;
  bottom: 100px; left: 40px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.np-gal-ov-type {
  font-size: 11px; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--np-gold);
}

.np-gal-ov-name {
  font-family: 'Lora', serif;
  font-size: 36px; font-weight: 400; color: white;
  line-height: 1.15;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.np-gal-ov-meta {
  display: flex; gap: 16px;
}

.np-gal-ov-tag,
.np-gal-ov-mat {
  font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 300;
  display: flex; align-items: center; gap: 5px;
}
.np-gal-ov-tag svg {
  width: 13px; height: 13px; stroke: var(--np-gold); fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* Gradient scrim */
.np-gal-scrim {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(15,14,12,0.55) 100%);
  z-index: 5;
  pointer-events: none;
}

/* Arrows */
.np-gal-arrows {
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(-50%);
  display: flex; justify-content: space-between;
  padding: 0 24px; z-index: 15; pointer-events: none;
}
.np-gal-arr {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.18);
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; pointer-events: auto;
}
.np-gal-arr:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); }
.np-gal-arr svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Counter */
.np-gal-cnt {
  position: absolute; top: 28px; right: 28px; z-index: 15;
  font-family: 'Lora', serif; font-size: 14px;
  color: rgba(255,255,255,0.45); letter-spacing: 2px;
  padding: 8px 16px; border-radius: 100px;
  background: rgba(0,0,0,0.45);
}
.np-gal-cnt strong { font-weight: 400; color: white; font-size: 20px; }

/* Progress */
.np-gal-prog {
  position: absolute; bottom: 0; left: 0;
  height: 3px; background: linear-gradient(90deg, var(--np-gold), white);
  z-index: 20; width: 0%; transition: width 5s linear;
}
.np-gal-prog.rst { transition: none; width: 0%; }


/* ================================================================
   MINI-GALLERY STRIP (below desktop slideshow)
   ================================================================ */
.np-gal-mini {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  background: rgba(15,14,12,0.03);
  border-top: 1px solid rgba(140,123,99,0.08);
  border-radius: 0 0 16px 16px;
}

.np-gal-mini-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  scrollbar-width: none;
  padding: 4px 0;
}
.np-gal-mini-track::-webkit-scrollbar { display: none; }

.np-gal-mini-th {
  width: 110px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  opacity: 0.45;
  transition: all 0.3s ease;
  background: var(--color-gray-200);
}
.np-gal-mini-th:hover { opacity: 0.75; }
.np-gal-mini-th.active {
  opacity: 1;
  border-color: var(--np-gold);
  box-shadow: 0 2px 12px rgba(196,180,154,0.35);
}
.np-gal-mini-th img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.np-gal-mini-arr {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(140,123,99,0.15);
  background: white;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  color: var(--np-dark);
}
.np-gal-mini-arr:hover {
  background: var(--np-cream-dark);
  border-color: var(--np-warm);
}
.np-gal-mini-arr svg {
  width: 16px; height: 16px; stroke: currentColor;
  fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}


/* ================================================================
   MOBILE — 3D CARD STACK + SWIPE
   ================================================================ */
.np-gal-mob {
  display: none;
  flex-direction: column;
  padding: 60px 0 80px;
  overflow: hidden;
}

.np-gal-mob-head {
  padding: 0 24px;
  margin-bottom: 8px;
}
.np-gal-mob-label {
  font-size: 10px; font-weight: 500; letter-spacing: 3px;
  text-transform: uppercase; color: var(--np-warm);
  margin-bottom: 8px;
}
.np-gal-mob-h {
  font-family: 'Lora', serif;
  font-size: 34px; font-weight: 400; line-height: 1.08;
}
.np-gal-mob-h em { font-style: italic; color: var(--np-warm); }
.np-gal-mob-sub {
  font-size: 13px; color: rgba(15,14,12,0.4); font-weight: 300; margin-top: 6px;
}

/* Filters */
.np-gal-mob-filters {
  display: flex; gap: 6px;
  padding: 16px 24px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.np-gal-mob-filters::-webkit-scrollbar { display: none; }

.np-gal-mob-f {
  padding: 8px 16px; border-radius: 100px;
  border: 1px solid rgba(140,123,99,0.12);
  background: transparent;
  color: rgba(15,14,12,0.45);
  font-family: 'Golos Text', sans-serif;
  font-size: 12px; cursor: pointer; white-space: nowrap;
  transition: all 0.3s ease; flex-shrink: 0;
}
.np-gal-mob-f.active { background: var(--np-dark); color: var(--np-cream); border-color: var(--np-dark); }

/* === THE STACK === */
.np-gal-stack-wrap {
  position: relative;
  height: 480px;
  margin: 16px 0;
  perspective: 1200px;
  -webkit-perspective: 1200px;
}

.np-gal-stack {
  position: absolute;
  inset: 0 24px;
}

.np-gal-scard {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 20px;
  overflow: hidden;
  transform-origin: center bottom;
  transition: transform 0.5s ease-out,
              opacity 0.4s ease;
  will-change: transform, opacity;
  touch-action: pan-y;
  cursor: grab;
}
.np-gal-scard:active { cursor: grabbing; }

.np-gal-scard img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none; -webkit-user-drag: none;
}

/* Stacking layers */
.np-gal-scard[data-pos="0"] {
  z-index: 5; transform: translateY(0) scale(1);
  box-shadow: 0 16px 48px rgba(15,14,12,0.2);
}
.np-gal-scard[data-pos="1"] {
  z-index: 4; transform: translateY(12px) scale(0.94);
  opacity: 0.7; filter: brightness(0.9);
}
.np-gal-scard[data-pos="2"] {
  z-index: 3; transform: translateY(24px) scale(0.88);
  opacity: 0.4; filter: brightness(0.8);
}
.np-gal-scard[data-pos="3"],
.np-gal-scard[data-pos="4"],
.np-gal-scard[data-pos="5"],
.np-gal-scard[data-pos="6"],
.np-gal-scard[data-pos="7"] {
  z-index: 2; transform: translateY(32px) scale(0.84);
  opacity: 0; pointer-events: none;
}

/* Swiping state */
.np-gal-scard.swiping {
  transition: none !important;
}
.np-gal-scard.fly-left {
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1),
              opacity 0.18s ease !important;
  transform: translateX(-120%) rotate(-12deg) !important;
  opacity: 0 !important;
}
.np-gal-scard.fly-right {
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1),
              opacity 0.18s ease !important;
  transform: translateX(120%) rotate(12deg) !important;
  opacity: 0 !important;
}

/* Card overlay info */
.np-gal-scard-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 60px 24px 24px;
  background: linear-gradient(180deg, transparent, rgba(15,14,12,0.75));
  display: flex; flex-direction: column; gap: 4px;
}

.np-gal-scard-type {
  font-size: 10px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: var(--np-gold);
}
.np-gal-scard-name {
  font-family: 'Lora', serif;
  font-size: 24px; color: white; font-weight: 400; line-height: 1.2;
}
.np-gal-scard-meta {
  font-size: 12px; color: rgba(255,255,255,0.5); font-weight: 300;
}

/* Swipe hint */
.np-gal-swipe-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  color: rgba(140,123,99,0.4);
  font-weight: 300;
}

.np-gal-swipe-hand {
  display: inline-block;
  animation: np-gal-swipe-anim 2.5s ease-in-out infinite;
}

@keyframes np-gal-swipe-anim {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-6px) rotate(-8deg); }
  40% { transform: translateX(12px) rotate(5deg); }
  60% { transform: translateX(12px) rotate(5deg); }
  80% { transform: translateX(0) rotate(0deg); }
}

/* Counter */
.np-gal-mob-cnt {
  text-align: center; margin-top: 12px;
  font-family: 'Lora', serif;
  font-size: 13px; color: rgba(15,14,12,0.3); letter-spacing: 2px;
}
.np-gal-mob-cnt strong { font-weight: 400; color: var(--np-warm); font-size: 18px; }

/* CTA */
.np-gal-mob-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 20px 24px 0; padding: 16px;
  border-radius: 14px; background: var(--np-dark); color: var(--np-cream);
  font-family: 'Golos Text', sans-serif;
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: all 0.3s ease;
}
.np-gal-mob-cta:hover { background: var(--np-warm); }
.np-gal-mob-cta svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }


/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes np-wipe {
  0% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 100%); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 960px) {
  .np-gal-head { display: none !important; }
  .np-gal-dk { display: none !important; }
  .np-gal-mini { display: none !important; }
  .np-gal-mob { display: flex !important; }
}
@media (min-width: 961px) {
  .np-gal-mob { display: none !important; }
}
@media (min-width: 1600px) {
  .np-gal { max-width: 80%; }
}
@media (min-width: 961px) and (max-width: 1200px) {
  .np-gal-head { padding: 36px 32px 20px; }
  .np-gal-h { font-size: 42px; }
  .np-gal-dk { grid-template-columns: 280px 1fr; }
  .np-gal-left { padding: 16px 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .np-gal-slide img { transition: none !important; }
  .np-gal-slide.leaving { animation: none !important; opacity: 0; }
  .np-gal-scard { transition-duration: 0.1s !important; }
  .np-gal-prog { transition: none !important; }
}
