/* EMKAN v147 — focused layout repair
   Scope: one canonical context strip, Civil/Services grid, Education/Learning RTL + square poster,
   and unified stepped disclosure icons. Loaded last, after v146. */

:root{
  --emkan-v147-context-max:1380px;
  --emkan-v147-context-desktop-gutter:48px;
  --emkan-v147-context-mobile-gutter:14px;
}

/* ========================================================================== 
   1) ONE CONTEXT STRIP EVERYWHERE
   The line, breadcrumb/address and Back button now live inside the SAME inner
   frame. No viewport-edge overflow and no per-module width drift.
   ========================================================================== */
html body :is(.emkan-context-bar,.store-context-bar,.podcast-context-bar,.product-toolbar){
  position:relative!important;
  left:auto!important;
  right:auto!important;
  transform:none!important;
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  margin:14px 0 20px!important;
  padding:0!important;
  border:0!important;
  display:block!important;
  box-sizing:border-box!important;
  color:var(--category-muted,var(--fg))!important;
}
html body .emkan-v147-context-inner{
  position:relative!important;
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:min(var(--emkan-v147-context-max),calc(100vw - (var(--emkan-v147-context-desktop-gutter) * 2)))!important;
  max-width:var(--emkan-v147-context-max)!important;
  min-height:32px!important;
  margin:0!important;
  padding:0 0 11px!important;
  border:0!important;
  border-bottom:1px solid var(--line)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:22px!important;
  box-sizing:border-box!important;
  font-size:10.5px!important;
  line-height:1.7!important;
}
html body .emkan-v147-context-inner > :is(.emkan-context-path,.product-context-path,#podcastPath,#storeCategoryPath,#productPath){
  min-width:0!important;
  flex:1 1 auto!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  margin:0!important;
  padding:0!important;
}
html body .emkan-v147-context-inner > :is(.emkan-context-back,#productBack,.product-back,.podcast-back,.store-back){
  flex:0 0 auto!important;
  margin:0!important;
  padding:0!important;
  white-space:nowrap!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
}
html[dir="rtl"] body .emkan-v147-context-inner{direction:rtl!important;text-align:right!important}
html[dir="ltr"] body .emkan-v147-context-inner{direction:ltr!important;text-align:left!important}

@media (max-width:900px){
  html body :is(.emkan-context-bar,.store-context-bar,.podcast-context-bar,.product-toolbar){margin:12px 0 17px!important}
  html body .emkan-v147-context-inner{
    width:calc(100vw - (var(--emkan-v147-context-mobile-gutter) * 2))!important;
    max-width:720px!important;
    min-height:30px!important;
    padding-bottom:9px!important;
    gap:14px!important;
    font-size:10px!important;
  }
}

/* ========================================================================== 
   2) CIVIL / SERVICES — no sidebar. Four equal covers in one centred row.
   Each service opens its own three-sample grid.
   ========================================================================== */
