/* EMKAN v141 — strategic geometry repair.
   Loaded last. Scope is deliberately narrow: preserve the established thin/linear language,
   do not touch page loading/transition timing. */

/* --------------------------------------------------------------------------
   1. CANONICAL COVER START + GRID RHYTHM
   Architecture is the reference and remains untouched. Civil, R&D, Content and Store
   now start at the exact same vertical rhythm as Architecture. Civil/R&D/Store are four
   columns on desktop, with the same 192px square cover and 36/34 spacing language.
   -------------------------------------------------------------------------- */
@media (min-width:921px){
  /* Same post-menu start used by the approved Architecture landing. */
  html body.emkan-primary-landing .module-main,
  html body.emkan-v141-store-landing .store-main{
    padding-top:clamp(92px,12vh,138px)!important;
    margin-top:0!important;
  }

  /* Only the three requested landing pages become four-column. */
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid,
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid.category-grid--five,
  html body.emkan-v141-store-landing .store-grid{
    width:876px!important;
    max-width:100%!important;
    grid-template-columns:repeat(4,192px)!important;
    grid-auto-rows:auto!important;
    column-gap:36px!important;
    row-gap:34px!important;
    margin-top:0!important;
    margin-inline:auto!important;
    justify-content:center!important;
    align-items:start!important;
  }
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-card,
  html body.emkan-v141-store-landing .store-card{
    width:192px!important;
    max-width:192px!important;
  }

  /* Content creation keeps its own card count, but its cover start/rhythm matches Architecture. */
  html body.emkan-content-landing .category-grid,
  html body.emkan-content-landing .category-grid.category-grid--five{
    margin-top:0!important;
    row-gap:34px!important;
    align-items:start!important;
  }
}
@media (min-width:701px) and (max-width:920px){
  html body.emkan-primary-landing .module-main,
  html body.emkan-v141-store-landing .store-main{padding-top:72px!important;margin-top:0!important;}
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid,
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid.category-grid--five,
  html body.emkan-v141-store-landing .store-grid{
    width:min(648px,100%)!important;
    grid-template-columns:repeat(3,minmax(0,192px))!important;
    gap:28px 36px!important;
    margin-top:0!important;
    justify-content:center!important;
  }
}
@media (max-width:700px){
  html body.emkan-primary-landing .module-main,
  html body.emkan-v141-store-landing .store-main{padding-top:52px!important;margin-top:0!important;}
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid,
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid.category-grid--five,
  html body.emkan-v141-store-landing .store-grid{
    width:min(420px,100%)!important;
    grid-template-columns:repeat(2,minmax(0,192px))!important;
    gap:22px 14px!important;
    margin-top:0!important;
    justify-content:center!important;
  }
}
@media (max-width:430px){
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid,
  html body:is(.emkan-v141-civil-landing,.emkan-v141-research-landing) .category-grid.category-grid--five,
  html body.emkan-v141-store-landing .store-grid{
    width:min(192px,100%)!important;
    grid-template-columns:1fr!important;
  }
}

