/* frontend/site/bar.css, the one top bar of the public site: the brand, the products dropdown and the four links, the
 * language dropdown, the theme switch, the way in and the start button, and the phone menu sheet that holds what the bar
 * has no room for. Every page links it, the home page included, and reads only the shared tokens in
 * frontend/shared/tokens.css (the home page loads no site.css), so it is written against the home page's palette,
 * corners and type sizes and nothing else. frontend/site/bar.js wires it. The language dropdown's rows are also the
 * footer's, so those rules live here too.
 *
 * Widths. From 1280 the whole bar stands in one row. Below it the links and the theme switch move into the sheet and
 * the bar keeps the brand, the language, the way in, the start button and the menu button. Under 700 the start button
 * says its short word, and under 520 the language shows its code and the way in moves into the sheet, because a menu
 * button does not fit beside the language, the way in and the start button in French on a 360 screen. */

:root {
  /* The home bar is 8 above and below its 44px brand and a hairline, so a page stands 61px below it, and below the
     notch where the phone has one. */
  --header-h: calc(61px + env(safe-area-inset-top, 0px));
  /* The home page's band, the page ground at 93 percent behind a blur, and the hairline under it is the shadow colour
     at 8 percent. */
  --header-glass: color-mix(in srgb, var(--surface) 93%, transparent);
  --header-line: color-mix(in srgb, var(--shadow-color) 8%, transparent);
  --menu-bg: var(--surface-raised);
  --menu-hover: color-mix(in srgb, var(--ink) 6%, transparent);
  --bar-drawer: cubic-bezier(.32, .72, 0, 1);
}

.site-header, .site-header *, .site-sheet, .site-sheet * { box-sizing: border-box; }
:where(.site-header, .site-sheet) a { color: inherit; text-decoration: none; }
.site-header :focus-visible, .site-sheet :focus-visible { outline: 2px solid var(--home-wine); outline-offset: 3px; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-glass);
  color: var(--ink);
  font-family: var(--font-ui);
  border-bottom: 1px solid var(--header-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 100%;
  padding-inline: var(--home-gut-l) var(--home-gut-r);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 500 24px/1 var(--font-logo);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.site-nav { display: none; }

/* Every entry of the bar, the products toggle included, is a home link: 15px at 500 in a 10 by 14 capsule with no
   underline, which takes a grey wash under the pointer. */
.site-nav > a, .site-products-toggle, .site-login {
  padding: 10px 14px;
  border-radius: 999px;
  font: 500 var(--home-fs-15px)/1.5 var(--font-ui);
  white-space: nowrap;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .site-nav > a:hover, .site-products-toggle:hover, .site-login:hover { background: var(--menu-hover); }
}
.site-tools { display: flex; align-items: center; gap: 6px; font-size: var(--home-fs-15px); }
.site-tools .site-login, .site-tools .site-theme { display: none; }

/* The language button and the theme button wear the home language button: a hairline of the text's own colour at 20
   percent, 14px at 500, 36 high. A coarse pointer keeps the 44px floor below. */
.site-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  min-width: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: 500 14px/1 var(--font-ui);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent);
  -webkit-tap-highlight-color: transparent;
  transition: scale 160ms var(--home-ease), background-color 150ms ease;
}
.site-chip:active { scale: .96; }
@media (hover: hover) and (pointer: fine) {
  .site-chip:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
}
.site-lang-code { display: inline; }
.site-lang-name { display: none; }

/* The start button is the bar's own size on home: 42 high, 20 across, 15px, a flat wine capsule that darkens a step on
   hover and presses to .96. */
.site-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--home-wine);
  color: var(--home-wine-ink);
  font: 600 var(--home-fs-15px)/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale 160ms var(--home-ease), background-color 160ms var(--home-ease);
}
.site-start:active { scale: .96; }
@media (hover: hover) and (pointer: fine) {
  .site-start:hover { background: var(--home-c-8d2540); }
}
.site-start-long { display: none; }

.site-menu-toggle { width: 44px; padding: 0; }
.site-menu-toggle .icon-close, .site-menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.site-menu-toggle[aria-expanded="true"] .icon-close { display: block; animation: menu-in 160ms var(--home-ease) both; }

/* A 360 screen holds the brand, the language code, the short start word and the menu button in Macedonian, whose start
   word is the widest, only with the wordmark and the start button a little smaller. */
