/* — contenedor principal — */
.pg-wrap {
  max-width: 1280px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* — grid responsivo — */
.pg-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (max-width: 1024px) {
  .pg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .pg-grid { grid-template-columns: repeat(2, 1fr); }
}

/* — miniatura con overlay — */
.pg-thumb {
  position: relative;
  display: block;
  padding-top: 75%; /* Proporción 4:3 */
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.pg-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%; /* Estado base: 1/4 inferior */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  background: #FF4500;
  color: #fff;
  font-weight: 700;
  font-size: 1rem; /* Tamaño de fuente base reducido */
  line-height: 1.2; /* Interlineado reducido */
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  mix-blend-mode: hard-light;
  transition: height 0.4s ease, font-size 0.4s ease; /* Transición suave */
}

.pg-thumb:hover .pg-title,
.pg-thumb:focus .pg-title {
  height: 100%; /* Se expande al 100% */
  font-size: 1.4rem; /* Texto más grande en hover */
}

/* — filtros — */
.pg-filters {
  margin-bottom: 1rem;
}
.pg-filters__componentes label {
  margin-right: 1rem;
}
.pg-filters label {
  color: #444;    /* en caso de texto blanco por tema */
  font-size: 1rem;
}

/* — asegurar que .pg-item siempre esté visible — */
.pg-item {
  display: block;
}

/* — modal (backdrop + centrar con Flexbox) — */
.pg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 100000 !important; /* subir por encima de TODO */
}

/* mostrar cuando aria-hidden="false" o clase .is-open */
.pg-modal[aria-hidden="false"],
.pg-modal.is-open {
  display: flex;
}

/* — contenido interior del modal — */
.pg-modal__content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  background: #fff;
  padding: 1.5rem;
  border-radius: 4px;
  z-index: 100001; /* un peldaño más arriba */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .pg-modal__content {
    grid-template-columns: 1fr;
  }
}

/* — botón de cerrar — */
.pg-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #333;
  cursor: pointer;
  z-index: 10000;
}

/* — botón “Ir a la Plataforma” — */
.pg-btn {
  display: inline-block;
  padding: .5em 1.2em;
  background: #000;
  color: #fff;
  text-decoration: none;
}

/* Variación naranja para acceso restringido */
.pg-btn--restricted {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  background: #ff6a00;
  font-weight: 700;
  line-height: 1;
  transition: background-color .2s ease, transform .1s ease;
}

.pg-btn--restricted:hover,
.pg-btn--restricted:focus { background: #e85f00; }
.pg-btn--restricted:active { transform: translateY(1px); }
.pg-btn--restricted svg { width: 1.1em; height: 1.1em; display: inline-block; }

/* — accesibilidad: ocultar con aria — */
.pg-modal[aria-hidden="true"] {
  display: none !important;
}

/* — Contenedor de píldoras de filtro — */
.pg-pills-container {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pg-pill {
  display: inline-flex;
  align-items: center;
  background-color: #e0e0e0;
  color: #333;
  border-radius: 16px;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
}

.pg-pill__remove {
  margin-left: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  color: #888;
}

.pg-pill__remove:hover {
  color: #333;
}