/**
 * StartupSocial — shared theme tokens + header chrome (index + inner pages).
 * Use with body.ss-branded and/or body.ss-home-mode.
 */

body.ss-branded,
body.ss-home-mode {
  --mm-bg: #0a0a0b;
  --mm-surface: #121214;
  --mm-border: rgba(255, 255, 255, 0.08);
  --mm-muted: rgba(255, 255, 255, 0.58);
  --mm-heading: #fafafa;
  --mm-header-tagline: rgba(255, 255, 255, 0.93);
  --mm-accent: #ff7f00;
  --mm-max: 1180px;
}

body.ss-branded[data-theme="light"],
body.ss-home-mode[data-theme="light"] {
  --mm-bg: #f4f4f5;
  --mm-surface: #ffffff;
  --mm-border: rgba(0, 0, 0, 0.08);
  --mm-muted: rgba(0, 0, 0, 0.55);
  --mm-heading: #0a0a0b;
  --mm-header-tagline: rgba(10, 10, 11, 0.68);
  --mm-accent: #e86800;
}

body.ss-branded #dark-overlay,
body.ss-home-mode #dark-overlay {
  background: rgba(0, 0, 0, 0.38) !important;
}

body.ss-branded[data-theme="light"] #light-overlay,
body.ss-home-mode[data-theme="light"] #light-overlay {
  background: rgba(255, 255, 255, 0.72) !important;
}

body.ss-branded .main-content-wrapper,
body.ss-home-mode .main-content-wrapper {
  background: transparent;
}

/* —— Header —— */
body.ss-branded .sticky-header.ss-mm-header,
body.ss-home-mode .sticky-header.ss-mm-header {
  background: rgba(10, 10, 11, 0.72) !important;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--mm-border) !important;
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.75rem;
}

/* Logo may shrink so lang + theme stay on one row */
body.ss-branded .sticky-header.ss-mm-header > .logo,
body.ss-home-mode .sticky-header.ss-mm-header > .logo {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin-bottom: 0 !important;
}

body.ss-branded[data-theme="light"] .sticky-header.ss-mm-header,
body.ss-home-mode[data-theme="light"] .sticky-header.ss-mm-header {
  background: rgba(255, 255, 255, 0.82) !important;
}

body.ss-branded .ss-mm-nav-desktop,
body.ss-home-mode .ss-mm-nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
  flex: 1;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 1100px) {
  body.ss-branded .ss-mm-nav-desktop,
  body.ss-home-mode .ss-mm-nav-desktop {
    display: flex;
  }
}

