/* ===== ESTILOS PARA PAGE-DOCUMENTOS.PHP ===== */

/* Contenedor principal de documentos */
.page-content.bottom-color-green {
  position: relative;
  overflow: hidden;
}

/* Contenido principal con fondo y elementos decorativos */
.body-page {
  background-color: var(--main-lighter-green-color);
  position: relative;
  padding: 60px 7vw 30px 7vw;
  margin-top: 0;
}

/* Elementos decorativos de fondo */
.body-page::before {
  content: "";
  position: absolute;
  top: 15%;
  right: -80px;
  width: 200px;
  height: 200px;
  background: linear-gradient(45deg, var(--main-orange-color), var(--main-green-color));
  border-radius: 50%;
  opacity: 0.06;
  z-index: 0;
}

.body-page::after {
  content: "";
  position: absolute;
  bottom: 10%;
  left: -100px;
  width: 250px;
  height: 250px;
  background: linear-gradient(-45deg, var(--main-light-green-color), var(--main-darker-green-color));
  border-radius: 50%;
  opacity: 0.05;
  z-index: 0;
}

/* Contenido de la página */
.body-page > * {
  position: relative;
  z-index: 1;
}

/* Contenedor de secciones */
.documentos-secciones {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Sección principal de documentos */
.documentos-listado {
  margin: 0;
  padding: 50px 0;
  background: white;
  border-radius: 25px;
  box-shadow: 0 10px 35px rgba(1, 164, 153, 0.12);
  position: relative;
  overflow: hidden;
}

/* Elementos decorativos para la sección de documentos */
.documentos-listado::before {
  content: "";
  position: absolute;
  top: -100px;
  left: -100px;
  width: 250px;
  height: 250px;
  background: linear-gradient(45deg, var(--main-light-green-color), var(--main-green-color));
  border-radius: 50%;
  opacity: 0.05;
  z-index: 0;
}

.documentos-listado::after {
  content: "";
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  background: var(--main-orange-color);
  border-radius: 50%;
  opacity: 0.06;
  z-index: 0;
}

/* Títulos de secciones de documentos */
.documentos-titulo-acf {
  text-align: center;
  color: var(--main-orange-color);
  font-size: 2.5rem;
  margin-bottom: 50px;
  font-family: "Nunito Sans", sans-serif;
  font-weight: 800;
  position: relative;
  z-index: 1;
  padding: 0 30px;
}

.documentos-titulo-acf:first-of-type {
  margin-top: 0;
}

.documentos-titulo-acf::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--main-orange-color), var(--main-green-color));
  border-radius: 2px;
}

/* Grid de documentos */
.documentos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  padding: 0 30px;
}

/* Enlaces de documentos */
.documento-link-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

/* Cards de documentos */
.documento-card {
  background: white;
  border-radius: 16px;
  border: 2px solid var(--main-green-color);
  box-shadow: 0 4px 15px rgba(1, 164, 153, 0.1);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 248px;
  cursor: pointer;
}

.documento-card p,
.documento-card p *,
.documento-info p,
.archivo-nombre-unico {
  background: transparent;
}

.documento-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, var(--main-light-green-color), var(--main-green-color));
  border-radius: 50%;
  opacity: 0.05;
  z-index: 0;
  transition: all 0.3s ease;
}

.documento-link-card:hover .documento-card {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(1, 164, 153, 0.15);
  border-color: var(--main-orange-color);
}

.documento-link-card:hover .documento-card::before {
  opacity: 0.08;
  transform: scale(1.2);
}

/* Miniatura del documento */
.documento-thumb {
  width: 120px;
  height: 152px;
  background: var(--main-lighter-green-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  box-shadow: 0 3px 10px rgba(1, 164, 153, 0.1);
  border: 2px solid var(--main-light-green-color);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.documento-link-card:hover .documento-thumb {
  border-color: var(--main-orange-color);
  box-shadow: 0 5px 15px rgba(227, 118, 4, 0.15);
}

.documento-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}

/* Ícono por defecto cuando no hay imagen */
.documento-thumb .dashicons {
  font-size: 40px;
  color: var(--main-green-color);
  opacity: 0.6;
}

/* Información del documento */
.documento-info {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Nombre del archivo */
.archivo-nombre-unico {
  color: var(--main-dark-grey-color);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  font-family: "Nunito Sans", sans-serif;
  letter-spacing: 0.3px;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: center;
  padding: 0 8px;
}

.documento-link-card:hover .archivo-nombre-unico {
  color: var(--main-green-color);
}

/* Mensaje cuando no hay documentos */
.documentos-vacio {
  text-align: center;
  color: var(--main-grey-color);
  font-size: 1.1rem;
  margin: 40px 0;
  font-style: italic;
  font-family: "Nunito Sans", sans-serif;
}

/* Separador entre secciones */
.documentos-titulo-acf + .documentos-grid {
  margin-top: 20px;
  position: relative;
}

.documentos-titulo-acf + .documentos-grid::before {
  content: "";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--main-light-green-color), transparent);
  opacity: 0.3;
}

/* Reset de botón para cards de imagen */
.documento-image-trigger {
  background: none;
  border: none;
  padding: 0;
  width: 100%;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

/* ===== LIGHTBOX ===== */

.cecta-lightbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
  overflow: visible;
}

.cecta-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(5px);
}

.cecta-lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.cecta-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  color: var(--main-dark-grey-color);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background 180ms ease, color 180ms ease;
}

.cecta-lightbox-close:hover {
  background: var(--main-orange-color);
  color: white;
}

/* ===== ANIMACIONES ===== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.documentos-listado {
  animation: fadeInUp 0.8s ease-out;
}

.documento-card {
  animation: fadeInUp 0.6s ease-out;
}

.documento-card:nth-child(even) {
  animation-delay: 0.1s;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
  .documentos-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 18px;
    padding: 0 20px;
  }
  
  .documento-thumb {
    width: 110px;
    height: 140px;
  }
  
  .documentos-titulo-acf {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .body-page {
    padding: 30px 5vw 24px;
  }
  
  .body-page::before,
  .body-page::after {
    display: none;
  }

  .documentos-listado {
    border-radius: 20px;
    margin: 20px 0;
    padding: 30px 3vw 25px 3vw;
  }

  .documentos-listado::before,
  .documentos-listado::after {
    display: none;
  }
  
  .documentos-titulo-acf {
    font-size: 1.7rem;
    margin: 24px 0 20px;
    padding: 0 20px;
  }
  
  .documentos-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 35px;
  }
  
  .documento-card {
    padding: 12px 10px;
    min-height: 220px;
  }
  
  .documento-thumb {
    width: 100px;
    height: 120px;
  }
  
  .archivo-nombre-unico {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .documentos-titulo-acf {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  .documentos-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 12px;
    padding: 0 12px;
  }
  
  .documento-card {
    min-height: 200px;
  }
  
  .documento-thumb {
    width: 90px;
    height: 110px;
  }
  
  .archivo-nombre-unico {
    font-size: 0.75rem;
  }
}
