/* The site's bar and foot (components/Header.astro, Footer.astro). Tokens from the
   design system, and none of its component classes. One width for every page, the
   tour's: 1320px. The service's own pages have a smaller bar of their own
   (src/localize_edge/web/site.css); the two share no markup, and may differ. */

/* In-page links scroll rather than jump, on every page of ours, and land clear of the
   sticky bar; for anyone who asked for less motion they jump. */
html { scroll-behavior: smooth }
[id] { scroll-margin-top: 76px }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto } }

/* Its own box model: the docs page has no reset, and padding must not widen the bar. */
.site-bar, .site-bar *, .site-foot, .site-foot * { box-sizing: border-box }
.site-wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px }
@media (max-width: 600px) { .site-wrap { padding: 0 16px } }

/* ---- the bar ---- */
.site-bar { position: sticky; top: 0; z-index: 40; background: var(--bg-base);
            border-bottom: 1px solid var(--border-divider); font-family: var(--font-sans) }
.site-bar .site-wrap { display: flex; align-items: center; gap: 28px; height: 60px }
.site-bar a { text-decoration: none }
.site-bar .site-lockup { display: flex; align-items: center; gap: 11px; color: var(--fg-primary) }
.site-mark svg { width: 24px; height: 24px; display: block }
.site-type { line-height: 0 }
.site-type svg { height: 17px; width: auto; display: block }
/* Whose project it is: "by" and Alconost's logo, beside ours. Its logo keeps its own
   colours in both themes; the word is the page's quietest ink. */
.site-brand { display: flex; align-items: center; gap: 9px }
.site-bar .site-by { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-tertiary);
                     font: 400 14px/1 var(--font-sans); white-space: nowrap }
.site-bar .site-by:hover { color: var(--fg-secondary) }
.site-by svg { height: 20px; width: auto; display: block }
/* Narrow: ours alone, so the button, the theme and the menu still fit. */
@media (max-width: 700px) { .site-bar .site-by { display: none } }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto }
.site-bar .site-link { padding: 6px 10px; border-radius: var(--radius-lg); white-space: nowrap;
                       color: var(--fg-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium);
                       transition: color 150ms cubic-bezier(0, 0, .2, 1), background-color 150ms cubic-bezier(0, 0, .2, 1) }
.site-bar .site-link:hover { color: var(--fg-primary); background: var(--surface-hover) }
/* The page you are on. */
.site-bar .site-link[aria-current="page"] { color: var(--primary-ink); background: var(--primary-bg) }

.site-end { display: flex; align-items: center; gap: 12px }
/* The design system's primary button, in tokens: the docs page doesn't load it. */
.site-bar .site-cta { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; white-space: nowrap;
                      border-radius: var(--radius-lg); font-size: var(--text-sm); font-weight: var(--weight-medium); color: #fff;
                      background: linear-gradient(to bottom, var(--primary-500), var(--primary-600));
                      box-shadow: 0 1px 3px var(--shadow-black-soft), inset 0 1px 0 var(--shadow-white-hairline);
                      position: relative; isolation: isolate; transition: transform 90ms cubic-bezier(0, 0, .2, 1) }
/* Its hover is a layer that fades in: a gradient cannot be animated (as .btn-primary). */
.site-bar .site-cta::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
                             background: linear-gradient(to bottom, var(--primary-400), var(--primary-500));
                             opacity: 0; transition: opacity 150ms cubic-bezier(0, 0, .2, 1) }
.site-bar .site-cta:hover::after { opacity: 1 }
.site-bar .site-cta:active { transform: scale(.98) }
.site-theme { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
              border: 0; border-radius: var(--radius-lg); background: none; color: var(--fg-secondary);
              transition: color 150ms cubic-bezier(0, 0, .2, 1), background-color 150ms cubic-bezier(0, 0, .2, 1) }
.site-theme:hover { color: var(--fg-primary); background: var(--surface-hover) }
.site-moon { display: none }
:root[data-theme="dark"] .site-moon { display: block }
:root[data-theme="dark"] .site-sun { display: none }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-moon { display: block }
  :root:not([data-theme="light"]) .site-sun { display: none }
}
.site-bar :focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px }

/* Narrow: the logo, the button and the theme stay; the links go behind one menu,
   the same links in the same order. */
.site-more { display: none; position: relative }
.site-more > summary { list-style: none; display: grid; place-items: center; width: 34px; height: 34px;
                       border-radius: var(--radius-lg); color: var(--fg-primary); cursor: pointer }
/* The menu's three lines turn into a cross, and back. */
.site-more > summary span, .site-more > summary span::before, .site-more > summary span::after {
  transition: transform 150ms cubic-bezier(0, 0, .2, 1), top 150ms cubic-bezier(0, 0, .2, 1), background-color 150ms cubic-bezier(0, 0, .2, 1) }
.site-more > summary::-webkit-details-marker { display: none }
.site-more > summary span, .site-more > summary span::before, .site-more > summary span::after {
  display: block; width: 16px; height: 1.5px; background: currentColor; border-radius: 1px; content: "" }
