/* ============================================================
   WORK GALLERY PAGE — work.css
   Extends style.css + mobile.css — no token duplication.
   ============================================================ */

/* ── WORK HERO ──────────────────────────────────────────────
   Split-screen editorial: cobalt left panel (photo cluster)
   + cream right panel (big title + sub-copy).
   Mirrors the about-hero split for visual continuity.
──────────────────────────────────────────────────────────── */
.work-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport — excludes mobile/tablet browser chrome */
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  background: var(--navy);
}

/* LEFT — photo mosaic panel */
.work-hero-left {
  position: relative;
  overflow: hidden;
  background: var(--cobalt);
  border-radius: 0 clamp(20px, 2.2vw, 36px) clamp(20px, 2.2vw, 36px) 0;
}

.work-hero-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 55% 45%;
  gap: 3px;
  will-change: transform;
}

.work-hero-mosaic-item {
  overflow: hidden;
  position: relative;
  border-radius: clamp(8px, 1vw, 14px);
}

.work-hero-mosaic-item img {
  width: 100%;
  height: 120%; /* extra buffer for parallax travel */
  margin-top: -10%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: grayscale(1) brightness(0.88) sepia(1) hue-rotate(185deg) saturate(4.5);
  transition: transform 0.8s var(--ease);
}

.work-hero-mosaic-item--wide {
  grid-column: 1 / 3;
  grid-row: 1;
}

.work-hero-mosaic-item--tall {
  grid-row: 2;
}

/* Cobalt overlay tints the mosaic */
.work-hero-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 49, 163, 0.35);
  pointer-events: none;
  z-index: 1;
}

/* Project count badge */
.work-hero-badge {
  position: absolute;
  bottom: clamp(28px, 3.5vw, 48px);
  left: clamp(28px, 3.5vw, 48px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-hero-badge-num {
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 100px);
  font-weight: 300;
  font-style: italic;
  color: var(--white);
  line-height: 0.85;
  letter-spacing: -0.03em;
}

.work-hero-badge-label {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* RIGHT — editorial text panel */
.work-hero-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(80px, 9vw, 120px) clamp(36px, 5vw, 72px) clamp(48px, 6vw, 72px);
  background: var(--navy);
  position: relative;
  overflow: visible;
}

.work-hero-eyebrow {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: clamp(20px, 3vw, 40px);
}

.work-hero-title {
  font-family: var(--display);
  font-size: clamp(80px, 14vw, 220px);
  font-weight: 300;
  font-style: italic;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--white);
  overflow: visible;
  white-space: nowrap;
  margin-bottom: clamp(20px, 3vw, 36px);
}

/* "WORK." — bold sans, cyan, matches homepage hero sans line */
.work-hero-title em {
  font-family: var(--body);
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: block;
  color: var(--cyan);
}

.work-hero-sub {
  font-family: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.5);
  max-width: 340px;
  padding-top: clamp(20px, 2.5vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ── FILTER BAR ──────────────────────────────────────────────
   Sticky white/cream pill row that filters the project list.
──────────────────────────────────────────────────────────── */
.work-filter {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--gutter);
}

.work-filter-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}

.work-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.work-filter-pills::-webkit-scrollbar { display: none; }

.work-filter-pill {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}

.work-filter-pill:hover {
  color: var(--cobalt);
  border-color: var(--cobalt);
}

.work-filter-pill.active {
  color: var(--white);
  background: var(--cobalt);
  border-color: var(--cobalt);
}

.work-filter-count {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── PROJECT CARDS ───────────────────────────────────────────
   Large editorial spreads. Each is a chapter of the page.
   Alternating image-left / image-right layout.
──────────────────────────────────────────────────────────── */
.work-projects {
  background: var(--white);
}

.work-project {
  border-top: 1px solid var(--border);
  padding: clamp(64px, 9vw, 140px) var(--gutter);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  overflow: hidden;
}

.work-project.hidden {
  display: none;
}

.work-project-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

/* Flip even projects: images left, text right becomes text left, images right */
.work-project--flip .work-project-inner {
  direction: rtl;
}

.work-project--flip .work-project-info,
.work-project--flip .work-project-images {
  direction: ltr;
}

/* ── Project info column ── */
.work-project-info {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 24px);
}

.work-project-num {
  font-family: var(--display);
  font-size: clamp(80px, 12vw, 180px);
  font-weight: 300;
  font-style: italic;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--border);
  display: block;
  margin-bottom: clamp(-24px, -2vw, -12px); /* overlap with title for depth */
  user-select: none;
}

.work-project-title {
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 104px);
  font-weight: 400;
  font-style: italic;
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--navy);
  position: relative;
  z-index: 1;
}

.work-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.work-project-tag {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cobalt);
  background: rgba(0, 49, 163, 0.07);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
}

.work-project-desc {
  font-family: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--navy);
  opacity: 0.6;
  max-width: 420px;
}

