/* ============================================
   ARCHIVO HISTÓRICO - CPL CONSULTORES
   Estilos específicos para la página de archivo
   ============================================ */

/* ============================================
   1. CONTENEDOR PRINCIPAL
   ============================================ */
.archivo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 60px 20px;
  margin-top: 120px;
}

/* ============================================
   2. ENCABEZADO
   ============================================ */
.archivo-header {
  margin-bottom: 30px;
}

.archivo-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #003366;
  margin: 0 0 8px 0;
}

.archivo-linea {
  display: block;
  width: 70px;
  height: 3px;
  background: #b8963a;
  border-radius: 2px;
  margin: 0 0 12px 0;
}

.archivo-header p {
  font-size: 1rem;
  color: #5a6b7a;
  margin: 0;
  max-width: 600px;
}

/* ============================================
   3. FILTROS
   ============================================ */
.archivo-filtros {
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.archivo-filtros-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.archivo-filtro-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archivo-filtro-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #003366;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.archivo-filtro-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23003366' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  width: 100%;
  transition: border-color 0.2s ease;
}

.archivo-filtro-select:focus {
  outline: none;
  border-color: #003366;
}

/* ============================================
   4. BOTÓN LIMPIAR FILTROS
   ============================================ */
.archivo-filtro-limpiar {
  display: flex;
  align-items: end;
}

.archivo-btn-limpiar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  color: #6b7a8a;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.archivo-btn-limpiar:hover {
  border-color: #003366;
  color: #003366;
  background: #f0f2f6;
}

.archivo-btn-limpiar i {
  font-size: 0.9rem;
}

/* ============================================
   5. CONTADOR DE RESULTADOS
   ============================================ */
.archivo-contador {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 0.95rem;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.archivo-contador i {
  color: #b8963a;
  font-size: 1.1rem;
}

.archivo-contador span {
  font-weight: 700;
  color: #003366;
}

/* ============================================
   6. LISTADO DE AÑOS
   ============================================ */
.archivo-anio {
  margin-bottom: 8px;
}

.archivo-anio-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 6px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 6px;
}

.archivo-anio-numero {
  font-size: 1.2rem;
  font-weight: 700;
  color: #003366;
}

.archivo-anio-total {
  font-size: 0.85rem;
  color: #6b7a8a;
}

/* ============================================
   7. ACORDEÓN - MES
   ============================================ */
.archivo-mes {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}

.archivo-mes-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #f8f9fb;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 0.2s ease;
  text-align: left;
}

.archivo-mes-toggle:hover {
  background: #eef0f2;
}

.archivo-mes-icono {
  color: #b8963a;
}

.archivo-mes-nombre {
  font-weight: 600;
  color: #003366;
  flex: 1;
}

.archivo-mes-count {
  font-size: 0.8rem;
  color: #6b7a8a;
}

.archivo-mes-flecha {
  color: #6b7a8a;
  transition: transform 0.3s ease;
}

.archivo-mes-abierto .archivo-mes-flecha {
  transform: rotate(180deg);
}

/* ============================================
   8. PUBLICACIONES DENTRO DEL MES
   ============================================ */
.archivo-mes-publicaciones {
  display: none;
}

.archivo-mes-abierto .archivo-mes-publicaciones {
  display: block;
}

/* ============================================
   9. PUBLICACIÓN INDIVIDUAL - FORMATO LISTA
   ============================================ */
.archivo-publicacion {
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.2s ease;
}

.archivo-publicacion:last-child {
  border-bottom: none;
}

.archivo-publicacion a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.archivo-publicacion a:hover {
  background: #f8f9fb;
}

/* Miniatura */
.archivo-publicacion-imagen {
  width: 120px;
  min-width: 120px;
  height: 68px;
  border-radius: 4px;
  overflow: hidden;
  background: #eef0f2;
  flex-shrink: 0;
}

.archivo-publicacion-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.archivo-publicacion-sin-imagen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b8c4;
  font-size: 1.5rem;
}

/* Información */
.archivo-publicacion-info {
  flex: 1;
  min-width: 0;
}

.archivo-publicacion-titulo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #003366;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.archivo-publicacion-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #6b7a8a;
  flex-wrap: wrap;
}

