/* 多语言（EN / RU / ES / AR）24 个专题页增强与 RTL 镜像样式 — 零影响中文站 */

/* ---------- 1. 移动端卡片表格：优先读取每单元格本地化 data-label ---------- */
@container (width < 640px) {
  .gh-about .gh-about__table tbody td[data-label]::before,
  .gh-case .gh-case__table tbody td[data-label]::before,
  .gh-history .gh-history__table tbody td[data-label]::before,
  .gh-certs .gh-certs__table tbody td[data-label]::before {
    content: attr(data-label) ": ";
  }
}

@container (width < 680px) {
  .gh-test .gh-test__table tbody td[data-label]::before,
  .gh-std .gh-std__table tbody td[data-label]::before {
    content: attr(data-label) ": ";
  }
}

/* ---------- 2. 统一多语言表格与指标防折行/防溢出保护 ---------- */
.gh-about__table :is(th, td),
.gh-case__table :is(th, td),
.gh-history__table :is(th, td),
.gh-certs__table :is(th, td),
.gh-test__table :is(th, td),
.gh-std__table :is(th, td) {
  text-align: start;
  overflow-wrap: anywhere;
}

.gh-case__kv-row {
  grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
}

.gh-about__facts dt,
.gh-certs__honor-level,
.gh-test__step-code,
.gh-std__badge,
.gh-std__article-tag {
  overflow-wrap: break-word;
}

@media (max-width: 580px) {
  .gh-about__metric-val,
  .gh-case__metric-val,
  .gh-history__phase-years,
  .gh-certs__metric-val,
  .gh-test__metric-val,
  .gh-std__metric-val {
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
    white-space: nowrap;
  }

  .gh-about__hero-lead,
  .gh-case__hero-lead,
  .gh-history__hero-lead,
  .gh-certs__hero-lead,
  .gh-test__hero-lead,
  .gh-std__hero-lead {
    font-size: .95rem;
  }
}

/* ---------- 3. 阿拉伯语 [dir="rtl"] 全量视觉与方向镜像 ---------- */
[dir="rtl"] .gh-about__hero-media::after,
[dir="rtl"] .gh-case__hero-media::after,
[dir="rtl"] .gh-history__hero-media::after,
[dir="rtl"] .gh-certs__hero-media::after,
[dir="rtl"] .gh-test__hero-media::after,
[dir="rtl"] .gh-std__hero-media::after {
  background:
    linear-gradient(270deg, #28181e 28%, rgba(40, 24, 30, .88) 52%, rgba(40, 24, 30, .38) 84%, rgba(40, 24, 30, .24) 100%),
    linear-gradient(180deg, rgba(40, 24, 30, .32) 0%, rgba(40, 24, 30, .60) 100%);
}

@media (max-width: 820px) {
  [dir="rtl"] .gh-about__hero-media::after,
  [dir="rtl"] .gh-case__hero-media::after,
  [dir="rtl"] .gh-history__hero-media::after,
  [dir="rtl"] .gh-certs__hero-media::after,
  [dir="rtl"] .gh-test__hero-media::after,
  [dir="rtl"] .gh-std__hero-media::after {
    background: linear-gradient(180deg, rgba(40, 24, 30, .74) 0%, #28181e 95%);
  }
}

/* RTL 手风琴指示符起始位置与闭合朝向 */
[dir="rtl"] .gh-case__archive-summary::before,
[dir="rtl"] .gh-test__faq summary::before,
[dir="rtl"] .gh-std__faq summary::before {
  rotate: 90deg;
}

[dir="rtl"] .gh-case__archive-details[open] > .gh-case__archive-summary::before,
[dir="rtl"] .gh-test__faq details[open] > summary::before,
[dir="rtl"] .gh-std__faq details[open] > summary::before {
  rotate: 0deg;
}

/* RTL 手风琴正文使用逻辑内边距 */
[dir="rtl"] .gh-test__faq-body,
[dir="rtl"] .gh-std__faq-body {
  padding-inline-start: 44px;
  padding-inline-end: 20px;
}

@media (max-width: 580px) {
  [dir="rtl"] .gh-test__faq-body,
  [dir="rtl"] .gh-std__faq-body {
    padding-inline: 16px;
  }
}

/* RTL 内链方向箭头水平镜像 */
[dir="rtl"] .gh-about__inline-link .icon,
[dir="rtl"] .gh-case__inline-link .icon,
[dir="rtl"] .gh-history__inline-link .icon,
[dir="rtl"] .gh-certs__inline-link .icon,
[dir="rtl"] .gh-test__inline-link .icon,
[dir="rtl"] .gh-std__inline-link .icon {
  transform: scaleX(-1);
}

/* 阿拉伯语正文与标题行高优化 */
[dir="rtl"] .gh-about,
[dir="rtl"] .gh-case,
[dir="rtl"] .gh-history,
[dir="rtl"] .gh-certs,
[dir="rtl"] .gh-test,
[dir="rtl"] .gh-std {
  line-height: 1.82;
}

[dir="rtl"] bdi[dir="ltr"] {
  unicode-bidi: isolate;
}
