/* Airpak Express — sleek language switcher (replaces Google Translate) */
.ap-lang-switcher{ position:relative; display:inline-block; vertical-align:middle; margin:0 10px; z-index:9990; }
.ap-lang-switcher *{ box-sizing:border-box; }

/* Pill button with sleek translate icon */
.ap-lang-btn{
  display:inline-flex; align-items:center; gap:7px;
  height:38px; padding:0 14px;
  font:600 13px/1 'Inter','Segoe UI',system-ui,sans-serif;
  color:#1a1a24;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(0,0,0,.08);
  border-radius:999px;
  cursor:pointer; outline:none;
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
  backdrop-filter:saturate(180%) blur(12px);
  -webkit-backdrop-filter:saturate(180%) blur(12px);
  transition:transform .15s, box-shadow .15s, border-color .15s;
  white-space:nowrap;
  user-select:none;
}
.ap-lang-btn:hover{
  transform:translateY(-1px);
  border-color:#CD2727;
  box-shadow:0 2px 4px rgba(0,0,0,.06), 0 8px 18px rgba(205,39,39,.15);
}
.ap-lang-btn:active{ transform:translateY(0); }
.ap-lang-btn .ap-lang-icon{
  width:18px; height:18px; flex:0 0 18px;
  color:#CD2727;
}
.ap-lang-btn .ap-lang-flag{ font-size:16px; line-height:1; }
.ap-lang-btn .ap-lang-code{
  font-weight:700; letter-spacing:.04em; font-size:12px;
  color:#373F41;
}
.ap-lang-btn .ap-lang-caret{
  width:10px; height:10px; flex:0 0 10px;
  margin-left:1px;
  color:#8a8a93;
  transition:transform .2s;
}
.ap-lang-switcher.open .ap-lang-btn{ border-color:#CD2727; box-shadow:0 0 0 3px rgba(205,39,39,.12), 0 8px 18px rgba(205,39,39,.15); }
.ap-lang-switcher.open .ap-lang-caret{ transform:rotate(180deg); }

/* Glassy dropdown menu */
.ap-lang-menu{
  position:absolute; top:calc(100% + 8px); right:0;
  min-width:220px;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(0,0,0,.06);
  border-radius:14px;
  box-shadow:
    0 1px 2px rgba(0,0,0,.04),
    0 10px 32px rgba(0,0,0,.14),
    0 4px 12px rgba(0,0,0,.08);
  backdrop-filter:saturate(180%) blur(20px);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  padding:6px;
  opacity:0; transform:translateY(-8px) scale(.96); transform-origin:top right;
  pointer-events:none;
  transition:opacity .18s, transform .18s;
  max-height:60vh; overflow-y:auto;
  z-index:10000;
}
.ap-lang-switcher.open .ap-lang-menu{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

.ap-lang-menu-head{
  font:600 10px/1.3 'Inter',sans-serif;
  color:#8a8a93; text-transform:uppercase; letter-spacing:.08em;
  padding:8px 10px 6px;
}

.ap-lang-item{
  display:flex; align-items:center; gap:10px;
  width:100%; padding:9px 10px; margin:1px 0;
  background:transparent; border:0; border-radius:9px;
  font:500 13.5px/1.2 'Inter','Segoe UI',system-ui,sans-serif;
  color:#1a1a24; cursor:pointer; text-align:left;
  transition:background .12s;
}
.ap-lang-item:hover{ background:#f3f3f7; }
.ap-lang-item .ap-lang-flag{ font-size:18px; line-height:1; }
.ap-lang-item .ap-lang-name{ flex:1; }
.ap-lang-item.active{ background:linear-gradient(135deg,rgba(205,39,39,.08),rgba(205,39,39,.04)); color:#CD2727; font-weight:600; }
.ap-lang-item.active::after{
  content:""; width:8px; height:8px; border-radius:50%;
  background:#CD2727; box-shadow:0 0 0 3px rgba(205,39,39,.15);
}

/* Pinned top-right of viewport — always on the right side of the page */
.ap-lang-switcher.ap-lang-floating{
  position:fixed; top:14px; right:72px; z-index:2147483640; margin:0;
}
@media(max-width:520px){
  .ap-lang-switcher.ap-lang-floating{ top:10px; right:64px; }
}

/* Dark mode (for juju2 dark sections) */
body.dark .ap-lang-btn, [data-theme="dark"] .ap-lang-btn{
  background:rgba(26,26,36,.85); color:#fff; border-color:rgba(255,255,255,.08);
}
body.dark .ap-lang-btn .ap-lang-code, [data-theme="dark"] .ap-lang-btn .ap-lang-code{ color:#e8e8ec; }
body.dark .ap-lang-menu, [data-theme="dark"] .ap-lang-menu{
  background:rgba(28,28,32,.96); border-color:rgba(255,255,255,.08);
}
body.dark .ap-lang-item, [data-theme="dark"] .ap-lang-item{ color:#fff; }
body.dark .ap-lang-item:hover, [data-theme="dark"] .ap-lang-item:hover{ background:rgba(255,255,255,.08); }
body.dark .ap-lang-menu-head, [data-theme="dark"] .ap-lang-menu-head{ color:#9a9aa3; }

@media(max-width:520px){
  .ap-lang-switcher{ margin:0 6px; }
  .ap-lang-btn{ height:34px; padding:0 10px; }
  .ap-lang-btn .ap-lang-code{ display:none; }
  .ap-lang-menu{ right:-30px; min-width:210px; }
}

/* Visible close (X) on the one-time language modal */
/* ============================================================
 * One-time language picker modal (built by ap-lang.js buildModal)
 * ============================================================ */
.ap-lang-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483646;
  opacity: 0;
  transition: opacity .22s ease;
  padding: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.ap-lang-modal-overlay.ap-lang-modal-open { opacity: 1; }
.ap-lang-modal-overlay.ap-lang-modal-closing { opacity: 0; }

.ap-lang-modal-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  padding: 32px 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: scale(.96) translateY(8px);
  transition: transform .22s ease;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.ap-lang-modal-open .ap-lang-modal-card { transform: scale(1) translateY(0); }

.ap-lang-modal-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  color: #CD2727;
}

.ap-lang-modal-head { text-align: center; margin-bottom: 22px; }
.ap-lang-modal-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  letter-spacing: -0.01em;
}
.ap-lang-modal-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #6b6b73;
}

.ap-lang-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.ap-lang-modal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: #f6f6f8;
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font: 500 13px/1.2 'Inter', sans-serif;
  color: #1c1c1e;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
  min-height: 76px;
}
.ap-lang-modal-option:hover {
  background: rgba(205, 39, 39, 0.08);
  border-color: #CD2727;
}
.ap-lang-modal-option:active { transform: scale(0.97); }
.ap-lang-modal-flag { font-size: 26px; line-height: 1; }
.ap-lang-modal-name { font-weight: 500; }

.ap-lang-modal-foot {
  display: flex;
  justify-content: center;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 8px;
  padding-top: 16px;
}

@media (max-width: 480px) {
  .ap-lang-modal-card { padding: 24px 18px 18px; }
  .ap-lang-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .ap-lang-modal-title { font-size: 19px; }
}

@media (prefers-color-scheme: dark) {
  .ap-lang-modal-card { background: #1c1c1e; }
  .ap-lang-modal-title { color: #f2f2f7; }
  .ap-lang-modal-sub { color: #a1a1a8; }
  .ap-lang-modal-option {
    background: rgba(255, 255, 255, 0.06);
    color: #f2f2f7;
  }
  .ap-lang-modal-foot { border-top-color: rgba(255, 255, 255, 0.08); }
}

.ap-lang-modal-card { position: relative; }
.ap-lang-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: #4a4a4a;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.ap-lang-modal-close:hover {
  background: rgba(205, 39, 39, 0.10);
  color: #CD2727;
  transform: scale(1.05);
}
.ap-lang-modal-close svg { width: 18px; height: 18px; }

/* Make the skip button more obvious so users see they can exit */
.ap-lang-modal-skip {
  border: 1px solid rgba(0,0,0,0.08) !important;
  background: rgba(0,0,0,0.02) !important;
  font-weight: 600 !important;
  padding: 10px 18px !important;
}

@media (prefers-color-scheme: dark) {
  .ap-lang-modal-close {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.10);
    color: #d4d4d4;
  }
  .ap-lang-modal-skip {
    border-color: rgba(255,255,255,0.12) !important;
    background: rgba(255,255,255,0.04) !important;
  }
}

