/* Site header, shared by Home, Download, Updates and Premium.
   Colors are literal values because Premium does not load site.css and cannot see its variables.
   Languages collapse into one button so five codes don't crowd the navigation. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.site-header .wrap {
  width: min(1040px, calc(100% - 96px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f5f5f7;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #ea2625;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 4px rgba(234, 38, 37, 0.16);
}

.mark svg { display: block; }

.nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  position: relative;
  text-decoration: none;
  color: rgba(245, 245, 247, 0.62);
  font-size: 14px;
  padding: 8px 0;
}

.nav a:hover { color: #f5f5f7; }

/* Current page gets a short red underline, easier to spot than a colour change alone. */
.nav a[aria-current="page"] { color: #f5f5f7; }

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #ea2625;
}

.lang {
  position: relative;
  margin-left: 22px;
}

/* Current language: flag + code, in the same night palette as the header. */
.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 9px;
  border: 1px solid rgba(251, 241, 230, 0.18);
  border-radius: 980px;
  background: rgba(251, 241, 230, 0.04);
  color: #fbf1e6;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lang-current:hover,
.lang-current[aria-expanded="true"] {
  border-color: rgba(246, 184, 96, 0.6);
  background: rgba(246, 184, 96, 0.08);
}

.lang-current svg { display: block; transition: transform 0.2s; }
.lang-current[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Flags: small rounded rectangles with a thin inner border so white areas stay visible on dark backgrounds */
.flag {
  flex: none;
  display: inline-block;
  width: 22px;
  height: 16px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.lang-current .flag { width: 20px; height: 14px; border-radius: 3px; }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='s'%3E%3Cpath d='M0 0v30h60V0z'/%3E%3C/clipPath%3E%3CclipPath id='t'%3E%3Cpath d='M30 15h30v15zv15H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cg clip-path='url%28%23s%29'%3E%3Cpath d='M0 0v30h60V0z' fill='%23012169'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0l60 30m0-30L0 30' clip-path='url%28%23t%29' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E"); }
.flag-fr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Cpath fill='%23002654' d='M0 0h1v2H0z'/%3E%3Cpath fill='%23fff' d='M1 0h1v2H1z'/%3E%3Cpath fill='%23CE1126' d='M2 0h1v2H2z'/%3E%3C/svg%3E"); }
.flag-es { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Cpath fill='%23AA151B' d='M0 0h3v2H0z'/%3E%3Cpath fill='%23F1BF00' d='M0 .5h3v1H0z'/%3E%3C/svg%3E"); }
.flag-pt { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23046A38' d='M0 0h12v20H0z'/%3E%3Cpath fill='%23DA291C' d='M12 0h18v20H12z'/%3E%3Ccircle cx='12' cy='10' r='4.6' fill='none' stroke='%23FFE900' stroke-width='1.4'/%3E%3Cpath fill='%23fff' stroke='%23DA291C' stroke-width='.9' d='M9.9 7.6h4.2v3.6a2.1 2.1 0 0 1-4.2 0z'/%3E%3C/svg%3E"); }
/* Arabic spans many countries, so it gets a neutral "ع" badge instead of one country's flag */
.flag-ar {
  display: inline-grid;
  place-items: center;
  background: #0b7a46;
  color: #fff;
  font-family: "Noto Sans Arabic", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.lang-current .flag-ar { font-size: 10px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  padding: 6px;
  border: 1px solid rgba(251, 241, 230, 0.12);
  border-radius: 16px;
  background: #2a2142;
  box-shadow: 0 20px 48px rgba(8, 5, 20, 0.55);
}

.lang-menu[hidden] { display: none; }

/* Language options are links to each language's pages */
.nav .lang-btn {
  box-sizing: border-box;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(251, 241, 230, 0.78);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0;
  text-align: start;
  padding: 10px 12px;
  cursor: pointer;
}

.nav .lang-btn:hover { background: rgba(251, 241, 230, 0.06); color: #fbf1e6; }

.nav .lang-btn[aria-current="true"] {
  background: rgba(246, 184, 96, 0.12);
  color: #fbf1e6;
  font-weight: 600;
}

.nav .lang-btn[data-lang="ar"] .lang-name { font-family: "Noto Sans Arabic", system-ui, sans-serif; }

.lang-check {
  margin-inline-start: auto;
  color: #f6b860;
  opacity: 0;
}
.nav .lang-btn[aria-current="true"] .lang-check { opacity: 1; }

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 4px auto;
  background: currentColor;
}

@media (max-width: 900px) {
  .site-header .wrap { width: min(1040px, calc(100% - 40px)); }

  .menu-btn { display: inline-block; }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 20px 24px;
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav.open { display: flex; }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .nav a { padding: 12px 0; font-size: 17px; }

  .nav a[aria-current="page"]::after { display: none; }

  .lang { margin-left: 0; }

  /* On narrow screens the menu is already open, so languages are laid out directly, no extra tap.
     The menu is marked [hidden] for desktop, so this rule needs !important to override it. */
  .lang-current { display: none; }

  .lang-menu,
  .lang-menu[hidden] {
    display: flex !important;
    position: static;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-top: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav .lang-btn {
    width: auto;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    border: 1px solid rgba(251, 241, 230, 0.16);
    border-radius: 980px;
    font-size: 14px;
  }

  .nav .lang-btn[aria-current="true"] {
    border-color: #f6b860;
    background: rgba(246, 184, 96, 0.12);
  }

  .lang-check { display: none; }
}

/* Telegram is a news channel: icon only in the header and footer, with tooltip and screen-reader label. Text appears in the mobile menu. */
.nav a.nav-tg,
.nav a.nav-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: -6px;
  padding: 6px;
  border-radius: 999px;
}

.nav a.nav-tg:hover,
.nav a.nav-wa:hover { background: rgba(255, 255, 255, 0.08); }

.nav-tg svg,
.nav-wa svg,
.footer-tg svg,
.footer-wa svg { display: block; }

.nav-tg-label,
.nav-wa-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.footer-tg,
.footer-wa {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .nav a.nav-tg,
  .nav a.nav-wa { margin-left: 0; padding: 12px 0; border-radius: 0; }
  .nav a.nav-tg:hover,
  .nav a.nav-wa:hover { background: none; }
  .nav-tg-label,
  .nav-wa-label { position: static; width: auto; height: auto; clip: auto; }
}

/* Arabic is right-to-left: language button and dropdown switch sides */
[dir="rtl"] .lang { margin-left: 0; margin-right: 22px; }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
@media (max-width: 900px) {
  [dir="rtl"] .lang { margin-right: 0; }
}

/* Brand wordmark logo.png (red NETFLY). Source is 730×198, scaled by height so it stays sharp on high-DPI screens. */
.logo img {
  display: block;
  height: 26px;
  width: auto;
}
@media (max-width: 900px) {
  .logo img { height: 22px; }
}

/* The two community icons sit closer together than the text links */
.nav a.nav-wa { margin-left: -14px; }
[dir="rtl"] .nav a.nav-wa { margin-left: 0; margin-right: -14px; }
@media (max-width: 900px) {
  .nav a.nav-wa,
  [dir="rtl"] .nav a.nav-wa { margin: 0; }
}

/* Header "Guides" menu: install guides and help pages. Opens on hover or click on desktop, folds open in the mobile menu. */
.nav-guides { position: relative; }
.nav-guides-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: rgba(251, 241, 230, 0.66);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.nav-guides-btn:hover,
.nav-guides.open .nav-guides-btn,
.nav-guides.is-active .nav-guides-btn { color: #fbf1e6; }
.nav-guides-btn svg { display: block; transition: transform 0.2s; }
.nav-guides.open .nav-guides-btn svg { transform: rotate(180deg); }
.guides-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: -16px;
  z-index: 40;
  min-width: 260px;
  padding: 8px;
  border: 1px solid rgba(251, 241, 230, 0.12);
  border-radius: 16px;
  background: #2a2142;
  box-shadow: 0 20px 48px rgba(8, 5, 20, 0.55);
}
/* Invisible bridge so the menu stays open while the pointer moves down to it */
.guides-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-guides.open .guides-menu { display: block; }
@media (hover: hover) and (min-width: 901px) {
  .nav-guides:hover .guides-menu { display: block; }
}
.guides-group {
  margin: 6px 12px 4px;
  color: #b9aecb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.guides-group:not(:first-child) { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(251, 241, 230, 0.1); }
.nav .guides-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(251, 241, 230, 0.78);
  font-size: 15px;
}
.nav .guides-menu a:hover { background: rgba(251, 241, 230, 0.06); color: #fbf1e6; }
.nav .guides-menu a[aria-current="page"] { background: rgba(246, 184, 96, 0.12); color: #fbf1e6; }
.nav .guides-menu a[aria-current="page"]::after { display: none; }
[dir="rtl"] .guides-menu { left: auto; right: -16px; }
html[lang="ar"] .guides-group { letter-spacing: 0; text-transform: none; }

@media (max-width: 900px) {
  .nav { max-height: calc(100vh - 72px); overflow-y: auto; }
  .nav-guides { width: 100%; }
  .nav-guides-btn { padding: 12px 0; font-size: 17px; }
  .guides-menu,
  .nav-guides.open .guides-menu {
    position: static;
    min-width: 0;
    padding: 0 0 8px;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .guides-menu::before { display: none; }
  .guides-group { margin: 8px 0 2px; }
  .guides-group:not(:first-child) { padding-top: 8px; }
  .nav .guides-menu a { padding: 8px 0 8px 14px; font-size: 16px; }
  [dir="rtl"] .nav .guides-menu a { padding: 8px 14px 8px 0; }
}
