/* =============================================================
   Biblioteca de Blogs
   Mismo layout que la Biblioteca de Recursos, adaptado a un
   fondo claro y con tarjetas de un solo color acorde a la marca.
   ============================================================= */

.blogs-biblioteca {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.blogs-title {
  font-size: 40px;
  font-weight: 600;
  margin: 0 0 0.25rem;
  text-align: center;
  color: #6452c0;
  line-height: 1.1;
  font-family: 'Inter', sans-serif;
}

.blogs-subtitle {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  color: #57606f;
  font-family: 'Inter', sans-serif;
}

.blogs-categorias-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.blogs-categorias {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.blogs-categorias::-webkit-scrollbar {
  display: none;
}

.blogs-cat-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: rgba(100, 82, 192, 0.08);
  border: 1.5px solid rgba(100, 82, 192, 0.25);
  border-radius: 50px;
  color: #6452c0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.blogs-cat-btn:hover {
  background: rgba(100, 82, 192, 0.16);
  border-color: rgba(100, 82, 192, 0.4);
  transform: translateY(-1px);
}

.blogs-cat-btn.active {
  background: #6452c0;
  border-color: #6452c0;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(100, 82, 192, 0.3);
}

.blogs-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(100, 82, 192, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: all 0.3s ease;
}

.blogs-scroll-btn:hover {
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.blogs-scroll-btn.prev {
  left: -20px;
}

.blogs-scroll-btn.next {
  right: -20px;
}

.blogs-scroll-btn svg {
  width: 18px;
  height: 18px;
  color: #6452c0;
}

.blogs-carrusel-container {
  position: relative;
  margin-top: 1.6rem;
  overflow: hidden;
}

.blogs-carrusel {
  overflow: hidden;
  border-radius: 1rem;
  position: relative;
  padding: 0.5rem 0;
}

.blogs-carrusel-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.45s cubic-bezier(.22, .9, .3, 1);
  will-change: transform;
  padding: 0 1rem;
  align-items: stretch;
  flex-wrap: nowrap;
}

/* TARJETAS con un único color acorde a la marca */
.blogs-card {
  position: relative;
  background: #faf9f7;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow .3s, transform .25s;
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(33.333% - 1rem);
  width: calc(33.333% - 1rem);
  height: auto;
  min-height: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-top: 4px solid #6452c0;
}

.blogs-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  transform: translateY(-6px);
}

.blogs-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
  background: none;
  padding: 0;
  margin: 1.3rem 0;
}

.blogs-body {
  padding: 1.5rem;
  font-size: .95rem;
  color: #374151;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
}

.blogs-body strong {
  display: block;
  font-weight: 700;
  color: #41454d;
  line-height: 1.2;
  max-height: 3.6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blogs-body p {
  margin: 0;
  color: #636a74;
  font-size: 0.92rem;
  overflow: hidden;
  text-align: justify;
}

.blogs-card-footer {
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(11, 23, 32, 0.06);
  background: transparent;
}

.blogs-card-btn {
  background: linear-gradient(90deg, #6452c0, #489fb9);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  min-width: 150px;
  text-align: center;
}

.blogs-card-btn:hover {
  transform: translateY(-2px);
}

.blogs-carrusel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.blogs-carrusel-prev {
  left: 6px;
}

.blogs-carrusel-next {
  right: 6px;
}

.blogs-carrusel-nav svg {
  color: #6452c0;
  width: 20px;
  height: 20px;
}

.blogs-ver-mas-container {
  text-align: center;
  margin-top: 1rem;
  display: none;
}

/* MODAL (misma estructura visual que el modal de recursos) */
.blogs-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.blogs-modal.blogs-active {
  display: flex;
  animation: fadeIn .25s ease;
}

.blogs-modal-content {
  background: #fff;
  border-radius: 1rem;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

.blogs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #6452c0 0%, #489fb9 100%);
  color: #fff;
}

.blogs-modal-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blogs-modal-close svg {
  width: 24px;
  height: 24px;
}

.blogs-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  max-height: calc(90vh - 100px);
  overflow: auto;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .blogs-card {
    flex: 0 0 calc(50% - 1rem);
    width: calc(50% - 1rem);
  }

  .blogs-body {
    padding: 1.25rem;
  }

  .blogs-image {
    height: 160px;
  }

  .blogs-scroll-btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .blogs-cat-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .blogs-title {
    font-size: 28px;
    margin: 0.5rem 0 0.25rem;
    line-height: 1.2;
  }

  .blogs-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .blogs-card {
    flex: 0 0 98%;
    width: 100%;
    margin: 0 auto;
  }

  .blogs-body {
    padding: 1.75rem;
  }

  .blogs-card-btn {
    padding: 8px 16px;
    min-width: 140px;
    font-size: 0.9rem;
  }

  .blogs-title {
    font-size: 24px;
  }

  .blogs-subtitle {
    font-size: 0.9rem;
  }
}
