/* EMKAN v142 — final geometry + store filter correction.
   Purpose: repair only the four reported regressions without changing the established visual language. */

/* --------------------------------------------------------------------------
   A. ONE CANONICAL GAP BETWEEN THE MAIN NAV AND THE LOWER CONTEXT/BREADCRUMB BAR
   -------------------------------------------------------------------------- */
@media (min-width:901px){
  /* Internal modules with an injected/hard-coded context bar must not add their own top padding. */
  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,
  html body .store-category-main,
  html body .product-main,
  html body .podcast-main{
    padding-top:0!important;
    margin-top:0!important;
  }

  /* Same distance everywhere: nav bottom -> context row, then the same lower breathing room. */
  html body main>.emkan-context-bar,
  html body .store-category-main>.store-context-bar,
  html body .podcast-main>.podcast-context-bar,
  html body .product-main>.product-toolbar{
    margin-top:22px!important;
    margin-bottom:24px!important;
    padding-top:0!important;
    padding-bottom:13px!important;
  }

  /* R&D must not be compressed closer to the menu than other internal pages. */
  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:22px!important;
    margin-bottom:24px!important;
    padding-bottom:13px!important;
  }
}
@media (max-width:900px){
  html body main>.emkan-context-bar,
  html body .store-category-main>.store-context-bar,
  html body .podcast-main>.podcast-context-bar,
  html body .product-main>.product-toolbar{
    margin-top:16px!important;
    margin-bottom:20px!important;
    padding-bottom:11px!important;
  }
}

/* --------------------------------------------------------------------------
   B. LANDING COVER RHYTHM — compact enough that <= 6 covers do not need scroll
      on a normal laptop viewport. Architecture's approved start rhythm is the reference.
   -------------------------------------------------------------------------- */
@media (min-width:921px){
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing,.emkan-v142-content-landing) .module-main,
  html body.emkan-v142-store-landing .store-main{
    padding-top:clamp(46px,6vh,60px)!important;
    padding-bottom:24px!important;
    margin-top:0!important;
  }

  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid,
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid.category-grid--five,
  html body.emkan-v142-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:28px!important;
    margin:0 auto!important;
    justify-content:center!important;
    align-items:start!important;
  }

  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-card,
  html body.emkan-v142-store-landing .store-card{
    width:192px!important;
    max-width:192px!important;
  }

  /* Content Creation has 6 covers: keep its intended column count, but fit the page cleanly. */
  html body.emkan-v142-content-landing .category-grid,
  html body.emkan-v142-content-landing .category-grid.category-grid--five{
    margin-top:0!important;
    row-gap:24px!important;
    align-items:start!important;
  }
}

@media (min-width:701px) and (max-width:920px){
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing,.emkan-v142-content-landing) .module-main,
  html body.emkan-v142-store-landing .store-main{
    padding-top:40px!important;
    padding-bottom:24px!important;
    margin-top:0!important;
  }
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid,
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid.category-grid--five,
  html body.emkan-v142-store-landing .store-grid{
    width:min(648px,100%)!important;
    grid-template-columns:repeat(3,192px)!important;
    gap:24px 36px!important;
    margin:0 auto!important;
    justify-content:center!important;
  }
  html body.emkan-v142-content-landing .category-grid,
  html body.emkan-v142-content-landing .category-grid.category-grid--five{
    margin-top:0!important;
    row-gap:22px!important;
  }
}

@media (max-width:700px){
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing,.emkan-v142-content-landing) .module-main,
  html body.emkan-v142-store-landing .store-main{
    padding-top:30px!important;
    padding-bottom:28px!important;
    margin-top:0!important;
  }
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid,
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid.category-grid--five,
  html body.emkan-v142-store-landing .store-grid{
    width:min(420px,100%)!important;
    grid-template-columns:repeat(2,minmax(0,192px))!important;
    gap:20px 14px!important;
    margin:0 auto!important;
    justify-content:center!important;
  }
  html body.emkan-v142-content-landing .category-grid,
  html body.emkan-v142-content-landing .category-grid.category-grid--five{
    margin-top:0!important;
    row-gap:20px!important;
  }
}
@media (max-width:430px){
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid,
  html body:is(.emkan-v142-civil-landing,.emkan-v142-research-landing) .category-grid.category-grid--five,
  html body.emkan-v142-store-landing .store-grid{
    width:min(192px,100%)!important;
    grid-template-columns:1fr!important;
  }
}

/* --------------------------------------------------------------------------
   C. STORE FILTERS = PODCAST DISCLOSURE LANGUAGE
      Permanent line stays under each heading. When the FIRST filter opens,
      a SECOND, new hairline appears after its last option before Sort / Season.
   -------------------------------------------------------------------------- */
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){
  width:100%!important;
  margin:0!important;
  padding:0!important;
  border: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;
  min-height:0!important;
  margin:0!important;
  padding:11px 0!important;
  list-style:none!important;
  cursor:pointer!important;
  border:0!important;
  border-bottom:1px solid var(--line)!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--category-muted,var(--fg))!important;
  font-size:10.5px!important;
  line-height:1.4!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;
  margin:0!important;
  padding:3px 0 12px!important;
  border:0!important;
  background:transparent!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;
  color:var(--fg)!important;
  text-align:start!important;
  text-decoration:none!important;
  font:inherit!important;
  font-size:11.5px!important;
  line-height:1.7!important;
  cursor:pointer!important;
}

/* Extra open-only separator: it is NOT the original title line moved downward. */
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{
  margin-bottom:8px!important;
  padding-bottom:16px!important;
  border-bottom:1px solid var(--line)!important;
}
/* Keep the original heading hairline visible while open. */
html body .store-category-side .store-subcategory-filter[open]>summary,
html body .podcast-controls .podcast-filter-row>.podcast-disclosure:first-child[open]>summary{
  border-bottom:1px solid var(--line)!important;
}
/* Cancel v141's old trick that made the original line transparent. */
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;
}

/* Preserve the compact Podcast-like vertical rhythm between the two headings. */
html body .store-category-side .store-subcategory-filter + .product-sort-wrap,
html body .store-category-side .store-subcategory-filter + .store-sort-filter,
html body .podcast-controls .podcast-disclosure + .podcast-disclosure{
  margin-top:0!important;
}
