/* ==========================================================================
   Languages: header/drawer switcher, Kurdish labels drawn by CSS,
   and right-to-left basics for Sorani (html[dir="rtl"]).
   ========================================================================== */

/* ---------- header switcher ---------- */
.kn-lang-li { position: relative; list-style: none; }
.kn-lang { position: relative; }
.kn-lang > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 10px;
	border-radius: 999px;
	color: inherit;
	font-size: 13px;
	font-weight: 700;
	list-style: none;
	cursor: pointer;
	user-select: none;
}
.kn-lang > summary::-webkit-details-marker { display: none; }
.kn-lang > summary:hover { background: rgba(127, 127, 127, .12); }
.kn-lang > summary i { font-size: 15px; opacity: .8; }
.kn-lang-menu {
	position: absolute;
	top: calc(100% + 8px);
	inset-inline-end: 0;
	z-index: 1100;
	display: flex;
	flex-direction: column;
	min-width: 180px;
	padding: 6px;
	border: 1px solid #e7e8ec;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(13, 12, 34, .16);
}
.kn-lang-menu a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 12px;
	border-radius: 8px;
	color: #16171c !important;
	text-decoration: none !important;
}
.kn-lang-menu a:hover { background: #f4f5f7; }
.kn-lang-menu a.is-on { background: #0d0c22; color: #fff !important; }
.kn-lang-menu strong { font-size: 14px; font-weight: 700; }
.kn-lang-menu small { color: #8a8f9c; font-size: 12px; }
.kn-lang-menu a.is-on small { color: rgba(255, 255, 255, .7); }
.kn-lang-menu a[lang="ckb"] strong { font-family: "Noto Sans Arabic", "Vazirmatn", system-ui, sans-serif; }
html.king-night .kn-lang-menu { background: #1b1c22; border-color: #2d2f38; }
html.king-night .kn-lang-menu a { color: #f2f3f6 !important; }
html.king-night .kn-lang-menu a:hover { background: #24262e; }
html.king-night .kn-lang-menu a.is-on { background: #f2f3f6; color: #121218 !important; }
html.king-night .kn-lang-menu a.is-on small { color: #555; }

/* ---------- phone drawer: three buttons ---------- */
.kn-drawer-lang {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	margin: 4px 0 10px;
	padding: 4px;
	border-radius: 12px;
	background: rgba(127, 127, 127, .1);
}
.kn-drawer-lang a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	border-radius: 9px;
	color: inherit !important;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none !important;
}
.kn-drawer-lang a.is-on { background: #0d0c22; color: #fff !important; }
html.king-night .kn-drawer-lang a.is-on { background: #f2f3f6; color: #121218 !important; }

/* ---------- labels that CSS writes (share sheet) ---------- */
html[lang="ku"] :is(.king-share-sheet, .king-share-popup) .share-system::after { content: "Zêdetir"; }
html[lang="ku"] :is(.king-share-sheet, .king-share-popup) .share-em::after { content: "E-name"; }
html[lang="ku"] :is(.king-share-sheet, .king-share-popup) .king-share-copy-btn::after { content: "Kopî bike"; }
html[lang="ku"] :is(.king-share-sheet, .king-share-popup) .social-share-section:has(.copied:not([hidden])) .king-share-copy-btn::after { content: "Hat kopîkirin"; }
html[lang="ckb"] :is(.king-share-sheet, .king-share-popup) .share-system::after { content: "زیاتر"; }
html[lang="ckb"] :is(.king-share-sheet, .king-share-popup) .share-em::after { content: "ئیمەیڵ"; }
html[lang="ckb"] :is(.king-share-sheet, .king-share-popup) .king-share-copy-btn::after { content: "کۆپی"; }
html[lang="ckb"] :is(.king-share-sheet, .king-share-popup) .social-share-section:has(.copied:not([hidden])) .king-share-copy-btn::after { content: "کۆپی کرا"; }

/* ==========================================================================
   Sorani: right-to-left
   ========================================================================== */
html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
	font-family: "Noto Sans Arabic", "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[dir="rtl"] body { line-height: 1.6; }
/* Arabic script needs no letter-spacing and reads better a little larger */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; }
/* Arrows point the other way */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-chevron-left,
html[dir="rtl"] .fa-angle-right,
html[dir="rtl"] .fa-angle-left,
html[dir="rtl"] .fa-arrow-right-long,
html[dir="rtl"] .fa-arrow-left-long { transform: scaleX(-1); }
/* Text blocks that were pinned to the left */
html[dir="rtl"] .king-main,
html[dir="rtl"] .king-q-view-content,
html[dir="rtl"] .king-history-modal-content,
html[dir="rtl"] .king-calendar-modal-panel,
html[dir="rtl"] .kn-sim,
html[dir="rtl"] .king-dropdown { text-align: right; }
/* Latin-only things stay left-to-right inside Sorani pages */
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] .king-share-url-field,
html[dir="rtl"] code,
html[dir="rtl"] kbd { direction: ltr; text-align: left; }
@media (max-width: 991px) { .kn-lang-li { display: none; } }