.site-more > summary span { position: relative }
.site-more > summary span::before { position: absolute; top: -5px }
.site-more > summary span::after { position: absolute; top: 5px }
.site-more[open] > summary span { background: transparent }
.site-more[open] > summary span::before { top: 0; transform: rotate(45deg) }
.site-more[open] > summary span::after { top: 0; transform: rotate(-45deg) }
.site-panel { position: absolute; top: calc(100% + 13px); right: -8px; width: min(280px, calc(100vw - 24px));
              padding: 6px; display: grid; gap: 2px; background: var(--bg-elevated); border: 1px solid var(--border-card);
              border-radius: var(--radius-xl); box-shadow: var(--shadow-xl) }
.site-bar .site-panel .site-link { padding: 10px 12px }
@media (prefers-reduced-motion: reduce) { .site-bar *, .site-bar *::before, .site-bar *::after { transition: none !important } }
/* Below 1040px the links, "by Alconost", the button and the theme no longer fit on one
   line, so the links fold into the menu. */
@media (max-width: 1040px) {
  .site-nav { display: none }
  .site-more { display: block }
  .site-end { margin-left: auto; gap: 8px }
}
@media (max-width: 400px) { .site-type svg { height: 15px } .site-bar .site-cta { padding: 0 11px } }
/* The menu's own theme switch: only where the bar's has given up its place. */
.site-bar .site-theme-row { display: none; width: 100%; text-align: left; border: 0; background: none;
                            cursor: pointer; font-family: inherit; border-top: 1px solid var(--border-divider);
                            border-radius: 0 0 var(--radius-lg) var(--radius-lg); margin-top: 4px }
/* At 320px the logo, the button, the theme and the menu came to 352px: the menu
   stood off the screen. Below 360px the theme switch goes into the menu, and the
   rest keeps its full size. */
@media (max-width: 360px) {
  .site-bar .site-wrap { gap: 16px }
  .site-bar .site-end > .site-theme { display: none }
  .site-bar .site-theme-row { display: block }
}

/* ---- the foot ---- */
.site-foot { border-top: 1px solid var(--border-divider); padding: 56px 0 36px; color: var(--fg-tertiary);
             font: var(--text-sm)/1.6 var(--font-sans) }
/* Through .site-wrap: a page's own link colour (`a:not(.btn)`) must not reach in. */
.site-foot .site-wrap a { color: var(--fg-secondary); text-decoration: none; transition: color 150ms cubic-bezier(0, 0, .2, 1) }
.site-foot .site-wrap a:hover { color: var(--fg-primary) }
.foot-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px 40px;
             padding-bottom: 36px; border-bottom: 1px solid var(--border-divider) }
.foot-about { max-width: 600px }
.foot-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--fg-primary) }
.foot-lockup { display: inline-flex; align-items: center; gap: 8px }
.foot-lockup .site-mark svg { width: 20px; height: 20px; display: block }
.foot-lockup .site-type svg { height: 17px; width: auto; display: block }
.foot-by { font-size: 14px; color: var(--fg-tertiary) }
.site-foot .foot-alconost { display: inline-flex }
.foot-alconost svg { height: 14px; width: auto; display: block }
.foot-tag { margin: 16px 0 0; color: var(--fg-secondary); font-size: 15px; line-height: 1.6 }
.foot-trust { margin: 10px 0 0; font-size: 13px }
.foot-h { margin-bottom: 12px; color: var(--fg-tertiary); font-size: 12px; font-weight: var(--weight-semibold);
          letter-spacing: .08em; text-transform: uppercase }
.foot-contact a, .foot-contact p { display: block; margin: 0 0 6px }
.foot-contact p { font-size: 13px }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding: 36px 0;
             border-bottom: 1px solid var(--border-divider) }
.foot-cols a { display: block; margin-bottom: 9px; width: fit-content }
.foot-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding-top: 24px; font-size: 13px }
.foot-legal, .foot-social { display: flex; flex-wrap: wrap; gap: 6px 20px }
/* Its own line, under the rest. */
.foot-social { width: 100%; margin-top: 4px; font-size: 12px }
.site-note { width: 100%; margin: 0 0 4px; max-width: 80ch }
/* A link in the page's note is a link in a sentence, and looks like one. */
.site-foot .site-note a { color: var(--fg-accent); text-decoration: underline; text-underline-offset: 2px }
.site-foot .site-note a:hover { color: var(--fg-primary) }
.site-foot :focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; border-radius: 2px }
@media (max-width: 700px) {
  .site-foot { padding-top: 44px }
  .foot-cols { grid-template-columns: 1fr 1fr; gap: 24px 20px }
}

/* The cookie banner (Footer.astro): bottom corner, out of the way, two plain choices. */
.consent { position: fixed; left: 16px; bottom: 16px; z-index: 50; max-width: 420px; padding: 16px 18px;
  background: var(--bg-elevated); border: 1px solid var(--border-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); color: var(--fg-secondary); font: 400 14px/1.5 var(--font-sans) }
.consent[hidden] { display: none }
.consent p { margin: 0 0 12px }
.consent a { color: var(--fg-accent) }
.consent-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap }
.consent-btn { font: 500 14px/1 var(--font-sans); padding: 9px 14px; border-radius: var(--radius-md); cursor: pointer;
  background: transparent; color: var(--fg-primary); border: 1px solid var(--border-card) }
.consent-btn:hover { border-color: var(--border-card-hover) }
.consent-yes { background: var(--fg-accent); border-color: var(--fg-accent); color: #fff }
@media (max-width: 480px) { .consent { left: 8px; right: 8px; bottom: 8px; max-width: none } }
