/* ==========================================================
   GobernArte Encuestas Grid (Grid Search GL)
   - Grid responsive respetando columnas configuradas
   - Controlado por: .gae-wrap[data-columns="X"]
   - Soporta infinite scroll por IntersectionObserver (.gae-sentinel)
========================================================== */

/* =========================
   CONTENEDOR GENERAL
========================= */
.gae-wrap{
  width: 100%;
  max-width: 100%;
  padding: 18px 0;
  box-sizing: border-box;
}

.gae-wrap *,
.gae-wrap *::before,
.gae-wrap *::after{
  box-sizing: border-box;
}

/* =========================
   HEADER
========================= */
.gae-header{
  margin-bottom: 16px;
  padding: 0 18px;
}

.gae-title h2{
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 700;
}

/* =========================
   CONTROLES (FILTROS)
========================= */
.gae-controls{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gae-search{
  padding: 10px 12px;
  border: 1px solid #2a2a2a33;
  border-radius: 10px;
  outline: none;
  min-width: 240px;
  flex: 2 1 260px;
}

.gae-filter{
  padding: 10px 12px;
  border: 1px solid #2a2a2a33;
  border-radius: 10px;
  outline: none;
  min-width: 160px;
  flex: 1 1 160px;
}

.gae-btn{
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

/* Desktop: todo en una línea (si cabe) */
@media (min-width: 992px){
  .gae-controls{
    flex-wrap: nowrap;
  }
  .gae-search{
    min-width: 320px;
  }
  .gae-filter{
    min-width: 170px;
  }
}

/* =========================
   CUERPO
========================= */
.gae-body{
  width: 100%;
  max-width: 100%;
  padding: 0 18px;
}

/* =========================
   GRID (RESPETA CONFIG)
   - Móvil: 1
   - Tablet: 2
   - Desktop: usa data-columns
========================= */
.gae-grid{
  width: 100%;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Tablet: 2 columnas */
@media (min-width: 700px){
  .gae-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop: respeta configuración */
@media (min-width: 1100px){
  /* fallback */
  .gae-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gae-wrap[data-columns="2"] .gae-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gae-wrap[data-columns="3"] .gae-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gae-wrap[data-columns="4"] .gae-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =========================
   TARJETAS
========================= */
.gae-card{
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ffffff14;
  background: #ffffff08;
  transition: transform .15s ease, box-shadow .15s ease;
}

.gae-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.gae-card-link{
  display: block;
  text-decoration: none;
  color: inherit;
}

.gae-card-thumb{
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: #00000010;
}

.gae-card-body{
  padding: 12px 14px 14px;
}

.gae-card-title{
  margin: 0 0 6px 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
}

.gae-card-meta{
  font-size: 12px;
  opacity: 0.75;
}

.gae-card-excerpt{
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

/* =========================
   LOADING
========================= */
.gae-loading{
  margin: 20px 0;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  border: 1px dashed #ffffff2a;
  font-weight: 600;
}

/* =========================
   INFINITE SCROLL SENTINEL
   - Elemento “invisible” que dispara cargas
========================= */
.gae-sentinel{
  width: 100%;
  height: 1px;
  margin-top: 1px;
  opacity: 0;
  pointer-events: none;
}

/* =========================
   BOTONES RÁPIDOS (ATAJOS)
========================= */
.gae-quick-buttons{
  padding: 0 18px;
  margin: 14px 0;
}

.gae-quick-buttons-title{
  font-weight: 700;
  margin-bottom: 8px;
}

.gae-quick-buttons-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gae-qb{
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #2a2a2a33;
  background: #ffffff;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease, transform .15s ease;
}

.gae-qb:hover{
  background: #f5f5f5;
  transform: translateY(-1px);
}