/* Subify public site: header, language menu, theme switch and mobile menu.
   Shared by every public page. Loaded after site.css, home-v11.css and starfield-site.css.
   The language menu and the theme switch copy the web app's header controls (same parts, same keyboard pattern). */

.site-header {
  display: block;
  height: auto;
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: inherit;
  text-decoration: none;
}
.site-header .brand-mark-wrap {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 36px;
}
.site-header .brand-mark-wrap img {
  display: block;
  width: 100%;
  height: auto;
}
.site-header .brand-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.logo-on-light { display: none; }
html[data-theme="light"] .logo-on-light { display: block; }
html[data-theme="light"] .logo-on-dark { display: none; }

.site-header .main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}
.site-header .main-nav a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--pro-muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header .main-nav a:hover,
.site-header .main-nav a:focus-visible {
  color: var(--pro-text);
  background: var(--pro-surface2);
  outline: none;
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-inline-start: auto;
}
.site-header .header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--pro-text);
  color: var(--pro-bg);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.site-header .header-cta:hover { opacity: 0.92; }
.site-header .header-cta:focus-visible { outline: 2px solid var(--pro-purple); outline-offset: 2px; }

/* Language menu (web app: .lang-picker / .lang-trigger / .lang-menu / .lang-opt) */
.site-header .lang-picker {
  position: relative;
  display: inline-flex;
  flex: none;
}
.site-header .lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--pro-line2);
  background: var(--pro-surface);
  color: var(--pro-text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.site-header .lang-trigger:hover,
.site-header .lang-picker.is-open .lang-trigger {
  border-color: var(--pro-purple);
  box-shadow: 0 0 0 3px rgba(155, 120, 255, 0.16);
}
.site-header .lang-trigger:focus-visible,
.site-header .lang-opt:focus-visible,
.site-header .theme-toggle:focus-visible,
.site-header .menu-btn:focus-visible {
  outline: 2px solid var(--pro-purple);
  outline-offset: 2px;
}
.site-header .lang-trigger-globe,
.site-header .lang-trigger-chev,
.site-header .lang-opt-tick {
  display: inline-flex;
  color: var(--pro-muted);
}
.site-header .lang-trigger-globe svg,
.site-header .lang-trigger-chev svg,
.site-header .lang-opt-tick svg {
  display: block;
  width: 15px;
  height: 15px;
}
.site-header .lang-trigger-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .lang-trigger-chev { transition: transform 0.2s; }
.site-header .lang-picker.is-open .lang-trigger-chev { transform: rotate(180deg); }
.site-header .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 60;
  width: 192px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--pro-line2);
  background: var(--pro-surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.16s, transform 0.16s, visibility 0s linear 0.16s;
}
/* Opening shows the menu at once so it can take focus; closing fades out first. */
.site-header .lang-picker.is-open .lang-menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.16s, transform 0.16s, visibility 0s;
}
.site-header .lang-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--pro-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.16s;
}
.site-header .lang-opt:hover,
.site-header .lang-opt:focus-visible {
  background: rgba(155, 120, 255, 0.14);
  outline: none;
}
.site-header .lang-opt[aria-checked="true"] {
  background: rgba(155, 120, 255, 0.2);
}
.site-header .lang-opt-name { flex: 1; min-width: 0; }
.site-header .lang-opt-code {
  color: var(--pro-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.site-header .lang-opt-tick { display: none; color: var(--pro-purple2); }
.site-header .lang-opt[aria-checked="true"] .lang-opt-tick { display: inline-flex; }

/* Theme switch (web app: .theme-toggle, moon and sun, knob moves when light is on) */
.site-header .theme-toggle {
  position: relative;
  flex: none;
  width: 60px;
  height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--pro-line2);
  background: var(--pro-surface);
  cursor: pointer;
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.18s, background 0.25s;
}
.site-header .theme-toggle:hover { border-color: var(--pro-purple); }
.site-header .theme-toggle-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--pro-muted);
  transition: color 0.25s;
}
.site-header .theme-toggle-icon svg {
  display: block;
  width: 15px;
  height: 15px;
}
.site-header .theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #9079ff, #6a52f0);
  box-shadow: 0 3px 10px rgba(106, 82, 240, 0.45);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.site-header .theme-toggle[aria-checked="true"] .theme-toggle-knob { transform: translateX(26px); }
.site-header .theme-toggle[aria-checked="false"] .moon,
.site-header .theme-toggle[aria-checked="true"] .sun { color: #fff; }

/* Mobile menu */
.site-header .menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--pro-line2);
  background: var(--pro-surface);
  color: var(--pro-text);
  font-size: 17px;
  cursor: pointer;
}
.site-header .mobile-nav { display: none; }
/* Opens as a full-width panel under the header (overrides the older side-drawer rules in site.css). */
.site-header .mobile-nav.mobile-open {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  bottom: auto;
  z-index: 90;
  display: flex;
  width: auto;
  max-width: none;
  margin: 0;
  border-radius: 0;
  height: auto;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--pro-line);
  background: var(--pro-bg);
}
.site-header .mobile-nav a {
  padding: 12px 6px;
  border-bottom: 1px solid var(--pro-line);
  color: var(--pro-text);
  font-size: 15px;
  text-decoration: none;
}
.site-header .mobile-nav a:last-child { border-bottom: 0; }

