/* =================================================================== */
/* ===           FASTALK - HOJA DE ESTILOS: BLOG (V4)              === */
/* ===   Extraído de la versión "Definitiva" del 21 Enero 2026     === */
/* =================================================================== */

/* ------------------------------------ */
/* 1. HEADER DE PÁGINA (Específico)     */
/* ------------------------------------ */
.page-header-section {
  padding-top: 180px;
  padding-bottom: 4rem;
  background-color: var(--color-bg-light);
  position: relative;
}

.page-header-section--grid-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  max-width: 1200px;
  background: radial-gradient(circle, rgba(74, 58, 255, 0.08) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}

.page-header-section--grid-bg::after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(74, 58, 255, 0.1) 1px, transparent 1px),
    linear-gradient(to right, rgba(74, 58, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, white 20%, transparent 80%);
  z-index: 0;
}

.page-header-section .container {
  position: relative;
  z-index: 1;
}

.text-center {
  text-align: center;
}


/* ------------------------------------ */
/* 2. LAYOUT PRINCIPAL (Grid 2 Cols)    */
/* ------------------------------------ */
.blog-layout-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 992px) {
  .blog-layout-container {
    grid-template-columns: 280px 1fr;
    /* Sidebar fija, contenido flexible */
    gap: 3.5rem;
  }
}

.blog-main-content {
  display: flex;
  flex-direction: column;
}


/* ------------------------------------ */
/* 3. SIDEBAR Y WIDGETS                 */
/* ------------------------------------ */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.sidebar-widget {
  background-color: var(--color-bg-secondary-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.sidebar-widget__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

/* Lista de Categorías */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-list a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 500;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-smooth);
}

.category-list a:hover {
  background-color: var(--color-accent-subtle-bg);
  color: var(--color-accent-primary);
  transform: translateX(5px);
}

.category-list a.is-active {
  background-color: var(--color-accent-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-light-sm);
}

/* Nube de Tags */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-cloud a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-light);
  padding: 0.4rem 0.9rem;
  border-radius: var(--border-radius-pill);
  text-decoration: none;
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-smooth);
}

.tag-cloud a:hover {
  background-color: var(--color-accent-subtle-bg);
  color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  transform: translateY(-2px);
}

.tag-cloud a.is-active {
  background-color: var(--color-accent-primary);
  color: #ffffff;
  border-color: transparent;
}


/* ------------------------------------ */
/* 4. CONTROLES (Búsqueda, Orden, Filtros) */
/* ------------------------------------ */
.blog-main-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .blog-main-header {
    grid-template-columns: 1fr auto;
  }
}

.search-control,
.sort-control {
  position: relative;
}

.search-control .material-icons,
.sort-control .material-icons {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  pointer-events: none;
}

#search-input,
#sort-select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  padding-left: 48px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg-secondary-light);
  transition: all var(--transition-smooth);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: var(--color-text-primary);
}

#search-input:focus,
#sort-select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px rgba(74, 58, 255, 0.2);
}

#sort-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239a9faf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Filtros Activos */
#active-filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2.5rem;
  min-height: 40px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-accent-subtle-bg);
  color: var(--color-accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-pill);
  border: 1px solid var(--color-accent-primary);
  /* Asegurado */
}

.active-filter-tag button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--color-accent-primary);
  opacity: 0.7;
  transition: opacity var(--transition-smooth);
}

.active-filter-tag button:hover {
  opacity: 1;
}


/* ------------------------------------ */
/* 5. TARJETA HÉROE (Post Destacado)    */
/* ------------------------------------ */
.blog-hero__card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 95%;
  /* Ajuste estético */
  margin: 0 auto 3.5rem auto;
  background-color: var(--color-bg-secondary-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(29, 43, 72, 0.08);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (min-width: 992px) {
  .blog-hero__card {
    grid-template-columns: 1.5fr 1fr;
  }
}

.blog-hero__card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(29, 43, 72, 0.12);
}

