/* MTM SIAM V23 — Stage 1: language selector, per-language typography, RTL (Arabic).
   Loaded after all other stylesheets. Colours/borders reuse the approved white palette. */

html.i18n-pending body{visibility:hidden}

/* ---------- Language selector ---------- */
.lang-switch{position:relative;flex-shrink:0;font:13px/1 Arial,sans-serif}
.lang-btn{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:8px 10px;background:#fff;color:#806027;border:1px solid #d6c6a5;border-radius:4px;font:inherit;line-height:1;cursor:pointer}
.lang-btn:hover,.lang-btn[aria-expanded=true]{border-color:#b08a42;background:#faf6ee}
.lang-btn:focus-visible,.lang-opt:focus-visible{outline:2px solid #806027;outline-offset:2px}
.lang-globe,.lang-caret{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.lang-caret{width:12px;height:12px;transition:transform .15s}
.lang-btn[aria-expanded=true] .lang-caret{transform:rotate(180deg)}
.lang-code{font-weight:700;letter-spacing:.6px}
.lang-menu{position:absolute;inset-block-start:calc(100% + 6px);inset-inline-end:0;z-index:50;min-width:176px;margin:0;padding:6px;list-style:none;background:#fff;border:1px solid #e4dac7;border-radius:6px;box-shadow:0 8px 24px rgba(60,45,15,.14)}
.lang-menu[hidden]{display:none}
.lang-opt{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;padding:10px 12px;background:none;border:0;border-radius:4px;color:#222;font:14px/1.3 Arial,"Segoe UI",Tahoma,sans-serif;text-align:start;cursor:pointer}
.lang-opt:hover{background:#f5f1e8}
.lang-opt[aria-current=true]{color:#806027;font-weight:700}
.lang-abbr{font-size:11px;font-weight:400;color:#777;letter-spacing:.6px}
.lang-opt[aria-current=true] .lang-abbr{color:#806027}
.lang-opt[aria-current=true] .lang-abbr:before{content:"✓ "}

/* Header placement: desktop keeps menu + selector grouped at the end; compact layout puts it beside the Menu button */
nav{margin-inline-start:auto}
@media(max-width:1050px){
  .identity{order:1}.lang-switch{order:2;margin-inline-start:auto}#toggle{order:3}nav{order:4}
}
@media(max-width:650px){.lang-btn{padding:8px}}

/* ---------- Per-language typography (system fonts only) ---------- */
html[lang=ar] body{font-family:Arial,"Segoe UI",Tahoma,"Noto Sans Arabic",sans-serif;line-height:1.85}
html[lang=ar] h1,html[lang=ar] h2,html[lang=ar] h3,html[lang=ar] .tag,html[lang=ar] .principles div,html[lang=ar] .timeline .year{font-family:Georgia,"Times New Roman","Noto Naskh Arabic","Traditional Arabic",serif}
html[lang=th] body{font-family:Arial,"Leelawadee UI","Noto Sans Thai",Tahoma,Thonburi,sans-serif;line-height:1.8}
html[lang=th] h1,html[lang=th] h2,html[lang=th] h3,html[lang=th] .tag,html[lang=th] .principles div{font-family:Georgia,"Noto Serif Thai","Leelawadee UI",Tahoma,Thonburi,serif}
/* Arabic and Thai must not be letter-spaced or slanted */
html[lang=ar] *,html[lang=th] *{letter-spacing:normal!important}
html[lang=ar] .tag,html[lang=th] .tag{font-style:normal}
html[lang=ar] .identity small,html[lang=th] .identity small{font-size:10px}
@media(max-width:650px){html[lang=ar] .identity small,html[lang=th] .identity small{font-size:9px}}

/* ---------- RTL (Arabic) ---------- */
[dir=rtl] .timeline{padding:0 24px 0 0;border-left:0;border-right:1px solid #b89b54}
[dir=rtl] .timeline li:before{left:auto;right:-30px}
[dir=rtl] .timeline,[dir=rtl] .division,[dir=rtl] .contact-layout,[dir=rtl] .idol-products article,[dir=rtl] .bin-page .bin-hero{text-align:right}
[dir=rtl] .brand-lineup>div{border-right:0;border-left:1px solid #806a40}
[dir=rtl] .brand-lineup>div:last-child{border:0}
[dir=rtl] #archive-view button{margin-left:0;margin-right:auto}
/* phone numbers and e-mail addresses stay left-to-right inside RTL text */
[dir=rtl] .contact-details a,[dir=rtl] footer a{direction:ltr;unicode-bidi:isolate}
[dir=rtl] .inquiry input[type=email],[dir=rtl] .inquiry input[type=tel]{direction:ltr;text-align:right}
/* hero imagery mirrors with the text: text on the right, picture on the left */
[dir=rtl] .hero{background-image:linear-gradient(270deg,#fff 8%,#fffffff2 30%,#ffffff00 85%),url('assets/hero.webp');background-position:left center}
[dir=rtl] .about-hero{background-image:linear-gradient(270deg,#fff 5%,#ffffffe8 32%,#ffffff00 90%),url('assets/about-hero.webp');background-position:left center}
[dir=rtl] .business-hero{background-image:linear-gradient(270deg,#fff 5%,#ffffffed 35%,#ffffff00 100%),url('assets/business-hero.webp');background-position:left center}
[dir=rtl] .global-hero{background-image:linear-gradient(270deg,#fff 10%,#fffffff0 30%,#ffffff00 85%),url('assets/global-hero.webp');background-position:left center}
[dir=rtl] .vision-hero{background-image:linear-gradient(270deg,#fffffff5 0%,#ffffffdd 45%,#ffffff00 100%),url('assets/vision-hero.webp')}
[dir=rtl] .contact-hero{background-image:linear-gradient(270deg,#fff 0%,#ffffffe8 35%,#ffffff00 85%),url('assets/contact-hero.webp');background-position:left center}
@media(max-width:700px){[dir=rtl] .bin-page .bin-hero{text-align:center}}
@media(max-width:650px){
  [dir=rtl] .brand-lineup>div{border-left:0;border-bottom:1px solid #806a40}
  [dir=rtl] .brand-lineup>div:last-child{border:0}
  [dir=rtl] .hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/hero.webp');background-position:35% center}
  [dir=rtl] .about-hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/about-hero.webp')}
  [dir=rtl] .business-hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/business-hero.webp')}
  [dir=rtl] .global-hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/global-hero.webp');background-position:35% center}
  [dir=rtl] .vision-hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/vision-hero.webp')}
  [dir=rtl] .contact-hero{background-image:linear-gradient(270deg,#fffffff5,#ffffffb8),url('assets/contact-hero.webp')}
}
/* Text still falling back to English inside an RTL page keeps correct punctuation order */
[dir=rtl] [lang=en]{unicode-bidi:plaintext}
