/* Greybox search page �?" reference port (section-rise entrance, pill input,
 * 5-column poster rail, DM Mono / Space Grotesk / Manrope type scale).
 * Loaded AFTER tailwind.min.css, so any .hidden collision is re-stated here.
 * Nav magnifier button styles live at the bottom of this file. */

/* ---- entrance: the single animation on open (0.4s, site ease) ---- */
@keyframes gxsp-rise {
  0% { opacity: 0; transform: translate3d(0, 10px, 0); }
  100% { opacity: 1; transform: translateZ(0); }
}

/* Flat black canvas while the search page owns the view (hero + ambient off). */
body.gx-search-mode { background: #000; }

.gx-search-page {
  padding: 132px 0 60px;
  min-height: calc(100vh - 74px);
  animation: gxsp-rise .4s cubic-bezier(.22, 1, .36, 1) both;
}

/* ---- intro block (kicker / headline / subtitle) ---- */
.gxsp-intro {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.gxsp-kicker {
  margin: 0 0 10px;
  color: #e8e6e1;
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  font-size: 10px;
  line-height: normal;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.gxsp-title {
  margin: 0;
  color: #f3f0ea;
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 600;
  font-size: clamp(38px, 5vw, 70px);
  line-height: .96;
  letter-spacing: -.065em;
}

.gxsp-sub {
  display: block;
  margin: 14px auto 0;
  max-width: 480px;
  color: rgba(255, 255, 255, .5);
  font-family: 'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
}

/* ---- search pill ---- */
.gxsp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .25);
  /* reference snaps focus colors with no transition */
}

.gxsp-head:focus-within {
  border-color: rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .11);
}

.gxsp-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, .4);
}

.gxsp-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 64px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  font-size: 18px;
  -webkit-appearance: none;
  appearance: none;
}

.gxsp-input::placeholder { color: rgba(255, 255, 255, .35); }
.gxsp-input::-webkit-search-cancel-button,
.gxsp-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.gxsp-clear {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, .55);
  background: transparent;
  cursor: pointer;
}

.gxsp-clear:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.gxsp-clear:focus-visible { outline: 2px solid #e8e6e1; outline-offset: 2px; }
.gxsp-clear svg { width: 16px; height: 16px; }
.gxsp-clear.hidden { display: none; }

/* ---- body wrapper ---- */
.gxsp-body { margin-top: 34px; }

/* ---- recent searches ---- */
.gxsp-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.gxsp-clear-recent {
  border: 0;
  background: none;
  padding: 0;
  color: rgba(255, 255, 255, .3);
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  cursor: pointer;
  transition: color .15s;
}

.gxsp-clear-recent:hover { color: #fff; }

.gxsp-recent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 6px;
}

.gxsp-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}

.gxsp-chip-text {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 2px 6px 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .65);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s;
}

.gxsp-chip-text:hover { color: #fff; }

.gxsp-chip-x {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.gxsp-chip-x:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* ---- section label ("Trending now", "Recent searches") ---- */
.gxsp-label {
  padding: 0 0 16px;
  margin: 0;
  color: #f3f0f3;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.03em;
  text-align: left;
}

/* ---- poster grid: 5 columns desktop / 3 columns mobile ---- */
.gxsp-grid,
.gxsp-skel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  padding: 10px 0 28px;
}

/* ---- poster card ---- */
.gxsp-card {
  min-width: 0;
  cursor: pointer;
}

.gxsp-card:focus-visible { outline: none; }

.gxsp-poster {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  background: #0a0a0c;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  transition: transform .18s ease, box-shadow .18s ease;
}

.gxsp-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  background: #0a0a0c;
}

.gxsp-card:hover .gxsp-poster,
.gxsp-card:focus-visible .gxsp-poster,
.gxsp-card.active .gxsp-poster {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
}

.gxsp-title-line {
  display: block;
  margin: 6px 2px 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .9);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gxsp-meta {
  display: block;
  margin: 2px 2px 0;
  color: rgba(255, 255, 255, .35);
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 400;
  font-size: 9.5px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---- skeleton + empty/error states ---- */
.gxsp-skel {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  /* reference ships the shimmer keyframe undefined �?" kept static to match */
}

.gxsp-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 0 24px;
  color: rgba(255, 255, 255, .4);
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-align: center;
}

.gxsp-empty.gxsp-error { color: rgba(255, 160, 160, .7); }

/* ---- infinite-scroll shelf: tail skeletons + scroll sentinel ----
 * search.css loads after tailwind, so .gxsp-grid{display:grid} outranks the
 * generic .hidden — re-state it for the tail row (same trick as #gxsp-clear). */
.gxsp-tail {
  margin-top: 18px;
  padding: 0;
}

.gxsp-tail.hidden { display: none; }

.gxsp-sentinel {
  width: 100%;
  height: 1px;
}

/* ---- responsive ---- */
@media (max-width: 800px) {
  .gx-search-page { padding: 92px 0 114px; }
  .gxsp-intro { margin-bottom: 20px; }
  .gxsp-title { font-size: 40px; }
  .gxsp-sub { font-size: 12px; }
  .gxsp-head { padding: 0 17px; }
  .gxsp-input { height: 56px; font-size: 16px; }
  .gxsp-body { margin-top: 24px; }
  .gxsp-label { font-size: 17px; padding-bottom: 12px; }
  .gxsp-grid,
  .gxsp-skel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 0 8px;
  }
  .gxsp-tail {
    margin-top: 10px;
  }
}

/* ---- navbar magnifier button (opens the search page) ---- */
.gx-search-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1),
              color .22s ease,
              background-color .38s cubic-bezier(.22, 1, .36, 1);
}

.gx-search-btn svg { width: 17px; height: 17px; display: block; }

.gx-search-btn:hover {
  transform: translate3d(0, -1px, 0);
  color: #f3f0ea;
  background: rgba(255, 255, 255, .16);
}

.gx-search-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .45);
}

/* active route: white disc, dark glyph (reference indicator state) */
.gx-search-btn.is-active {
  background: #f3f0ea;
  color: #111;
}

.gx-search-btn.is-active:hover { color: #111; }

@media (prefers-reduced-motion: reduce) {
  .gx-search-page { animation: none; }
  .gx-search-btn { transition: none; }
}
