/* ============================================================
   Mr Cow Studio — Project Portfolio Stylesheet
   Dark gallery island, embedded in the cream brand theme.
   ============================================================ */

/* ---------- Page-level body class ----------
   Keep the surrounding background cream (from style.css)
   so the dark gallery reads as an intentional section. */
.page-projects {
  background: var(--background, #F7F3EE);
}

.page-projects #main {
  scroll-margin-top: 100px;
}

/* ---------- Gallery section (full-width dark) ---------- */
.gallery-page {
  padding: 60px 24px 100px;
  background-color: #050505;
  color: #fff;
}

.gallery-page > * {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Gallery hero (H1 block) ---------- */
.gallery-hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 48px;
}

.gallery-hero .breadcrumbs {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 22px;
}

.gallery-hero .breadcrumbs a {
  color: #d4af37;
  text-decoration: none;
}

.gallery-hero .breadcrumbs a:hover {
  text-decoration: underline;
}

.gallery-hero .breadcrumbs span {
  margin: 0 10px;
  color: rgba(212, 175, 55, 0.4);
}

.gallery-hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4af37;
  margin-bottom: 14px;
}

.gallery-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 20px;
}

.gallery-hero h1 em {
  color: #d4af37;
  font-style: italic;
}

.gallery-hero .lede {
  color: #c0c0c0;
  font-size: 16px;
  line-height: 1.75;
  max-width: 680px;
  margin: 0 auto;
}

/* ---------- Filter Nav ---------- */
.filter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 36px;
  padding: 0 4px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #d4af37;
  color: #d4af37;
  padding: 8px 16px;
  min-height: 36px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
  border-radius: 4px;
}

.filter-btn:hover,
.filter-btn.active {
  background: #d4af37;
  color: #000;
  font-weight: 600;
}

/* ---------- Gallery Grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  grid-auto-rows: 360px;
  grid-auto-flow: dense;
  gap: 18px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  display: block;
  transition: opacity 0.5s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
  filter: brightness(0.6);
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85) 55%, rgba(0,0,0,0.95));
  opacity: 1;
  transform: translateY(0);
  transition: background 0.35s ease, transform 0.35s ease, padding 0.35s ease;
}

.gallery-item:hover .overlay,
.gallery-item:focus-within .overlay {
  background: linear-gradient(transparent, rgba(0,0,0,0.92) 35%, rgba(0,0,0,0.98));
  padding-bottom: 28px;
}

.overlay h3 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 600;
  color: #d4af37;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.overlay p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #d0d0d0;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tall { grid-row: span 2; }
.big  { grid-column: span 2; grid-row: span 2; }

/* ---------- Modal (lightbox) ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.modal-content {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

.close {
  position: absolute;
  top: 16px;
  right: 22px;
  color: white;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  z-index: 2;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 24px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
}

.nav-btn:hover {
  background: rgba(212, 175, 55, 0.85);
  color: #000;
}

.prev { left: 16px; }
.next { right: 16px; }

/* ---------- CTA band between gallery and footer ---------- */
.projects-cta {
  padding: 80px 0;
}

.projects-cta__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px;
  background: var(--cream, #EFE8DF);
  border: 1px solid var(--border, #DDD5CA);
  border-radius: var(--radius-lg, 24px);
}

.projects-cta__title {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--dark, #2D2926);
  font-weight: 600;
  line-height: 1.1;
  margin: 12px 0 18px;
}

.projects-cta__text {
  color: var(--text-muted, #7A746E);
  font-size: 16px;
  line-height: 1.75;
  max-width: 560px;
}

.projects-cta__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-self: end;
  min-width: 240px;
}

.projects-cta__actions .btn {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 320px;
  }
}

/* Small tablet / large phone */
@media (max-width: 800px) {
  .gallery-page {
    padding: 40px 16px 70px;
  }

  .gallery-hero {
    margin-bottom: 32px;
  }

  .gallery-hero h1 {
    font-size: clamp(28px, 8vw, 42px);
  }

  .gallery-hero .lede {
    font-size: 15px;
  }

  /* Filter nav: wrap so every style tag is visible at once */
  .filter-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 28px;
    padding: 0;
  }

  .filter-btn {
    font-size: 11.5px;
    padding: 7px 12px;
    min-height: 34px;
    letter-spacing: 0.04em;
  }

  /* Gallery: single column, looser rows for image proportions */
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
  }

  .gallery-item {
    aspect-ratio: 4 / 3;
  }

  .tall, .big {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Overlay always-on (no hover on touch) — solid bar so it never reads as hidden */
  .overlay {
    opacity: 1 !important;
    background: rgba(5, 5, 5, 0.92);
    padding: 16px 18px;
    border-top: 1px solid rgba(212, 175, 55, 0.45);
  }

  .overlay h3 {
    font-size: 1.2rem;
    color: #d4af37;
    text-shadow: none;
    line-height: 1.2;
    display: block;
  }

  .overlay p {
    display: block !important;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #f5f5f5;
    text-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 6px;
  }

  /* CTA stacks */
  .projects-cta {
    padding: 48px 0;
  }

  .projects-cta__inner {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 24px;
    border-radius: var(--radius-md, 16px);
  }

  .projects-cta__actions {
    justify-self: stretch;
    min-width: 0;
  }

  /* Modal: tighter close + nav buttons */
  .close {
    top: 10px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .nav-btn {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .prev { left: 8px; }
  .next { right: 8px; }
}

/* Small phones */
@media (max-width: 420px) {
  .gallery-page {
    padding: 32px 12px 60px;
  }

  .gallery-hero h1 {
    font-size: 28px;
  }

  .gallery-hero .breadcrumbs {
    font-size: 11px;
    margin-bottom: 16px;
  }

  .gallery-hero .eyebrow {
    font-size: 11px;
  }

  .filter-btn {
    font-size: 11px;
    padding: 8px 12px;
  }

  .projects-cta__inner {
    padding: 24px 18px;
  }
}
