/* The interface-language switch (_language_switch.html), linked by the partial itself.
   Moved out of app/templates/_language_switch.html in Step 18b; served as /static/css/lang-switch.<hash>.css with a
   content hash (app/services/assets.py). Edit here. */

/* ---- _language_switch.html ---- */
  .lang-switch {
    position: relative; display: inline-block; font: inherit;
    /* Vertical alignment, twice over, because this partial has to sit in two
       kinds of host and neither property works in both.

       `align-self` covers a flex parent — the home page's masthead is
       `display: flex; align-items: baseline`, and an icon-only inline-block has
       no text to take a baseline from, so the browser synthesises one at its
       bottom margin edge. The globe's *bottom* then lined up with the text
       baseline and it floated visibly above its neighbours.

       `vertical-align` covers an inline parent, such as the sign-in card, where
       `align-self` is ignored. -.28em drops a 1.25em icon so its middle sits on
       the text's optical centre rather than its baseline.

       Setting both is safe: each is ignored in the layout mode the other
       serves. */
    align-self: center; vertical-align: -.28em;
  }
  .lang-switch > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center;
    line-height: 1;
    /* Accent, not inherited text colour. This control always sits among links —
       the masthead's "Log in", the sign-in card's footnotes — and both of those
       are accent-coloured, so inheriting the body colour made the globe the one
       dark mark in a row of blue. */
    color: var(--color-accent, var(--accent, currentColor));
  }
  /* Safari draws its own triangle through `::-webkit-details-marker`, which
     `list-style: none` alone does not remove. */
  .lang-switch > summary::-webkit-details-marker { display: none; }
  /* The same darkening the masthead links use on hover, looked up through both
     token sets and falling back to no change rather than to a colour that might
     not belong to this palette. */
  .lang-switch > summary:hover {
    color: var(--color-accent-700, var(--accent, currentColor));
  }
  .lang-switch > summary:focus-visible {
    outline: 2px solid var(--color-accent, var(--accent, currentColor)); outline-offset: 3px;
  }
  .lang-switch svg { display: block; width: 1.25em; height: 1.25em; }
  /* Right-aligned, because every place this sits is at the right-hand end of
     something; anchoring it left would push the panel off a 360px viewport. */
  /* Below the trigger by default. `switch_up` flips it, for the one place that
     sits at the bottom of a full-height sidebar with nothing underneath to open
     into — see the rail's foot. */
  .lang-switch .lang-panel {
    position: absolute; right: 0; top: calc(100% + .5em); z-index: 40;
    display: flex; flex-direction: column; align-items: stretch; margin: 0;
    background: var(--color-surface, var(--surface, #ffffff));
    border: 1px solid var(--color-border, var(--line, rgba(0, 0, 0, .16)));
    padding: .3em 0; min-width: 8em;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  }
  /* ⚠️ Do not put this inside a scrolling container. An absolutely positioned
     panel is clipped by any ancestor that scrolls, whatever its offsets — this
     control spent a version in the workspace rail (`overflow: hidden auto`) and
     the panel came out as a sliver of white with its contents cut off. Every
     host it has now — the home page masthead, the sign-in card, the workspace
     top bar — is outside one. */
  .lang-switch .lang-panel button,
  .lang-switch .lang-panel .lang-on {
    font: inherit; text-align: left; white-space: nowrap;
    background: none; border: 0; padding: .5em 1em; cursor: pointer;
    color: var(--color-text, var(--ink, inherit));
  }
  .lang-switch .lang-panel button:hover {
    background: var(--color-accent-50, var(--accent-soft, rgba(0, 0, 0, .06)));
  }
  /* The current language is text, not a disabled button: there is nothing to
     press, and a control that does nothing is worse than no control. */
  .lang-switch .lang-panel .lang-on {
    cursor: default; font-weight: 600;
    color: var(--color-accent, var(--accent, inherit));
  }