.archivo-publicacion-area {
  background: #eef0f2;
  padding: 1px 10px;
  border-radius: 10px;
  color: #003366;
  font-size: 0.7rem;
}

.archivo-publicacion-fecha {
  font-size: 0.75rem;
}

.archivo-publicacion-arrow {
  color: #b0b8c4;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.archivo-publicacion a:hover .archivo-publicacion-arrow {
  transform: translateX(3px);
  color: #003366;
}

/* ============================================
   10. VOLVER A PUBLICACIONES
   ============================================ */
.archivo-volver {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.archivo-btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #003366;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: gap 0.2s ease;
}

.archivo-btn-volver:hover {
  gap: 14px;
}

/* ============================================
   11. MENSAJE CUANDO NO HAY PUBLICACIONES
   ============================================ */
.archivo-vacio {
  text-align: center;
  padding: 60px 20px;
  background: #f8f9fb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.archivo-vacio i {
  font-size: 2.5rem;
  color: #b8963a;
  display: block;
  margin-bottom: 12px;
}

.archivo-vacio p {
  font-size: 1.1rem;
  color: #6b7a8a;
}

/* ============================================
   12. RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 992px) {
  .archivo-filtros-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   13. RESPONSIVE - MÓVIL
   ============================================ */
@media (max-width: 768px) {
  .archivo-container {
    padding: 20px 16px 40px 16px;
  }

  .archivo-header h1 {
    font-size: 1.6rem;
  }

  .archivo-filtros {
    padding: 16px;
  }

  .archivo-filtros-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .archivo-filtro-limpiar {
    margin-top: 4px;
  }

  .archivo-btn-limpiar {
    width: 100%;
    justify-content: center;
  }

  /* Tarjetas horizontales en móvil */
  .archivo-publicacion a {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 10px;
  }

  .archivo-publicacion-imagen {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    min-width: unset;
    max-width: 100%;
  }

  .archivo-publicacion-titulo {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .archivo-publicacion-arrow {
    align-self: flex-end;
  }

  .archivo-mes-toggle {
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  .archivo-anio-numero {
    font-size: 1rem;
  }

  .archivo-volver {
    margin-top: 20px;
  }

  .archivo-btn-volver {
    font-size: 0.9rem;
  }
}

/* ============================================
   14. RESPONSIVE - MÓVIL PEQUEÑO
   ============================================ */
@media (max-width: 480px) {
  .archivo-header h1 {
    font-size: 1.3rem;
  }

  .archivo-filtros {
    padding: 12px;
  }

  .archivo-filtro-select {
    font-size: 0.85rem;
    padding: 6px 28px 6px 10px;
  }

  .archivo-publicacion-titulo {
    font-size: 0.85rem;
  }

  .archivo-mes-toggle {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}

/* ============================================
   6. LISTADO DE AÑOS (ACORDEÓN)
   ============================================ */
.archivo-anio {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}

.archivo-anio-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: #f8f9fb;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: background 0.2s ease;
  text-align: left;
}

.archivo-anio-toggle:hover {
  background: #eef0f2;
}

.archivo-anio-fecha {
  font-weight: 700;
  color: #003366;
  font-size: 1.1rem;
}

.archivo-anio-fecha i {
  color: #b8963a;
  margin-right: 8px;
}

.archivo-anio-total {
  font-size: 0.85rem;
  color: #6b7a8a;
  flex: 1;
}

.archivo-anio-flecha {
  color: #6b7a8a;
  transition: transform 0.3s ease;
}

.archivo-anio-abierto .archivo-anio-flecha {
  transform: rotate(180deg);
}

/* ============================================
   7. PUBLICACIONES DENTRO DEL AÑO
   ============================================ */
.archivo-anio-publicaciones {
  display: none;
  padding: 4px 0 8px 0;
}

.archivo-anio-abierto .archivo-anio-publicaciones {
  display: block;
}

/* ============================================
   8. RESPONSIVE - MÓVIL
   ============================================ */
@media (max-width: 768px) {
  .archivo-anio-toggle {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .archivo-anio-fecha {
    font-size: 1rem;
  }

  .archivo-anio-total {
    font-size: 0.75rem;
  }
}
