/* ═══════════════════════════════════════════════
   MAGA KITCHEN — proyectos.css
═══════════════════════════════════════════════ */

/* ── Nav active ── */
.nav-active { position: relative; }
.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1.5px;
  background: var(--red);
}

/* ══ HERO ══ */
.proy-hero {
  position: relative;
  height: 500px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.proy-hero-bg {
  position: absolute;
  inset: 0;
}

.proy-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.proy-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    rgba(0,0,0,.75) 0%,
    rgba(0,0,0,.35) 55%,
    rgba(0,0,0,.1) 100%);
}

.proy-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 40px 52px;
  max-width: 600px;
}

.proy-hero-h1 {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  line-height: 1.08;
  color: var(--white);
  margin-bottom: 14px;
}

.proy-hero-h1 em { color: var(--red); font-style: italic; }

.proy-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,.65);
  line-height: 1.7;
  max-width: 480px;
}

/* ══ DIFERENCIADORES ══ */
.difs-section {
  background: var(--black);
  padding: 0;
}

.difs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid #1a1a1a;
}

.dif-card {
  padding: 40px 32px;
  border-right: 1px solid #1a1a1a;
  transition: background .2s;
}

.dif-card:last-child { border-right: none; }
.dif-card:hover { background: #0a0a0a; }

.dif-icon {
  width: 48px;
  height: 48px;
  background: rgba(128,0,32,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  margin-bottom: 18px;
}

.dif-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--white);
  margin-bottom: 10px;
  font-weight: 500;
}

.dif-card p {
  font-size: 13px;
  color: rgba(255,255,255,.52);
  line-height: 1.7;
}

/* ══ GALERÍA ══ */
.galeria-section { background: var(--cream); }

.galeria-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.galeria-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Hereda .filter-btn de style.css */

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

/* Item base */
.galeria-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--light);
  aspect-ratio: 4 / 3;
}

/* Primera imagen más grande */
.galeria-item:first-child {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .45s ease;
}

.galeria-item:hover img { transform: scale(1.05); }

.galeria-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  padding: 28px 16px 14px;
  opacity: 0;
  transition: opacity .22s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.galeria-item:hover .galeria-overlay { opacity: 1; }

.galeria-overlay h4 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--white);
  font-weight: 400;
  line-height: 1.2;
}

.galeria-tag {
  font-size: 10px;
  font-family: 'DM Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.55);
}

/* Ocultar items filtrados */
.galeria-item.hidden {
  display: none;
}

/* ══ LIGHTBOX ══ */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.94);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.lb-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 501;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

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

.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 80px);
}

.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  display: block;
  transition: opacity .2s;
}

.lb-img.loading { opacity: 0; }

.lb-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  width: 100%;
}

.lb-counter {
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,.4);
  letter-spacing: 1px;
  white-space: nowrap;
}

.lb-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--white);
  font-weight: 400;
  flex: 1;
}

.lb-subtitle {
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: rgba(255,255,255,.45);
}

/* Botones nav */
.lb-nav {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--white);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
  align-self: center;
}

.lb-nav:hover { background: rgba(255,255,255,.16); }

/* Botón cerrar */
.lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--white);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 502;
  transition: background .2s;
}

.lb-close:hover { background: var(--red); border-color: var(--red); }

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET ≤900px
══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .proy-hero { height: 420px; }
  .proy-hero-h1 { font-size: 38px; }
  .proy-hero-content { padding: 0 24px 44px; }

  .difs-grid { grid-template-columns: 1fr 1fr; }
  .dif-card { border-right: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a; }
  .dif-card:nth-child(2n) { border-right: none; }
  .dif-card:nth-last-child(-n+2) { border-bottom: none; }

  .galeria-grid { grid-template-columns: 1fr 1fr; }
  .galeria-item:first-child { grid-column: span 2; }

  .lb-content { max-width: calc(100vw - 120px); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE ≤600px
══════════════════════════════════════════════ */
@media (max-width: 600px) {
  .proy-hero { height: 360px; }
  .proy-hero-h1 { font-size: 30px; }
  .proy-hero-content { padding: 0 20px 36px; }
  .proy-hero-sub { font-size: 14px; }

  .difs-grid { grid-template-columns: 1fr; }
  .dif-card { border-right: none; border-bottom: 1px solid #1a1a1a; padding: 28px 20px; }
  .dif-card:last-child { border-bottom: none; }

  .galeria-grid { grid-template-columns: 1fr; gap: 2px; }
  .galeria-item:first-child { grid-column: span 1; aspect-ratio: 4 / 3; }
  .galeria-overlay { opacity: 1; }

  .lightbox { padding: 12px; gap: 8px; }
  .lb-content { max-width: 100%; }
  .lb-nav { width: 36px; height: 36px; }
  .lb-info { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lb-title { font-size: 15px; }

  .nav { z-index: 401; }
}
