/* Language switcher (25 Sep 2026): header top-right + footer row.
   Built on <details>/<summary>, so no JavaScript and no floating widget. */

.sf-lang { position: relative; flex: 0 0 auto; }
.sf-lang > summary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 10px; border: 1px solid #e4ded6; border-radius: 8px;
  background: #fff; color: #1f2328; font-size: 13px; font-weight: 700;
  cursor: pointer; list-style: none; white-space: nowrap;
  transition: border-color .18s ease, background-color .18s ease;
}
.sf-lang > summary::-webkit-details-marker { display: none; }
.sf-lang > summary:hover { border-color: #c9c4bf; background: #fbf9f6; }
.sf-lang[open] > summary { border-color: #c8102e; }
.sf-lang__globe { width: 16px; height: 16px; color: #c8102e; flex: 0 0 auto; }
.sf-lang__chev { width: 7px; height: 7px; border-right: 1.6px solid #858a90; border-bottom: 1.6px solid #858a90; transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease; }
.sf-lang[open] .sf-lang__chev { transform: rotate(-135deg) translate(-2px, -2px); }

.sf-lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
  min-width: 190px; padding: 6px; border: 1px solid #e4ded6; border-radius: 12px;
  background: #fff; box-shadow: 0 24px 48px -28px rgba(31,35,40,.55);
}
.sf-lang__menu a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: 8px; color: #1f2328; font-size: 14px; text-decoration: none;
}
.sf-lang__menu a:hover, .sf-lang__menu a:focus-visible { background: #f5f2ee; color: #1f2328; }
.sf-lang__menu a.is-current { background: #fdf5f5; }
.sf-lang__code { color: #858a90; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.sf-lang__menu a.is-current .sf-lang__code { color: #c8102e; }
.sf-lang__name { font-weight: 600; }

/* Footer row */
.sf-lang-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 22px; padding: 18px 0 0; border-top: 1px solid rgba(255,255,255,.12); }
.sf-lang-row__label { display: inline-flex; align-items: center; gap: 8px; color: #b3b9bf; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.sf-lang-row__label .sf-lang__globe { color: #e7596e; }
.sf-lang-row ul { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; }
.sf-lang-row a { display: inline-flex; align-items: center; padding: 7px 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #d7dbdf; font-size: 13px; font-weight: 600; text-decoration: none; transition: border-color .18s ease, color .18s ease, background-color .18s ease; }
.sf-lang-row a:hover, .sf-lang-row a:focus-visible { border-color: #e7596e; color: #fff; }
.sf-lang-row a.is-current { background: #fff; border-color: #fff; color: #1f2328; }

/* A light footer needs the dark-on-light treatment instead. */
.sf-site-footer--light .sf-lang-row { border-top-color: #ece8e2; }
.sf-site-footer--light .sf-lang-row__label { color: #858a90; }
.sf-site-footer--light .sf-lang-row a { border-color: #e4ded6; color: #5f6368; }
.sf-site-footer--light .sf-lang-row a.is-current { background: #1f2328; border-color: #1f2328; color: #fff; }

@media (max-width: 900px) {
  /* The header row is a CSS grid with auto flow, so a new child lands in whatever cell is
     next and can end up on top of the wordmark. Place the three things explicitly instead:
     brand | language | hamburger on one row, the menu and CTA full width beneath. */
  .sf-header > div:first-child { grid-template-columns: minmax(0, 1fr) auto auto !important; column-gap: 10px !important; }
  .sf-header > div:first-child > a:first-child { grid-column: 1; grid-row: 1; min-width: 0; }
  .sf-header > div:first-child > .sf-lang--header { grid-column: 2; grid-row: 1; }
  .sf-header > div:first-child > .sf-mobile-toggle { grid-column: 3; grid-row: 1; margin-left: 0 !important; }
  .sf-header > div:first-child > .sf-header__nav { grid-column: 1 / -1; }
  .sf-header > div:first-child > a:last-child { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
  /* The wordmark gives up space first rather than being overlapped. */
  .sf-header > div:first-child > a:first-child > span { min-width: 0; }
  .sf-header > div:first-child > a:first-child span { overflow: hidden; text-overflow: ellipsis; }
  /* Globe only on a phone: the wordmark is white-space:nowrap and cannot give up width,
     so the switcher gives it up instead. The code stays in the accessible name and the full
     list is one tap away. */
  .sf-lang--header > summary { min-height: 44px; min-width: 44px; justify-content: center; padding: 8px; gap: 0; }
  .sf-lang--header > summary b,
  .sf-lang--header > summary .sf-lang__chev { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sf-lang--header .sf-lang__globe { width: 20px; height: 20px; }
  .sf-lang__menu { min-width: 200px; }
  .sf-lang__menu a { min-height: 44px; font-size: 15px; }
  .sf-lang-row { gap: 12px 14px; }
  .sf-lang-row a { min-height: 44px; padding: 9px 16px; font-size: 13.5px; }
  .sf-lang-row__label { font-size: 12px; }
}

/* Right-to-left: Arabic. The menu anchors to the other side and the chevron mirrors. */
[dir="rtl"] .sf-lang__menu { right: auto; left: 0; }
[dir="rtl"] .sf-lang__menu a { grid-template-columns: 30px minmax(0, 1fr); }
