/* ═══════════════════════════════════════════════
   GALLERY — style.css
   BrightShine Co. · Light mode aesthetic
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
  --bg:         #F8F6F2;
  --bg-alt:     #FFFFFF;
  --ink:        #111111;
  --ink-mid:    #555550;
  --ink-faint:  #999990;
  --border:     rgba(0,0,0,0.08);
  --accent:     #0077ff;
  --accent-lt:  #00c6ff;
  --charcoal:   #1C1C1C;
  --warm-white: #FDFCF9;
  --radius:     3px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: var(--warm-white) var(--charcoal);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
.gallery-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #111;
}

/* ── Parallax layers ──
   JS handles transform, CSS just positions them */
.parallax {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 100%;
  height: 110%; /* slightly taller so parallax never exposes edges */
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  display: block;
}

.layer1 { z-index: 1; }
.layer2 { z-index: 2; }
.layer3 { z-index: 3; }

/* ── Fade-in for layer2, layer3 (couch, coffee table) ── */
.fadeIn {
  opacity: 0;
  animation: heroFadeIn 1.1s ease forwards;
}
.layer2.fadeIn { animation-delay: 0.25s; }
.layer3.fadeIn { animation-delay: 0.55s; }

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Dark gradient over hero image ── */
.gallery-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,0.08) 0%,
    rgba(0,0,0,0.4)  55%,
    rgba(0,0,0,0.65) 100%
  );
  z-index: 4;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   HERO TITLE
═══════════════════════════════════════════════ */
.gallery-hero-title-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 5;
  text-align: center;
  width: min(680px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  /* JS will animate transform on scroll */
}

/* slide instruction row */
.gallery-hero-title-1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  line-height: 1;
}
.gallery-hero-title-1 svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* main headline */
.gallery-hero-title-2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
  font-weight: 300;
  color: var(--warm-white);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* description */
.gallery-hero-title-3 {
  font-size: 0.82rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.48);
  max-width: 500px;
}

/* ── Staggered fade-down for title elements ── */
.fadeDown {
  opacity: 0;
  animation: heroFadeDown 0.8s ease forwards;
}
.gallery-hero-title-1.fadeDown { animation-delay: 0.45s; }
.gallery-hero-title-2.fadeDown { animation-delay: 0.65s; }
.gallery-hero-title-3.fadeDown { animation-delay: 0.85s; }

@keyframes heroFadeDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   HERO STATS STRIP
═══════════════════════════════════════════════ */
.gallery-hero-details-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.gallery-hero-details-container > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 30px 16px;
  border-right: 1px solid rgba(255,255,255,0.07);
  background: rgba(10,10,10,0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}
.gallery-hero-details-container > div:last-child {
  border-right: none;
}

/* icon wrapper inside each detail */
.gallery-hero-details-container > div > div {
  margin-bottom: 6px;
}

.gallery-hero-details-container h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 300;
  color: var(--warm-white);
  line-height: 1;
}

.gallery-hero-details-container p {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin-top: 2px;
}

/* stagger the detail fades */
.detail1.fadeIn { animation-delay: 0.9s; }
.detail2.fadeIn { animation-delay: 1.05s; }
.detail3.fadeIn { animation-delay: 1.2s; }
.detail4.fadeIn { animation-delay: 1.35s; }

/* ═══════════════════════════════════════════════
   PORTFOLIO SECTION
═══════════════════════════════════════════════ */
.portfolio-container {
  background: var(--bg);
  padding: 110px 0 130px;
}

/* ── Section header ── */
.portfolio-header {
  max-width: 1400px;
  margin: 0 auto 56px;
  padding: 0 8%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 60px;
  row-gap: 0;
}

/* subtitle line */
.portfolio-subtitle {
  grid-column: 1 / 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.portfolio-subtitle::before {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.portfolio-subtitle p {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* main title */
.portfolio-title {
  grid-column: 1 / 2;
  grid-row: 2;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.15;
}

/* description */
.portfolio-description {
  grid-column: 2 / 3;
  grid-row: 2;
  align-self: end;
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--ink-mid);
  padding-bottom: 2px;
}

/* filter row */
.portfolio-filter {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

/* ── Filter pills ── */
.portfolio-filter-container {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.portfolio-filter-li {
  padding: 9px 22px;
  border: 1px solid var(--accent);
  border-radius: 9999px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  background: #fff0;
  transition: border-color 0.22s ease, color 0.22s ease, background 0.22s ease;
  user-select: none;
}
.portfolio-filter-li:hover {
  background: rgba(0, 119, 255, 0.15);
  color: var(--accent);
}
.portfolio-filter-active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--warm-white) !important;
}

/* ── Show counter ── */
.showCounterContainer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 8% 18px;
}
.showCounter {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ═══════════════════════════════════════════════
   PHOTO GRID
═══════════════════════════════════════════════ */
.portfolio-image-container {
  max-width: 1400px;
  margin: 0 auto;
}

.portfolio-image-wrapper {
  padding: 0 8%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

/* ═══════════════════════════════════════════════
   PHOTO CARD
═══════════════════════════════════════════════ */
.photo-card {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.photo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.1);
  border-color: rgba(0,119,255,0.18);
}

/* ═══════════════════════════════════════════════
   BEFORE / AFTER SLIDER
═══════════════════════════════════════════════ */
.photo-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: col-resize;
  background: #ddd;
  --position: 50%;
}

.photos {
  position: relative;
  width: 100%;
  height: 100%;
}

/* both images fill the container */
.image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-before { z-index: 1; }

/* after image clips from the right — JS updates clip-path */
.image-after {
    z-index: 2;
    width: 100%;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

/* invisible range input covers the whole container */
.slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: col-resize;
  z-index: 10;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  padding: 0;
}

/* divider line — JS sets left % */
.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 2px;
  background: rgba(255,255,255,0.92);
  transform: translateX(-50%);
  z-index: 8;
  pointer-events: none;
  will-change: left;
  box-shadow: 0 0 6px rgba(0,0,0,0.28);
}

/* handle knob — JS sets left % */
.slider-handle {
  position: absolute;
  top: 50%;
  left: var(--position);
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--warm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  pointer-events: none;
  will-change: left;
  box-shadow: 0 2px 14px rgba(0,0,0,0.22);
  transition: transform 0.15s ease;
}
.photo-container:active .slider-handle {
  transform: translate(-50%, -50%) scale(1.1);
}
.slider-handle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Before / After label pills ── */
.ba-label {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 7;
  pointer-events: none;
}
.ba-label span {
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 2px;
}

/* ── Card info footer ── */
.photo-card-bottom {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.photo-label {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.photo-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .portfolio-image-wrapper {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .gallery-hero-details-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-hero-details-container > div {
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  .portfolio-header {
    grid-template-columns: 1fr;
    padding: 0 6%;
  }
  .portfolio-subtitle,
  .portfolio-title,
  .portfolio-description,
  .portfolio-filter {
    grid-column: 1 / 2;
    grid-row: auto;
  }
  .portfolio-description { margin-top: 14px; }

  .portfolio-image-wrapper {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 6%;
  }
  .showCounterContainer { padding-left: 6%; padding-right: 6%; }
}

@media (max-width: 600px) {
  .gallery-hero-title-2 { font-size: 2rem; }

  .gallery-hero-details-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-image-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .portfolio-filter-li {
    padding: 7px 14px;
    font-size: 0.65rem;
  }
}

@media (max-width: 400px) {
  .portfolio-image-wrapper {
    grid-template-columns: 1fr;
  }
}