/* CAAH language switcher. See inc/caah-translate.php. */

.caah-lang {
  position: relative;
}

.caah-lang > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.caah-lang > summary::-webkit-details-marker {
  display: none;
}

.caah-lang-current {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.caah-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(31, 32, 39, 0.08);
  border-radius: var(--radius-sm, 12px);
  box-shadow: 0 16px 40px rgba(31, 32, 39, 0.12);
}

html.dark-mode .caah-lang-menu {
  background: rgba(30, 30, 30, 0.97);
  border-color: rgba(255, 255, 255, 0.06);
}

.caah-lang-menu .caah-lang-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.caah-lang-menu .caah-lang-option:hover,
.caah-lang-menu .caah-lang-option:focus-visible {
  background: rgba(223, 57, 66, 0.08);
}

.caah-lang-option[aria-pressed="true"] {
  font-weight: 700;
  color: var(--primary, #DF3942);
}

.caah-lang-note {
  margin: 6px 4px 2px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted, #5d5b62);
}

html.dark-mode .caah-lang-note {
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile menu row */
.caah-lang-mobile {
  width: 100%;
  margin-bottom: 16px;
}

.caah-lang-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.caah-lang-row .caah-lang-option {
  min-height: 44px;
  padding: 10px 6px;
  justify-content: center;
}

.caah-lang-row .btn.caah-lang-option[aria-pressed="true"] {
  border: 2px solid var(--primary, #DF3942);
  color: var(--primary, #DF3942);
  font-weight: 700;
}

/* Hide Google's own toolbar, balloons and highlight; the switcher above replaces them. */
.caah-gt-element,
.skiptranslate > iframe,
iframe.goog-te-banner-frame,
iframe.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip {
  display: none !important;
}

body {
  top: 0 !important;
}

.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

/* Arabic: right-to-left reading order. Phone numbers, addresses and times stay LTR. */
html.caah-lang-rtl body {
  direction: rtl;
  text-align: right;
}

/*
 * Off-screen helpers use left:-9999px. In a right-to-left document, overflow to the left is
 * scrollable, which made the page 11,000px wide and opened scrolled away from the content.
 * Park them off the right edge instead, and clip any other stray horizontal overflow.
 */
html.caah-lang-rtl {
  overflow-x: clip;
}

html.caah-lang-rtl .caah-hp,
html.caah-lang-rtl .caah-skip-link:not(:focus) {
  left: auto;
  right: -9999px;
}

html.caah-lang-rtl .caah-skip-link:focus {
  left: auto;
  right: 0;
}

/* The chat assistant stays English (not machine-translated), so keep it left-to-right. */
html.caah-lang-rtl .caah-concierge {
  direction: ltr;
  text-align: left;
}

html.caah-lang-rtl a[href^="tel:"],
html.caah-lang-rtl .caah-nap-address {
  direction: ltr;
  unicode-bidi: isolate;
}

html.caah-lang-rtl .caah-nap-address {
  text-align: right;
}
