.snite-explore {
  width: 100%;
  overflow-x: hidden; /* prevent horizontal scroll on wide filter rows */
}
/* Keep Explore as wide as the home/archive layouts, not edge-to-edge. */
.snite-explore.site-main { max-width: none !important; }

/* Prevent Explore styles from being overridden by theme/global link styles */
.snite-explore a { text-decoration: none !important; }

/* Keep header menus above the filter UI without changing footer layout. */
.site-header,
header.site-header {
  position: sticky;
  top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
  z-index: 9998;
}

.site-header .wp-block-navigation__responsive-container,
.site-header .wp-block-navigation__submenu-container,
header.site-header .wp-block-navigation__responsive-container,
header.site-header .wp-block-navigation__submenu-container {
  z-index: 9999;
}

/* Match the full-width Explore layout from the reference site. */
.snite-explore-inner {
  --snite-explore-pad-x: var(--wp--preset--spacing--40, clamp(16px, 2vw, 28px));
  width: 100%;
  max-width: none !important;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  padding-left: var(--snite-explore-pad-x);
  padding-right: var(--snite-explore-pad-x);
  padding-top: 1.25rem;
  padding-bottom: 1.75rem;
}

/* Filter menus (no <br> / <p>) */
.snite-explore-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.15rem;
  margin-bottom: 1rem;
  padding: 0.1rem 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.snite-explore-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.snite-explore-row-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.snite-explore-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.snite-explore .snite-explore-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--wp--preset--color--contrast, #fff);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.snite-explore .snite-explore-menu a:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.16);
  color: var(--wp--preset--color--contrast, #fff);
}

.snite-explore .snite-explore-menu a.is-active {
  background: #fff;
  border-color: #fff;
  color: #111;
  box-shadow: none !important;
}

.snite-explore .snite-explore-menu a:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-color);
  outline-offset: 2px;
}

/* Grid */
.snite-explore .snite-explore-grid {
  display: grid;
  gap: clamp(1rem, 1.5vw, 1.4rem);
  grid-template-columns: repeat(5, minmax(0px, 1fr));
  width: 100%;
}

@media (max-width: 62.5rem) {
  /* Keep selector specificity >= base rule so it actually overrides. */
  .snite-explore .snite-explore-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .snite-explore-row {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .snite-explore-row::-webkit-scrollbar {
    display: none;
  }
  .snite-explore-menu {
    flex-wrap: nowrap;
    width: max-content;
    min-width: max-content;
  }
  .snite-explore-menu li {
    flex: 0 0 auto;
  }
}

@media (max-width: 48rem) {
  .snite-explore .snite-explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .snite-explore-row,
  .snite-explore-menu {
    gap: 0.45rem;
  }
  .snite-explore .snite-explore-menu a {
    padding: 7px 12px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 37.5rem) {
  .snite-explore-inner {
    padding-left: var(--wp--preset--spacing--10, 0.75rem);
    padding-right: var(--wp--preset--spacing--10, 0.75rem);
  }
  .snite-explore-filters {
    gap: 0.45rem;
  }
  .snite-explore-row,
  .snite-explore-menu {
    gap: 0.4rem;
  }
  .snite-explore .snite-explore-menu a {
    padding: 7px 12px;
    font-size: 0.8125rem;
  }
  .snite-explore .snite-explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.875rem; }
}

/* Poster cards */
.snite-explore-card {
  border-radius: var(--wp--preset--border-radius--sm, 0.25rem);
  overflow: hidden;
  background: var(--wp--preset--color--surface-color, #1a1a1a);
  box-shadow: var(--wp--preset--shadow--sm, 0 2px 4px rgba(0, 0, 0, 0.26));
  min-height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.snite-explore-card:hover {
  transform: translateY(-2px);
}

.snite-explore-card a {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.snite-explore-poster {
  position: relative;
  aspect-ratio: 16 / 9 !important;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  border-radius: var(--wp--preset--border-radius--sm, 0.25rem) var(--wp--preset--border-radius--sm, 0.25rem) 0 0;
}

.snite-explore-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  display: block;
}

.snite-explore-badge {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.25rem 0.45rem;
  border-radius: 0.375rem;
  background: rgba(0,0,0,0.55);
  font-size: 0.75rem;
  line-height: 1;
}

.snite-explore-title {
  padding: 14px;
  font-size: var(--wp--preset--font-size--medium, 1rem);
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snite-explore-pagination {
  margin-top: 1.25rem;
}

.snite-explore-pagination .page-numbers {
    background: var(--wp--preset--color--surface-color);
    border-radius: var(--wp--preset--border-radius--sm);
    box-shadow: var(--wp--preset--shadow--sm);
    font-size: .875rem;
    padding: .325rem 1rem;
    text-decoration: none
}

.snite-explore-pagination .page-numbers.current {
  border-color: var(--wp--preset--color--accent-color);
  background: rgba(255,255,255,0.10);
}

.snite-explore-pagination .page-numbers:hover {
  background: rgba(255,255,255,0.08);
}
