/* Copyright 2026 Vikrant Rathore and Sibuna contributors. LGPL-3.0-or-later; see LICENSE.
 * The language menu and right-to-left layout. Both the
 * landing page (site.css) and the guidedog pages (guidedog.css) load this file, so the
 * colors use the variables of either. */
.language-menu {
  position:relative;
  flex:none;
  font-size:14px
}
.language-menu summary {
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  list-style:none;
  padding:6px 10px;
  min-height:36px;
  border:1px solid var(--gd-border, var(--line));
  border-radius:6px;
  white-space:nowrap;
  color:var(--gd-text-soft, var(--ink))
}
.language-menu summary::-webkit-details-marker {
  display:none
}
.language-menu summary::before {
  content:"";
  width:16px;
  height:16px;
  background:currentColor;
  -webkit-mask:var(--globe) center/contain no-repeat;
  mask:var(--globe) center/contain no-repeat;
  --globe:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z'/%3E%3C/svg%3E")
}
.language-sr {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap
}
.language-menu > div {
  position:absolute;
  inset-inline-end:0;
  top:calc(100% + 8px);
  width:180px;
  display:grid;
  padding:6px;
  background:var(--gd-bg, var(--paper));
  border:1px solid var(--gd-border, var(--line));
  border-radius:8px;
  box-shadow:0 10px 30px #20352f30;
  z-index:50
}
.language-menu > div a {
  padding:8px 12px;
  border-radius:4px;
  color:var(--gd-text, var(--ink));
  text-decoration:none;
  text-align:start
}
.language-menu > div a:hover {
  background:var(--gd-bg-hover, var(--pale))
}
.language-menu a[aria-current="true"] {
  color:var(--gd-link, var(--green));
  font-weight:600
}
.language-menu summary:focus-visible,
.language-menu a:focus-visible {
  outline:2px solid var(--gd-link, var(--green));
  outline-offset:2px
}
/* In a guidedog header the menu comes last, after the theme switch. */
.gd-header .language-menu {
  font-size:.875rem
}
@media (max-width:40rem) {
  .gd-header .language-menu summary span {
    display:none
  }
}

/* Right to left: code, commands and formulas keep their direction, and the order of
 * their characters is settled apart from the text around them. */
pre,code,kbd,samp,math,.math {
  direction:ltr;
  unicode-bidi:isolate
}
/* The guidedog pages: the drawer, lists, quotes and the search box. */
[dir="rtl"] .gd-sidebar {
  border-right:0;
  border-left:1px solid var(--gd-border)
}
[dir="rtl"] .gd-search {
  margin-left:0;
  margin-right:auto
}
[dir="rtl"] .gd-search form .gd-icon {
  left:auto;
  right:.7rem
}
[dir="rtl"] .gd-search input {
  padding:0 2.1rem 0 .75rem
}
[dir="rtl"] .search-results {
  right:auto;
  left:0
}
[dir="rtl"] .gd-article :is(ul,ol) {
  padding-left:0;
  padding-right:1.6em
}
[dir="rtl"] .gd-article blockquote {
  border-left:0;
  border-right:3px solid var(--gd-border);
  padding-left:0;
  padding-right:1rem
}