.work-project-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--cobalt);
  width: fit-content;
  transition: gap 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.work-project-cta:hover {
  gap: 16px;
  color: var(--navy);
  border-color: var(--navy);
}

.work-project-cta svg {
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}

.work-project-cta:hover svg {
  transform: translateX(4px);
}

/* ── Project images column ── */
.work-project-images {
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(10px, 1.2vw, 16px);
  position: relative;
}

.work-project-img-primary {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
}

.work-project-img-primary img {
  width: 100%;
  height: 120%; /* extra height for parallax travel */
  object-fit: cover;
  object-position: center;
  display: block;
  margin-top: -10%;
  will-change: transform;
}

.work-project-img-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.2vw, 16px);
}

.work-project-img-sm {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
}

.work-project-img-sm img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin-top: -10%;
  will-change: transform;
}

/* Hover: subtle image scale */
.work-project-img-primary:hover img,
.work-project-img-sm:hover img {
  transform: scale(1.04) !important;
  transition: transform 0.75s var(--ease) !important;
}

/* ── COMING SOON TEASER ──────────────────────────────────────
   Placeholder card for future projects — keeps the grid
   feeling full without showing empty slots.
──────────────────────────────────────────────────────────── */
.work-more {
  background: var(--light-blue);
  border-top: 1px solid var(--border);
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  text-align: center;
}

.work-more-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2vw, 24px);
}

.work-more-eyebrow {
  font-family: var(--body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cobalt);
}

.work-more-headline {
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.work-more-sub {
  font-family: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--grey);
  max-width: 420px;
}

/* ── CTA BACKGROUND PARALLAX ─────────────────────────────────
   Matches the about page CTA exactly — portrait image drifts
   behind the navy + dot pattern on scroll.
──────────────────────────────────────────────────────────── */
.cta-bg-parallax {
  position: absolute;
  inset: -20% 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.cta-bg-parallax img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.5;
  display: block;
}

/* ── TABLET ──────────────────────────────────────────────────
   769px–1100px — keep 2-col layout but tighten the hero so
   all text stays within the visible viewport. The big title
   font + default padding could push the sub-description below
   the fold on iPad landscape/portrait when browser chrome is
   visible (100dvh addresses that, but font reduction ensures
   comfort at every tablet size).
──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) and (min-width: 769px) {
  .work-hero-title {
    font-size: clamp(56px, 10vw, 110px);
    white-space: normal;
  }

  .work-hero-right {
    padding-top: clamp(56px, 7vw, 90px);
    padding-bottom: clamp(32px, 4.5vw, 56px);
    justify-content: center;
  }
}

/* ── MOBILE ──────────────────────────────────────────────────
   Below 768px — stack hero, full-width images, single column.
──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Hero — stack panels */
  .work-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .work-hero-left {
    min-height: 65vw;
    border-radius: 0 0 clamp(16px, 4vw, 28px) clamp(16px, 4vw, 28px);
  }

  /* 2-column side-by-side on mobile — BrandHero left, Casita Verde right */
  .work-hero-mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 100%;
  }

  /* Reset wide item to left column, single row */
  .work-hero-mosaic-item--wide {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  /* Reset tall items to same single row */
  .work-hero-mosaic-item--tall {
    grid-row: 1;
  }

  /* Hide the third image on mobile — two is enough */
  .work-hero-mosaic-item--tall:last-child {
    display: none;
  }

  .work-hero-badge {
    bottom: 20px;
    left: 20px;
  }

  .work-hero-badge-num { font-size: clamp(36px, 12vw, 64px); }

  .work-hero-right {
    padding: clamp(36px, 6vw, 56px) 20px clamp(40px, 6vw, 56px);
    justify-content: flex-start;
  }

  .work-hero-title {
    font-size: clamp(64px, 18vw, 120px);
    white-space: normal;
  }

  .work-hero-sub { max-width: 100%; }

  /* Filter */
  .work-filter-inner { height: 48px; }
  .work-filter-count { display: none; }

  /* Project cards — single column */
  .work-project { padding: clamp(40px, 7vw, 64px) 20px; }

  .work-project-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Reset flip on mobile */
  .work-project--flip .work-project-inner { direction: ltr; }

  /* Images come first on mobile */
  .work-project-images { order: -1; }

  .work-project-num {
    font-size: clamp(56px, 18vw, 100px);
    margin-bottom: -8px;
  }

  .work-project-title { font-size: clamp(40px, 12vw, 72px); }

  .work-project-img-primary { aspect-ratio: 16/9; }

  /* More section */
  .work-more { padding: clamp(48px, 8vw, 80px) 20px; }
}

@media (max-width: 480px) {
  .work-project-img-strip { grid-template-columns: 1fr 1fr; }
  .work-project-img-sm { aspect-ratio: 3/4; }
}
