/* ============================================================
   proyecto.css — Estilos para páginas individuales de proyecto
   Estética coherente con el portfolio: Space Grotesk, misma paleta.
   Siempre en tema oscuro (momento 1): fondo negro, acento amarillo.
   ============================================================ */

/* ── Reset de variables: tema oscuro fijo ── */
.proyecto-page {
  --bg:          #080808;
  --text:        #e8e8e8;
  --text-dim:    rgba(232,232,232,0.90);
  --border:      rgba(232,232,232,0.18);
  --accent:      #D4E174;
  --accent-dim:  rgba(212,225,116,0.25);
  --muted:       rgb(115,115,115);
  --nav-bg:      rgba(8,8,8,0.95);
  --bg-overlay:  rgba(8,8,8,0.45);
  background: var(--bg);
  color: var(--text);
  cursor: none;
}

/* Logo en la página de proyecto —
   Se oculta el <img> (opacity:0) para mantener su espacio en el flex,
   y se dibuja el logo coloreado en ::before usando mask-image.
   Esto garantiza exactamente el mismo color que el SVG inline del index. */
.proyecto-page .nav__logo-link {
  position: relative; /* contexto para el ::before absoluto */
}

.proyecto-page .nav__logo-img {
  height: 32px;
  width: 32px;
  display: block;
  opacity: 0;       /* invisible pero ocupa el espacio en el layout */
  flex-shrink: 0;
}

.proyecto-page .nav__logo-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  width: 32px;
  background-color: var(--accent);        /* mismo var que en index.html */
  -webkit-mask: url(../images/logo.svg) no-repeat center / contain;
          mask: url(../images/logo.svg) no-repeat center / contain;
  pointer-events: none;
}

.proyecto-page .nav__logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);   /* usa la variable, no hardcode */
  line-height: 1;
}

/* Botón "volver" en navbar */
.nav__back-link {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 6px 18px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.nav__back-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   SLIDER
   ============================================================ */
.proyecto-slider {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 460px;
  overflow: hidden;
  background: #0d0d0d;
  margin-top: var(--nav-h, 64px);
}

.slider__track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slider__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Placeholder hasta que se reemplace por <img> real */
.slider__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 32px 40px;
}

.slider__placeholder-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(212,225,116,0.35);
  font-family: var(--font, 'Space Grotesk', sans-serif);
}

/* Imagen real dentro del slide */
.slider__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Botones prev / next */
.slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(8,8,8,0.55);
  border: 1px solid rgba(212,225,116,0.28);
  color: #D4E174;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  font-family: var(--font, 'Space Grotesk', sans-serif);
}
.slider__btn:hover {
  background: rgba(212,225,116,0.14);
  border-color: #D4E174;
  transform: translateY(-50%) scale(1.05);
}
.slider__btn--prev { left: 28px; }
.slider__btn--next { right: 28px; }

/* Dots */
.slider__dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slider__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: none;
  background: rgba(212,225,116,0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s;
}
.slider__dot.is-active {
  background: #D4E174;
  transform: scale(1.5);
}

/* Contador 01 / 04 */
.slider__counter {
  position: absolute;
  bottom: 24px;
  right: 32px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(212,225,116,0.40);
  z-index: 10;
  font-family: var(--font, 'Space Grotesk', sans-serif);
}

/* ============================================================
   ENCABEZADO DEL PROYECTO
   ============================================================ */
.proyecto-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 72px 80px 56px;
  border-bottom: 1px solid var(--border);
}

/* Wrap para título + subtítulo */
.proyecto-header__content {
  display: flex;
  flex-direction: column;
}

/* Acciones (ej: botón "Ver libro") */
.proyecto-header__actions {
  flex-shrink: 0;
  padding-bottom: 2px; /* alinea visualmente con el subtítulo */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Texto de aclaración debajo del botón de acción */
.proyecto-header__hint {
  margin-top: 8px;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.7;
  text-align: right;
}

/* Botón "Ver libro" / acción secundaria del header */
.proyecto-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font, 'Space Grotesk', sans-serif);
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  padding: 8px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.proyecto-pdf-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.proyecto-pdf-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.proyecto-nombre {
  font-size: clamp(3rem, 5.5vw, 6rem);
  font-weight: 700;
  line-height: 0.93;
  letter-spacing: -0.04em;
  color: var(--accent);
  margin-bottom: 24px;
}

.proyecto-subtitulo {
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   SECCIÓN DE INFORMACIÓN
   ============================================================ */
.proyecto-info {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  max-width: 1440px;
}

/* Columna principal (textos largos) */
.info-col-main {
  padding: 80px 80px 80px 80px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* Columna lateral (diseñadores, propósito, tools) */
.info-col-side {
  padding: 80px 60px 80px 60px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Bloque de información individual */
.info-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-block__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.info-block__title {
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.08;
}

.info-block__text {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-dim);
}

.info-block__text p + p {
  margin-top: 1.1em;
}

/* Diseñadores */
.designers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.designer-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.designer-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.designer-role {
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Divisor lateral */
.info-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Tools — reutiliza .tag de styles.css */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   SECCIÓN MEDIA — GALERÍA FADE + VIDEO
   Dos mitades iguales: izquierda galería automática, derecha video
   ============================================================ */
.proy-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 70vh;
  min-height: 500px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── Mitad izquierda: galería con fade en loop ── */
.proy-media__gallery {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  border-right: 1px solid var(--border);
}

/* Cada imagen ocupa toda la mitad, apilada */
.proy-gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  will-change: opacity;
}
.proy-gallery__img.is-active {
  opacity: 1;
}

/* Placeholder visible cuando no hay fotos cargadas */
.proy-gallery__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232,232,232,0.08);
  pointer-events: none;
  z-index: 0;
}

