/* ============================================================
   ORST — Smart Related Links
   ============================================================ */
.orst-smart-related {
  margin: 34px 0 0;
  padding: 22px 24px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.orst-smart-related h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.3;
}
.orst-smart-related ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.orst-smart-related li { margin: 0; }
.orst-smart-related a {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.orst-smart-related a:hover,
.orst-smart-related a:focus {
  color: var(--orst-bg-end, #d60080);
  box-shadow: inset 0 0 0 1px rgba(214, 0, 128, 0.24), 0 8px 18px rgba(214, 0, 128, 0.1);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .orst-smart-related { margin-top: 26px; padding: 18px; border-radius: 16px; }
  .orst-smart-related ul { grid-template-columns: 1fr; }
}

/* ============================================================
   ORST — Desktop language switcher
   A fixed pill rendered on all screens > 1100px (wster-v5) or > 782px (generic).
   Hidden on mobile via the media queries at the bottom of this file.
   ============================================================ */
.orst-language-switcher {
  position: fixed;
  z-index: 99990;
  top: var(--orst-offset-y, 16px);
  right: var(--orst-offset-x, 16px);
  margin: 0;
  padding: 0;
  font: 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
.admin-bar .orst-language-switcher {
  top: calc(var(--orst-offset-y, 16px) + 32px);
}
.orst-language-switcher.orst-position-top-left  { right: auto; left: var(--orst-offset-x, 16px); }
.orst-language-switcher.orst-position-bottom-right { top: auto; right: var(--orst-offset-x, 16px); bottom: var(--orst-offset-y, 16px); }
.orst-language-switcher.orst-position-bottom-left  { top: auto; right: auto; bottom: var(--orst-offset-y, 16px); left: var(--orst-offset-x, 16px); }
.admin-bar .orst-language-switcher.orst-position-bottom-right,
.admin-bar .orst-language-switcher.orst-position-bottom-left { top: auto; }

/* Theme-adapter: desktop position for proglamtool & wster-v5 */
.orst-language-switcher.orst-theme-adapter-proglamtool,
.orst-language-switcher.orst-theme-adapter-wster-v5 { z-index: 1002; }

.orst-language-switcher.orst-theme-adapter-proglamtool.orst-position-top-right,
.orst-language-switcher.orst-theme-adapter-wster-v5.orst-position-top-right {
  top: var(--orst-offset-y, 14px);
  right: max(var(--orst-offset-x, 28px), 28px);
}
.orst-language-switcher.orst-theme-adapter-proglamtool.orst-position-top-left,
.orst-language-switcher.orst-theme-adapter-wster-v5.orst-position-top-left {
  top: var(--orst-offset-y, 14px);
  left: max(var(--orst-offset-x, 28px), 28px);
}

/* Pill control */
.orst-language-control {
  position: relative;
  display: inline-block;
  width: 132px; min-width: 132px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--orst-bg-start, #f10a98) 0%, var(--orst-bg-end, #d60080) 100%);
  box-shadow: 0 5px 16px rgba(145, 0, 86, 0.25);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.orst-language-control:hover { box-shadow: 0 7px 20px rgba(145, 0, 86, 0.32); transform: translateY(-1px); }
.orst-language-control:focus-within { box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 5px 16px rgba(145,0,86,0.3); }

/* Globe icon (CSS mask) */
.orst-language-control::before {
  position: absolute; z-index: 1;
  top: 50%; left: 11px;
  width: 19px; height: 19px;
  margin-top: -10px;
  background-color: var(--orst-text, #fff);
  mask: center / 19px 19px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18'/%3E%3C/svg%3E");
  -webkit-mask: center / 19px 19px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}
/* Chevron */
.orst-language-control::after {
  position: absolute;
  top: 50%; right: 13px;
  width: 6px; height: 6px;
  margin-top: -5px;
  border-right: 2px solid var(--orst-text, #fff);
  border-bottom: 2px solid var(--orst-text, #fff);
  transform: rotate(45deg);
  content: "";
  pointer-events: none;
}

.orst-language-select {
  box-sizing: border-box !important;
  width: 132px !important; min-width: 132px !important; max-width: 132px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 30px 0 38px !important;
  border: 0 !important; border-radius: 0 !important; outline: 0;
  color: var(--orst-text, #fff) !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 13px !important; font-weight: 600 !important;
  cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
}
.orst-language-select:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.orst-language-select option { color: #222; background: #fff; }

/* RTL */
[dir="rtl"] .orst-language-switcher       { right: auto; left: var(--orst-offset-x, 16px); }
[dir="rtl"] .orst-language-control::after { right: auto; left: 13px; }
[dir="rtl"] .orst-language-control::before{ right: 11px; left: auto; }
[dir="rtl"] .orst-language-select         { padding-right: 38px !important; padding-left: 30px !important; }

/* ============================================================
   ORST — Mobile globe button + dropdown panel
   ============================================================ */

/* Hidden by default; JS moves this into .header-actions */
.orst-mobile-switcher {
  display: none;
  position: relative;
  align-items: center;
}

/* Circular globe button */
.orst-mobile-globe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orst-bg-start, #f10a98) 0%, var(--orst-bg-end, #d60080) 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(145, 0, 86, 0.28);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.orst-mobile-globe-btn:hover        { box-shadow: 0 6px 18px rgba(145,0,86,0.38); transform: translateY(-1px); }
.orst-mobile-globe-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.orst-mobile-globe-btn svg           { display: block; }

/* Dropdown panel */
.orst-mobile-lang-panel {
  position: fixed;   /* overridden by JS with precise coords */
  z-index: 10010;
  min-width: 160px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.orst-mobile-lang-panel[hidden] { display: none; }

.orst-mobile-lang-option {
  display: block;
  padding: 10px 18px;
  color: #1f2937;
  font-size: 14px; font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.orst-mobile-lang-option:hover,
.orst-mobile-lang-option:focus {
  background: rgba(241, 10, 152, 0.07);
  color: var(--orst-bg-end, #d60080);
  outline: none;
}
.orst-mobile-lang-option.orst-lang-active {
  color: var(--orst-bg-end, #d60080);
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE — wster-v5  breakpoint: 1100 px
   Below this point: hide the desktop pill, show the globe button.
   ============================================================ */
@media (max-width: 1100px) {
  /* Kill every variant of the desktop switcher for wster-v5 */
  .orst-desktop-switcher,
  .orst-language-switcher.orst-theme-adapter-wster-v5 {
    display: none !important;
  }

  /* Show and activate the globe button */
  .orst-mobile-switcher {
    display: flex;
  }
}

/* ============================================================
   RESPONSIVE — proglamtool  breakpoint: 900 px
   ============================================================ */
@media (max-width: 900px) {
  .orst-language-switcher.orst-theme-adapter-proglamtool {
    display: none !important;
  }
  .orst-mobile-switcher {
    display: flex;
  }
}

/* ============================================================
   RESPONSIVE — generic themes  breakpoint: 782 px
   ============================================================ */
@media (max-width: 782px) {
  /* Hide default pill for all non-wster, non-proglamtool themes */
  .orst-language-switcher:not(.orst-theme-adapter-wster-v5):not(.orst-theme-adapter-proglamtool) {
    display: none !important;
  }

  /* Globe button: fallback fixed position when not inside a theme header */
  .orst-mobile-switcher:not(.orst-in-header) {
    display: flex;
    position: fixed;
    top: var(--orst-mobile-offset-y, 8px);
    right: var(--orst-mobile-offset-x, 12px);
    z-index: 99995;
  }
  .admin-bar .orst-mobile-switcher:not(.orst-in-header) {
    top: calc(var(--orst-mobile-offset-y, 8px) + 48px);
  }
}
