/* ============================================
   GALLERY — gallery.css
   Layout: full-viewport pieces, image left
   description right, alternating on reverse
   ============================================ */

/* ── Page setup ──────────────────────────── */
.gallery-page {
  background: var(--cream);
}

/* Nav: starts transparent over gallery header, 
   gains background on scroll (handled by JS) */
.nav--transparent {
  background: transparent;
  border-bottom-color: transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav--scrolled {
  background: rgba(245, 240, 232, 0.92) !important;
  border-bottom-color: rgba(107, 79, 58, 0.12) !important;
  backdrop-filter: blur(8px);
}

/* ── Gallery header ──────────────────────── */
.gallery-header {
  height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gap);
  border-bottom: 1px solid var(--cream-dark);
  position: relative;
}

.gallery-header__index {
  align-self: end;
  padding-bottom: 2rem;
}

.gallery-counter {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.3s ease;
}

.gallery-header__title {
  text-align: center;
}

.gallery-header__title h1 {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 14rem);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.gallery-header__hint {
  align-self: start;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* ── Work piece ──────────────────────────── */
.work {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
  border-bottom: 1px solid var(--cream-dark);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.work.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Alternating layout */
.work--reverse {
  direction: rtl;
}
.work--reverse > * {
  direction: ltr;
}

/* Image side */
.work__canvas {
  position: relative;
  overflow: hidden;
}

.work__img {
  position: absolute;
  inset: 0;
  transition: transform 0.8s ease;
}

.work:hover .work__img {
  transform: scale(1.03);
}

/* Placeholder gradients — replace with <img> tags */
.work__img--1 {
  background: linear-gradient(145deg, #7a9e7e 0%, #3a5a40 50%, #2d4a33 100%);
}
.work__img--2 {
  background: linear-gradient(155deg, #c4a882 0%, #8a6040 40%, #6b4f3a 100%);
}
.work__img--3 {
  background: linear-gradient(135deg, #a8c4a2 0%, #6b9e70 50%, #4a7c55 100%);
}
.work__img--4 {
  background: linear-gradient(160deg, #d4b896 0%, #a07850 40%, #7a5530 100%);
}
.work__img--5 {
  background: linear-gradient(140deg, #8faa8b 0%, #5a8a60 45%, #3a5a40 100%);
}
.work__img--6 {
  background: linear-gradient(150deg, #b8956a 0%, #8a6040 35%, #5a3a20 100%);
}

/* Meta / description side */
.work__meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 5vw, 4.5rem);
  border-left: 1px solid var(--cream-dark);
}

.work--reverse .work__meta {
  border-left: none;
  border-right: 1px solid var(--cream-dark);
}

.work__number {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-family: var(--font-sans);
}

.work__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  padding: 2rem 0;
}

.work__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.work__medium {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown-light);
}

.work__year {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.work__rule {
  width: 32px;
  height: 1px;
  background: var(--cream-dark);
  margin: 1.5rem 0;
}

.work__desc {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--muted);
  max-width: 38ch;
  font-weight: 300;
}

.work__dims {
  margin-top: 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dark);
  /* lighter — just a whisper of info */
  filter: contrast(0.6);
}

.work__enquire {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, gap 0.25s;
  width: fit-content;
}

.work__enquire:hover {
  border-color: var(--green);
  gap: 0.7rem;
}

/* ── Scrolling counter update ────────────── */
/* Handled by JS — .gallery-counter text updates
   as each work enters the viewport            */

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  .gallery-header__title h1 {
    font-size: clamp(4rem, 22vw, 7rem);
  }

  .work {
    grid-template-columns: 1fr;
    grid-template-rows: 55svh auto;
    min-height: unset;
  }

  .work--reverse {
    direction: ltr;
  }

  .work__canvas {
    min-height: 55svh;
  }

  .work__meta {
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid var(--cream-dark);
    padding: 2.5rem var(--gap);
    min-height: unset;
  }

  .work__desc {
    max-width: 100%;
  }
}
