/* The shared nav of the site pages and the home page: the launch offer bar, the nav row,
   the phone menu and the footer settings (site/README.md -> Nav). Loads after the page styles. */

/* Launch offer bar (promo.js). The colours are the same in light and dark mode, except the bar and the end date. */
.promo { position: relative; z-index: 51; background: #ffd84a; color: #1d1a17; font-size: 14px; line-height: 1.4; }
[data-theme="dark"] .promo { background: #f5cc3a; }
.promo-off .promo { display: none; }
.promo-in { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 8px 52px; }
.promo-tag { flex: none; margin-right: -6px; font-weight: 700; white-space: nowrap; }
.promo-tag::after { content: " ·"; font-weight: 400; }
.promo b { font-weight: 650; }
.promo s { opacity: .6; }
.promo-end { color: #8a4b00; font-weight: 600; }
[data-theme="dark"] .promo-end { color: #7a4100; }
/* The CTA link covers the whole bar (::after); the × sits above it. */
.promo a.promo-go { display: inline-flex; flex: none; align-items: center; gap: 4px; border-radius: 4px; color: #1d1a17 !important; font-weight: 650; white-space: nowrap;
  text-decoration: underline !important; text-decoration-thickness: 1.5px !important; text-underline-offset: 3px; }
.promo a.promo-go::after { content: ""; position: absolute; inset: 0; }
.promo:hover a.promo-go, .promo a.promo-go:focus-visible { text-decoration-thickness: 2.5px !important; }
.promo a.promo-go:focus-visible, .promo-x:focus-visible { outline: 2px solid #1d1a17; outline-offset: 3px; }
.promo-x:focus-visible { outline-offset: -2px; }
.promo-go svg, .promo-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.promo-x { position: absolute; z-index: 1; right: 10px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: #1d1a17; opacity: .7; cursor: pointer; }
.promo-x:hover { opacity: 1; background: rgba(29, 26, 23, .1); }
.promo-narrow { display: none; }

/* The fixed nav of the site pages sits below the bar; promo.js moves it up as the bar scrolls away. */
:root { --promo-h: 44px; }
html:not(.promo-off) .promo ~ .nav { top: var(--promo-top, var(--promo-h)); }

/* Nav row: brand, Product, Pricing, Writing … language, Log in, Download, phone menu. */
.nav-inner > nav { flex: 1; min-width: 0; margin-left: 32px; }
.nav-sp { flex: 1; }
.nav nav > a.nav-link { display: inline; color: var(--muted); white-space: nowrap; }
.nav nav > a.nav-link:hover, .nav nav > a.nav-link[aria-current="page"] { color: var(--text); }
.nav nav > a.nav-signin { display: inline-block; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.nav nav > a.nav-signin:hover { color: var(--accent); }
.nav .nav-dl { white-space: nowrap; }
/* One filled button on a screen: the nav Download is an outline button until the page's
   [data-primary-cta] scrolls out above the viewport (nav-account.js adds .nav-dl-fill). */
.nav-dl { transition: transform .15s, background-color .2s, border-color .2s, color .2s; }
html a.nav-dl:not(.nav-dl-fill) { border-color: var(--line-2); background: var(--card); color: var(--text) !important; box-shadow: none; }
html a.nav-dl:not(.nav-dl-fill):hover { background: var(--bg-alt); }
@media (prefers-reduced-motion: reduce) { .nav-dl { transition: none; } }
.nav-sp ~ .lang-menu > summary { justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); }
.nav-sp ~ .lang-menu > summary:hover, .nav-sp ~ .lang-menu[open] > summary { background: var(--bg-alt); color: var(--text); }
.nav-sp ~ .lang-menu > summary svg { width: 18px; height: 18px; }
.nav-sp ~ .lang-menu > summary span { display: none; }

/* Phone menu (≤ 600 px). A <details>: theme.js closes it on an outside tap or Escape. */
.nav-more { display: none; }
.nav-more > summary { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--card); color: var(--text); cursor: pointer; list-style: none; user-select: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.nav-more .i-close, .nav-more[open] .i-menu { display: none; }
.nav-more[open] .i-close { display: block; }
.nav-more:not([open]) .nav-panel { display: none; }
.nav-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; max-height: calc(100dvh - 70px - var(--promo-top, 0px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 10px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg); box-shadow: var(--shadow); font-size: 15px; text-align: left; }
.nav-panel-h { margin: 10px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav-panel .nav-prod-menu { position: static; width: auto; padding: 0; transform: none; border: 0; border-radius: 0; background: none; box-shadow: none; }
.nav-panel .nav-prod-menu::before { content: none; }
.nav-panel hr { margin: 8px 0; border: 0; border-top: 1px solid var(--line-2); }
.nav-panel-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 10px; color: var(--text) !important; font-weight: 500; text-decoration: none !important; }
.nav-panel-row + .nav-panel-row { border-top: 1px solid var(--line); }
.nav-panel-row[aria-current="page"] { color: var(--accent) !important; }
.nav-panel .lang-menu ul { position: static; display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 8px; box-shadow: none; }

/* The language menu with its name (footer, phone menu). */
.footer-prefs .lang-menu > summary, .nav-panel .lang-menu > summary { gap: 6px; height: 32px; padding: 0 12px; border-color: var(--line-2); background: var(--card); color: var(--text-2); font-size: 13px; }
.footer-prefs .lang-menu > summary span, .nav-panel .lang-menu > summary span { display: none; }
.footer-prefs .lang-menu > summary .lm-name, .nav-panel .lang-menu > summary .lm-name { display: inline; }
.footer-prefs .lang-menu > summary::after, .nav-panel .lang-menu > summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.nav-panel .lang-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.footer-prefs .lang-menu ul { top: auto; bottom: calc(100% + 6px); }

/* Light and dark (theme.js). */
.theme-seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); }
.theme-seg button { min-height: 28px; padding: 2px 12px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.theme-seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.theme-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Footer settings: language and theme at the right of the bottom row. */
.footer-bottom { flex-wrap: wrap; align-items: center; }
.footer-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }

@media (max-width: 760px) {
  .nav-inner > nav { margin-left: 22px; }
  .nav nav { gap: 18px; }
}
@media (max-width: 600px) {
  :root { --promo-h: 56px; }
  /* Two lines: the offer and the link, then the price and the end date. */
  .promo-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 10px; padding: 7px 46px 7px 14px; font-size: 13px; line-height: 1.3; }
  .promo-tag, .promo-wide { display: none; }
  .promo-narrow { display: contents; }
  .promo-narrow > div:last-child { grid-column: 1 / -1; font-size: 12px; }
  .promo a.promo-go { grid-row: 1; grid-column: 2; }
  .promo-x { right: 6px; }
  .nav nav { gap: 12px; }
  .nav .nav-prod, .nav nav > a.nav-link, .nav-sp ~ .lang-menu { display: none; }
  .nav-more { display: block; }
  .nav .nav-dl { min-height: 34px; padding: 5px 13px; }
  .footer-prefs { margin-left: 0; width: 100%; }
}
@media (max-width: 440px) { .nav nav { gap: 10px; } }
@media (max-width: 360px) {
  .promo-in { column-gap: 8px; padding: 7px 38px 7px 12px; }
  .promo-narrow > div:first-child { font-size: 12.5px; }
  .promo-narrow > div:last-child { font-size: 11.5px; }
  .promo a.promo-go { font-size: 12.5px; }
  .promo-go svg { display: none; }
  .promo-x { right: 3px; }
}
