/* ==========================================================================
   Farmacia Parque Yamaguchi - Diseno del listado del blog
   Propuesta 1: cuadricula editorial de 3 columnas
   --------------------------------------------------------------------------
   AMBITO: solo el listado del blog. El plugin anade la clase .fpy-blog al
   <body> unicamente en esa pagina, y todo el archivo cuelga de ella. No afecta
   a categorias, etiquetas, busqueda, portada ni a la ficha del articulo.

   Nota importante: las reglas NO dependen de que exista un contenedor concreto
   (.entries). Depender de el fue el error de la version anterior: si el tema no
   lo pinta, no se aplicaba nada y las imagenes salian a tamano natural.

   PARA CAMBIAR DE PROPUESTA: sustituye este bloque entero. Nada mas depende
   de el, y el CSS se carga desde el plugin (assets/blog-listado.css).
   ========================================================================== */

/* ---- Rejilla ---------------------------------------------------------------
   El contenedor real de las tarjetas se marca desde JavaScript anadiendo
   .fpy-rejilla a su padre comun, sin depender de ninguna clase del tema. */
body.fpy-blog .fpy-rejilla {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 38px 26px !important;
  align-items: start;
  max-width: none;
}

/* ---- Tarjeta --------------------------------------------------------------- */
body.fpy-blog .entry-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* ---- Imagen destacada ------------------------------------------------------
   aspect-ratio recorta a 4:3 y object-fit evita la deformacion. */
body.fpy-blog .entry-card .ct-featured-image,
body.fpy-blog .entry-card figure {
  margin: 0 0 18px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
  background: #e7f0ea;
}

body.fpy-blog .entry-card .ct-featured-image img,
body.fpy-blog .entry-card figure img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transition: transform .45s ease;
}

body.fpy-blog .entry-card:hover .ct-featured-image img,
body.fpy-blog .entry-card:hover figure img {
  transform: scale(1.045);
}

/* Red de seguridad: ninguna imagen del listado puede desbordar su columna. */
body.fpy-blog .entry-card img {
  max-width: 100%;
  height: auto;
}

/* ---- Categoria ------------------------------------------------------------- */
body.fpy-blog .entry-card .entry-meta:first-of-type {
  order: -1;
  margin: 0 0 10px;
}

body.fpy-blog .entry-card .entry-meta:first-of-type .meta-categories a {
  display: inline-block;
  background: #e7f0ea;
  color: #294a38;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
}

body.fpy-blog .entry-card .entry-meta:first-of-type .meta-categories a:hover {
  background: #d9e8de;
}

/* ---- Titulo ---------------------------------------------------------------- */
body.fpy-blog .entry-card .entry-title {
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: -.022em;
  margin: 0 0 10px;
  font-weight: 700;
}

body.fpy-blog .entry-card .entry-title a {
  color: #292d2a;
  text-decoration: none;
}

body.fpy-blog .entry-card .entry-title a:hover {
  color: #528d67;
}

/* ---- Extracto -------------------------------------------------------------- */
body.fpy-blog .entry-card .entry-excerpt {
  font-size: 14.5px;
  line-height: 1.62;
  color: #6b726c;
  margin: 0 0 16px;
}

body.fpy-blog .entry-card .entry-excerpt p {
  margin: 0;
  /* Recorta a 3 lineas para que todas las tarjetas midan lo mismo. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Autor y fecha ---------------------------------------------------------
   La fecha baja al pie de la tarjeta. El autor se oculta porque en el contenido
   importado aparece siempre como "Admin" y no aporta nada. */
body.fpy-blog .entry-card .entry-meta:last-of-type {
  margin: auto 0 0;
  padding-top: 14px;
  font-size: 12.5px;
  color: #8a9089;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.fpy-blog .entry-card .entry-meta:last-of-type .meta-author {
  display: none;
}

body.fpy-blog .entry-card .entry-meta:last-of-type a {
  color: #8a9089;
  text-decoration: none;
}

/* ---- Paginacion ------------------------------------------------------------ */
body.fpy-blog .ct-pagination,
body.fpy-blog .pagination {
  margin-top: 58px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.fpy-blog .ct-pagination a,
body.fpy-blog .ct-pagination span,
body.fpy-blog .pagination a,
body.fpy-blog .pagination span {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #e0e6e1;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #4a554d;
}

body.fpy-blog .ct-pagination .current,
body.fpy-blog .pagination .current {
  background: #294a38;
  border-color: #294a38;
  color: #fff;
}

/* ---- Adaptacion a pantallas menores ---------------------------------------- */
@media (max-width: 1000px) {
  body.fpy-blog .fpy-rejilla {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  body.fpy-blog .fpy-rejilla {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 34px !important;
  }

  body.fpy-blog .entry-card .entry-title {
    font-size: 19px;
  }
}
