/* EMKAN v134 — precision stabilization pass.
   Keeps the approved minimal / linear visual language and only normalizes
   shared geometry, RTL, dropdown rhythm and the requested registration rail. */

/* Header: shorter shared hairlines, enough breathing room for all nav labels. */
@media (min-width:1280px){
  html body .site-header{width:min(calc(100% - 300px),1340px)!important;max-width:1340px!important;margin-inline:auto!important}
  html body .site-header .primary-nav{padding-inline:116px!important}
  html body .site-header .nav-list{width:max-content!important;max-width:calc(100% - 232px)!important;gap:clamp(21px,1.55vw,30px)!important;margin-inline:auto!important}
  html body .site-header .language-button{left:18px!important;right:auto!important}
  html body .site-header .nav-frame>.theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{right:18px!important;left:auto!important;inset-inline:auto!important}
}
@media (min-width:901px) and (max-width:1279px){
  html body .site-header{width:min(calc(100% - 72px),1100px)!important;max-width:1100px!important;margin-inline:auto!important}
  html body .site-header .primary-nav{padding-inline:72px!important}
  html body .site-header .nav-list{width:max-content!important;max-width:calc(100% - 144px)!important;gap:clamp(14px,1.35vw,22px)!important;margin-inline:auto!important}
  html body .site-header .language-button{left:14px!important;right:auto!important}
  html body .site-header .nav-frame>.theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{right:14px!important;left:auto!important;inset-inline:auto!important}
}

/* Theme control: never touch the Welcome pair. Elsewhere keep one slightly smaller icon. */
.site-header .theme-button,.menu-page .theme-button{width:30px!important;height:30px!important;padding:0!important}
.site-header .theme-button .theme-icon-wrap,.menu-page .theme-button .theme-icon-wrap{width:15px!important;height:15px!important}
.site-header i.emkan-v133-theme-icon,.menu-page i.emkan-v133-theme-icon{font-size:13.5px!important;line-height:15px!important;width:15px!important;height:15px!important}
.site-header svg.emkan-v133-theme-icon,.menu-page svg.emkan-v133-theme-icon{width:13.5px!important;height:13.5px!important}
@media (min-width:901px){
  html body .site-header .nav-frame>.theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{position:absolute!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important;align-self:auto!important}
}

/* Dropdown/submenu rhythm: deliberately tighter everywhere, while leaving main nav untouched. */
:is(.category-list ul,.article-category-list,.detail-subcategory-list,.v49-filter-list,.podcast-filter-list,.podcast-topics,.podcast-seasons,.store-subcategory-list,.store-sort-list,.civil-filter-list,.research-filter-list){padding-top:4px!important;padding-bottom:0!important}
:is(.category-button,.article-category-choice,.detail-subcategory-list a,.v49-filter-option,.podcast-filter-list button,.podcast-topics button,.podcast-seasons button,.store-subcategory-list a,.store-sort-list button,.civil-filter-list button,.research-filter-list button,.emkan-landing-category,.detail-nav a){padding:4px 0!important;line-height:1.42!important;font-size:12px!important}
:is(.store-subcategory-list,.store-sort-list,.v49-filter-list) > * + *{margin-top:0!important}

/* Registration: three labels sit directly above one fine baseline; active state overlays it. */
body.v115-course-detail #contentApp .v49-progress,
#contentApp .v49-progress{
  position:relative!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  width:100%!important;gap:0!important;margin:0 0 24px!important;padding:0!important;
  border:0!important;border-bottom:1px solid var(--line)!important;list-style:none!important;
}
body.v115-course-detail #contentApp .v49-progress li,
#contentApp .v49-progress li{
  position:relative!important;margin:0!important;padding:0 8px 10px!important;border:0!important;
  font-size:10.5px!important;line-height:1.55!important;text-align:center!important;white-space:nowrap!important;color:var(--category-muted)!important;
}
body.v115-course-detail #contentApp .v49-progress li[aria-current="step"],
#contentApp .v49-progress li[aria-current="step"]{color:var(--fg)!important;font-weight:600!important}
body.v115-course-detail #contentApp .v49-progress li[aria-current="step"]::after,
#contentApp .v49-progress li[aria-current="step"]::after{
  content:""!important;position:absolute!important;z-index:2!important;left:14%!important;right:14%!important;bottom:-1px!important;height:1px!important;background:var(--hover-accent)!important;
}

