/**
 * noticias.css - Portada de noticias y pagina de articulo.
 *
 * POR QUE EXISTE
 * Estos estilos estaban dentro de un <style> en page/noticias.html. Al aparecer la pagina
 * de articulo (php/noticia.php) los necesitaban las dos, y una tarjeta no puede verse
 * distinta segun donde se pinte. Se sacaron aqui para tener un solo sitio donde tocarlos.
 *
 * Se apoya en style.css: los colores y la cabecera .section-title vienen de alli. Aqui solo
 * va lo propio de noticias. Color de marca: #106eea.
 *
 * SECCIONES
 *   1. Tarjetas del listado (las usa la portada, las relacionadas y el 404)
 *   2. Filtro por tema
 *   3. Pagina de articulo
 *   4. Bloque de soluciones y relacionadas
 */

/* ── 1. Tarjetas del listado ─────────────────────────────────────────────── */

.blog-card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  transition: transform .25s, box-shadow .25s;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .14);
}

.blog-card .card-body {
  display: flex;
  flex-direction: column;
}

.blog-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.blog-card .card-text {
  font-size: .9rem;
  color: #555;
  flex-grow: 1;
}

.blog-card .card-date {
  font-size: .8rem;
  color: #106eea;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.blog-card .btn-read {
  background: #106eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: .85rem;
  font-weight: 600;
  margin-top: 14px;
  display: inline-block;
  text-decoration: none;
  align-self: flex-start;
  transition: background .2s;
}

.blog-card .btn-read:hover {
  background: #0d5ecc;
  color: #fff;
}

.badge-tag {
  background: #e2eefd;
  color: #106eea;
  font-size: .75rem;
  border-radius: 20px;
  padding: 3px 10px;
  margin-right: 4px;
  /* La tarjeta es un flex en columna: sin esto la pildora se estira a todo el ancho y
     parece una barra en vez de una etiqueta. */
  align-self: flex-start;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state i {
  font-size: 3rem;
  color: #cce0fb;
  margin-bottom: 16px;
  display: block;
}

/* Esqueleto mientras carga el listado: evita que la pagina "salte" cuando llegan los datos */
.skeleton { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .4 } }
.skeleton-card { background: #f1f6fe; border-radius: 10px; height: 220px; }

/* ── 2. Filtro por tema ──────────────────────────────────────────────────── */

.noticias-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.noticias-filtros button {
  background: #fff;
  border: 1px solid #e2eefd;
  color: #555;
  border-radius: 50px;
  padding: 7px 18px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.noticias-filtros button:hover { border-color: #106eea; color: #106eea; }
.noticias-filtros button.activo { background: #106eea; border-color: #106eea; color: #fff; }

.noticias-subtitulo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  margin: 40px 0 20px;
}

.noticias-mas {
  text-align: center;
  margin-top: 36px;
}

.noticias-mas button {
  background: #fff;
  color: #106eea;
  border: 2px solid #106eea;
  border-radius: 8px;
  padding: 10px 28px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.noticias-mas button:hover { background: #106eea; color: #fff; }

/* ── 3. Pagina de articulo ───────────────────────────────────────────────── */

/* El texto se limita a ~720px: una linea muy larga cansa y se pierde el renglon. El resto
   de bloques del articulo se alinean a la misma columna. */
.articulo-cabecera,
.articulo-meta,
.articulo-cuerpo,
.articulo-soluciones,
.articulo-relacionadas,
.articulo-volver {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.articulo-cabecera { padding-bottom: 16px; }
.articulo-cabecera h1 { line-height: 1.25; }

@media (min-width: 1024px) {
  /* El subtitulo hereda del .section-title un ancho del 50%, demasiado estrecho para una
     frase larga cuando la columna ya esta limitada. */
  .articulo-cabecera p { width: 100%; }
}

.articulo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  font-size: .85rem;
  color: #777;
  padding-bottom: 28px;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 32px;
}

.articulo-meta i { color: #106eea; margin-right: 4px; }

.articulo-cuerpo {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #444;
}

.articulo-cuerpo p { margin-bottom: 20px; }

.articulo-cuerpo h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #222;
  margin: 36px 0 16px;
}

.articulo-cuerpo ul { padding-left: 22px; margin-bottom: 20px; }
.articulo-cuerpo li { margin-bottom: 10px; }
.articulo-cuerpo strong { color: #222; }

.articulo-cuerpo a {
  color: #106eea;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.articulo-cuerpo a:hover { color: #0d5ecc; }

.articulo-cuerpo img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 24px 0;
}

/* ── 4. Soluciones y relacionadas ────────────────────────────────────────── */

.articulo-soluciones {
  background: #f6f9fe;
  border: 1px solid #e2eefd;
  border-radius: 12px;
  padding: 28px;
  margin-top: 48px;
}

.articulo-soluciones h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}

.articulo-soluciones > p {
  font-size: .9rem;
  color: #555;
  margin-bottom: 18px;
}

.articulo-soluciones ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 20px;
}

.articulo-soluciones li a {
  color: #106eea;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.articulo-soluciones li a:hover { color: #0d5ecc; text-decoration: underline; }

.articulo-cta {
  background: #106eea;
  color: #fff;
  border-radius: 6px;
  padding: 10px 26px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  display: inline-block;
  transition: background .2s;
}

.articulo-cta:hover { background: #0d5ecc; color: #fff; }

.articulo-relacionadas { margin-top: 48px; }

.articulo-relacionadas h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 20px;
}

.relacionada {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}

.relacionada:hover {
  border-color: #106eea;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.relacionada-tema {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #106eea;
}

.relacionada-titulo {
  font-size: .95rem;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
}

.relacionada-fecha { font-size: .78rem; color: #888; }

.articulo-volver { margin-top: 40px; }

.articulo-volver a {
  color: #106eea;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}

.articulo-volver a:hover { text-decoration: underline; }