/* Aura de foco */
.blog-hero__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.blog-hero__card:hover::before {
  opacity: 1;
}

.blog-hero__image-wrapper {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}

.blog-hero__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-hero__card:hover .blog-hero__image {
  transform: scale(1.05);
}

.blog-hero__content {
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blog-hero__tag {
  display: inline-block;
  background: var(--gradient-text);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  align-self: flex-start;
}

.blog-hero__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  text-decoration: none;
}

.blog-hero__card a:hover .blog-hero__title {
  color: var(--color-accent-primary);
}

.blog-hero__excerpt {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.blog-hero__author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-bg-secondary-light);
  box-shadow: 0 0 0 2px var(--color-accent-primary);
}

.author__name {
  font-weight: 600;
  color: var(--color-text-primary);
}

.author__date {
  font-size: 0.9rem;
  color: var(--color-text-tertiary);
}


/* ------------------------------------ */
/* 6. GRID DE POSTS (Listado)           */
/* ------------------------------------ */
.blog-posts-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  /* Móvil */
}

@media (min-width: 768px) {
  .blog-main-content .blog-posts-grid {
    grid-template-columns: repeat(2, 1fr);
    /* Tablet y Desktop */
  }
}

.blog-post-card {
  position: relative;
  /* Contexto para stretched-link y aura */
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-secondary-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-light-md);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

.blog-post-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-light-lg);
}

/* Efecto Aura en Cards Pequeñas */
.blog-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.blog-post-card:hover::before {
  opacity: 1;
}

.post-card__image-link {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.post-card__content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-tertiary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.post-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.post-card__meta-item .material-icons {
  font-size: 16px;
}

.post-card__title-link {
  text-decoration: none;
}

.post-card__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
  margin-bottom: 0.75rem;
  transition: color var(--transition-smooth);
}

.post-card__title-link:hover .post-card__title {
  color: var(--color-accent-primary);
}

.post-card__excerpt {
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
}

.post-card__tag-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-pill);
  text-decoration: none;
  transition: all var(--transition-smooth);
  position: relative;
  z-index: 5;
  /* Encima del stretched-link */
}

.post-card__tag-link:hover {
  background-color: var(--color-accent-subtle-bg);
  color: var(--color-accent-primary);
}

/* Enlace expandido */
.stretched-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0);
}

/* Flecha animada en Hover */
.post-card__arrow-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  font-size: 28px;
  color: #ffffff;
  background-color: var(--color-accent-primary);
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 4px 15px rgba(74, 58, 255, 0.3);
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-post-card:hover .post-card__arrow-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Estado Vacío (Sin resultados) */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-lg);
}


/* ------------------------------------ */
/* 7. PAGINACIÓN                        */
/* ------------------------------------ */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 4rem;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 0.5rem;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 600;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-smooth);
}

.pagination a:hover {
  border-color: var(--color-accent-primary);
  background-color: var(--color-accent-subtle-bg);
  color: var(--color-accent-primary);
}

.pagination .page-item.active a {
  background-color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-light-md);
}

.pagination .page-item.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* --- 5. TARJETA HÉROE (Featured Post) - FIX APLICADO --- */

/* Aseguramos que ningún enlace dentro del héroe tenga subrayado */
.blog-hero__card,
.blog-hero__card a {
  text-decoration: none !important;
}

.blog-hero__title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  display: block;

  /* 1. Eliminamos subrayado con máxima prioridad */
  text-decoration: none !important;
  border: none;

  /* 2. TRANSICIÓN SUAVE (Fucking Smooth) */
  transition: color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* El hover ahora es más específico para asegurar el cambio de color */
.blog-hero__card:hover .blog-hero__title {
  color: var(--color-accent-primary);
  text-decoration: none !important;
}

/* OPCIONAL: Si al hacer hover sobre el TITULO directamente quieres el efecto */
.blog-hero__title:hover {
  color: var(--color-accent-primary);
  text-decoration: none !important;
}