@media (max-width: 1180px) {
  .site-header .main-nav { display: none; }
  .site-header .menu-btn { display: inline-flex; }
}
@media (max-width: 640px) {
  .site-header .header-cta { display: none; }
  .site-header .header-inner { gap: 10px; }
}
@media (min-width: 1181px) {
  .site-header .mobile-nav,
  .site-header .mobile-nav.mobile-open { display: none; }
}

/* The header follows the page direction (set by the language controller), not the
   reference-header rules in site.css, so the brand stays at the start and the controls at the end in every language. */
html[dir="ltr"] .site-header,
html[dir="ltr"] .site-header .header-inner,
html[dir="ltr"] .site-header .header-actions { direction: ltr; }
html[dir="rtl"] .site-header,
html[dir="rtl"] .site-header .header-inner,
html[dir="rtl"] .site-header .header-actions { direction:inherit; }

/* Phone width: the language name is hidden (the globe and the aria-label stay), so the sign-in button fits beside the controls. */
@media (max-width: 480px) {
  .site-header .header-inner { gap: 8px; }
  .site-header .brand-name { font-size: 16px; }
  .site-header .lang-trigger { gap: 4px; padding: 0 8px; }
  .site-header .lang-trigger-name { display: none; }
  .site-header .theme-toggle { width: 52px; }
  .site-header .theme-toggle-knob { width: 22px; height: 22px; }
  .site-header .theme-toggle[aria-checked="true"] .theme-toggle-knob { transform: translateX(18px); }
  .site-header .menu-btn { width: 36px; }
}

/* ==========================================================================
   Owner review round: homepage box, logo, liquid-glass header, heading fonts
   ========================================================================== */

/* 1) Homepage "See Subify in action": no dark box behind the section. The product demo keeps its own frame. */
.reference-home .subify-showcase,
html[data-theme="light"] .reference-home .subify-showcase,
html[data-theme="dark"] .reference-home .subify-showcase {
  background: transparent !important;
}

/* 2) Logo: the uploaded wordmark (mark + سابیفای) replaces the mark image and the text beside it. */
.brand > .brand-name { display: none !important; }
.brand .brand-mark-wrap {
  width: auto !important;
  height: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center;
}
.brand .brand-mark-wrap img {
  width: auto !important;
  height: 38px !important;
  max-width: none !important;
  min-width: 0 !important;
  object-fit: contain !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}
@media (max-width: 520px) {
  .brand .brand-mark-wrap img { height: 32px !important; }
}

/* 3) Header: liquid glass. The glass layer sits behind the content, so the links stay sharp. */
.site-header.reference-header {
  position: sticky;
  top: 10px;
  z-index: 100;
  margin: 10px auto 0;
  width: min(1180px, calc(100% - 24px));
  border-radius: 24px;
  isolation: isolate;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28) !important;
}
.site-header.reference-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}
.site-header.reference-header::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: rgba(14, 11, 20, 0.34);
  backdrop-filter: blur(4px) saturate(165%);
  -webkit-backdrop-filter: blur(4px) saturate(165%);
  filter: url(/assets/img/glass-distortion.svg#glass-distortion);
  -webkit-filter: url(/assets/img/glass-distortion.svg#glass-distortion);
}
html[data-theme="light"] .site-header.reference-header {
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 16px 40px rgba(38, 49, 72, 0.14) !important;
}
html[data-theme="light"] .site-header.reference-header::after {
  background: rgba(255, 255, 255, 0.46);
}
@media (max-width: 820px) {
  .site-header.reference-header {
    top: 0;
    margin: 0;
    width: 100%;
    border-radius: 0 0 22px 22px;
  }
  .site-header.reference-header::before,
  .site-header.reference-header::after { border-radius: 0 0 22px 22px; }
}

/* 4) Headings: one family per language across every page (Estedad in Persian, Inter Display in English). */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
  font-family: Estedad, Vazirmatn, Tahoma, sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}
html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3,
html[dir="ltr"] h4 {
  font-family: SubifyInterDisplay, SubifyInter, Arial, sans-serif !important;
  font-weight: 700 !important;
}

/* Logo variant follows the theme, on every page (the dark mark is shown unless the light theme is active). */
.brand .logo-on-dark { display: block !important; }
.brand .logo-on-light { display: none !important; }
html[data-theme="light"] .brand .logo-on-dark { display: none !important; }
html[data-theme="light"] .brand .logo-on-light { display: block !important; }

/* Owner review: the first heading of the homepage is set in Lalezar (Persian). English keeps Inter Display. */
html[dir="rtl"] h1.ref-hero-title,
html[dir="rtl"] h1.ref-hero-title * {
  font-family: Lalezar, Peyda, Estedad, sans-serif !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

