/* =============================================
   SQUARE — Explore
============================================= */

/* ---- Search bar ---- */
.explore-search-wrap {
  padding: var(--s-4) var(--s-4) var(--s-3);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--grad-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.explore-search-bar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--surface-2);
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  padding: 0 var(--s-4);
  height: 46px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.explore-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.explore-search-bar img.isax { opacity: 0.5; flex-shrink: 0; }
.explore-search-bar:focus-within img.isax { opacity: 0.9; }

#exploreInput {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-body);
}
#exploreInput::placeholder { color: var(--text-3); }

.explore-search-clear {
  color: var(--text-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
  flex-shrink: 0;
}
.explore-search-clear.visible { opacity: 1; pointer-events: all; }

/* ---- Category pills ---- */
.explore-categories {
  display: flex;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.explore-categories::-webkit-scrollbar { display: none; }

.category-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
.category-pill:hover { background: var(--surface-2); color: var(--text); }
.category-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Section ---- */
.explore-section { margin-bottom: var(--s-6); }

.explore-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4) var(--s-2);
}
.explore-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.explore-see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity var(--t-fast) var(--ease);
}
.explore-see-all:hover { opacity: 0.7; }

/* ---- Trending pills row ---- */
.trending-pills-row {
  display: flex;
  gap: var(--s-2);
  padding: 0 var(--s-4) var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.trending-pills-row::-webkit-scrollbar { display: none; }

.trending-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-align: center;
}
.trending-pill:hover { border-color: var(--primary); background: var(--primary-glow); }
.trending-pill-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}
.trending-pill-count {
  font-size: 11px;
  color: var(--text-3);
  display: block;
  margin-top: 1px;
}

/* ---- People row ---- */
.explore-people-row {
  display: flex;
  gap: var(--s-3);
  padding: 0 var(--s-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.explore-people-row::-webkit-scrollbar { display: none; }

.explore-person-card {
  flex-shrink: 0;
  width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-4) var(--s-3);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.explore-person-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-2px);
}
.explore-person-card .avatar {
  width: 56px; height: 56px;
  margin: 0 auto var(--s-2);
}
.explore-person-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.explore-person-handle {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: var(--s-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.explore-follow-btn {
  width: 100%;
  padding: 6px 0;
  border-radius: var(--r-full);
  background: var(--grad-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: transform var(--t-base) var(--ease-spring), opacity var(--t-fast) var(--ease);
}
.explore-follow-btn:active { transform: scale(0.95); }
.explore-follow-btn.following {
  background: var(--surface-3);
  color: var(--text-2);
}

/* ---- Discovery grid ---- */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 var(--s-1);
}
.explore-grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  border-radius: 4px;
}
.explore-grid-item:nth-child(1),
.explore-grid-item:nth-child(7),
.explore-grid-item:nth-child(13) {
  grid-column: span 2;
  grid-row: span 2;
}
.explore-grid-item img,
.explore-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 120px;
  transition: transform 0.4s var(--ease);
}
.explore-grid-item:hover img,
.explore-grid-item:hover video { transform: scale(1.05); }

.explore-grid-item .grid-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 60%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  display: flex;
  align-items: flex-end;
  padding: var(--s-2);
  gap: 6px;
}
.explore-grid-item:hover .grid-overlay,
.explore-grid-item:active .grid-overlay { opacity: 1; }

.grid-overlay-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.grid-overlay-stat svg { flex-shrink: 0; }

.grid-video-badge {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: var(--r-full);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}
.grid-video-badge svg { flex-shrink: 0; }

/* ---- Search results ---- */
.search-results { padding: 0 0 var(--s-8); }
.search-result-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--s-4) var(--s-4) var(--s-2);
}
.search-result-user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.search-result-user:hover { background: var(--surface-2); }
.search-result-user .avatar { width: 44px; height: 44px; flex-shrink: 0; }
.search-result-name { font-size: 14px; font-weight: 700; color: var(--text); }
.search-result-handle { font-size: 12px; color: var(--text-3); }

.search-hashtag {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.search-hashtag:hover { background: var(--surface-2); }
.search-hashtag-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: var(--primary-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.search-hashtag-text { font-size: 14px; font-weight: 700; color: var(--text); }
.search-hashtag-count { font-size: 12px; color: var(--text-3); }

/* ---- Empty state ---- */
.explore-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px var(--s-8);
  text-align: center;
  gap: var(--s-3);
  color: var(--text-3);
}
.explore-empty img.isax { width: 56px; height: 56px; opacity: 0.3; }
.explore-empty p { font-size: 14px; font-weight: 500; line-height: 1.6; }

/* =============================================
   DESKTOP EXPLORE (>= 900px)
============================================= */
@media (min-width: 900px) {

  /* Sticky search moves to top of main column */
  .explore-search-wrap {
    top: 0;
    border-radius: 0;
  }

  /* Wider grid columns on desktop */
  .explore-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 0 var(--s-3);
  }

  /* Person cards: more visible */
  .explore-person-card {
    width: 160px;
  }
}
