/* ══════════════════════════════════════════════════════════════
   NAV EXTRAS — the header track and the language switcher.

   Kept apart from core.css because about-us.php loads a different
   stylesheet (winbox-racing.css) but shows the same two components.
   One file, linked by both, so they cannot drift apart.
   ══════════════════════════════════════════════════════════════ */

/* These three are declared in news.css, which about-us.php does not load —
   without them the shared drawer's text and borders fall back to invalid
   values there and it looks nothing like the news pages. Same values, so
   news.css simply redeclares them harmlessly. */
:root {
  --line:   rgba(255,255,255,.09);
  --muted:  #8b97a8;
  --muted2: #c3cdda;
}

/* ══ TRACK STRIP ══
   A full-width circuit line under the header with a car running the lap,
   seen from above. Sits directly above the breaking-news ticker.

   The car art is 78x40, so the strip has to be tall enough for a top-down
   car — a side profile would have fitted in half the height. */
.track-strip {
  position: relative;
  height: 40px;
  overflow: hidden;
  margin-bottom: 8px;
  /* Faded at both ends so the car emerges and leaves rather than popping
     against a hard edge. */
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}

/* Asphalt, edge to edge */
.nt-road {
  position: absolute; inset: 3px 0;
  background: linear-gradient(to bottom,
    rgba(255,255,255,.02), rgba(255,255,255,.06) 50%, rgba(255,255,255,.02));
  border-top: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
}

/* Dashed centre line — the racing line the car follows */
.nt-dash {
  position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(to right,
    rgba(255,255,255,.22) 0 16px, transparent 16px 34px);
}

/* Start/finish line, echoing the chequered strip in the language menu */
.nt-finish {
  position: absolute; right: 34px; top: 0; bottom: 0; width: 9px;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.75) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.75) 75%),
    linear-gradient(45deg, rgba(255,255,255,.75) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.75) 75%);
  background-size: 4.5px 4.5px;
  background-position: 0 0, 2.25px 2.25px;
  background-color: rgba(10,20,34,.8);
  opacity: .5;
}

/* Centred on the road rather than sitting on its lower edge, because from
   above the car occupies the lane, it does not stand on the ground. */
.nt-car {
  position: absolute; left: 0; top: 50%;
  width: 62px; height: 32px; margin-top: -16px;
  animation: nt-lap 13s linear infinite;
  will-change: transform;
}
.nt-car svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 5px rgba(0,200,240,.45)); }

/* Speed streak trailing the car */
.nt-streak {
  position: absolute; right: 100%; top: 50%; width: 52px; height: 1.5px;
  background: linear-gradient(to left, rgba(0,200,240,.8), transparent);
  transform: translateY(-50%);
  animation: nt-streak 13s linear infinite;
}

/* Crosses the full viewport, then waits off-screen so the page is calm
   most of the time rather than permanently busy. 100vw rather than 100%
   because the strip is full-bleed and vw ignores any scrollbar rounding
   that would leave the car visible at the edge. */
@keyframes nt-lap {
  0%   { transform: translateX(-120px); }
  62%  { transform: translateX(calc(100vw + 120px)); }
  100% { transform: translateX(calc(100vw + 120px)); }
}
@keyframes nt-streak {
  0%, 2% { opacity: 0; }
  8%     { opacity: 1; }
  54%    { opacity: 1; }
  62%    { opacity: 0; }
  100%   { opacity: 0; }
}

/* Hover the strip and the car comes round sooner */
.track-strip:hover .nt-car,
.track-strip:hover .nt-streak { animation-duration: 5s; }

@media (max-width: 760px) {
  .track-strip { height: 32px; margin-bottom: 6px; }
  .nt-car      { width: 50px; height: 26px; margin-top: -13px; }
  .nt-finish   { right: 16px; }
}

/* Respect people who have asked the OS for less movement: the car parks
   on the start line instead of lapping. */
@media (prefers-reduced-motion: reduce) {
  .nt-car    { animation: none; transform: translateX(calc(100vw - 140px)); }
  .nt-streak { display: none; }
}

/* ── LANGUAGE SWITCHER ── */

/* Shared flag chip. Fixed 3:2 box so English, 中文 and BM never jitter
   the row height between them. */