body.ss-branded .ss-mm-nav-desktop a,
body.ss-home-mode .ss-mm-nav-desktop a {
  color: var(--mm-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

body.ss-branded .ss-mm-nav-desktop a:hover,
body.ss-home-mode .ss-mm-nav-desktop a:hover,
body.ss-branded .ss-mm-nav-desktop a.ss-mm-nav-active,
body.ss-home-mode .ss-mm-nav-desktop a.ss-mm-nav-active {
  color: var(--mm-heading);
}

body.ss-branded .ss-mm-pill-cta,
body.ss-home-mode .ss-mm-pill-cta {
  display: none;
  align-items: center;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1c0d00 !important;
  background: linear-gradient(135deg, #ffa040, #ff7f00);
  border: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  body.ss-branded .ss-mm-pill-cta,
  body.ss-home-mode .ss-mm-pill-cta {
    display: inline-flex;
  }
}

body.ss-branded .ss-mm-pill-cta:hover,
body.ss-home-mode .ss-mm-pill-cta:hover {
  color: #1c0d00 !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 127, 0, 0.4);
}

body.ss-branded[data-theme="light"] .ss-mm-pill-cta,
body.ss-home-mode[data-theme="light"] .ss-mm-pill-cta {
  color: #fff !important;
  background: linear-gradient(135deg, #e86800, #c45a00);
}

body.ss-branded[data-theme="light"] .ss-mm-pill-cta:hover,
body.ss-home-mode[data-theme="light"] .ss-mm-pill-cta:hover {
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(232, 104, 0, 0.4);
}

body.ss-branded .sticky-header.ss-mm-header .logo .text-container span:first-child,
body.ss-branded .sticky-header.ss-mm-header .ss-brand-wordmark,
body.ss-home-mode .sticky-header.ss-mm-header .logo .text-container span:first-child,
body.ss-home-mode .sticky-header.ss-mm-header .ss-brand-wordmark {
  font-family: "Syne", "Outfit", sans-serif !important;
  font-weight: 700 !important;
}

body.ss-branded .sticky-header.ss-mm-header .tagline,
body.ss-home-mode .sticky-header.ss-mm-header .tagline {
  font-family: "Poppins", sans-serif !important;
  font-weight: 400 !important;
  font-size: 0.72rem !important;
  line-height: 1.25 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--mm-header-tagline) !important;
  opacity: 1 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  -webkit-font-smoothing: antialiased;
}

body.ss-branded[data-theme="dark"] .sticky-header.ss-mm-header .tagline,
body.ss-home-mode[data-theme="dark"] .sticky-header.ss-mm-header .tagline {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

body.ss-branded .header-controls,
body.ss-home-mode .header-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Language select: explicit surface + text (avoids white text on white from Bootstrap + header inheritance) */
body.ss-branded .sticky-header.ss-mm-header .ss-lang-select,
body.ss-home-mode .sticky-header.ss-mm-header .ss-lang-select {
  flex-shrink: 0;
  width: auto;
  min-width: 6.75rem;
  max-width: 9.25rem;
  padding: 0.32rem 1.85rem 0.32rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 0.375rem;
  border: 1px solid var(--mm-border) !important;
  background-color: var(--mm-surface) !important;
  color: var(--mm-heading) !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.45rem center !important;
  background-size: 0.65rem !important;
  cursor: pointer;
}

body.ss-branded[data-theme="light"] .sticky-header.ss-mm-header .ss-lang-select,
body.ss-home-mode[data-theme="light"] .sticky-header.ss-mm-header .ss-lang-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
}

body.ss-branded .sticky-header.ss-mm-header .ss-lang-select:focus,
body.ss-home-mode .sticky-header.ss-mm-header .ss-lang-select:focus {
  border-color: var(--mm-accent) !important;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(255, 127, 0, 0.35) !important;
}

body.ss-branded[data-theme="light"] .sticky-header.ss-mm-header .ss-lang-select:focus,
body.ss-home-mode[data-theme="light"] .sticky-header.ss-mm-header .ss-lang-select:focus {
  box-shadow: 0 0 0 2px rgba(232, 104, 0, 0.35) !important;
}

body.ss-branded .sticky-header.ss-mm-header .ss-lang-select option,
body.ss-home-mode .sticky-header.ss-mm-header .ss-lang-select option {
  background-color: var(--mm-surface);
  color: var(--mm-heading);
}

body.ss-branded .sticky-header.ss-mm-header .theme-toggle-container,
body.ss-home-mode .sticky-header.ss-mm-header .theme-toggle-container {
  flex-shrink: 0;
  display: inline-block;
}

/* Back link on Launch page: readable in both themes */
body.ss-branded .sticky-header.ss-mm-header .ss-header-back,
body.ss-home-mode .sticky-header.ss-mm-header .ss-header-back {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--mm-muted) !important;
  font-size: 0.78rem;
}

body.ss-branded .sticky-header.ss-mm-header .ss-header-back:hover,
body.ss-home-mode .sticky-header.ss-mm-header .ss-header-back:hover {
  color: var(--mm-heading) !important;
}

/* Marketplace: external product logos (hotlinked from official sites) */
.ss-marketplace-logo {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  margin-bottom: 1rem;
}

.ss-marketplace-card .ss-external-ref {
  font-size: 0.8rem;
  color: var(--theme-text-secondary, rgba(255, 255, 255, 0.55));
}

[data-theme="light"] .ss-marketplace-card .ss-external-ref {
  color: rgba(0, 0, 0, 0.55);
}

/* —— Mobile / small screens: branded header + no horizontal bleed —— */
@media (max-width: 991.98px) {
  body.ss-branded .sticky-header.ss-mm-header,
  body.ss-home-mode .sticky-header.ss-mm-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.65rem;
    row-gap: 0.35rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px)) !important;
  }

  body.ss-branded .sticky-header.ss-mm-header > .logo,
  body.ss-home-mode .sticky-header.ss-mm-header > .logo {
    grid-column: 1;
    min-width: 0;
    align-items: center;
  }

  body.ss-branded .sticky-header.ss-mm-header .logo .text-container,
  body.ss-home-mode .sticky-header.ss-mm-header .logo .text-container {
    min-width: 0;
    overflow: hidden;
    max-width: 100% !important;
  }

  body.ss-branded .sticky-header.ss-mm-header .logo .text-container > span:first-child,
  body.ss-home-mode .sticky-header.ss-mm-header .logo .text-container > span:first-child {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.9rem, 3.8vw, 1.35rem) !important;
    line-height: 1.15 !important;
  }

  body.ss-branded .sticky-header.ss-mm-header > .header-controls,
  body.ss-home-mode .sticky-header.ss-mm-header > .header-controls {
    grid-column: 2;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: flex-end;
  }

  body.ss-branded .sticky-header.ss-mm-header .theme-toggle-container,
  body.ss-home-mode .sticky-header.ss-mm-header .theme-toggle-container,
  body.ss-branded .sticky-header.ss-mm-header .country-selector-container,
  body.ss-home-mode .sticky-header.ss-mm-header .country-selector-container {
    margin-left: 0 !important;
  }
}