/* ── Mitad derecha: video ── */
.proy-media__video {
  position: relative;
  overflow: hidden;
  background: #000;
}

/* Video único o ítem de secuencia — ocupa todo el espacio */
.proy-media__video video,
.proy-video__item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Secuencia de videos con fade: oculto por defecto */
.proy-video__item {
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}
.proy-video__item.is-active {
  opacity: 1;
}

/* YouTube / Vimeo iframe — ligeramente sobredimensionado
   para ocultar barras de UI que algunos embeds insertan */
.proy-media__video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: 110%;
  transform: translate(-50%, -50%);
  border: none;
  pointer-events: none;
}

/* Placeholder video vacío */
.proy-video__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080808;
}
/* Ícono círculo + triángulo play */
.proy-video__placeholder::after {
  content: '';
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(212,225,116,0.18);
  box-shadow: 0 0 32px rgba(212,225,116,0.04);
}

/* Galería dual (dos columnas de fotos, sin video)
   La columna derecha no necesita borde exterior */
.proy-media--dual .proy-media__gallery:last-child {
  border-right: none;
}

/* ── Panel derecho web: GIF estático + botón "Ver web" ── */
.proy-media__web {
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
}

.proy-web__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font, 'Space Grotesk', sans-serif);
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  padding: 14px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
  align-self: flex-end;
  margin: 24px 24px 0;
}
.proy-web__btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.proy-web__btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.proy-web__gif {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .proy-media {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .proy-media__gallery {
    height: 60vw;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .proy-media__video {
    height: 56vw;
  }
}

/* ============================================================
   NAVEGACIÓN DE PIE DE PÁGINA
   Izquierda: volver al inicio · Derecha: siguiente proyecto
   ============================================================ */
.proyecto-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 56px 80px 96px;
  border-top: 1px solid var(--border);
}

.proyecto-footer-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.proyecto-footer-nav__link:hover { color: var(--accent); }

.proyecto-footer-nav__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.proyecto-footer-nav__link--back:hover svg  { transform: translateX(-4px); }
.proyecto-footer-nav__link--next:hover svg  { transform: translateX( 4px); }

/* ============================================================
   MODAL VISOR DE PDF
   ============================================================ */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8,8,8,0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.pdf-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Barra superior del modal */
.pdf-modal__bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

/* Botón cerrar */
.pdf-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font, 'Space Grotesk', sans-serif);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.pdf-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Iframe del PDF — ocupa toda la altura restante */
.pdf-modal__frame {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: #111;
}

/* Tapa el logo/marca de Heyzine en la esquina inferior del iframe */
.pdf-modal__heyzine-cover {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 110px;
  height: 36px;
  background: #111;
  z-index: 10;
  pointer-events: none;
}

/* ── Flipbook en mobile: iframe ocupa ancho completo, altura proporcional ── */
@media (max-width: 768px) {
  .pdf-modal {
    flex-direction: column;
  }
  .pdf-modal__frame {
    flex: none;
    width: 100vw;
    height: calc(100vw * 0.65); /* proporción landscape del flipbook */
    min-height: 260px;
  }
  /* En mobile, cubrir el logo de Heyzine abajo a la derecha */
  .pdf-modal__heyzine-cover {
    width: 90px;
    height: 30px;
  }
}

/* ============================================================
   MODAL VISOR DE VIDEO (Ver corto / Ver video)
   ============================================================ */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8,8,8,0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal__bar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.video-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font, 'Space Grotesk', sans-serif);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.video-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.video-modal__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

/* El video ocupa todo el espacio disponible manteniendo su aspect ratio */
.video-modal__player {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  outline: none;
  display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .proyecto-info {
    grid-template-columns: 1fr 300px;
  }
  .info-col-main { padding: 60px; }
  .info-col-side { padding: 60px 40px; }
}

@media (max-width: 768px) {
  .proyecto-slider {
    height: 55vw;
    min-height: 280px;
  }

  .slider__btn { width: 36px; height: 36px; font-size: 0.85rem; }
  .slider__btn--prev { left: 12px; }
  .slider__btn--next { right: 12px; }
  .slider__counter { right: 16px; bottom: 16px; }

  .proyecto-header {
    padding: 40px 24px 36px;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  /* Botón de acción (Ver libro / Ver sala / etc.) alineado a la derecha en mobile */
  .proyecto-header__actions {
    align-self: flex-end;
  }

  .proyecto-info {
    grid-template-columns: 1fr;
  }

  .info-col-main {
    padding: 48px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 48px;
  }

  .info-col-side {
    padding: 48px 24px;
  }

  /* Navegación pie de página: siempre en la misma fila, cada link ocupa su mitad */
  .proyecto-footer-nav {
    padding: 48px 24px 72px;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .proyecto-footer-nav__link { flex: 1; }
  .proyecto-footer-nav__link--next { justify-content: flex-end; }
}

@media (max-width: 480px) {
  .proyecto-nombre {
    font-size: clamp(2.4rem, 10vw, 3.5rem);
  }
}