.lang-flag {
  display: inline-flex; flex: none;
  width: 21px; height: 14px; border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.lang-flag .flag { width: 100%; height: 100%; display: block; }

.lang-switch { margin-left: 6px; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14);
  padding: 5px 9px 5px 7px; border-radius: 999px;
  font: inherit; color: rgba(255,255,255,.82);
  transition: border-color .25s, background .25s, color .25s;
}
.lang-code { font-family: var(--fc); font-size: 12px; letter-spacing: .1em; }
.lang-chev {
  width: 13px; height: 13px; fill: currentColor; opacity: .55;
  transition: transform .25s;
}
.lang-btn:hover, .lang-switch:hover .lang-btn, .lang-switch:focus-within .lang-btn {
  color: var(--cyan);
  border-color: rgba(0,200,240,.5);
  background: rgba(0,200,240,.09);
}
.lang-switch:hover .lang-chev, .lang-switch:focus-within .lang-chev { transform: rotate(180deg); opacity: 1; }

/* Right-aligned: it sits at the end of the bar, so a left-aligned panel
   would hang off the edge of the viewport on narrower desktops. */
.lang-menu {
  left: auto; right: 0; min-width: 208px;
  padding: 0 0 6px; overflow: hidden; border-radius: 4px;
}

/* Chequered flag strip — the one flag a racing team should own. Pure CSS
   so it costs no request and scales cleanly. */
.lang-chequer {
  display: block; height: 6px;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.85) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.85) 75%),
    linear-gradient(45deg, rgba(255,255,255,.85) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.85) 75%);
  background-size: 6px 6px;
  background-position: 0 0, 3px 3px;
  background-color: #0b1524;
  margin-bottom: 6px;
}

.lang-opt {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; text-decoration: none;
  color: rgba(255,255,255,.72);
  transition: color .2s, background .2s;
  position: relative;
}
.lang-opt:hover { color: #fff; background: rgba(0,200,240,.08); }

/* Cyan spine on the active row — echoes the eyebrow dashes elsewhere */
.lang-opt.on { color: var(--cyan); background: rgba(0,200,240,.07); }
.lang-opt.on::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; background: var(--cyan);
}

