/* -------- Layout / Container -------- */
.opo-blog-grid {
  width: 100%;
}

/* Tabs sin fondo */
.opo-blog-grid__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
  max-width: 1140px;
  margin: 0 auto 2px auto;
  padding: 0 15px;
}

.opo-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  cursor: pointer;
  font-family: "Satoshi", Sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #2D2D2D;
  position: relative;
}

.opo-tab:hover, .opo-tab:focus, .opo-tab:active{
  background-color: transparent;
  color: #2D2D2D;
  text-decoration: none;
}

.opo-tab.is-active {
  color: #C1301D;
}

.opo-tab.is-active::after, .opo-tab:hover::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 100%;
  background: #2D2D2D;
  border-radius: 2px;
}

/* Contenido con fondo (posts + footer) */
.opo-blog-grid__content {
  background: #F4F5F8;
  border-radius: 18px;
  padding: 70px 15px 125px 15px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* -------- Grid -------- */
.opo-blog-grid__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  position: relative;
  max-width: 1140px;
  margin: auto;
}

@media (max-width: 1024px) {
  .opo-blog-grid__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .opo-blog-grid__grid { grid-template-columns: 1fr; }
}

/* -------- Card -------- */
.opo-card {
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  max-width: 365px;
}

.opo-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.opo-card__media {
  height: 260px;
  background-size: cover;
  background-position: center;
  border-radius: 25px;
  position: relative;
}

.opo-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #fff;
  background: #2E2E2E;
}

/* Colores por slug (ajusta a tus slugs reales) */
.opo-card--cat-articulo .opo-card__badge,
.opo-card--cat-articulos .opo-card__badge { background: #C83C2A; }

.opo-card--cat-consejo .opo-card__badge,
.opo-card--cat-consejos .opo-card__badge { background: #D7C4A7; color:#2A241E; }

.opo-card--cat-descargable .opo-card__badge,
.opo-card--cat-descargables .opo-card__badge { background: #E8C43A; color:#2A241E; }

.opo-card--cat-podcast .opo-card__badge,
.opo-card--cat-podcasts .opo-card__badge { background: #FFFFFF; color:#2A241E; }

.opo-card--cat-historia-real .opo-card__badge,
.opo-card--cat-historias-reales .opo-card__badge { background: #222; }

.opo-card__body {
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.opo-card__title {
  font-size: 24px;
  line-height: 25px;
  color: #2D2D2D;
  font-weight: 500;
  font-family: "ClashDisplay", Sans-serif;
}

.opo-card__excerpt {
  font-size: 12px;
  line-height: 14px;
  color: #2D2D2D;
  font-family: "Satoshi", Sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.opo-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 30px;
}

.opo-card__cta {
  font-size: 14px;
  line-height: 16px;
  font-weight: 700;
  color: #2D2D2D;
  font-family: "Satoshi", Sans-serif;
  letter-spacing: 1.5px;
}

.opo-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid #EDB926;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2D2D2D;
}

.opo-card__icon:hover{
  color: #2D2D2D;
}

.opo-card__icon svg {
  width: 22px;
  height: 22px;
}

/* -------- Footer -------- */
.opo-blog-grid__footer {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.opo-load-more {
  appearance: none;
  border: 1px solid rgba(17,17,17,.25);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.opo-load-more.is-loading {
  opacity: .7;
  cursor: progress;
}

.opo-blog-grid__status {
  font-size: 12px;
  color: rgba(17,17,17,.65);
}

.opo-blog-grid__empty {
  grid-column: 1 / -1;
  padding: 14px 0;
  color: rgba(17,17,17,.7);
}

/* -------- Overlay + spinner (sobre el bloque gris entero) -------- */
.opo-blog-grid__content.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.06);
  z-index: 5;
  border-radius: 18px;
  pointer-events: auto;
  cursor: progress;
}

.opo-blog-grid__content.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(17, 17, 17, 0.18);
  border-top-color: #E2572D;
  transform: translate(-50%, -50%);
  animation: opoSpin 0.9s linear infinite;
  z-index: 6;
}

@keyframes opoSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 768px) {
  .opo-blog-grid__content {
    padding: 35px 15px 60px 15px;
  }

  .opo-card__media {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .opo-blog-grid__content {
    padding: 24px 12px 40px 12px;
    border-radius: 14px;
  }

  .opo-card__media {
    height: 190px;
    border-radius: 18px;
  }

  .opo-blog-grid__tabs {
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .opo-tab {
    white-space: nowrap;
  }
}
