/*
 * Bilingual (RTL Persian / LTR English) layer.
 * Loaded after theme.css. Fixes direction-dependent layout that the base
 * stylesheet only handled for RTL, plus shared accessibility utilities.
 */

/* ---------- Direction-aware icons ---------- */
[dir="rtl"] .idsc-icon--arrow {
  transform: scaleX(-1);
}

/* Slider prev/next: the button mirrors "back", the icon mirrors per direction. */
.idsc-hero-slider__nav {
  transform: scaleX(-1);
}

.idsc-hero-slider__nav:hover {
  transform: scaleX(-1) translateY(-2px);
}

.idsc-hero-slider__nav--next,
.idsc-hero-slider__nav--next:hover {
  transform: none;
}

.idsc-hero-slider__nav--next:hover {
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.idsc-site-header__tagline {
  max-width: 320px;
  font-size: 11px;
  line-height: 1.5;
  color: rgb(255 255 255 / 0.72);
}

@media (min-width: 48rem) {
  .idsc-site-header__tagline {
    font-size: 0.75rem;
  }

  .idsc-site-header__controls {
    justify-self: end;
  }
}

.idsc-site-header__mobile-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.idsc-site-header__nav .idsc-nav-menu {
  flex-wrap: nowrap;
}

.idsc-site-header__nav .idsc-nav-menu > li > a {
  white-space: nowrap;
}

@media (min-width: 48rem) and (max-width: 79.99rem) {
  .idsc-site-header__nav .idsc-nav-menu > li > a {
    padding-inline: 0.7rem;
    font-size: 0.88rem;
  }

  .idsc-site-header__tagline {
    display: none;
  }
}

.idsc-header-search {
  padding-bottom: 1rem;
}

.idsc-header-search__form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 1.2rem;
  background: rgb(255 255 255 / 0.1);
}

.idsc-header-search__icon {
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
  margin-inline-start: 0.5rem;
  color: rgb(255 255 255 / 0.7);
  flex-shrink: 0;
}

.idsc-header-search__form input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.idsc-header-search__form input[type="search"]::placeholder {
  color: rgb(255 255 255 / 0.6);
}

.idsc-header-search__form .idsc-btn-gold {
  min-height: 2.75rem;
  padding-block: 0;
}

/* ---------- Floating support dock: always on the inline-end edge ---------- */
.idsc-support-dock {
  left: auto;
  right: auto;
  inset-inline-end: 1rem;
  justify-items: end;
}

@media (max-width: 47.99rem) {
  .idsc-support-dock {
    bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }
}

/* ---------- English typography ---------- */
html[lang="en"] .idsc-home-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.35rem, 4.6vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

html[lang="en"] .idsc-section-title,
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3 {
  letter-spacing: -0.01em;
}

html[lang="en"] .prose,
html[lang="en"] .entry-content,
html[lang="en"] .idsc-news-content {
  text-align: start;
  hyphens: manual;
}

/* Keep phone numbers, emails and URLs readable inside RTL text. */
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] a[href^="mailto:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- Language notices for untranslated content ---------- */
.idsc-language-notice {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgb(86 72 216 / 0.18);
  border-radius: 1rem;
  background: rgb(86 72 216 / 0.06);
  color: var(--color-idsc-primary);
  font-size: 0.92rem;
}

.idsc-language-notice a {
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Accessibility ---------- */
.idsc-skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 100000;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--color-idsc-primary);
  font-weight: 700;
  box-shadow: 0 10px 30px rgb(23 35 114 / 0.2);
}

.idsc-skip-link:focus {
  top: 1rem;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-idsc-accent, #f5c76b);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Empty states ---------- */
.idsc-empty-state {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 9rem;
  padding: 1.5rem;
  border: 1px dashed rgb(35 57 157 / 0.18);
  border-radius: 1.4rem;
  background: rgb(255 255 255 / 0.6);
  color: var(--color-idsc-muted, #64748b);
  text-align: center;
  font-size: 0.9rem;
}

/* History archive: term number/date badges sit on a light card (they were white on white). */
.idsc-history-term .idsc-media-badge:not(.is-gold) {
  background: rgb(86 72 216 / 0.1);
  color: var(--color-idsc-secondary, #5648d8);
}

/* Trust seals (eNamad etc.) keep their own size. */
.idsc-trust-badge img {
  display: inline-block;
  width: auto;
  max-width: 100%;
  max-height: 170px;
}
