/* SpaceGate Nova — unified movies/series hubs v2 */
.sg-content-hub,
.sg-content-listing {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 8%, rgba(139, 66, 255, .12), transparent 34rem),
    var(--sg3-bg, #030308);
}

.sg-content-hero {
  position: relative;
  min-height: clamp(530px, 76vh, 780px);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: 120px var(--sg3-page) 76px;
  background: #07070d;
}

.sg-content-hero > img,
.sg-content-listing-hero > img,
.sg-content-category > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sg-content-hero > img {
  z-index: -3;
  object-position: center 28%;
  filter: saturate(.88) contrast(1.04);
}

.sg-content-hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 3, 8, .98) 0%, rgba(3, 3, 8, .72) 44%, rgba(3, 3, 8, .16) 78%),
    linear-gradient(0deg, var(--sg3-bg, #030308) 0%, rgba(3, 3, 8, .42) 36%, transparent 72%);
}

.sg-content-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  z-index: -1;
  background: linear-gradient(0deg, var(--sg3-bg, #030308), transparent);
}

.sg-content-hero__copy {
  width: min(680px, 92vw);
  animation: sgContentReveal .75s cubic-bezier(.16, 1, .3, 1) both;
}

.sg-content-hero__copy > small,
.sg-content-categories__head small,
.sg-content-listing-hero small {
  display: block;
  color: var(--sg3-cyan, #45d7ff);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.sg-content-hero__copy h1 {
  margin: 10px 0 18px;
  font-family: Manrope, Alexandria, sans-serif;
  font-size: clamp(3.5rem, 7vw, 7.4rem);
  line-height: .92;
  letter-spacing: -.055em;
}

.sg-content-hero__copy p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: clamp(13px, 1.08vw, 16px);
  line-height: 1.9;
}

.sg-content-hero__copy > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.sg-content-hero__secondary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .065);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(16px);
}

.sg-content-hub__body { padding-bottom: 100px; }

.sg-content-categories {
  padding: 34px var(--sg3-page) 20px;
  scroll-margin-top: 88px;
}

.sg-content-categories__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.sg-content-categories__head h2 {
  margin: 5px 0 0;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  line-height: 1;
}

.sg-content-categories__head > a {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.sg-content-categories__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sg-content-category {
  position: relative;
  min-height: 248px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 24px;
  background: #11121b;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .27);
  color: #fff;
  transform: translateZ(0);
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), border-color .35s ease, box-shadow .35s ease;
}

.sg-content-category:nth-child(1),
.sg-content-category:nth-child(2) {
  grid-column: span 2;
  min-height: 320px;
}

.sg-content-category > img {
  z-index: -3;
  transition: transform .8s cubic-bezier(.16, 1, .3, 1), filter .45s ease;
}

.sg-content-category__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(0deg, rgba(3, 3, 9, .98), rgba(3, 3, 9, .08) 78%),
    linear-gradient(120deg, rgba(139, 66, 255, .18), transparent 58%);
}

.sg-content-category--arabic .sg-content-category__shade {
  background: linear-gradient(0deg, rgba(3, 3, 9, .98), rgba(50, 18, 13, .08) 78%);
}

.sg-content-category--asian .sg-content-category__shade,
.sg-content-category--korean .sg-content-category__shade,
.sg-content-category--indian .sg-content-category__shade,
.sg-content-category--anime .sg-content-category__shade,
.sg-content-category--family .sg-content-category__shade {
  background: linear-gradient(0deg, rgba(3, 3, 9, .98), rgba(72, 22, 92, .1) 78%);
}

.sg-content-category__code {
  position: absolute;
  top: 16px;
  left: 16px;
  min-width: 34px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(5, 5, 11, .48);
  color: rgba(255, 255, 255, .86);
  font-family: Manrope, sans-serif;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  backdrop-filter: blur(12px);
}

.sg-content-category__copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 2;
}

.sg-content-category__copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--sg3-cyan, #45d7ff);
  font-size: 9px;
  font-weight: 800;
}

