/* ═══════════════════════════════════════════════════════════════════════════
   NEXUM GALLERY v7 — Project Grid with Hover Reveal
   Grid editorial · hover overlay · luxury automotive
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── SECTION ─────────────────────────────────────────────────────────────── */
#galeria {
  background: #f2f2f0;
  padding: 0 0 5rem;
  overflow: hidden;
}

#galeria .gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 5rem 5vw 3.5rem;
}

/* ── GRID CONTAINER ──────────────────────────────────────────────────────── */
.gallery-carousel {
  padding: 0 5vw;
}

.gc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(180px, 18vw, 280px);
  gap: 10px;
}

/* ── FEATURED ITEMS (span 2 cols or 2 rows) ──────────────────────────────── */
.gc-card:nth-child(1)  { grid-column: span 2; grid-row: span 2; } /* 1st: big */
.gc-card:nth-child(6)  { grid-column: span 2; }                   /* 6th: wide */
.gc-card:nth-child(9)  { grid-column: span 2; grid-row: span 2; } /* 9th: big */
.gc-card:nth-child(14) { grid-column: span 2; }                   /* 14th: wide */

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.gc-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #1a1a1a;
  border-radius: 3px;
}

/* Image */
.gc-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .7s cubic-bezier(.16,1,.3,1),
              filter .7s cubic-bezier(.16,1,.3,1);
  filter: brightness(.92) saturate(.85);
  will-change: transform;
}

.gc-card:hover img {
  transform: scale(1.07);
  filter: brightness(.7) saturate(.75);
}

/* ── HOVER OVERLAY ───────────────────────────────────────────────────────── */
.gc-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem 1.5rem;

  /* Base: barely-there gradient always visible at bottom */
  background: linear-gradient(
    to top,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.1)  35%,
    transparent     65%
  );

  /* Overlay grows on hover */
  transition: background .5s ease;
}

.gc-card:hover .gc-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,.88) 0%,
    rgba(0,0,0,.55) 50%,
    rgba(0,0,0,.15) 100%
  );
}

/* Red accent bar — slides in from left on hover */
.gc-card-overlay::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #c8101a;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}

.gc-card:hover .gc-card-overlay::before {
  transform: scaleY(1);
}

/* ── TEXT INSIDE OVERLAY ─────────────────────────────────────────────────── */
.gc-card-service {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #c8101a;
  margin-bottom: .5rem;

  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease .05s, transform .35s ease .05s;
}

.gc-card-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(15px, 1.6vw, 22px);
  font-weight: 400;
  color: #f2f2f0;
  line-height: 1.15;
  margin-bottom: .3rem;

  opacity: 0;
  transform: translateY(14px);
  transition: opacity .38s ease .1s, transform .38s ease .1s;
}

.gc-card-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .05em;
  color: rgba(242,242,240,.55);

  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease .16s, transform .35s ease .16s;
}

/* Reveal all text on hover */
.gc-card:hover .gc-card-service,
.gc-card:hover .gc-card-title,
.gc-card:hover .gc-card-sub {
  opacity: 1;
  transform: translateY(0);
}

/* Always show title on featured (larger) cards — subtitle/service on hover */
.gc-card:nth-child(1) .gc-card-title,
.gc-card:nth-child(9) .gc-card-title {
  opacity: .85;
  transform: translateY(0);
  font-size: clamp(20px, 2.4vw, 32px);
}

/* ── LIGHTBOX ─────────────────────────────────────────────────────────────── */
.gc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,7,7,.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  backdrop-filter: blur(6px);
}

.gc-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gc-lb-inner {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gc-lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.gc-lb-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.gc-lb-text {}

.gc-lb-service {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #c8101a;
  margin-bottom: .35rem;
  display: block;
}

.gc-lb-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 400;
  color: #f2f2f0;
  display: block;
  margin-bottom: .2rem;
}

.gc-lb-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: rgba(242,242,240,.45);
  display: block;
}

.gc-lb-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.gc-lb-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(242,242,240,.18);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #f2f2f0;
  transition: all .25s ease;
}

.gc-lb-btn:hover {
  background: #c8101a;
  border-color: #c8101a;
}

.gc-lb-btn svg {
  width: 15px; height: 15px;
  stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.gc-lb-counter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: .1em;
  color: rgba(242,242,240,.4);
  white-space: nowrap;
}

.gc-lb-counter span {
  font-size: 20px;
  color: #f2f2f0;
}

.gc-lb-close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(242,242,240,.18);
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(242,242,240,.6);
  transition: all .25s ease;
}

.gc-lb-close:hover {
  color: #f2f2f0;
  border-color: rgba(242,242,240,.5);
}

.gc-lb-close svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2;
  fill: none;
}

/* ── HIDE SOURCE TRACK ───────────────────────────────────────────────────── */
.gallery-track { display: none !important; }

/* ── TABLET ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .gc-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: clamp(160px, 20vw, 240px);
  }

  .gc-card:nth-child(9)  { grid-column: span 2; grid-row: span 1; }
  .gc-card:nth-child(14) { grid-column: span 1; }
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  #galeria .gallery-head {
    padding: 3.5rem 1.25rem 2.5rem;
  }

  .gallery-carousel {
    padding: 0 1.25rem;
  }

  .gc-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(130px, 28vw, 180px);
    gap: 6px;
  }

  /* Reset all spanning on small screens */
  .gc-card:nth-child(1),
  .gc-card:nth-child(6),
  .gc-card:nth-child(9),
  .gc-card:nth-child(14) {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Keep just the first one featured */
  .gc-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gc-card-title { font-size: 14px; }

  /* On mobile: always show title (no hover state on touch) */
  .gc-card-title,
  .gc-card-service {
    opacity: 1;
    transform: translateY(0);
  }

  .gc-lb-inner {
    max-width: 95vw;
    gap: .75rem;
  }

  .gc-lb-img { max-height: 60vh; }

  .gc-lb-caption {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ── SMALL MOBILE ────────────────────────────────────────────────────────── */
@media (max-width: 400px) {
  #galeria .gallery-head {
    padding: 3rem 1rem 2rem;
  }

  .gallery-carousel {
    padding: 0 1rem;
  }

  .gc-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: clamp(110px, 32vw, 150px);
    gap: 4px;
  }

  .gc-card:nth-child(1) {
    grid-column: span 2;
  }

  .gc-card-title { font-size: 12px; }
  .gc-card-service { font-size: 8px; }
}

/* ── REDUCED MOTION ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gc-card img,
  .gc-card-overlay,
  .gc-card-overlay::before,
  .gc-card-service,
  .gc-card-title,
  .gc-card-sub,
  .gc-lightbox { transition-duration: .01ms !important; }
}
