/* Media share public detail pages — mobile-first.
   Scope: main.nv-share-page / main.nv-share-layout (and body.nv-share-body).
   Share card class is nv-share-card (NOT landing carousel .nv-media-card).
   Landing carousel stays under body.nv-landing in styles.css — max-width:194px
   cannot apply here because class names no longer collide. */

main.nv-share-page,
main.nv-share-layout,
body.nv-share-body,
body.nv-share-body *,
body.nv-share-body *::before,
body.nv-share-body *::after,
main.nv-share-page *,
main.nv-share-page *::before,
main.nv-share-page *::after {
  box-sizing: border-box;
}

html:has(main.nv-share-page),
html:has(body.nv-share-body),
body.nv-share-body,
body:has(main.nv-share-page) {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html:has(main.nv-share-page),
  html:has(body.nv-share-body),
  body.nv-share-body,
  body:has(main.nv-share-page) {
    overflow-x: hidden;
  }
}

body.nv-share-body,
body:has(main.nv-share-page) {
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}

/* Containers: near full-bleed on mobile; tablet/desktop max-width at 900px+. */
body.nv-share-body .container,
body:has(main.nv-share-page) .container,
main.nv-share-page .container,
main.nv-share-layout .container,
body.nv-share-body .navbar.container,
body:has(main.nv-share-page) .navbar.container,
.nv-share-shell.container,
footer.nv-share-footer .container {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: auto;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

main.nv-share-page.nv-share-layout,
main.nv-share-page {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  padding: 0.75rem 0 2.5rem;
  margin: 0;
  overflow-x: clip;
}

.nv-share-backdrop {
  position: absolute;
  inset: 72px 0 auto 0;
  height: min(42vh, 360px);
  max-width: 100%;
  background-size: cover;
  background-position: center top;
  opacity: 0.28;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent);
  pointer-events: none;
}

.nv-share-shell {
  position: relative;
  z-index: 1;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}

/* Card is the layout root: poster sibling + copy (not a carousel flex child). */
main.nv-share-page .nv-share-card,
main.nv-share-layout .nv-share-card,
body.nv-share-body .nv-share-card,
.nv-share-shell > .nv-share-card {
  display: flex !important;
  flex-direction: column !important;
  flex: none !important;
  flex-grow: 0 !important;
  flex-shrink: 1 !important;
  flex-basis: auto !important;
  align-self: stretch !important;
  align-items: stretch !important;
  gap: 1.25rem;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-inline: 0 !important;
  transform: none;
  background: rgba(14, 14, 20, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.75rem;
  overflow: hidden;
}

main.nv-share-page .nv-share-card:hover,
main.nv-share-layout .nv-share-card:hover,
body.nv-share-body .nv-share-card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.nv-share-card--empty {
  max-width: 720px;
  margin: 2.5rem auto 0;
}

main.nv-share-page .nv-share-grid,
main.nv-share-layout .nv-share-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0;
  align-items: start;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  flex: 1 1 auto;
}

main.nv-share-page .nv-share-copy,
main.nv-share-layout .nv-share-copy,
main.nv-share-page .nv-share-grid > *,
main.nv-share-layout .nv-share-grid > * {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Mobile: poster spans the full card width. */
main.nv-share-page .nv-share-poster-wrap,
main.nv-share-layout .nv-share-poster-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  flex: 0 0 auto;
}

main.nv-share-page .nv-share-copy,
main.nv-share-page .nv-share-actions,
main.nv-share-page .nv-share-store-row,
main.nv-share-layout .nv-share-copy,
main.nv-share-layout .nv-share-actions,
main.nv-share-layout .nv-share-store-row {
  grid-column: 1;
  width: 100% !important;
  max-width: 100% !important;
}

main.nv-share-page .nv-share-poster,
main.nv-share-layout .nv-share-poster,
body.nv-share-body .nv-share-poster {
  position: static !important;
  display: block;
  flex: none !important;
  flex-shrink: 1 !important;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--card);
  overflow: visible;
}

.nv-share-poster--empty {
  min-height: 0;
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(145deg, rgba(109, 92, 255, 0.18), rgba(62, 184, 255, 0.08)),
    var(--card);
}

