/* ==========================================================================
   NURSOY — trilingual layer (fonts, language switcher, RTL geometry)
   Loaded after assets/css/main.css on every page.
   ========================================================================== */

/* ---------- Fonts ---------- */
/* Speda: the Kurdish (Sorani) display face used by the brand headings. */
@font-face {
  font-family: 'Speda';
  src: url('../fonts/Speda-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Speda';
  src: local('Speda Bold'), local('Speda-Bold'), url('../fonts/Speda-Bold.ttf') format('truetype');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --nursoy-gold: #d1ad7e;
  --nursoy-navy: #030e2e;
  --nursoy-panel: #0c1623;
  --nursoy-line: rgba(209, 173, 126, 0.28);
}

/* Latin keeps the template faces; Arabic-script languages get proper stacks. */
html[lang="ku"] body,
html[lang="ar"] body {
  font-family: 'Noto Sans Arabic', 'Noto Kufi Arabic', var(--default-font);
}

html[lang="ku"] :is(h1, h2, h3, h4, h5, h6, .sitename, .hero-title, .footer-title),
html[lang="ar"] :is(h1, h2, h3, h4, h5, h6, .sitename, .hero-title, .footer-title) {
  font-family: 'Speda', 'Noto Kufi Arabic', 'Noto Sans Arabic', var(--heading-font);
}

/* Kurdish renders with Speda everywhere the brand asked for it. */
[style*="'Speda'"],
[style*='"Speda"'] {
  font-family: 'Speda', 'Noto Kufi Arabic', sans-serif !important;
}

/* ---------- Language switcher ---------- */
.lang-switch {
  position: relative;
  display: flex;
  align-items: center;
  margin-inline-end: 6px;
  z-index: 1060;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--nursoy-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #e8eefc;
  font-family: 'Montserrat', var(--default-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.lang-switch__btn:hover,
.lang-switch.is-open .lang-switch__btn {
  color: var(--nursoy-gold);
  border-color: var(--nursoy-gold);
  background: rgba(209, 173, 126, 0.1);
}

.lang-switch__btn i {
  font-size: 14px;
  line-height: 0;
}

.lang-switch__btn .bi-chevron-down {
  font-size: 10px;
  opacity: .65;
  transition: transform .25s ease;
}

.lang-switch.is-open .lang-switch__btn .bi-chevron-down {
  transform: rotate(180deg);
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 168px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: rgba(8, 18, 40, 0.97);
  border: 1px solid var(--nursoy-line);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 1061;
}

.lang-switch.is-open .lang-switch__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switch__menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

html[lang="ku"] .lang-switch__menu button,
html[lang="ar"] .lang-switch__menu button {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 14px;
}

.lang-switch__menu button small {
  font-size: 10px;
  letter-spacing: 1.2px;
  opacity: .5;
}

.lang-switch__menu button:hover {
  background: rgba(209, 173, 126, 0.14);
  color: #fff;
}

.lang-switch__menu button.is-active {
  background: rgba(209, 173, 126, 0.2);
  color: var(--nursoy-gold);
}

.lang-switch__menu button.is-active::after {
  content: "\F26E";
  font-family: "bootstrap-icons";
  font-size: 12px;
}

/* On phones the switcher collapses to a compact globe + code. */
@media (max-width: 575.98px) {
  .lang-switch__btn {
    padding: 6px 9px;
    font-size: 11px;
  }
  .lang-switch__btn .lang-switch__long {
    display: none;
  }
}

/* Keep the switcher reachable while the mobile drawer is open. */
@media (max-width: 1199.98px) {
  body.mobile-nav-active .lang-switch {
    position: fixed;
    top: 14px;
    inset-inline-end: 62px;
    margin: 0;
    z-index: 10001;
  }
}

/* ---------- RTL foundations ---------- */
html[dir="rtl"] body {
  text-align: right;
}

/* Arabic script must not be letter-spaced: it breaks letter joining. */
html[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, p, a, li, span, small, button, td, th, .sitename, .footer-title, .hero-title, .info-tag-yellow, .dept-title) {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Each paragraph decides its own base direction, so Latin brand names,
   phone numbers and URLs stay readable inside RTL sentences. */
html[dir="rtl"] :is(main, footer, header) :is(p, li, h1, h2, h3, h4, h5, h6, td, th, a, small, span, div) {
  unicode-bidi: plaintext;
}

html[dir="rtl"] .footer-info-item,
html[dir="rtl"] .navmenu a,
html[dir="rtl"] .lang-switch__btn {
  unicode-bidi: plaintext;
}

/* LTR islands */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] .phone-ltr {
  direction: ltr;
  text-align: right;
}

/* ---------- RTL component geometry ---------- */
html[dir="rtl"] .dropdown-custom ul {
  left: auto;
  right: 0;
}

html[dir="rtl"] .dropdown-custom ul li a:hover {
  padding-left: 20px;
  padding-right: 25px;
}

html[dir="rtl"] .navmenu a i,
html[dir="rtl"] .footer-info-item i,
html[dir="rtl"] .logo img {
  margin-left: 0;
  margin-right: 12px;
}

html[dir="rtl"] .gold-line-v {
  margin-right: 0;
  margin-left: 15px;
}

html[dir="rtl"] .diagonal-mask {
  left: auto;
  right: -50px;
  transform: skewX(10deg);
}

html[dir="rtl"] .hero-overlay {
  background: linear-gradient(to left, rgba(3, 14, 46, 0.9), rgba(3, 14, 46, 0.4));
}

html[dir="rtl"] .content-wrapper {
  padding: 15% 10% 0 0;
  text-align: right;
}

html[dir="rtl"] .page-title .container,
html[dir="rtl"] .text-center {
  text-align: center;
}

html[dir="rtl"] .list-group-item,
html[dir="rtl"] .custom-sidebar .nav-link {
  text-align: right;
}

/* Swiper / glightbox controls must point the other way */
html[dir="rtl"] .swiper-button-next,
html[dir="rtl"] .glightbox-next {
  transform: scaleX(-1);
}

html[dir="rtl"] .swiper-button-prev,
html[dir="rtl"] .glightbox-prev {
  transform: scaleX(-1);
}

html[dir="rtl"] #scroll-top {
  right: auto;
  left: 24px;
}

html[dir="rtl"] .info-card-styled,
html[dir="rtl"] .project-info-box {
  text-align: right;
}

html[dir="rtl"] .d-flex.gap-3 > i,
html[dir="rtl"] .machinery-nav i {
  margin-inline-end: 4px;
}

/* Bootstrap RTL swap keeps utilities correct; these guard the leftovers */
html[dir="rtl"] .text-start {
  text-align: right !important;
}

html[dir="rtl"] .text-end {
  text-align: left !important;
}

/* Arabic numerals stay grouped with their words */
html[dir="rtl"] .stat-number,
html[dir="rtl"] .purecounter {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Small country chips used in the footer and project sidebars */
.flag-chip,
img[src^="assets/img/flags/"] {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

/* Spam trap for the contact form - kept out of the layout and out of the tab order */
.cf-honeypot {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