.lang-names { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lang-n1 { font-family: var(--fb); font-size: 13.5px; font-weight: 600; }
.lang-n2 {
  font-family: var(--fc); font-size: 10.5px; letter-spacing: .13em;
  text-transform: uppercase; color: rgba(255,255,255,.38);
}
.lang-opt.on .lang-n2 { color: rgba(0,200,240,.55); }
.lang-tick { width: 15px; height: 15px; fill: var(--cyan); margin-left: auto; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .lang-chev, .lang-btn { transition: none; }
}

/* ══ MOBILE NAV VISIBILITY ══
   winbox-racing.css hides BOTH the links and the hamburger at ≤560px
   ("hamburger hidden too for now"), which leaves about-us.php with no
   navigation at all on a phone. The news pages are saved by core.css,
   which about-us.php does not load — this file does load on both, and
   comes after winbox-racing.css, so it is the one place to fix it once.

   760px, not 560px: between those widths the desktop links were still
   showing and were badly cramped. */
@media (max-width: 760px) {
  .nav-links  { display: none !important; }
  .nav-toggle { display: flex !important; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE DRAWER
   Moved here from news.css so about-us.php gets it too — that page
   loads winbox-racing.css instead, and used to carry its own older
   drawer. One copy, both pages, no drift.
   ══════════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════════
   MOBILE DRAWER  (Frame 11)
   Slide-over panel from the right with icon rows, an expandable
   Races group and a Subscribe call to action.
   ══════════════════════════════════════════════════════════════ */
.mnav {
  position: fixed; inset: 0; z-index: 600;
  visibility: hidden; pointer-events: none;
}
.mnav.open { visibility: visible; pointer-events: auto; }

.mnav-scrim {
  position: absolute; inset: 0;
  background: rgba(3, 6, 12, .68);
  opacity: 0; transition: opacity .32s ease;
}
.mnav.open .mnav-scrim { opacity: 1; }

.mnav-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(80vw, 330px);
  background: #0b1526;
  border-left: 1px solid rgba(255,255,255,.08);
  border-radius: 18px 0 0 18px;
  box-shadow: -18px 0 50px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .34s cubic-bezier(.32,.72,.3,1);
}
.mnav.open .mnav-panel { transform: translateX(0); }

.mnav-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 6px 20px;
}
.mnav-logo { height: 34px; width: auto; display: block; }
.mnav-close {
  width: 34px; height: 34px; flex: 0 0 auto;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .2s;
}
.mnav-close svg { width: 22px; height: 22px; fill: #fff; }
.mnav-close:hover { background: rgba(255,255,255,.08); }

.mnav-list { display: flex; flex-direction: column; gap: 2px; }
.mnav-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 13px 14px;
  border: none; background: none; cursor: pointer;
  border-radius: 10px;
  font-family: var(--fb); font-size: 15px; font-weight: 500;
  /* Races is a <button>, the rest are <a>. Browsers apply a `font`
     shorthand to buttons that also resets line-height, so without this
     that one row's text sat at a different size and rhythm to the others.
     appearance:none stops the platform button styling as well. */
  line-height: 1.35;
  appearance: none; -webkit-appearance: none;
  color: var(--muted2);
  transition: background .2s, color .2s;
}
.mnav-item svg { width: 19px; height: 19px; fill: currentColor; flex: 0 0 auto; opacity: .85; }

/* Artwork icons. Fixed square box with object-fit so the differing source
   sizes (72x72 up to 90x67) all occupy the same space and stay aligned. */
.mnav-ico {
  width: 21px; height: 21px; flex: 0 0 auto;
  object-fit: contain; opacity: .9;
}
.mnav-item.on .mnav-ico { opacity: 1; }
.mnav-item span { flex: 1; }
.mnav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.mnav-item.on {
  background: rgba(255,255,255,.08);
  color: var(--cyan);
}
.mnav-item.on svg { opacity: 1; }

.mnav-chev { margin-left: auto; transition: transform .25s ease; opacity: .55 !important; }
.mnav-toggle[aria-expanded="true"] .mnav-chev { transform: rotate(90deg); }

.mnav-sub { display: flex; flex-direction: column; padding: 2px 0 6px 50px; }
.mnav-sub[hidden] { display: none; }
.mnav-sub a {
  padding: 9px 4px; font-size: 14px; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 14px;
  transition: color .2s, border-color .2s;
}
.mnav-sub a:hover { color: var(--cyan); border-color: var(--cyan); }

.mnav-cta {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 22px;
  background: var(--cyan); color: #04141c;
  border-radius: 999px; padding: 13px 20px;
  font-family: var(--fc); font-size: 13px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.mnav-cta svg { width: 16px; height: 16px; fill: #04141c; }
.mnav-cta:hover { box-shadow: 0 0 24px rgba(0,200,240,.45); }

/* ── Language row in the mobile drawer ──
   Three tap targets side by side rather than a dropdown: a menu inside
   a drawer is awkward to hit on a phone. */
.mnav-lang { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.mnav-lang-l {
  display: block; font-family: var(--fc); font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.4); margin-bottom: 9px;
}
.mnav-lang-row { display: flex; gap: 8px; }
.mnav-lang-b {
  flex: 1; padding: 9px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 9px;
  font-family: var(--fc); font-size: 12px; letter-spacing: .1em;
  color: rgba(255,255,255,.7); text-decoration: none;
  transition: border-color .2s, background .2s, color .2s;
}
.mnav-lang-b:hover { border-color: var(--cyan); color: var(--cyan); }
.mnav-lang-b.on {
  border-color: var(--cyan); background: rgba(0,200,240,.12); color: var(--cyan);
}
/* Slightly larger here — this is a thumb target, not a pointer target */
.mnav-lang-b .lang-flag { width: 26px; height: 17px; }


.mnav-socials {
  display: flex; justify-content: center; gap: 12px;
  margin-top: auto; padding-top: 24px;
}
.mnav-socials a {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.mnav-socials svg { width: 15px; height: 15px; fill: var(--cyan); }
.mnav-socials a:hover { border-color: var(--cyan); background: rgba(0,200,240,.1); }