.nv-share-kicker {
  margin: 0 0 0.35rem;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: normal;
  word-break: normal;
}

main.nv-share-page .nv-share-copy h1,
main.nv-share-layout .nv-share-copy h1,
body.nv-share-body .nv-share-copy h1 {
  margin: 0;
  max-width: 100%;
  width: 100%;
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  white-space: normal;
}

.nv-share-meta,
.nv-share-muted {
  color: var(--muted);
}

main.nv-share-page .nv-share-meta,
body.nv-share-body .nv-share-meta {
  margin: 0.75rem 0 0;
  padding: 0;
  min-height: 0;
  flex: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
}

.nv-share-meta-bit {
  display: inline;
  white-space: nowrap;
}

.nv-share-meta-sep {
  display: inline;
  opacity: 0.55;
  user-select: none;
}

.nv-share-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
}

.nv-share-genre {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.nv-share-overview {
  margin: 1.25rem 0 0;
  max-width: 100%;
  width: 100%;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: normal;
  word-break: normal;
}

main.nv-share-page .nv-share-actions,
main.nv-share-page .nv-share-store-row,
body.nv-share-body .nv-share-actions,
body.nv-share-body .nv-share-store-row {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 100%;
}

main.nv-share-page .nv-share-actions .btn,
main.nv-share-page .nv-share-store-row .btn,
main.nv-share-page .nv-share-store-row .nv-share-store-soon,
body.nv-share-body .nv-share-actions .btn,
body.nv-share-body .nv-share-store-row .btn,
body.nv-share-body .nv-share-store-row .nv-share-store-soon {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.nv-share-store-row {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.nv-share-store-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  white-space: normal;
}

.nv-share-already-installed {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.nv-share-open-subtle {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-size: 0.88rem;
}

.nv-share-open-subtle:hover {
  color: #e4c56a;
}

/* Share landing primary CTA — Novaria black + gold (scoped; does not restyle marketing pages) */
main.nv-share-page .btn-primary,
main.nv-share-page .nv-share-btn-primary,
body.nv-share-body .btn-primary,
body.nv-share-body .nv-share-btn-primary {
  background: linear-gradient(145deg, #f0d78a 0%, #d4af37 42%, #b8860b 100%);
  color: #1a1408;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid rgba(240, 215, 138, 0.35);
  box-shadow:
    0 10px 28px rgba(184, 134, 11, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

main.nv-share-page .btn-primary:hover,
main.nv-share-page .nv-share-btn-primary:hover,
body.nv-share-body .btn-primary:hover,
body.nv-share-body .nv-share-btn-primary:hover {
  background: linear-gradient(145deg, #f5e0a0 0%, #e0bc48 45%, #c99614 100%);
  color: #140f05;
  box-shadow:
    0 14px 34px rgba(184, 134, 11, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

main.nv-share-page .btn-secondary.nv-share-btn-secondary,
body.nv-share-body .btn-secondary.nv-share-btn-secondary {
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: #e4c56a;
}

main.nv-share-page .btn-secondary.nv-share-btn-secondary:hover,
body.nv-share-body .btn-secondary.nv-share-btn-secondary:hover {
  border-color: rgba(228, 197, 106, 0.55);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: none;
}

main.nv-share-page .btn-outline:hover,
body.nv-share-body .btn-outline:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 24px rgba(184, 134, 11, 0.12);
}

.nv-share-cta-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: 100%;
  max-width: 22rem;
  margin-top: 1.5rem;
}

main.nv-share-page .nv-share-cta-stack .nv-share-store-row,
body.nv-share-body .nv-share-cta-stack .nv-share-store-row {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  margin-top: 0;
}

.nv-share-cta-stack .btn,
.nv-share-cta-stack .nv-share-store-soon {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.nv-share-cta-mobile[hidden],
.nv-share-cta-desktop[hidden],
#nv-share-already-installed[hidden] {
  display: none !important;
}

/* Progressive: prefer mobile CTA under 900px even before JS. */
@media (max-width: 899px) {
  .nv-share-cta-desktop:not([hidden]) {
    /* JS may still win via [hidden]; without JS show mobile only */
  }
  html:not(.nv-share-cta-js) .nv-share-cta-desktop {
    display: none !important;
  }
  html:not(.nv-share-cta-js) .nv-share-cta-mobile {
    display: block !important;
  }
}

@media (min-width: 900px) {
  html:not(.nv-share-cta-js) .nv-share-cta-mobile {
    display: none !important;
  }
  html:not(.nv-share-cta-js) .nv-share-cta-desktop {
    display: block !important;
  }
}

footer.nv-share-footer,
.nv-share-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  width: 100%;
  max-width: 100%;
}

.nv-share-footer a {
  color: var(--text);
}

.nv-share-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  overflow-wrap: anywhere;
}

@media (min-width: 480px) {
  main.nv-share-page {
    padding: 1.5rem 0 3.5rem;
  }

  main.nv-share-page .nv-share-card,
  main.nv-share-layout .nv-share-card,
  body.nv-share-body .nv-share-card {
    padding: 1.25rem;
  }

  .nv-share-overview {
    line-height: 1.7;
  }
}

@media (min-width: 900px) {
  body.nv-share-body .container,
  body:has(main.nv-share-page) .container,
  main.nv-share-page .container,
  main.nv-share-layout .container,
  body.nv-share-body .navbar.container,
  body:has(main.nv-share-page) .navbar.container,
  .nv-share-shell.container,
  footer.nv-share-footer .container {
    max-width: 1100px !important;
    padding-inline: 1.5rem;
  }

  main.nv-share-page {
    padding: 2rem 0 4rem;
  }

  .nv-share-backdrop {
    height: min(48vh, 420px);
  }

  main.nv-share-page .nv-share-card,
  main.nv-share-layout .nv-share-card,
  body.nv-share-body .nv-share-card,
  .nv-share-shell > .nv-share-card {
    display: grid !important;
    flex-direction: unset !important;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr) !important;
    align-items: start;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: clamp(1.25rem, 2vw, 2rem);
    width: 100% !important;
    max-width: 100% !important;
  }

  main.nv-share-page .nv-share-poster-wrap,
  main.nv-share-layout .nv-share-poster-wrap {
    max-width: 280px;
    margin-inline: 0;
    grid-column: 1;
    grid-row: 1;
  }

  main.nv-share-page .nv-share-grid,
  main.nv-share-layout .nv-share-grid {
    grid-column: 2;
    grid-row: 1;
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  main.nv-share-page .nv-share-copy h1,
  main.nv-share-layout .nv-share-copy h1,
  body.nv-share-body .nv-share-copy h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
  }

  .nv-share-overview {
    max-width: 68ch;
  }

  /* Desktop: CTA stack stays under overview in the copy column — not a floating row. */
  .nv-share-cta-desktop {
    width: 100%;
  }

  .nv-share-cta-stack,
  .nv-share-cta-desktop .nv-share-actions {
    margin-top: 1.75rem;
    max-width: 22rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }

  .nv-share-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nv-share-cta-mobile .nv-share-actions,
  .nv-share-cta-mobile .nv-share-store-row {
    flex-direction: column;
  }

  main.nv-share-page .nv-share-cta-stack .btn,
  main.nv-share-page .nv-share-cta-stack .nv-share-store-soon,
  main.nv-share-page .nv-share-cta-desktop .nv-share-actions .btn,
  main.nv-share-page .nv-share-cta-desktop .nv-share-store-row .btn,
  main.nv-share-page .nv-share-cta-desktop .nv-share-store-row .nv-share-store-soon,
  body.nv-share-body .nv-share-cta-stack .btn,
  body.nv-share-body .nv-share-cta-stack .nv-share-store-soon,
  body.nv-share-body .nv-share-cta-desktop .nv-share-actions .btn,
  body.nv-share-body .nv-share-cta-desktop .nv-share-store-row .btn,
  body.nv-share-body .nv-share-cta-desktop .nv-share-store-row .nv-share-store-soon {
    width: 100%;
    max-width: 100%;
  }

  .nv-share-footer {
    margin-top: 3rem;
    padding: 2rem 0 calc(3rem + env(safe-area-inset-bottom, 0px));
  }
}