body.emkan-v147-civil-services .detail-main{padding-top:0!important}
body.emkan-v147-civil-services .detail-layout{
  width:100%!important;
  max-width:none!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
}
body.emkan-v147-civil-services #detailNav{display:none!important}
body.emkan-v147-civil-services .detail-layout > article{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
.emkan-v147-services-view{width:100%!important;max-width:1040px!important;margin:0 auto!important;padding:8px 0 0!important}
.emkan-v147-services-grid{
  display:grid!important;
  grid-template-columns:repeat(4,192px)!important;
  justify-content:center!important;
  align-items:start!important;
  gap:28px!important;
  margin:18px auto 0!important;
  padding:0!important;
}
.emkan-v147-service-card,
.emkan-v147-sample-card{
  display:block!important;
  width:192px!important;
  min-width:0!important;
  color:var(--fg)!important;
  text-decoration:none!important;
  background:transparent!important;
  border:0!important;
}
.emkan-v147-service-media,
.emkan-v147-sample-media{
  display:block!important;
  width:100%!important;
  aspect-ratio:1/1!important;
  overflow:hidden!important;
  border:1px solid var(--line)!important;
  background:var(--bg)!important;
}
.emkan-v147-service-media img,
.emkan-v147-sample-media img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  filter:grayscale(1)!important;
  transform:scale(1.005)!important;
  transition:filter .45s ease,transform .55s cubic-bezier(.22,.61,.36,1)!important;
}
.emkan-v147-service-card:is(:hover,:focus-visible) img,
.emkan-v147-sample-card:is(:hover,:focus-visible) img{filter:grayscale(0)!important;transform:scale(1.018)!important}
.emkan-v147-service-caption,
.emkan-v147-sample-caption{
  display:grid!important;
  gap:7px!important;
  padding-top:10px!important;
  font-size:10.5px!important;
  font-weight:520!important;
  line-height:1.55!important;
  color:var(--fg)!important;
}
.emkan-v147-service-rule,
.emkan-v147-sample-rule{position:relative!important;display:block!important;width:100%!important;height:1px!important;background:var(--line)!important;overflow:hidden!important}
.emkan-v147-service-rule::after,
.emkan-v147-sample-rule::after{content:""!important;position:absolute!important;inset-block:0!important;inset-inline-start:0!important;width:22%!important;background:var(--hover-accent)!important;opacity:0!important;transform:scaleX(.25)!important;transform-origin:inset-inline-start center!important;transition:opacity .2s ease,transform .3s ease!important}
.emkan-v147-service-card:is(:hover,:focus-visible) .emkan-v147-service-caption,
.emkan-v147-sample-card:is(:hover,:focus-visible) .emkan-v147-sample-caption{color:var(--hover-accent)!important}
.emkan-v147-service-card:is(:hover,:focus-visible) .emkan-v147-service-rule::after,
.emkan-v147-sample-card:is(:hover,:focus-visible) .emkan-v147-sample-rule::after{opacity:1!important;transform:scaleX(1)!important}
.emkan-v147-service-head{max-width:840px!important;margin:0 auto 20px!important;padding:0 0 13px!important;border-bottom:1px solid var(--line)!important}
.emkan-v147-service-head h1{margin:0 0 7px!important;font-size:20px!important;font-weight:620!important;line-height:1.65!important}
.emkan-v147-service-head p{margin:0!important;font-size:11px!important;line-height:1.95!important;color:var(--category-muted)!important}
.emkan-v147-samples-grid{display:grid!important;grid-template-columns:repeat(3,192px)!important;justify-content:center!important;align-items:start!important;gap:28px!important;margin:0 auto!important;padding:0!important}
.emkan-v147-sample-detail{max-width:840px!important;margin:0 auto!important;padding:4px 0!important}
.emkan-v147-sample-detail h1{margin:0 0 10px!important;font-size:21px!important;font-weight:620!important;line-height:1.65!important}
.emkan-v147-sample-detail p{margin:0 0 18px!important;font-size:11px!important;line-height:2!important;color:var(--category-muted)!important}
.emkan-v147-sample-hero{width:min(100%,620px)!important;aspect-ratio:16/10!important;margin:22px auto 0!important;overflow:hidden!important;border:1px solid var(--line)!important}
.emkan-v147-sample-hero img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
:is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-civil-services :is(.emkan-v147-service-head,.emkan-v147-sample-detail,.emkan-v147-service-caption,.emkan-v147-sample-caption){direction:rtl!important;text-align:right!important}
html[lang="en"] body.emkan-v147-civil-services :is(.emkan-v147-service-head,.emkan-v147-sample-detail,.emkan-v147-service-caption,.emkan-v147-sample-caption){direction:ltr!important;text-align:left!important}

@media (max-width:900px){
  .emkan-v147-services-view{padding-top:4px!important}
  .emkan-v147-services-grid{grid-template-columns:repeat(2,minmax(0,192px))!important;gap:24px 20px!important}
  .emkan-v147-samples-grid{grid-template-columns:repeat(2,minmax(0,192px))!important;gap:24px 20px!important}
  .emkan-v147-service-card,.emkan-v147-sample-card{width:100%!important}
}
@media (max-width:520px){
  .emkan-v147-services-grid,.emkan-v147-samples-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px 12px!important}
  .emkan-v147-service-caption,.emkan-v147-sample-caption{font-size:10px!important;padding-top:8px!important}
  .emkan-v147-service-head{margin-bottom:15px!important}
}

/* ========================================================================== 
   3) EDUCATION > LEARNING RESOURCE
   FA/AR rail (search + tree) is physically on the RIGHT. EN is on the LEFT.
   The square poster + topic title/intro sit at the top beside that rail.
   ========================================================================== */
