/* =========================================================
   BLOG TAG STYLESHEET
   Responsive: Desktop / Tablet / Mobile
   Color base: var(--color-primary)
   ========================================================= */

/* =========================================================
   01. BASE
   ========================================================= */

.blog-page {
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.blog-page *,
.blog-page *::before,
.blog-page *::after {
  box-sizing: border-box;
}

.blog-page img {
  display: block;
  max-width: 100%;
}

.blog-page .container {
  width: 100%;
  padding-inline: clamp(20px, 3vw, 48px);
  margin-inline: auto;
  box-sizing: border-box;
}

.blog-page .container-large {
  width: 100%;
  padding-inline: clamp(20px, 3vw, 48px);
  margin-inline: auto;
  box-sizing: border-box;
}

.blog-page h2,
.blog-page h3,
.blog-page h4 {
  margin: 0;
  font-family: inherit;
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* =========================================================
   02. CATEGORÍAS (BARRA DE FILTROS)
   ========================================================= */

.blog-categories-nav {
  position: relative;
  z-index: 4;

  margin-bottom: 28px;
  padding: 4px 0;

  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.025);
}

.blog-categories-nav .container,
.blog-categories-nav .container-large {
  width: 100%;
  padding-inline: 16px;
}

.blog-categories-list {
  display: flex;
  align-items: center;
  gap: 8px;

  margin: 0;
  padding: 6px 0;

  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.blog-categories-list::-webkit-scrollbar {
  display: none;
}

.blog-categories-list li {
  flex-shrink: 0;
}

.blog-categories-list li a {
  display: inline-flex;
  align-items: center;

  padding: 7px 16px;

  border-radius: 999px;
  border: 1px solid transparent;

  color: #64748b;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.blog-categories-list li a:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
}

.blog-categories-list li a.active {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 700;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* =========================================================
   03. GRID DE ARTÍCULOS
   ========================================================= */

.blog-content-wrapper {
  padding: 0 0 60px;
}

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* =========================================================
   04. TARJETAS DE ARTÍCULOS
   ========================================================= */

.blog-post-card {
  display: flex;
  flex-direction: column;

  height: 100%;
  min-width: 0;
  overflow: hidden;

  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 17px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.035);

  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.blog-post-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--color-primary) 35%, #e2e8f0);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--color-primary) 9%, rgba(15, 23, 42, 0.08));
}

.post-card-img-link {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.post-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-post-card:hover .post-card-img {
  transform: scale(1.05);
}

.post-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;

  padding: 18px 20px 20px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;

  margin-bottom: 8px;
  font-size: 11.5px;
}

.post-card-category {
  display: inline-flex;
  align-items: center;

  color: var(--color-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-card-date {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.post-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;

  margin-bottom: 10px;

  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
}

.post-card-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;

  margin-bottom: 16px;

  color: #475569;
  font-size: 13.5px;
  line-height: 1.6;
}

.blog-post-card .ac__button {
  align-self: flex-start;
  margin-top: auto;
}

/* =========================================================
   05. PAGINACIÓN
   ========================================================= */

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 40px;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 40px;
  height: 40px;
  padding: 0 12px;

  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;

  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;

  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.blog-pagination a.page-numbers:hover {
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 35%, #e2e8f0);
  background: color-mix(in srgb, var(--color-primary) 5%, #ffffff);
  transform: translateY(-1px);
}

.blog-pagination .page-numbers.current,
.blog-pagination .current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.blog-pagination .dots {
  background: transparent;
  border: 0;
}

/* =========================================================
   06. ESTADO VACÍO
   ========================================================= */

.blog-no-posts {
  padding: 48px 24px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.blog-no-posts h2 {
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 19px;
}

.blog-no-posts p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

/* =========================================================
   07. RESPONSIVE
   ========================================================= */

/* Tablet: 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .blog-page .container,
  .blog-page .container-large {
    width: min(100% - 40px, 960px);
  }

  .blog-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

/* Mobile & Tablet pequeña: <= 768px */
@media (max-width: 768px) {
  .blog-page .container,
  .blog-page .container-large {
    width: min(100% - 32px, 640px);
  }

  .blog-categories-nav {
    margin-bottom: 20px;
  }

  .blog-categories-list {
    gap: 6px;
    padding: 4px 0;
  }

  .blog-categories-list li a {
    padding: 6px 13px;
    font-size: 12.5px;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .post-card-content {
    padding: 16px 18px 18px;
  }

  .post-card-title {
    font-size: 16px;
  }

  .post-card-excerpt {
    font-size: 13px;
    margin-bottom: 14px;
  }

  .blog-pagination {
    margin-top: 30px;
  }
}

/* Mobile pequeño: <= 480px */
@media (max-width: 480px) {
  .blog-page .container,
  .blog-page .container-large {
    width: calc(100% - 28px);
  }

  .post-card-content {
    padding: 15px 16px 16px;
  }

  .blog-pagination .page-numbers {
    min-width: 35px;
    height: 35px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .blog-no-posts {
    padding: 36px 16px;
  }
}

/* Mobile muy pequeño: <= 360px */
@media (max-width: 360px) {
  .blog-page .container,
  .blog-page .container-large {
    width: calc(100% - 22px);
  }

  .post-card-title {
    font-size: 15px;
  }
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  .blog-page *,
  .blog-page *::before,
  .blog-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
