/* Pit Stop language switch (English / Español). A file, not an inline <style>,
   because the creator page sends a CSP with style-src 'self'. Shared by all three pages. */

/* Hidden until /lang-switch.js runs, so a visitor without JavaScript never sees a button that does nothing. */
.lang-toggle,.lang-toggle-link{display:none}
html.lang-js .lang-toggle{display:inline-flex}
html.lang-js .lang-toggle-link{display:inline-flex}

/* While a saved Spanish choice is applied on load (a few milliseconds), keep English from flashing. */
html.lang-pending body{visibility:hidden}

/* Header pill: top right, 44px tap target */
.lang-toggle{align-items:center;justify-content:center;flex:0 0 auto;min-height:44px;min-width:44px;padding:0 18px;border:1.5px solid #1f6fe0;border-radius:999px;background:#fff;color:#1558b8;font:inherit;font-size:14px;font-weight:700;line-height:1;letter-spacing:0;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent}
.lang-toggle:hover{background:#e8f1fd}
.lang-toggle:focus-visible{outline:3px solid #12b886;outline-offset:3px}

/* Footer link: looks like its neighbours, still a 44px tap target */
.lang-toggle-link{align-items:center;min-height:44px;padding:0;border:0;background:none;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.lang-toggle-link:focus-visible{outline:3px solid #12b886;outline-offset:4px}

/* Home page footer: the longer Spanish links plus this one must wrap on phones instead of overflowing */
.footer-links{flex-wrap:wrap;row-gap:0}

/* Placement: the pill is the last child of the header. Keep it at the far right. */
.site-header>nav,.guide-header>nav{margin-left:auto}
.site-header>.lang-toggle,.guide-header>.lang-toggle{order:3}

/* When a header wraps onto two rows, the pill stays on the first row next to the logo
   and the nav drops below. (Nav order 2 alone changes nothing while the pill is order 3.) */
@media(max-width:900px){.guide-header>nav{order:2}.guide-header>.lang-toggle--guide{order:1;margin-left:auto}}  /* How it works wraps at 900px */
@media(max-width:760px){.site-header>nav{order:2}.site-header>.lang-toggle--creators{order:1;margin-left:auto}  /* Creators wraps at 760px */
  /* Creators: let the long Spanish tagline under the logo wrap, so the pill fits on the logo row */
  .site-header:has(>.lang-toggle--creators)>.brand small{max-width:170px}}
@media(max-width:600px){.site-header>.lang-toggle--landing{order:1;margin-left:auto}}                         /* Home page wraps at 600px */
@media(max-width:380px){
  .lang-toggle{padding:0 14px;font-size:13px}
}