@media (min-width:901px){
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout,
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout.v90-education-detail-layout{
    width:100%!important;
    max-width:1180px!important;
    margin-inline:auto!important;
    display:grid!important;
    align-items:start!important;
    gap:34px!important;
    direction:ltr!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout{
    grid-template-columns:minmax(0,1fr) 190px!important;
    grid-template-areas:"content rail"!important;
  }
  html[lang="en"] body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout{
    grid-template-columns:190px minmax(0,1fr)!important;
    grid-template-areas:"rail content"!important;
  }
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout > .v69-content-search-rail{
    grid-area:rail!important;
    width:190px!important;
    max-width:190px!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    position:static!important;
    transform:none!important;
  }
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout > .v69-content-detail-body{
    grid-area:content!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .v69-content-search-rail{direction:rtl!important;text-align:right!important}
  html[lang="en"] body.emkan-v147-learning-resource #contentApp .v69-content-search-rail{direction:ltr!important;text-align:left!important}
}

body.emkan-v147-learning-resource #contentApp .emkan-v137-learning-lead,
body.emkan-v147-learning-resource #contentApp .emkan-v136-learning-lead,
body.emkan-v147-learning-resource #contentApp .learning-course-cover{display:none!important}

body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{
  width:100%!important;
  margin:0 0 24px!important;
  padding:0 0 18px!important;
  border-bottom:1px solid var(--line)!important;
  display:grid!important;
  align-items:start!important;
  gap:22px!important;
}
:is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{
  grid-template-columns:minmax(0,1fr) 190px!important;
  grid-template-areas:"copy poster"!important;
  direction:ltr!important;
}
html[lang="en"] body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{
  grid-template-columns:190px minmax(0,1fr)!important;
  grid-template-areas:"poster copy"!important;
  direction:ltr!important;
}
body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-poster{
  grid-area:poster!important;
  width:190px!important;
  height:190px!important;
  aspect-ratio:1/1!important;
  overflow:hidden!important;
  border:1px solid var(--line)!important;
  background:var(--bg)!important;
}
body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-poster img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important}
body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy{grid-area:copy!important;min-width:0!important}
body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy h1{margin:0 0 9px!important;font-size:20px!important;font-weight:620!important;line-height:1.7!important;color:var(--fg)!important}
body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy p{margin:0!important;font-size:11px!important;line-height:2!important;color:var(--category-muted)!important;white-space:pre-line!important}
:is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy{direction:rtl!important;text-align:right!important}
html[lang="en"] body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy{direction:ltr!important;text-align:left!important}

/* Learning workspace/tree also mirrors physically: right in FA/AR, left in EN. */
@media (min-width:901px){
  body.emkan-v147-learning-resource #contentApp .learning-workspace,
  body.emkan-v147-learning-resource #contentApp .learning-workspace.v90-learning-workspace{
    width:100%!important;
    max-width:none!important;
    display:grid!important;
    align-items:start!important;
    gap:26px!important;
    direction:ltr!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .learning-workspace{
    grid-template-columns:minmax(0,1fr) 180px!important;
    grid-template-areas:"panels tree"!important;
  }
  html[lang="en"] body.emkan-v147-learning-resource #contentApp .learning-workspace{
    grid-template-columns:180px minmax(0,1fr)!important;
    grid-template-areas:"tree panels"!important;
  }
  body.emkan-v147-learning-resource #contentApp .learning-workspace > .learning-side{grid-area:tree!important;width:180px!important;max-width:180px!important;position:static!important;transform:none!important;margin:0!important;padding:0!important}
  body.emkan-v147-learning-resource #contentApp .learning-workspace > .learning-panels{grid-area:panels!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
}

/* One stepped two-line disclosure icon, same visual family as the rest of the site. */
body.emkan-v147-learning-resource #contentApp details > summary::after{content:none!important;display:none!important}
body.emkan-v147-learning-resource #contentApp .emkan-v147-disclosure-mark,
body.emkan-v147-learning-resource #contentApp .emkan-v146-lesson-mark{
  position:relative!important;
  display:inline-block!important;
  width:12px!important;
  height:10px!important;
  flex:0 0 12px!important;
  visibility:visible!important;
  opacity:.72!important;
  border:0!important;
  background:transparent!important;
  color:currentColor!important;
}
body.emkan-v147-learning-resource #contentApp :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::before,
body.emkan-v147-learning-resource #contentApp :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::after{
  content:""!important;
  position:absolute!important;
  inset-inline-end:0!important;
  left:auto!important;
  top:auto!important;
  height:1px!important;
  background:currentColor!important;
  transform:none!important;
  transition:width .2s cubic-bezier(.22,.61,.36,1)!important;
}
body.emkan-v147-learning-resource #contentApp :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::before{top:2px!important;width:6px!important}
body.emkan-v147-learning-resource #contentApp :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::after{bottom:2px!important;width:11px!important;opacity:1!important}
body.emkan-v147-learning-resource #contentApp details[open] > summary :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::before{width:11px!important}
body.emkan-v147-learning-resource #contentApp details[open] > summary :is(.emkan-v147-disclosure-mark,.emkan-v146-lesson-mark)::after{width:6px!important}

@media (max-width:900px){
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout{display:block!important;width:100%!important;max-width:none!important}
  body.emkan-v147-learning-resource #contentApp > .v69-content-detail-layout > .v69-content-search-rail{width:100%!important;max-width:none!important;margin:0 0 18px!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{grid-template-columns:120px minmax(0,1fr)!important;grid-template-areas:"poster copy"!important;gap:16px!important;margin-bottom:18px!important;padding-bottom:15px!important}
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{grid-template-columns:minmax(0,1fr) 120px!important;grid-template-areas:"copy poster"!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-poster{width:120px!important;height:120px!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy h1{font-size:17px!important}
  body.emkan-v147-learning-resource #contentApp .learning-workspace{display:block!important}
}
@media (max-width:560px){
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header,
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{
    grid-template-columns:92px minmax(0,1fr)!important;
    grid-template-areas:"poster copy"!important;
    gap:13px!important;
  }
  :is(html[lang="fa"],html[lang="ar"]) body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-header{grid-template-columns:minmax(0,1fr) 92px!important;grid-template-areas:"copy poster"!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-poster{width:92px!important;height:92px!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy h1{font-size:15px!important;margin-bottom:6px!important}
  body.emkan-v147-learning-resource #contentApp .emkan-v147-learning-copy p{font-size:10px!important;line-height:1.85!important}
}
