/* Language switcher, edition picker and per-script typography. Loaded on every page. */

/* ---- language switcher (header) ---- */
.langswitch{position:relative;display:inline-block}
.langswitch>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;border:1px solid #bcc5ce;background:#fff;color:var(--ink);padding:9px 12px;border-radius:8px;font-size:13px;font-weight:600;white-space:nowrap}
.langswitch>summary::-webkit-details-marker{display:none}
.langswitch>summary svg{width:16px;height:16px;flex:none}
.langswitch[open]>summary{border-color:var(--navy)}
.langswitch ul{position:absolute;right:0;top:calc(100% + 6px);z-index:60;list-style:none;margin:0;padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);width:240px;max-height:min(70vh,520px);overflow:auto}
.langswitch li a{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:6px;font-size:14px}
.langswitch li a:hover,.langswitch li a:focus-visible{background:var(--soft)}
.langswitch li a[aria-current="true"]{font-weight:700;background:#fff3d4}
.langswitch li a small{color:var(--muted);font-size:11px;align-self:center}

/* ---- language links (footer, crawlable) ---- */
.langlinks{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0 0 14px;padding:0;list-style:none}
.langlinks a{display:inline;margin:0;font-size:13px}
.langlinks a[aria-current="true"]{color:#fff;font-weight:700}

/* ---- Amazon edition picker ---- */
.editions{margin-top:10px;font-size:13px}
.edition-own{display:inline-block;margin-right:10px}
.edition-link{display:inline-block;color:var(--blue);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.edition-more{display:none;vertical-align:top}
.js-ed .edition-more{display:inline-block}
.edition-more>summary{cursor:pointer;color:var(--blue);font-weight:600;list-style:none}
.edition-more>summary::-webkit-details-marker{display:none}
.edition-more>summary:after{content:" ▾"}
.edition-more[open]>summary:after{content:" ▴"}
.edition-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.edition-list a{display:inline-block;border:1px solid #d2d9df;background:#fff;border-radius:6px;padding:5px 9px;font-size:12px;font-weight:600;color:var(--ink)}
.edition-list a:hover{border-color:var(--navy)}

/* ---- typography per script ---- */
h1,h2,h3,h4{overflow-wrap:break-word}
html[lang]:not([lang="en"]) .legal,html[lang]:not([lang="en"]) p,html[lang]:not([lang="en"]) dd{overflow-wrap:break-word}
html[lang="de"] h1,html[lang="de"] h2,html[lang="de"] h3,html[lang="de"] p{hyphens:auto}
html[lang="ja"],html[lang="zh"],html[lang="ko"]{--sans:"Hiragino Sans","Noto Sans CJK JP","Noto Sans CJK SC","Noto Sans CJK KR","Yu Gothic","Microsoft YaHei","Malgun Gothic",Arial,sans-serif;--serif:"Hiragino Mincho ProN","Noto Serif CJK JP","Noto Serif CJK SC","Noto Serif CJK KR","Yu Mincho","SimSun","Batang",Georgia,serif}
html[lang="ja"] p,html[lang="zh"] p,html[lang="ko"] p,html[lang="ja"] dd,html[lang="zh"] dd,html[lang="ko"] dd{line-break:strict;word-break:normal;overflow-wrap:anywhere}
html[lang="hi"],html[lang="ar"]{--sans:"Noto Sans","Noto Sans Devanagari","Noto Sans Arabic","Segoe UI",Tahoma,Arial,sans-serif;--serif:"Noto Serif","Noto Naskh Arabic","Noto Serif Devanagari",Georgia,serif}
/* Tight negative tracking is a Latin-script habit; it breaks joined and ideographic scripts. */
html[lang="ja"] *,html[lang="zh"] *,html[lang="ko"] *,html[lang="ar"] *,html[lang="hi"] *{letter-spacing:normal!important}
html[lang="ja"] .hero h1,html[lang="zh"] .hero h1,html[lang="ko"] .hero h1,html[lang="ar"] .hero h1,html[lang="hi"] .hero h1{font-size:clamp(40px,5vw,72px);line-height:1.12}
html[lang="ar"] body,html[lang="hi"] body{line-height:1.7}
html[lang="vi"] body{line-height:1.6}

/* ---- right-to-left (Arabic) ---- */
html[dir="rtl"] body{direction:rtl;text-align:right}
html[dir="rtl"] .skip{left:auto;right:-999px}
html[dir="rtl"] .skip:focus{left:auto;right:10px}
html[dir="rtl"] .utility-disclosure{text-align:left}
html[dir="rtl"] .sidepaths{border-left:0;padding-left:0;border-right:1px solid var(--line);padding-right:23px}
html[dir="rtl"] .hero-copy{padding:72px 0 58px 40px}
html[dir="rtl"] .value-card{right:auto;left:28px}
html[dir="rtl"] .hero-art:after{background:linear-gradient(270deg,var(--navy) 0%,rgba(13,32,56,.6) 18%,rgba(13,32,56,.12) 58%,rgba(13,32,56,.2) 100%)}
html[dir="rtl"] .quick{border-right:0;border-left:1px solid var(--line)}
html[dir="rtl"] .quick:last-child{border:0}
html[dir="rtl"] .challenge{text-align:right}
html[dir="rtl"] .mcard ul,html[dir="rtl"] .prose ul{padding-left:0;padding-right:20px}
html[dir="rtl"] .shelf{right:auto;left:22px}
html[dir="rtl"] .shelf span{margin-left:0;margin-right:6px}
html[dir="rtl"] .drawer{right:auto;left:0;box-shadow:15px 0 50px rgba(0,0,0,.15)}
html[dir="rtl"] .close{float:left}
html[dir="rtl"] .buy>span{margin-left:0;margin-right:4px}
html[dir="rtl"] .crumbs li+li:before{margin-right:0;margin-left:6px;content:"‹"}
html[dir="rtl"] .score-link{margin-left:0;margin-right:4px}
html[dir="rtl"] .house-go{margin-left:0;margin-right:auto}
html[dir="rtl"] .langswitch ul{right:auto;left:0}
html[dir="rtl"] .edition-own{margin-right:0;margin-left:10px}
html[dir="rtl"] .review-main .rv-verdict,html[dir="rtl"] .review-main blockquote{border-left:0;padding-left:0;border-right:4px solid var(--gold);padding-right:18px}
@media(max-width:920px){.langswitch ul{right:0}html[dir="rtl"] .langswitch ul{left:0;right:auto}}
