/* =========================
   PROYECTOS - PRIVACIDAD Y EVIDENCIA
========================= */
.section-intro {
  max-width: 900px;
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 1.4rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}

.btn-outline {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  border: 1px solid rgba(37, 99, 235, 0.22);
  cursor: pointer;
  font-family: inherit;
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.18);
}

.project-modal {
  width: min(980px, calc(100% - 2rem));
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: transparent;
  color: var(--text-main);
}

.project-modal::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  max-height: min(86vh, 900px);
  overflow: auto;
  scroll-padding-top: 4rem;
  background: #ffffff;
  border-radius: 22px;
  padding: 2rem;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.modal-card-wide {
  width: 100%;
}

.modal-card h3 {
  color: var(--bg-dark);
  font-size: 1.45rem;
  margin-bottom: 0.8rem;
}

.modal-toolbar {
  position: sticky;
  top: -2rem;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  margin: -2rem -2rem 0;
  padding: 0.75rem 1rem;
  background: #ffffff;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--bg-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  background: #dbeafe;
  transform: rotate(90deg);
}

.project-privacy {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.06));
}

.project-privacy p {
  margin: 0;
  color: var(--text-main);
  font-size: 0.95rem;
}

.project-privacy strong {
  color: var(--primary-dark);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.evidence-card {
  min-height: 145px;
  border-radius: 16px;
  border: 1px dashed rgba(37, 99, 235, 0.32);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.08)),
    #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  overflow: hidden;
}

.evidence-card span {
  color: var(--primary-dark);
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.evidence-card small {
  color: var(--text-muted);
  line-height: 1.4;
}

.evidence-grid-images {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evidence-card-image {
  padding: 0;
  border-style: solid;
  background: #ffffff;
  justify-content: flex-start;
}

.evidence-card-image img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: top left;
  display: block;
  background: #eef2f7;
}

.evidence-card-mobile img {
  height: 360px;
  object-fit: contain;
  object-position: top center;
  padding: 0.75rem;
}

.evidence-card-image figcaption {
  padding: 0.9rem 1rem 1rem;
  display: grid;
  gap: 0.25rem;
}

@media (max-width: 768px) {
  .modal-card {
    padding: 1.4rem;
  }

  .modal-toolbar {
    top: -1.4rem;
    margin: -1.4rem -1.4rem 0;
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .evidence-grid,
  .evidence-grid-images {
    grid-template-columns: 1fr;
  }

  .evidence-card-image img,
  .evidence-card-mobile img {
    height: auto;
    max-height: 420px;
    object-fit: contain;
  }
}


/* =========================
   MÓDULOS EXPANDIBLES Y CARRUSEL DE EVIDENCIA
========================= */
.evidence-modules {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.evidence-module {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.evidence-module summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.25rem;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.04)),
    #f8fafc;
  border-bottom: 1px solid transparent;
}

.evidence-module summary:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 3px #1d4ed8;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.evidence-module[open] summary {
  border-bottom-color: var(--border-soft);
}

main section:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: -3px;
}

.evidence-module summary::-webkit-details-marker {
  display: none;
}

.evidence-module summary span {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1rem;
}

.evidence-module summary span::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.45rem;
  transition: transform 0.2s ease;
}

.evidence-module[open] summary span::before {
  transform: rotate(90deg);
}

.evidence-module summary small {
  color: var(--text-muted);
  line-height: 1.4;
}

.evidence-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 42%);
  gap: 1rem;
  padding: 1rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

.evidence-carousel-mobile {
  grid-auto-columns: minmax(220px, 28%);
}

.evidence-slide {
  scroll-snap-align: start;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: zoom-in;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.evidence-slide:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.evidence-slide img {
  width: 100%;
  height: 230px;
  display: block;
  object-fit: cover;
  object-position: top left;
  background: #eef2f7;
}

.evidence-slide-mobile img {
  height: 360px;
  object-fit: contain;
  object-position: top center;
  padding: 0.7rem;
}

.evidence-slide span,
.evidence-slide small {
  display: block;
  padding-inline: 1rem;
}

.evidence-slide span {
  padding-top: 0.9rem;
  color: var(--primary-dark);
  font-weight: 800;
}

.evidence-slide small {
  padding-top: 0.25rem;
  padding-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.image-lightbox {
  width: min(1180px, calc(100% - 1.5rem));
  border: 0;
  padding: 0;
  background: transparent;
}

.image-lightbox::backdrop {
  background: rgba(2, 6, 23, 0.86);
  backdrop-filter: blur(8px);
}

.lightbox-card {
  position: relative;
  background: #0f172a;
  color: #ffffff;
  border-radius: 22px;
  padding: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-card figure {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.lightbox-media {
  position: relative;
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  height: min(65vh, 700px);
}

.lightbox-media img[aria-hidden="true"] {
  visibility: hidden;
}

.lightbox-message {
  position: absolute;
  padding: 1rem 3.5rem;
  color: #ffffff;
  text-align: center;
}

.lightbox-card img {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: #111827;
}

.lightbox-card figcaption {
  display: grid;
  gap: 0.25rem;
  padding: 0 3.5rem 0.5rem;
}

.lightbox-card figcaption strong {
  color: #ffffff;
  font-size: 1.05rem;
}

.lightbox-card figcaption span {
  color: #cbd5e1;
  line-height: 1.45;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.76);
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 2rem;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(37, 99, 235, 0.92);
}

@media (max-width: 768px) {
  .evidence-carousel,
  .evidence-carousel-mobile {
    grid-auto-columns: minmax(240px, 82%);
  }

  .evidence-slide img,
  .evidence-slide-mobile img {
    height: 300px;
    object-fit: contain;
    object-position: top center;
  }

  .lightbox-card {
    padding: 0.75rem;
  }

  .lightbox-card figcaption {
    padding-inline: 0.5rem;
    padding-bottom: 0.25rem;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 1.7rem;
  }
}