@media (max-width: 399px) {
  .site-brand { font-size: 22px; }
  .site-start { padding: 0 12px; }
}
@media (min-width: 520px) {
  .site-tools .site-login { display: inline-flex; }
  .site-lang-code { display: none; }
  .site-lang-name { display: inline; }
  .site-start { padding: 0 20px; }
  .site-sheet-login { display: none; }
}
@media (min-width: 700px) {
  .site-start-long { display: inline; }
  .site-start-short { display: none; }
}
@media (min-width: 1280px) {
  /* Home keeps every entry to the right of its brand, so the nav sits beside the tools and not between them and the brand. */
  .site-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
  .site-tools .site-theme { display: inline-flex; }
  .site-menu-toggle { display: none; }
}

/* The language dropdown, in the bar and in the footer of every other page, and the products dropdown, which only the
   wide bar has because the sheet lists the product pages outright. */
.site-lang, .site-products { position: relative; }
.site-lang-list, .site-products-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--home-r-16px);
  background: var(--menu-bg);
  color: var(--ink);
  font-family: var(--font-ui);
  box-shadow: var(--shadow-lift), 0 0 0 1px var(--line);
  transform-origin: top right;
}
/* The card is 300 wide with rows of 56 (W8-S13), and its corners are the row's radius plus its padding so they stay concentric. */
.site-products-list { right: auto; left: -14px; min-width: 300px; padding: 8px; border-radius: var(--radius-xl); transform-origin: top left; }
.site-products .site-products-list a { min-height: 56px; justify-content: flex-start; gap: 14px; padding-inline: 8px 14px; border-radius: calc(var(--radius-xl) - 8px); }
/* The product's Fluent 3D picture, 40 wide in a 56 row (W8-S13). */
.site-product-pic { width: 40px; height: 40px; flex: none; }
.site-lang-list:not([hidden]), .site-products-list:not([hidden]) { display: flex; flex-direction: column; animation: menu-in 160ms var(--home-ease) both; }
.site-products-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.site-products-toggle svg { transition: transform 160ms var(--home-ease); }
.site-products-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.site-lang-option, .site-products-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--home-r-10px);
  background: transparent;
  color: inherit;
  font: 400 var(--home-fs-15px)/1.5 var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease;
}
/* The chosen language is marked as home marks it, by weight and a wine dot at the row's end. */
.site-lang-option[aria-selected="true"] { font-weight: 600; }
.site-lang-option[aria-selected="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
@media (hover: hover) and (pointer: fine) {
  .site-lang-option:hover, .site-products-list a:hover { background: var(--menu-hover); }
}
@keyframes menu-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.site-theme { padding: 0; }
.site-theme svg { width: 17px; height: 17px; }
.site-theme .icon-sun { display: none; }
:root[data-theme="dark"] .site-theme .icon-sun { display: block; }
:root[data-theme="dark"] .site-theme .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-theme .icon-sun { display: block; }
  :root:not([data-theme="light"]) .site-theme .icon-moon { display: none; }
}

/* The phone menu is a sheet that drops from under the bar. */
.site-sheet {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 49;
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--home-gut-r) 28px var(--home-gut-l);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  box-shadow: 0 1px 0 var(--header-line), 0 30px 60px -30px color-mix(in srgb, var(--shadow-color) 35%, transparent);
}
.site-sheet:not([hidden]) { animation: sheet-in 320ms var(--bar-drawer) both; }
/* The page holds still under the open sheet; a swipe over it scrolled the page
   behind, which showed through the strip below the sheet (2 October 2026). */
html.is-sheet-open { overflow: hidden; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.site-sheet nav { display: flex; flex-direction: column; }
.site-sheet nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}
.site-sheet nav a.site-sheet-product { gap: 14px; }
.site-sheet > .site-theme { margin-top: 20px; }
.site-sheet-actions { display: grid; gap: 10px; margin-top: 20px; }
.site-sheet-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  font: 600 16px/1 var(--font-ui);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
@media (min-width: 1280px) {
  .site-sheet { display: none !important; }
}

/* A phone or a tablet showing the desktop layout is still steered with a thumb, so the controls it reaches keep the 44
   pixel floor wherever the pointer is coarse, whatever the width. The text keeps its desktop size, because the
   links only just fit the row at 1280 pixels. */
@media (hover: none) and (pointer: coarse) {
  .site-nav > a, .site-products-toggle { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
  .site-chip { min-height: 44px; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-chip, .site-start, .site-lang-option, .site-products-list a { transition: none; }
}
