/* ==========================================================================
   PROYECTOS: ÍNDICE EDITORIAL CON PREVIEW FLOTANTE
   Arquitecto Creativo — Coherencia arquitectónica y minimalismo de despacho
   ========================================================================== */

.projects-index-section {
  position: relative;
  z-index: 20;
  background: var(--paper);
  color: var(--ink);
  padding: 85px var(--gutter) 100px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -40px 80px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

.projects-index-section .section-top {
  color: var(--ink);
  opacity: 0.8;
}

.projects-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 42px;
  margin-bottom: 48px;
  gap: 30px;
  flex-wrap: wrap;
}

.projects-header-row h2 {
  font-family: "Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(56px, 9.6vw, 136px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin: 0;
  color: var(--ink);
  text-shadow: none;
}

.projects-header-row h2 .brand-dot {
  color: var(--accent-green, #84cc16);
}

.projects-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.projects-count {
  font-weight: 600;
  color: var(--ink);
  padding: 5px 14px;
  border: 1px solid rgba(17, 17, 17, 0.25);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.projects-count::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green, #84cc16);
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.8);
}

.projects-hint {
  opacity: 0.65;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

/* ==========================================================================
   LISTA / ÍNDICE TIPOGRÁFICO
   ========================================================================== */

.projects-index {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(17, 17, 17, 0.18);
}

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(220px, 1.8fr) minmax(180px, 1.2fr) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 26px 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease), border-left-color 0.25s var(--ease);
}