@media (max-width: 520px) {
  body.ss-branded .sticky-header.ss-mm-header .ss-logo-img,
  body.ss-home-mode .sticky-header.ss-mm-header .ss-logo-img {
    width: 34px !important;
  }

  body.ss-branded .sticky-header.ss-mm-header .ss-lang-select,
  body.ss-home-mode .sticky-header.ss-mm-header .ss-lang-select {
    min-width: 5.5rem;
    max-width: 7.25rem;
    font-size: 0.68rem;
    padding: 0.28rem 1.55rem 0.28rem 0.4rem;
  }

  body.ss-branded .sticky-header.ss-mm-header .ss-header-back,
  body.ss-home-mode .sticky-header.ss-mm-header .ss-header-back {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Keep tagline visible; beat legacy 0.5rem / hide clipping from style.css */
  body.ss-branded .sticky-header.ss-mm-header .tagline,
  body.ss-home-mode .sticky-header.ss-mm-header .tagline {
    display: block !important;
    font-size: clamp(0.625rem, 2.85vw, 0.72rem) !important;
    max-width: min(100%, 52vw) !important;
  }
}

@media (max-width: 400px) {
  body.ss-branded .sticky-header.ss-mm-header .tagline,
  body.ss-home-mode .sticky-header.ss-mm-header .tagline {
    max-width: min(100%, 46vw) !important;
  }
}

/* Fullscreen nav above legacy stacking (sticky header is z-index 1001) */
body.ss-branded .nav.nav-overlay,
body.ss-home-mode .nav.nav-overlay {
  z-index: 1100;
}

body.ss-branded.nav-active .sticky-header.ss-mm-header,
body.ss-home-mode.nav-active .sticky-header.ss-mm-header {
  z-index: 1101;
}

@media (max-width: 767.98px) {
  body.ss-branded:not(.ss-home-mode) {
    overflow-x: clip;
  }
}

/* Devanagari when Hindi is selected */
html:lang(hi) body.ss-branded,
html:lang(hi) body.ss-home-mode {
  font-family: "Noto Sans Devanagari", "Poppins", sans-serif;
}
