/* Native ES / FR / AR presentation.
   Loaded after page styles; original imagery and media-frame geometry are unchanged. */

/* Compact native language disclosure, matching the LMC Crystal interaction.
   This shell applies to EN / ZH too; links remain ordinary crawlable anchors. */
.site-header details.language-switch {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  white-space: normal;
}
.site-header details.language-switch > summary {
  display: flex;
  min-height: 44px;
  min-width: 80px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(233, 213, 173, .35);
  border-radius: 3px;
  background: rgba(255, 255, 255, .035);
  color: var(--white, #f4f3ef);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  direction: ltr;
  cursor: pointer;
  list-style: none;
}
.site-header details.language-switch .language-chevron {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}
.site-header details.language-switch[open] .language-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .site-header details.language-switch .language-chevron { transition: none; }
}
.site-header details.language-switch > summary::-webkit-details-marker { display: none; }
.site-header details.language-switch > summary::marker { content: ""; }
.site-header details.language-switch > summary:hover,
.site-header details.language-switch[open] > summary {
  border-color: var(--gold-light, #c4a26d);
  background: rgba(196, 162, 109, .1);
}
.site-header details.language-switch > summary:focus-visible {
  outline: 2px solid var(--gold-light, #c4a26d);
  outline-offset: 3px;
}
.site-header details.language-switch .language-menu {
  position: absolute;
  z-index: 120;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 190px;
  max-width: calc(100vw - 32px);
  max-height: min(360px, calc(100dvh - 100px));
  overflow-y: auto;
  padding: 5px;
  border: 1px solid rgba(196, 162, 109, .48);
  border-radius: 4px;
  background: #111113;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .38);
}
.site-header details.language-switch:not([open]) .language-menu { display: none; }
.site-header details.language-switch .language-menu a {
  min-height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 2px;
  color: #efede8;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: start;
  white-space: nowrap;
}
.site-header details.language-switch .language-menu a:hover,
.site-header details.language-switch .language-menu a:focus-visible,
.site-header details.language-switch .language-menu a[aria-current="page"],
.site-header details.language-switch .language-menu a.is-active {
  color: #ead5ad;
  background: rgba(196, 162, 109, .13);
}
.site-header details.language-switch .language-menu a:focus-visible {
  outline: 2px solid #c4a26d;
  outline-offset: -2px;
}
.site-header details.language-switch :is(.language-flag, .language-current-flag, .language-option-flag) {
  flex: 0 0 auto;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  line-height: 1;
}
@media (max-width: 600px) {
  .site-header details.language-switch > summary {
    min-width: 76px;
    min-height: 44px;
    gap: 5px;
    padding-inline: 8px;
  }
  .site-header .nav-disclosure {
    min-width: 72px;
    gap: 6px;
    padding-inline: 8px;
  }
}

/* Natural expansion for the longer Spanish/French labels. */
html:is(:lang(es), :lang(fr), :lang(ar)) :is(h1, h2, h3, h4, p, li, dt, dd, th, td, label) {
  overflow-wrap: anywhere;
}
html:is(:lang(es), :lang(fr)) :is(h1, h2, h3, h4, p) { hyphens: manual; }
html:is(:lang(es), :lang(fr), :lang(ar)) :is(.button, .catalog-book-primary, .catalog-book-download, .cl-actions a, .cl-related) {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  line-height: 1.45;
}
html:is(:lang(es), :lang(fr), :lang(ar)) :is(.actions, .cl-actions, .cl-status, .product-category-toolbar) {
  flex-wrap: wrap;
}
html:is(:lang(es), :lang(fr), :lang(ar)) :is(.cl-card-title h2, .cl-row-name, .cl-poster-caption) {
  overflow-wrap: anywhere;
}
html:is(:lang(es), :lang(fr), :lang(ar)) .cl-poster-line { white-space: normal; }
html:is(:lang(es), :lang(fr), :lang(ar)) .cl-actions a { min-height: 44px; }
html:is(:lang(es), :lang(fr), :lang(ar)) .cl-categories button {
  min-width: 0;
  line-height: 1.45;
}

/* Arabic text requires connected glyphs, comfortable leading and no tracking.
   Use local system Arabic fonts; no external font request is required. */
html:lang(ar) body {
  font-family: "Geeza Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.7;
}
html:lang(ar) :is(h1, h2, h3, h4, p, li, a, button, input, textarea, select, label, small, strong, span, summary, dt, dd, th, td) {
  letter-spacing: normal !important;
  text-transform: none;
}
html:lang(ar) :is(h1, h2, h3, h4),
html:lang(ar) :is(h1, h2, h3, h4) span,
html:lang(ar) .cl-library {
  font-family: "Geeza Pro", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  font-style: normal;
}
html:lang(ar) :is(h1, h2, h3, h4) { line-height: 1.35; }
html:lang(ar) :is(p, li, dt, dd) { line-height: 1.75; }
html:lang(ar) :is(button, input, select, textarea) { font-family: inherit; }
html:lang(ar) :is(.kicker, .cl-poster-caption, .cl-card-title h2, .products-mega-card strong) { line-height: 1.5; }

/* These controls explicitly aligned left in the original LTR styles. */
html:lang(ar) :is(
  .ss-sheet-spec-table th, .ss-sheet-spec-table td,
  .ss-sheet-legacy-body th, .ss-sheet-legacy-body td,
  .journal-filter-list button, .journal-topic-grid button,
  .blog-article-table th, .blog-article-table td,
  .decision-table th, .decision-table td,
  .compatibility-table th, .compatibility-table td,
  .ce-comparison th, .ce-comparison td,
  .feature-tile, .gallery-filter-toggle, .gallery-moodboard-action,
  .empty-state, .lightbox-caption, .cl-row-select, .cl-categories button,
  .surface-tab, .special-tab, .hairline-filter, .embossed-filter, .special-filter,
  .sample-open, .sample-color strong, .sample-pattern strong,
  .base-material-card, .copper-view-tab, .inspiration-open,
  .favorites-tabs button, .favorites-compare-head > div,
  .reference-library-bar.inspiration-meta > small,
  .page-materials .material-gallery-section .material-subhead > p,
  .page-materials .material-catalog-evidence .material-subhead > p
) { text-align: start; }
html:lang(ar) :is(ul, ol) {
  padding-left: 0;
  padding-inline-start: 1.35em;
}
html:lang(ar) :is(.blog-article-copy blockquote, .blog-archive-note, .ss-sheet-spec-layout aside, .inquiry-checklist) {
  border-left: 0;
  border-inline-start: 3px solid var(--gold, #c4a26d);
}
html:lang(ar) .screen-icon--action {
  margin-left: 0;
  margin-inline-start: 7px;
}

/* Coordinate math in site.js uses positive scrollLeft / offsetLeft. Keep the
   rail and its controls LTR, while each Arabic slide has natural RTL content. */
html:lang(ar) :is(
  .products-mega-viewport, .products-mega-track,
  .product-category-viewport, .product-category-track,
  .products-mega-control-actions, .product-category-actions,
  .products-mega-pagination, .product-category-pagination,
  .home-hero-dots, .gallery-hero-dots
) { direction: ltr; }
html:lang(ar) :is(.products-mega-slide, .product-category-slide) { direction: rtl; }

/* Codes, phone numbers and addresses retain their familiar reading order. */
html:lang(ar) :is(input[type="email"], input[type="tel"], input[type="url"], a[href^="mailto:"], a[href^="tel:"], .phone-input-grid, .cl-number, .cl-version) {
  direction: ltr;
  unicode-bidi: isolate;
}
html:lang(ar) :is(input[type="email"], input[type="tel"], input[type="url"]) { text-align: left; }
html:lang(ar) .cl-number-hint { margin-left: 0; margin-inline-start: auto; }
html:lang(ar) .cl-row { border-left: 0; border-inline-start: 3px solid transparent; }
html:lang(ar) .cl-row.is-selected { border-inline-start-color: #de474f; }
html:lang(ar) .cl-filters select { padding-inline: 12px 34px; }
html:lang(ar) .cl-icon--arrow { transform: scaleX(-1); }
html:lang(ar) .cl-detail { border-left: 0; border-inline-start: 1px solid #353538; padding-inline: 26px 0; }

/* PDFs remain in their original edition and physical page order. */
html:lang(ar) .catalog-book-stage { direction: ltr; }
html:lang(ar) .catalog-book-visual figcaption { text-align: end; }
html:lang(ar) .drawer-panel {
  border-left: 0;
  border-inline-start: 1px solid var(--gold-line);
  transform: translateX(-100%);
  box-shadow: 30px 0 80px rgba(0, 0, 0, .44);
}
html:lang(ar) .drawer.is-open .drawer-panel { transform: translateX(0); }
html:lang(ar) .drawer-close { float: left; }

@media (max-width: 900px) {
  html:lang(ar) .cl-detail { border: 1px solid #523438; padding: 18px; }
  html:lang(ar) .cl-status [data-reset] { margin-left: 0; margin-inline-start: auto; }
}
@media (max-width: 600px) {
  html:is(:lang(es), :lang(fr), :lang(ar)) .cl-row .cl-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  html:lang(ar) .cl-filters select { padding-inline: 8px 4px; }
}

@media (max-width: 760px) {
  html:lang(ar) .drawer-panel { border-inline-start: 0; }
}

/* Independent screenshot review: keep Arabic copy above a dark text-side
   scrim, and place the floating actions away from the RTL introduction. */
html:lang(ar) .floating-actions {
  right: auto;
  left: 24px;
}
html:lang(ar) .home-hero-carousel .hero-content > .kicker {
  font-size: 13px;
  line-height: 1.65;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
}
@media (min-width: 761px) {
  html:lang(ar) .home-hero-carousel::before {
    background: linear-gradient(270deg, rgba(9, 9, 10, .7) 0%, rgba(9, 9, 10, .48) 55%, rgba(9, 9, 10, .08) 100%);
  }
}

/* Long sample / quotation guidance needs the full dialog width on phones;
   short material facts retain their existing two-column label/value layout. */
@media (max-width: 760px) {
  html:is(:lang(es), :lang(fr), :lang(ar)) .dialog-facts > .dialog-source-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  html:is(:lang(es), :lang(fr), :lang(ar)) .dialog-facts > .dialog-source-row > dd {
    min-width: 0;
    width: 100%;
  }
}