.project-row:hover {
  background: rgba(0, 0, 0, 0.03);
  border-left-color: var(--accent-green, #84cc16);
  padding-left: 22px;
}

.project-col-num {
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0.5;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.project-col-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.project-name {
  font-family: "Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.project-row:hover .project-name {
  transform: translateX(4px);
  color: var(--brown);
}

.project-col-category {
  font-size: 13px;
  opacity: 0.8;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.project-col-solution {
  font-size: 12px;
  opacity: 0.55;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-col-action {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-action-pill {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid rgba(17, 17, 17, 0.28);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.project-row:hover .project-action-pill {
  background: var(--dark, #0a0a0a);
  color: var(--accent-green, #84cc16);
  border-color: var(--dark, #0a0a0a);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transform: scale(1.03);
}

/* En móvil: botón de visita directa en la fila */
.project-direct-link {
  color: var(--paper);
  opacity: 0.7;
  font-size: 13px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s;
}

.project-direct-link:hover {
  opacity: 1;
}

/* Resumen móvil inline cuando se expande */
.project-mobile-body {
  display: none;
}

/* ==========================================================================
   PREVIEW FLOTANTE MAGNÉTICO (DESKTOP)
   ========================================================================== */

.project-floating-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  pointer-events: none;
  z-index: 999 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s;
  will-change: transform, opacity;
}

.project-floating-preview.is-visible {
  opacity: 1;
  visibility: visible;
}

.preview-card-inner {
  background: #0f0f12;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-floating-preview.is-visible .preview-card-inner {
  transform: scale(1);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  letter-spacing: 0.01em;
  text-transform: none;
}

.preview-badge {
  font-weight: 600;
  color: var(--accent-green, #84cc16);
  letter-spacing: 0.01em;
}

.preview-action-hint {
  opacity: 0.6;
}

.preview-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0c;
  overflow: hidden;
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.2s ease;
}

.preview-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  background: #0f0f12;
}

.preview-title {
  font-family: "Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 16px;
  color: var(--paper);
}

.preview-scope {
  font-size: 10px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   FICHA / DOSSIER EXTENDIDO (SIDE-BY-SIDE DIALOG)
   ========================================================================== */

.project-dossier {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(10, 10, 12, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3.5vw, 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.project-dossier.is-active {
  opacity: 1;
  pointer-events: auto;
}

.dossier-dialog {
  position: relative;
  width: min(94vw, 1140px);
  max-height: 88vh;
  background: #0e0e11;
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.85);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.4s var(--ease);
  display: grid;
  grid-template-columns: 1.35fr 1fr;
}

.project-dossier.is-active .dossier-dialog {
  transform: scale(1) translateY(0);
}

.dossier-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--paper);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: all 0.25s;
}

.dossier-close-btn:hover {
  background: var(--paper);
  color: var(--dark);
  transform: rotate(90deg);
}

.dossier-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #0a0a0c;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.dossier-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s var(--ease);
}

.dossier-zoom-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(10, 10, 14, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.dossier-media:hover .dossier-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.dossier-media:hover img {
  transform: scale(1.02);
}

.dossier-media-overlay-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(20, 20, 24, 0.88);
  backdrop-filter: blur(8px);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.3s var(--ease);
}

.dossier-media:hover .dossier-media-overlay-btn {
  opacity: 1;
  transform: translateY(0);
}

.dossier-body {
  padding: clamp(28px, 3.8vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  overflow-y: auto;
  max-height: 88vh;
}

.dossier-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}

.dossier-title {
  font-family: "Baskerville", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0;
}

.dossier-desc {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.88;
  margin: 0;
}

.dossier-context {
  font-size: 13.5px;
  line-height: 1.6;
  opacity: 0.72;
  margin: 0;
  font-style: italic;
  border-left: 2px solid var(--accent-green, #84cc16);
  padding-left: 14px;
}

.dossier-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.dossier-tag-pill {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--paper, #ffffff);
  opacity: 0.85;
}

.dossier-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 4px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
}

.spec-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
  font-size: 10px;
  flex-shrink: 0;
}

.spec-val {
  font-weight: 500;
  text-align: right;
  opacity: 0.95;
}

.dossier-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dossier-primary-btn {
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dossier-primary-btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

.dossier-secondary-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
}

.dossier-secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--paper);
}

.dossier-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.dossier-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--paper, #ffffff);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 11px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.dossier-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent-green, #84cc16);
}

.dossier-nav-btn:active {
  transform: scale(0.95);
  background: rgba(132, 204, 22, 0.2);
}

/* Oculto en escritorio */
.project-mobile-thumb {
  display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 950px) {
  .project-row {
    grid-template-columns: 40px minmax(180px, 1.5fr) minmax(140px, 1.2fr) auto;
  }
  .project-col-solution {
    display: none;
  }
}

@media (max-width: 768px) {
  .projects-index-section {
    padding: 40px var(--gutter) 60px;
  }

  .projects-header-row {
    margin-bottom: 24px;
  }

  .projects-hint {
    display: none;
  }

  .project-floating-preview {
    display: none !important;
  }

  .project-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px;
    border-radius: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  .project-row:hover {
    padding-left: 10px;
    background: transparent;
  }

  .project-row:active {
    transform: scale(0.98);
    background: rgba(0, 0, 0, 0.04);
  }

  .project-col-num {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.45;
    flex-shrink: 0;
    min-width: 18px;
  }

  .project-mobile-thumb {
    display: block;
    width: 64px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  }

  .project-mobile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .project-col-title {
    flex: 1;
    min-width: 0;
  }

  .project-name {
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .project-col-category {
    display: none;
  }

  .project-action-pill {
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.01em;
    text-transform: none;
    flex-shrink: 0;
  }

  .dossier-dialog {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }

  .dossier-media {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 48vh;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: #0a0a0c;
  }

  .dossier-media img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
  }

  .dossier-media:hover img {
    transform: none !important;
  }

  .dossier-zoom-hint {
    opacity: 1 !important;
    transform: none !important;
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 4px 10px;
    background: rgba(10, 10, 14, 0.88);
  }

  .dossier-body {
    max-height: none;
    padding: 22px 18px;
    gap: 14px;
  }

  .dossier-nav-group {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    margin-top: 10px;
    display: flex;
    gap: 10px;
  }

  .dossier-nav-btn {
    flex: 1;
    text-align: center;
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* ==========================================================================
   LIGHTBOX / ZOOM FULLSCREEN MODAL (SIN RECORTES)
   ========================================================================== */
.dossier-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  box-sizing: border-box;
  touch-action: pan-x pan-y pinch-zoom;
}

.dossier-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.dossier-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10002;
  transition: background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.dossier-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.dossier-lightbox-content {
  width: 100%;
  height: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.dossier-lightbox-content img {
  max-width: 96vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}
