/* ─── PROJECT PAGES v2 — TWO PANEL, NO SCROLL ──────────────────────────── */


/* ─── NO-SCROLL DESKTOP ──────────────────────────────────────────────────── */

@media (min-width: 768px) {
  html, body { overflow: hidden; }
}


/* ─── PAGE: grid 60 / 40 ─────────────────────────────────────────────────── */

.project2-page {
  position: fixed;
  inset: 0;
  padding-top: 68px; /* clear fixed header */
  display: grid;
  grid-template-columns: 74fr 26fr;
  overflow: hidden;
  background: #080808;
}


/* ─── LEFT: MEDIA PANEL ──────────────────────────────────────────────────── */

.project2-media-panel {
  position: relative;
  background: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: var(--line-weight) solid rgba(255,255,255,.07);
}

/* Video — mantiene 16:9, nunca recorta */
.project2-video-wrap {
  width: 100%;
  max-width: calc((100vh - 68px) * 16 / 9);
  aspect-ratio: 16 / 9;
}

.project2-video-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* Slideshow — imagen completa, sin recorte */
.project2-slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.project2-slide.is-active { display: flex; }

.project2-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Slide arrows */
.project2-slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(8,8,8,.35);
  border: none;
  color: rgba(255,255,255,.4);
  padding: 20px 12px;
  cursor: none;
  transition: color .3s, background .3s, opacity .35s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project2-slide-btn:hover { color: rgba(255,255,255,.9); background: rgba(8,8,8,.6); }
.project2-slide-btn.is-hidden { opacity: 0; pointer-events: none; }
.project2-slide-prev { left: 0; }
.project2-slide-next { right: 0; }
.project2-slide-btn svg { display: block; width: 18px; height: 18px; }

/* Slide counter */
.project2-slide-counter {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .3em;
  color: rgba(255,255,255,.35);
  background: rgba(8,8,8,.5);
  padding: 5px 12px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}


/* ─── RIGHT: INFO PANEL ──────────────────────────────────────────────────── */

.project2-info-panel {
  display: flex;
  flex-direction: column;
  padding: 32px 48px 32px 44px;
  overflow: hidden;
}

/* Back */
.project2-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  align-self: flex-start;
  flex-shrink: 0;
  margin-bottom: 28px;
  transition: color .3s, gap .3s var(--ease-out);
}

.project2-back svg { width: 13px; height: 13px; flex-shrink: 0; transition: transform .3s var(--ease-out); }
.project2-back:hover { color: #fff; gap: 14px; }
.project2-back:hover svg { transform: translateX(-3px); }

/* Identity */
.project2-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.project2-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  border: var(--line-weight) solid rgba(255,255,255,.15);
  padding: 4px 10px;
}

.project2-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(26px, 2.56vw, 42px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.project2-client {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  flex-shrink: 0;
}

/* Divider */
.project2-divider {
  height: var(--line-weight);
  background: rgba(255,255,255,.08);
  margin: 24px 0;
  flex-shrink: 0;
}

/* Description */
.project2-desc {
  flex-shrink: 0;
  margin-bottom: 20px;
}

.project2-desc p {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: clamp(10px, 0.92vw, 13px);
  line-height: 1.32;
  color: rgba(255,255,255,.5);
  margin: 0 0 .8em;
}

.project2-desc p:last-child { margin-bottom: 0; }

/* Metadata */
.project2-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0; margin: 0;
  align-self: start;
  width: 100%;
}

.project2-meta-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 8px 0;
  border-bottom: var(--line-weight) solid rgba(255,255,255,.07);
}

.project2-meta-item:first-child { border-top: var(--line-weight) solid rgba(255,255,255,.07); }

.project2-meta dt {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
}

.project2-meta dd {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: rgba(255,255,255,.5);
  margin: 0;
}

/* Footer: share + prev/next */
.project2-panel-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: var(--line-weight) solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
}

/* Share */
.project2-share {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.project2-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  letter-spacing: 0;
  color: rgba(255,255,255,.35);
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px;
  cursor: none;
  transition: color .3s;
}

.project2-share-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.project2-share-btn:hover { color: #fff; }
.project2-share-btn.is-copied { color: rgba(255,255,255,.9); }

/* ─── COMPARE SLIDER ─────────────────────────────────────────────────────── */

.compare-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.compare-after,
.compare-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.compare-before {
  clip-path: inset(0 50% 0 0);
}

.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 0;
  z-index: 3;
  pointer-events: none;
}

.compare-line {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--line-weight);
  background: rgba(255,255,255,.75);
  transform: translateX(-50%);
}

.compare-grip {
  position: absolute;
  top: 50%; left: 0;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
}

.compare-grip svg {
  width: 14px; height: 14px;
  stroke: #080808;
  display: block;
}

.compare-label {
  position: absolute;
  top: 20px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  background: rgba(8,8,8,.55);
  padding: 5px 10px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.compare-label-before { left: 20px; }
.compare-label-after  { right: 20px; }


/* ─── LIGHTBOX ───────────────────────────────────────────────────────────── */

.project2-slide[data-type="image"] { cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

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

.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,8,8,.96);
  cursor: none;
}

.lightbox-close {
  position: absolute;
  top: 28px; right: 32px;
  z-index: 1;
  background: none;
  border: none;
  cursor: none;
  color: var(--color-white-dim);
  padding: 8px;
  transition: color .3s, transform .3s var(--ease-out);
}

.lightbox-close:hover { color: #fff; transform: rotate(90deg); }
.lightbox-close svg { width: 28px; height: 28px; display: block; }

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  transform: scale(.96);
  transition: transform .4s var(--ease-out);
  box-shadow: 0 40px 120px rgba(0,0,0,.8);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.is-open .lightbox-img { transform: scale(1); }

.lightbox.is-open .lightbox-img.is-zoomed { cursor: grab; }


/* ─── RESPONSIVE — TABLET (≤ 1024px) ────────────────────────────────────── */

@media (max-width: 1024px) {
  .project2-page { grid-template-columns: 55fr 45fr; }
  .project2-info-panel { padding: 28px 32px 28px 32px; }
}


/* ─── RESPONSIVE — MOBILE (≤ 767px) ─────────────────────────────────────── */

@media (max-width: 767px) {

  .project2-page {
    position: static;
    display: block;
    padding-top: 0;
    overflow: visible;
    height: auto;
  }

  /* Media: altura libre, crece según el slide activo */
  .project2-media-panel {
    height: auto;
    display: block;
    border-right: none;
    border-bottom: var(--line-weight) solid rgba(255,255,255,.07);
  }

  /* Slides normales: flujo natural, imagen al 100% del ancho */
  .project2-slide {
    position: relative;
    inset: auto;
    display: none;
  }

  .project2-slide.is-active { display: block; }

  .project2-slide img {
    width: 100%;
    height: auto;
    object-fit: initial;
  }

  /* Compare: after en flujo normal define la altura, before encima absolute */
  .project2-slide[data-type="compare"] .compare-wrap {
    height: auto;
  }

  .project2-slide[data-type="compare"] .compare-after {
    position: relative;
    inset: unset;
    display: block;
    width: 100%;
    height: auto;
    object-fit: initial;
  }

  .project2-slide[data-type="compare"] .compare-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .project2-video-wrap {
    max-width: 100%;
    width: 100%;
  }

  /* Info panel: normal flow */
  .project2-info-panel {
    padding: 24px 24px 48px;
    overflow: visible;
  }

  .project2-meta { flex: none; }

  .project2-panel-footer { margin-top: 28px; }

  .project2-slide-btn { cursor: pointer; }
  .project2-share-btn { cursor: pointer; }
}
