/* ===============================
   LEAF CATEGORY / ENTRIES PAGE
================================= */

.sd-category-page--leaf .sd-entry-hero{
  padding: 18px 0 20px;
}

/* GRID superior */
.sd-entry-hero__grid .sd-postgrid{
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

/* Cada tarjeta del grid superior con fondo blanco */
.sd-category-page--leaf .sd-entry-hero .sd-postcard{
  background: #fff;
  border: 1px solid #dddddd;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: none;
}

.sd-category-page--leaf .sd-entry-hero .sd-postcard__link{
  display: block;
  text-decoration: none;
  color: inherit;
}

.sd-category-page--leaf .sd-entry-hero .sd-postcard__media{
  background: #fff;
  padding: 10px;
}

.sd-category-page--leaf .sd-entry-hero .sd-postcard__img,
.sd-category-page--leaf .sd-entry-hero .sd-postcard__img--ph{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

.sd-category-page--leaf .sd-entry-hero .sd-postcard__body{
  padding: 8px 10px 10px;
  background: #fff;
}

/* Colapsado inicial: solo 15 */
.sd-category-page--leaf .sd-entry-hero__grid.is-collapsed .sd-postgrid > .sd-postcard:nth-child(n+16){
  display: none;
}

/* Expandido: mostrar todas */
.sd-category-page--leaf .sd-entry-hero__grid.is-expanded .sd-postgrid > .sd-postcard:nth-child(n+16){
  display: block;
}

.sd-entry-hero__grid{
  transition: all .2s ease;
}

/* CTA central */
.sd-entry-cta{
  display: flex;
  justify-content: center;
  margin: 28px 0 40px;
}

.sd-entry-cta__btn{
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(180deg, #2d8fd1 0%, #176cad 100%);
  box-shadow: 0 4px 14px rgba(12, 71, 114, 0.20);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  cursor: pointer;
  border: 0;
}

.sd-entry-cta__btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(12, 71, 114, 0.28);
  filter: brightness(0.96);
  color: #fff;
}

/* En vista leaf, las cajas internas siguen el patrón de category.css */
.sd-category-page--leaf .sd-home-panel__box .sd-postcard{
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.sd-category-page--leaf .sd-home-panel__box .sd-postcard__media{
  background: transparent;
  padding: 0 0 8px 0;
}

.sd-category-page--leaf .sd-home-panel__box .sd-postcard__img,
.sd-category-page--leaf .sd-home-panel__box .sd-postcard__img--ph{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 0;
}

.sd-category-page--leaf .sd-home-panel__box .sd-postcard__body{
  background: transparent;
  padding: 0;
}

/* Archivo final por si se reutiliza más adelante */
.sd-entry-archive{
  margin-top: 54px;
  padding-top: 8px;
}

.sd-entry-archive__box{
  background: #fff;
  border: 1px solid #dddddd;
  border-radius: 3px;
  padding: 14px 16px 16px;
}

.sd-postgrid--archive{
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.sd-postgrid--archive .sd-postcard{
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.sd-postgrid--archive .sd-postcard__media{
  background: transparent;
  padding: 0 0 8px 0;
}

.sd-postgrid--archive .sd-postcard__img,
.sd-postgrid--archive .sd-postcard__img--ph{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 0;
}

.sd-postgrid--archive .sd-postcard__body{
  background: transparent;
  padding: 0;
}

/* Paginación */
.sd-entry-pagination{
  margin-top: 26px;
}

.sd-entry-pagination .page-numbers{
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.sd-entry-pagination .page-numbers li{
  margin: 0;
  padding: 0;
}

.sd-entry-pagination a,
.sd-entry-pagination span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  background: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sd-entry-pagination a:hover{
  background: rgba(11, 118, 196, 0.10);
  color: #0b79b7;
  border-color: rgba(11, 118, 196, 0.35);
}

.sd-entry-pagination .current{
  background: #0b79b7;
  border-color: #0b79b7;
  color: #fff;
}

/* Más aire específico en vista de entradas */
.sd-category-page--leaf .sd-home-lists{
  margin-top: 8px;
}

.sd-category-page--leaf .sd-category-pills-block{
  margin-top: 58px;
  margin-bottom: 62px;
}

.sd-category-page--leaf .sd-category-bottom-grid{
  margin-top: 72px;
}

@media (max-width: 1180px){
  .sd-entry-hero__grid .sd-postgrid,
  .sd-postgrid--archive{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px){
  .sd-entry-hero__grid .sd-postgrid,
  .sd-postgrid--archive{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){
  .sd-entry-hero__grid .sd-postgrid,
  .sd-postgrid--archive{
    grid-template-columns: 1fr;
  }
}