/* Content / education RTL: rail belongs on the right in Persian/Arabic. */
@media (min-width:481px){
  :is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp .v49-layout:not(.v69-content-detail-layout){
    grid-template-columns:minmax(0,1fr) 190px!important;direction:ltr!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp .v49-layout:not(.v69-content-detail-layout)>.v49-rail{
    grid-column:2!important;grid-row:1!important;direction:rtl!important;text-align:right!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp .v49-layout:not(.v69-content-detail-layout)>.v49-results-wrap{
    grid-column:1!important;grid-row:1!important;direction:rtl!important;text-align:right!important;
  }
}
@media (min-width:481px) and (max-width:720px){
  :is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp .v49-layout:not(.v69-content-detail-layout){grid-template-columns:minmax(0,1fr) 130px!important}
}
:is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp :is(.v49-rail,.v49-results-wrap,.v49-detail,.v49-reading,.v49-section,.v69-content-search-rail){direction:rtl!important;text-align:right!important}
html[lang="en"] body.content-section-page #contentApp :is(.v49-rail,.v49-results-wrap,.v49-detail,.v49-reading,.v49-section,.v69-content-search-rail){direction:ltr!important;text-align:left!important}
:is(html[lang="fa"],html[lang="ar"]) body.content-section-page #contentApp :is(.project-search,.v49-search-group,.v69-content-search,.emkan-standard-search) input[type="search"]{direction:rtl!important;text-align:right!important}
html[lang="en"] body.content-section-page #contentApp :is(.project-search,.v49-search-group,.v69-content-search,.emkan-standard-search) input[type="search"]{direction:ltr!important;text-align:left!important}

/* Store search + Category / Sort share the same quiet geometry. */
.store-category-side :is(.product-search,.emkan-store-search-proxy){position:relative!important;display:block!important}
.store-category-side :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{
  position:absolute!important;z-index:2!important;top:50%!important;width:10px!important;height:10px!important;
  fill:none!important;stroke:currentColor!important;stroke-width:1.35!important;stroke-linecap:round!important;color:var(--category-muted)!important;opacity:.62!important;pointer-events:none!important;transform:translateY(-58%)!important;
}
:is(html[lang="fa"],html[lang="ar"]) .store-category-side :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{left:6px!important;right:auto!important}
html[lang="en"] .store-category-side :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{right:6px!important;left:auto!important}
:is(html[lang="fa"],html[lang="ar"]) .store-category-side :is(.product-search,.emkan-store-search-proxy) input[type="search"]{padding-left:24px!important;padding-right:0!important;text-align:right!important;direction:rtl!important}
html[lang="en"] .store-category-side :is(.product-search,.emkan-store-search-proxy) input[type="search"]{padding-right:24px!important;padding-left:0!important;text-align:left!important;direction:ltr!important}
.store-category-side :is(.store-subcategory-filter,.store-sort-filter)>summary{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important}
.store-category-side :is(.store-subcategory-filter,.store-sort-filter)>summary>.emkan-v133-disclosure-mark{margin:0!important;flex:0 0 12px!important}

/* Client samples: understated and clearly demo-only until replaced in admin. */
.emkan-client-demo-badge{font-size:7.5px!important;line-height:1!important;letter-spacing:.04em!important;color:var(--category-muted)!important;opacity:.7!important}

/* Editorial metadata for long-form content: same linear grammar as article footer. */
.emkan-editorial-meta{margin-top:26px!important;padding:0!important;border-top:1px solid var(--line)!important}
.emkan-editorial-meta-row{display:flex!important;align-items:baseline!important;flex-wrap:wrap!important;gap:7px!important;padding:12px 0!important;border-bottom:1px solid var(--line)!important;font-size:10.5px!important;line-height:1.9!important}
.emkan-editorial-meta-label{font-size:11px!important;font-weight:650!important;color:var(--fg)!important}
.emkan-editorial-meta-value{color:var(--category-muted)!important;white-space:pre-line!important}

/* Central navigation editor — deliberately inherits admin's existing cards/fields. */
.emkan-v134-nav-grid{display:grid;gap:0!important;margin-top:12px;border-top:1px solid var(--line,#d7d9dd)}
.emkan-v134-nav-row{display:grid;grid-template-columns:82px repeat(3,minmax(0,1fr));gap:12px;align-items:end;padding:12px 0;border-bottom:1px solid var(--line,#d7d9dd)}
.emkan-v134-nav-row>label{margin:0!important}
.emkan-v134-nav-row .emkan-v134-nav-visible{align-self:center;display:flex;align-items:center;gap:7px;font-size:11px}
@media(max-width:760px){.emkan-v134-nav-row{grid-template-columns:1fr}.emkan-v134-nav-row .emkan-v134-nav-visible{padding-bottom:4px}}

/* Education item pages: reassert the approved right-hand rail in RTL after all legacy layers. */
@media (min-width:901px){
  :is(html[lang="fa"],html[lang="ar"]) body.v90-education-item-page.has-emkan-context.content-section-page #contentApp > .v69-content-detail-layout.v90-education-detail-layout{
    display:grid!important;grid-template-columns:minmax(0,648px) 190px!important;grid-template-areas:"content rail"!important;direction:ltr!important;gap:0!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.v90-education-item-page #contentApp > .v69-content-detail-layout.v90-education-detail-layout > .v69-content-search-rail{
    grid-area:rail!important;grid-column:2!important;direction:rtl!important;text-align:right!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.v90-education-item-page #contentApp > .v69-content-detail-layout.v90-education-detail-layout > .v69-content-detail-body{
    grid-area:content!important;grid-column:1!important;direction:rtl!important;text-align:right!important;
  }
  html[lang="en"] body.v90-education-item-page.has-emkan-context.content-section-page #contentApp > .v69-content-detail-layout.v90-education-detail-layout{
    display:grid!important;grid-template-columns:190px minmax(0,648px)!important;grid-template-areas:"rail content"!important;direction:ltr!important;gap:0!important;
  }
}
:is(html[lang="fa"],html[lang="ar"]) body.v90-education-item-page #contentApp .v69-content-search{direction:rtl!important;text-align:right!important}
:is(html[lang="fa"],html[lang="ar"]) body.v90-education-item-page #contentApp .v69-content-search input[type="search"]{direction:rtl!important;text-align:right!important}
html[lang="en"] body.v90-education-item-page #contentApp .v69-content-search{direction:ltr!important;text-align:left!important}
html[lang="en"] body.v90-education-item-page #contentApp .v69-content-search input[type="search"]{direction:ltr!important;text-align:left!important}

/* Store rail: normalize both the original side wrapper and the dynamic filter rail. */
:is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy){position:relative!important;display:block!important}
:is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{
  position:absolute!important;z-index:2!important;top:50%!important;width:10px!important;height:10px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.35!important;stroke-linecap:round!important;color:var(--category-muted)!important;opacity:.62!important;pointer-events:none!important;transform:translateY(-58%)!important;
}
:is(html[lang="fa"],html[lang="ar"]) :is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{left:6px!important;right:auto!important}
html[lang="en"] :is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy) .emkan-v134-store-search-icon{right:6px!important;left:auto!important}
:is(html[lang="fa"],html[lang="ar"]) :is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy) input[type="search"]{padding-left:24px!important;padding-right:0!important;text-align:right!important;direction:rtl!important}
html[lang="en"] :is(.store-category-side,.emkan-store-filter-rail) :is(.product-search,.emkan-store-search-proxy) input[type="search"]{padding-right:24px!important;padding-left:0!important;text-align:left!important;direction:ltr!important}
:is(.store-category-side,.emkan-store-filter-rail) :is(.store-subcategory-filter,.store-sort-filter)>summary{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;min-height:25px!important;padding-block:4px!important;font-size:10px!important;line-height:1.4!important}
:is(.store-category-side,.emkan-store-filter-rail) :is(.store-subcategory-filter,.store-sort-filter)>summary :is(.emkan-v133-disclosure-mark,.store-subcategory-mark,.store-sort-mark){margin:0!important;flex:0 0 12px!important}

/* Clients: a quiet six-column logo strip that follows the site's linear language. */
.emkan-clients-section{margin-top:clamp(52px,8vh,88px)!important;padding-top:20px!important;border-top:1px solid var(--line)!important}
.emkan-clients-head{display:flex!important;justify-content:space-between!important;align-items:end!important;gap:24px!important;margin-bottom:24px!important}
.emkan-clients-head h2{margin:0!important;font-size:10px!important;font-weight:650!important}
.emkan-clients-head p{margin:0!important;max-width:520px!important;font-size:8.7px!important;line-height:1.8!important;color:var(--category-muted)!important;text-align:end!important}
.emkan-clients-grid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:clamp(18px,2.6vw,44px)!important;border:0!important;align-items:start!important}
.emkan-client{min-width:0!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;text-decoration:none!important;color:var(--fg)!important}
.emkan-client-mark{width:100%!important;aspect-ratio:1.7/1!important;display:grid!important;place-items:center!important;border:0!important;background:transparent!important}
.emkan-client-mark img{max-width:72%!important;max-height:62%!important;width:auto!important;height:auto!important;object-fit:contain!important;filter:grayscale(1)!important;opacity:.78!important;transition:filter .24s ease,opacity .24s ease!important}
.emkan-client:hover .emkan-client-mark img{filter:none!important;opacity:1!important}
.emkan-client-placeholder{width:54px!important;height:54px!important;display:grid!important;place-items:center!important;border:1px solid color-mix(in srgb,var(--fg) 18%,transparent)!important;border-radius:50%!important;font-size:8px!important;letter-spacing:.12em!important;color:var(--category-muted)!important}
.emkan-client-caption,.emkan-client-name{font-size:8.6px!important;line-height:1.55!important;text-align:center!important;color:var(--category-muted)!important}
@media(max-width:900px){.emkan-clients-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.emkan-clients-head{align-items:start!important;flex-direction:column!important}.emkan-clients-head p{text-align:start!important}}
@media(max-width:520px){.emkan-clients-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