.sg-content-category__copy strong {
  display: block;
  font-size: clamp(1.35rem, 2vw, 2.1rem);
  line-height: 1.1;
}

.sg-content-category__copy i {
  display: block;
  max-width: 92%;
  margin-top: 7px;
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  font-style: normal;
  line-height: 1.65;
}

.sg-content-category:hover,
.sg-content-category:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(139, 66, 255, .5);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .42), 0 0 0 1px rgba(139, 66, 255, .08);
  outline: none;
}

.sg-content-category:hover > img,
.sg-content-category:focus-visible > img {
  transform: scale(1.055);
  filter: saturate(1.1);
}

.sg-content-category.is-empty { opacity: .72; }

.sg-content-listing-hero {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  padding: 118px var(--sg3-page) 54px;
  background: #080811;
}

.sg-content-listing-hero > img { z-index: -3; object-position: center 30%; }

.sg-content-listing-hero > span {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 3, 8, .98), rgba(3, 3, 8, .68) 48%, rgba(3, 3, 8, .2)),
    linear-gradient(0deg, var(--sg3-bg, #030308), transparent 72%);
}

.sg-content-listing-hero > div {
  width: min(700px, 92vw);
  animation: sgContentReveal .55s cubic-bezier(.16, 1, .3, 1) both;
}

.sg-content-listing-hero h1 {
  margin: 7px 0 12px;
  font-size: clamp(2.7rem, 5.4vw, 5.8rem);
  line-height: .95;
}

.sg-content-listing-hero p {
  max-width: 580px;
  margin: 0;
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
  line-height: 1.85;
}

.sg-content-listing__body { padding: 18px var(--sg3-page) 100px; }

/* Fixed-size tabs: hover does not move, resize, or cause adjacent tabs to jump. */
.sg-content-nav {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: -38px 0 28px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background: rgba(8, 8, 17, .82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  backdrop-filter: blur(24px) saturate(140%);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.sg-content-nav::-webkit-scrollbar { display: none; }

.sg-content-nav a {
  position: relative;
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 42px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .65);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  scroll-snap-align: start;
  transform: translateZ(0);
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.sg-content-nav a small {
  min-width: 20px;
  height: 20px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 8px;
  line-height: 1;
  transition: background-color .22s ease;
}

.sg-content-nav a:hover,
.sg-content-nav a:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
  outline: none;
}

.sg-content-nav a.is-active {
  border-color: rgba(139, 66, 255, .42);
  background: linear-gradient(120deg, rgba(139, 66, 255, .24), rgba(69, 215, 255, .1));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

.sg-content-nav a.is-active small { background: rgba(255, 255, 255, .14); }
.sg-content-nav a.is-empty:not(.is-active) { opacity: .58; }

.sg-content-listing__head { margin-bottom: 12px; padding: 0 !important; }
.sg-content-listing__head h2 { margin: 5px 0 0; font-size: clamp(1.9rem, 3.5vw, 3.8rem); }
.sg-content-filterbar { margin-bottom: 24px; }

/* Stabilize the primary navigation hover/active states against older theme layers. */
.sgx-signature .top-links { align-items: center; }
.sgx-signature .top-links a {
  position: relative !important;
  box-sizing: border-box !important;
  min-width: max-content;
  height: 38px !important;
  margin: 0 !important;
  line-height: 1 !important;
  transform: none !important;
  border: 1px solid transparent !important;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease !important;
}
.sgx-signature .top-links a::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  right: 14px !important;
  left: 14px !important;
  bottom: 2px !important;
  height: 2px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--sg3-cyan, #45d7ff), var(--sg3-violet, #8b42ff)) !important;
  transform: scaleX(0) !important;
  transform-origin: center !important;
  transition: transform .2s ease !important;
}
.sgx-signature .top-links a:hover,
.sgx-signature .top-links a:focus-visible {
  color: #fff !important;
  border-color: rgba(255, 255, 255, .08) !important;
  background: rgba(255, 255, 255, .065) !important;
  box-shadow: none !important;
  outline: none !important;
}
.sgx-signature .top-links a.active {
  color: #fff !important;
  border-color: rgba(139, 66, 255, .22) !important;
  background: rgba(139, 66, 255, .12) !important;
  box-shadow: none !important;
}
.sgx-signature .top-links a.active::after { transform: scaleX(1) !important; }

@keyframes sgContentReveal {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
  .sg-content-categories__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sg-content-category:nth-child(1),
  .sg-content-category:nth-child(2) { grid-column: span 1; min-height: 270px; }
}

@media (max-width: 760px) {
  .sg-content-hero { min-height: 620px; align-items: flex-end; padding: 112px 18px 58px; }
  .sg-content-hero > img { object-position: 58% center; }
  .sg-content-hero__shade {
    background:
      linear-gradient(0deg, rgba(3, 3, 8, 1) 0%, rgba(3, 3, 8, .78) 48%, rgba(3, 3, 8, .18) 82%),
      linear-gradient(90deg, rgba(3, 3, 8, .65), transparent);
  }
  .sg-content-hero__copy h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .sg-content-categories { padding: 28px 16px 14px; }
  .sg-content-categories__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .sg-content-category,
  .sg-content-category:nth-child(1),
  .sg-content-category:nth-child(2) { min-height: 205px; border-radius: 18px; }
  .sg-content-category__copy { right: 13px; bottom: 13px; left: 13px; }
  .sg-content-category__copy strong { font-size: 1.18rem; }
  .sg-content-category__copy i { display: none; }
  .sg-content-listing-hero { min-height: 350px; padding: 110px 18px 46px; }
  .sg-content-listing-hero > span {
    background:
      linear-gradient(0deg, rgba(3, 3, 8, 1), rgba(3, 3, 8, .48) 65%, rgba(3, 3, 8, .12)),
      linear-gradient(90deg, rgba(3, 3, 8, .45), transparent);
  }
  .sg-content-listing__body { padding: 14px 16px 88px; }
  .sg-content-nav { margin-top: -32px; border-radius: 15px; }
  .sg-content-nav a { min-width: 76px; min-height: 39px; padding: 0 11px; }
}

@media (max-width: 420px) {
  .sg-content-categories__grid { grid-template-columns: 1fr 1fr; }
  .sg-content-category,
  .sg-content-category:nth-child(1),
  .sg-content-category:nth-child(2) { min-height: 178px; }
  .sg-content-category__code { top: 10px; left: 10px; height: 22px; font-size: 7px; }
}

@media (hover: none) {
  .sg-content-category:hover { transform: none; }
  .sg-content-category:hover > img { transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-content-hero__copy,
  .sg-content-listing-hero > div { animation: none; }
  .sg-content-category,
  .sg-content-category > img,
  .sg-content-nav a,
  .sgx-signature .top-links a,
  .sgx-signature .top-links a::after { transition: none !important; }
}

/* Keep the home hero preview tabs stable while active/hovered. Older rules
   changed their width and vertical position, which made neighboring tabs jump. */
.sg3-hero__preview,
.sg3-hero__preview.is-active {
  width: clamp(120px, 11vw, 175px) !important;
  transform: none !important;
  box-sizing: border-box !important;
  transition: opacity .24s ease, border-color .24s ease, box-shadow .24s ease !important;
}
.sg3-hero__preview:hover,
.sg3-hero__preview:focus-visible {
  opacity: .9 !important;
  border-color: rgba(255, 255, 255, .3) !important;
  transform: none !important;
  outline: none !important;
}
.sg3-hero__preview.is-active {
  opacity: 1 !important;
  border-color: rgba(69, 215, 255, .62) !important;
}

@media (max-width: 760px) {
  .sg3-hero__preview,
  .sg3-hero__preview.is-active { width: 108px !important; }
}

@media (max-width: 420px) {
  .sg3-hero__preview,
  .sg3-hero__preview.is-active { width: 96px !important; }
}