/* --------------------------------------------------------------------------
   2. VIRTUAL EDUCATION — restore its dedicated v135 visual system.
   Later generic content/card rules must not turn this into the ordinary section theme.
   -------------------------------------------------------------------------- */
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-program{
  margin-top:34px!important;padding-top:0!important;border-top:1px solid var(--line)!important;
  color:var(--fg)!important;display:block!important;position:relative!important;overflow:visible!important;
  width:100%!important;max-width:none!important;background:transparent!important;box-shadow:none!important;
}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-head{
  display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:24px!important;
  padding:17px 0 15px!important;margin:0!important;border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;
}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-head h2{margin:0!important;font-size:15px!important;font-weight:600!important;line-height:1.7!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-head p{margin:3px 0 0!important;color:var(--category-muted)!important;font-size:10.5px!important;line-height:1.9!important;max-width:690px!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-badges{display:flex!important;align-items:center!important;gap:13px!important;flex-wrap:wrap!important;white-space:nowrap!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-badge{font-size:9px!important;color:var(--category-muted)!important;padding:0 0 3px!important;border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;border-radius:0!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-gate{padding:18px 0!important;margin:0!important;border:0!important;border-bottom:1px solid var(--line)!important;max-width:650px!important;background:transparent!important;box-shadow:none!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-gate p{margin:0 0 12px!important;font-size:11px!important;line-height:2!important;color:var(--category-muted)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:14px!important;align-items:end!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-row label{display:grid!important;gap:4px!important;font-size:10px!important;color:var(--category-muted)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-row input{border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;color:var(--fg)!important;padding:8px 0!important;outline:0!important;font:inherit!important;letter-spacing:.05em!important;border-radius:0!important;box-shadow:none!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-row input:focus{border-bottom-color:var(--hover-accent)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp :is(.emkan-v135-access-row button,.emkan-v135-lesson-complete,.emkan-v135-materials a){appearance:none!important;border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;color:var(--fg)!important;padding:8px 0!important;text-decoration:none!important;font:inherit!important;font-size:10.5px!important;cursor:pointer!important;border-radius:0!important;box-shadow:none!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp :is(.emkan-v135-access-row button,.emkan-v135-lesson-complete,.emkan-v135-materials a):hover{color:var(--hover-accent)!important;border-bottom-color:var(--hover-accent)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-status{min-height:18px!important;margin:8px 0 0!important;font-size:9.5px!important;color:var(--category-muted)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lessons{display:block!important;margin:0!important;padding:0!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson{position:relative!important;display:grid!important;grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr)!important;gap:32px!important;padding:22px 0!important;margin:0!important;border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson.is-locked{opacity:.52!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson.is-complete .emkan-v135-lesson-number{color:var(--hover-accent)!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson-copy{min-width:0!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson-kicker{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0 0 7px!important;color:var(--category-muted)!important;font-size:9px!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson h3{margin:0 0 8px!important;font-size:13px!important;font-weight:600!important;line-height:1.8!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson p{margin:0 0 11px!important;font-size:10.5px!important;line-height:2!important;color:var(--category-muted)!important;white-space:pre-line!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-video-wrap{position:relative!important;width:100%!important;aspect-ratio:16/9!important;background:rgba(127,127,127,.045)!important;overflow:hidden!important;border:0!important;border-radius:0!important;box-shadow:none!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-video-wrap video{display:block!important;width:100%!important;height:100%!important;object-fit:contain!important;background:#050607!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-video-lock{position:absolute!important;inset:0!important;display:grid!important;place-items:center!important;background:color-mix(in srgb,var(--bg) 86%,transparent)!important;font-size:10px!important;color:var(--category-muted)!important;text-align:center!important;padding:20px!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-progress-line{height:1px!important;background:var(--line)!important;margin-top:12px!important;overflow:hidden!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-progress-line>span{display:block!important;height:1px!important;width:0;background:var(--hover-accent)!important;transition:width .18s linear!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-materials{padding:18px 0!important;margin:0!important;border:0!important;border-bottom:1px solid var(--line)!important;background:transparent!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-materials h3{margin:0 0 8px!important;font-size:12px!important;font-weight:600!important;}
body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-materials-list{display:flex!important;gap:20px!important;flex-wrap:wrap!important;}
:is(html[lang="fa"],html[lang="ar"]) body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-program{direction:rtl!important;text-align:right!important;}
html[lang="en"] body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-program{direction:ltr!important;text-align:left!important;}
@media(max-width:760px){
  body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-virtual-head{align-items:flex-start!important;flex-direction:column!important;gap:8px!important;}
  body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-lesson{grid-template-columns:1fr!important;gap:14px!important;padding:18px 0!important;}
  body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-access-row{grid-template-columns:1fr!important;}
}


body.content-section-page.emkan-v141-virtual-learning #contentApp .emkan-v135-material-disabled{
  font-size:10px!important;
  color:var(--category-muted)!important;
  padding-bottom:6px!important;
  border-bottom:1px solid var(--line)!important;
  opacity:.65!important;
}

/* --------------------------------------------------------------------------
   3. STORE + PODCAST FILTER RHYTHM
   Store mirrors Podcast: search, first disclosure, second disclosure. A separator appears
   below the last option ONLY while the first disclosure is open.
   -------------------------------------------------------------------------- */
html body .store-category-side{display:block!important;min-width:0!important;}
html body .store-category-side .product-search{margin:0 0 18px!important;}
html body .store-category-side :is(.store-subcategory-filter,.store-sort-filter){border:0!important;border-bottom:1px solid var(--line)!important;margin:0!important;padding:0!important;background:transparent!important;}
html body .store-category-side :is(.store-subcategory-filter,.store-sort-filter)>summary{
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
  list-style:none!important;cursor:pointer!important;padding:11px 0!important;margin:0!important;
  font-size:10.5px!important;line-height:1.4!important;color:var(--category-muted,var(--fg))!important;
  border:0!important;background:transparent!important;box-shadow:none!important;
}
html body .store-category-side :is(.store-subcategory-filter,.store-sort-filter)>summary::-webkit-details-marker{display:none!important;}
html body .store-category-side :is(.store-subcategory-list,.store-sort-list){display:grid!important;gap:7px!important;padding:3px 0 12px!important;margin:0!important;border:0!important;}
html body .store-category-side :is(.store-subcategory-list a,.store-sort-list button){
  display:block!important;width:100%!important;min-height:0!important;margin:0!important;padding:0!important;
  border:0!important;background:transparent!important;box-shadow:none!important;text-align:start!important;text-decoration:none!important;
  color:var(--fg)!important;font:inherit!important;font-size:11.5px!important;line-height:1.7!important;cursor:pointer!important;
}
html body .store-category-side :is(.store-subcategory-list a,.store-sort-list button):is(:hover,:focus-visible,.is-active){color:var(--hover-accent)!important;outline:0!important;}
html body .store-category-side .store-sort-list button.is-active{font-weight:600!important;}
html body .store-category-side .product-sort-wrap{margin:0!important;padding:0!important;border:0!important;}
html body .store-category-side .product-sort-label{display:none!important;}
html body .store-category-side #productSort.emkan-v141-sort-source{display:none!important;}

/* Open-only separator after the LAST option of the first group. */
html body .store-category-side .store-subcategory-filter[open]>.store-subcategory-list,
html body .podcast-controls .podcast-filter-row>.podcast-disclosure:first-child[open]>.podcast-filter-list{
  padding-bottom:16px!important;
  margin-bottom:8px!important;
  border-bottom:1px solid var(--line)!important;
}
/* Prevent the container's permanent border from visually doubling the temporary open line. */
html body .store-category-side .store-subcategory-filter[open],
html body .podcast-controls .podcast-filter-row>.podcast-disclosure:first-child[open]{border-bottom-color:transparent!important;}

/* --------------------------------------------------------------------------
   4. STORE ADD-TO-CART — exactly one localized label, never three in parallel.
   -------------------------------------------------------------------------- */
html body #addToCart>.lang-fa,
html body #addToCart>.lang-en,
html body #addToCart>.lang-ar{display:none!important;}
html[lang="fa"] body #addToCart>.lang-fa{display:inline!important;}
html[lang="en"] body #addToCart>.lang-en{display:inline!important;}
html[lang="ar"] body #addToCart>.lang-ar{display:inline!important;}

/* --------------------------------------------------------------------------
   5. R&D INTERNAL PAGES — context/content starts with the same tight rhythm as other modules.
   The landing page remains governed by the Architecture-matched cover start defined above.
   -------------------------------------------------------------------------- */
@media (min-width:901px){
  html body.emkan-v136-rd-section .detail-main,
  html body.emkan-v136-rd-articles .articles-main--architecture-tools,
  html body.emkan-v136-rd-article .article-page{
    padding-top:4px!important;
    margin-top:0!important;
  }
  html body.emkan-v136-rd-section :is(.emkan-context-bar,.detail-context-bar),
  html body.emkan-v136-rd-articles :is(.emkan-context-bar,.articles-context-bar),
  html body.emkan-v136-rd-article :is(.emkan-context-bar,.article-context-bar){
    margin-top:0!important;
  }
}
@media (max-width:900px){
  html body.emkan-v136-rd-section .detail-main,
  html body.emkan-v136-rd-articles .articles-main--architecture-tools,
  html body.emkan-v136-rd-article .article-page{padding-top:6px!important;margin-top:0!important;}
}

/* --------------------------------------------------------------------------
   6. CIVIL SERVICES NESTING — same thin disclosure language, including second level.
   -------------------------------------------------------------------------- */
html body .detail-nav .detail-subcategory-filter{border:0!important;border-bottom:1px solid var(--line)!important;margin:0!important;padding:0!important;}
html body .detail-nav .detail-subcategory-filter>summary{padding:10px 0!important;}
html body .detail-nav .detail-subcategory-list{padding:2px 0 10px!important;gap:6px!important;}
html body .detail-nav .detail-subcategory-children{margin-top:4px!important;}

/* Explicitly DO NOT alter .page-shell transitions / is-preload / is-leaving.
   v141 preserves the established loader and 260 ms navigation timing. */
