.infoteca {
  padding: 20px;
  background: #f5f5f5;
}
#titulo-infoteca {
  text-align: center;
  padding: 40px 40px;
  margin: 30px 0 30px 0;
  color: var(--tertiary-color);
  text-align: center;
  margin: 80px 0 40px 0;
  background: url("../Photos/infoteca/fondo_infoteca.jpg");
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 40px;
}

#titulo-infoteca h2 {
  color: #fff;
  background-color: #27272793;
  padding: 10px 20px;
  display: inline-block;
  border-radius: 8px;
}

.title-underline {
  display: block;
  width: 180px;
  height: 4px;
  background-color: rgb(255, 174, 0);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ── TABS DE TIPO ── */
.tipo-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tipo-tab {
  padding: 10px 22px;
  border: 2px solid #c3e0cc;
  border-radius: 24px;
  background: #fff;
  color: #1a7a4f;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tipo-tab:hover {
  background: #e8f5ec;
  border-color: #1a7a4f;
}

.tipo-tab.active {
  background: #1a7a4f;
  color: #fff;
  border-color: #1a7a4f;
}

/* Badge de tipo dentro de la tarjeta */
.tipo-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.badge-articulo  { background: #dbeafe; color: #1d4ed8; }
.badge-libro     { background: #fef3c7; color: #92400e; }
.badge-divulgacion { background: #fce7f3; color: #9d174d; }

/* Layout: filtros a la izquierda, tarjetas a la derecha */
.infoteca-layout {
  display: flex;
  gap: 20px;
}

/* Panel lateral */
.infoteca-filtros {
  width: 230px;
  background: #e8f5ec;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #c3e0cc;
}

.infoteca-filtros h3 {
  margin-bottom: 15px;
}

.infoteca-filtros label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

/* El select como el de la imagen */
.infoteca-filtros select {
  width: 100%;
  padding: 8px;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: #e0e0e0;
  font-size: 0.9rem;
}

/* Input de búsqueda */
.input-busqueda {
  width: 100%;
  padding: 8px;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: #ffffff;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.input-busqueda:focus {
  outline: none;
  border-color: #1a7a4f;
}

/* Grid de tarjetas */
.infoteca-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.infoteca-item {
  background: #ffffff;
  border-radius: 6px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.infoteca-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.publicacion-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Portada generada con degradado */
.portada-generada {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Portada con imagen de artículo */
.portada-imagen {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.portada-imagen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.3)
  );
  z-index: 1;
}

.portada-imagen .portada-info {
  z-index: 2;
}

.portada-letra {
  font-size: 5rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.portada-info {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  justify-content: flex-end;
  z-index: 2;
}

.año-badge {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Contenido de la publicación */
.publicacion-contenido {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.infoteca-item h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 36px;
}

.infoteca-item .autores {
  font-size: 0.75rem;
  margin-bottom: 6px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infoteca-item .revista {
  font-size: 0.7rem;
  margin-bottom: 10px;
  color: #888;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.enlace-disponible {
  display: block;
  text-align: center;
  padding: 8px;
  background: #1a7a4f;
  color: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  transition: background 0.2s;
  margin-top: auto;
}

.publicacion-link:hover .enlace-disponible {
  background: #115c3a;
}

.sin-enlace {
  display: block;
  text-align: center;
  padding: 8px;
  background: #e0e0e0;
  color: #999;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-top: auto;
}

/* Responsive básico */
@media (max-width: 900px) {
  .infoteca-layout {
    flex-direction: column;
  }

  .infoteca-filtros {
    width: 100%;
  }

  .infoteca-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .infoteca-grid {
    grid-template-columns: 1fr;
  }

  #titulo-infoteca {
    padding: 20px;
    font-size: 1.5rem;
  }

  .portada-letra {
    font-size: 3rem;
  }
}
