/* EMKAN v143 — precision stabilization pass.
   Scope: responsive header geometry, canonical context rhythm, compact contact,
   disclosure icon normalization, Civil service cards, product-grid rhythm,
   and virtual-learning password-eye cleanup. */

/* 1) RESPONSIVE HEADER — two thin rails, less vertical white space, utilities inset. */
@media (max-width:900px){
  html body .site-header{
    width:min(680px,calc(100% - 48px))!important;
    max-width:680px!important;
    margin-inline:auto!important;
  }
  html body .site-header .nav-frame{
    margin-top:11px!important;
    min-height:36px!important;
    height:auto!important;
    grid-template-columns:50px minmax(0,1fr) 50px!important;
    grid-template-areas:"lang toggle theme" "nav nav nav"!important;
    padding-inline:10px!important;
    padding-block:0!important;
    border-top:1px solid var(--line)!important;
    border-bottom:1px solid var(--line)!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  html body .site-header .language-button,
  html body .site-header .theme-button{
    min-height:28px!important;
    height:28px!important;
    margin:0!important;
  }
  html body .site-header .language-button{justify-self:start!important;padding:0!important;}
  html body .site-header .theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{justify-self:end!important;width:28px!important;min-width:28px!important;padding:0!important;}
  html body .site-header .mobile-menu-button{width:30px!important;height:30px!important;min-height:30px!important;}
  html body .site-header .nav-list{
    border-top:0!important;
    padding:3px 0 5px!important;
  }
  html body .site-header .nav-link,
  :is(html[lang="fa"],html[lang="ar"]) body .site-header .nav-link{
    padding:5px 3px!important;
    line-height:1.2!important;
  }
}
@media (max-width:560px){
  html body .site-header{width:calc(100% - 36px)!important;}
  html body .site-header .nav-frame{
    margin-top:9px!important;
    min-height:34px!important;
    grid-template-columns:46px minmax(0,1fr) 46px!important;
    padding-inline:9px!important;
  }
  html body .site-header .language-button{font-size:.67rem!important;}
  html body .site-header .theme-icon-wrap,
  html body .site-header .theme-icon{width:13px!important;height:13px!important;}
  html body .site-header .theme-icon--moon{font-size:12.5px!important;line-height:13px!important;}
}

/* 2) ONE CANONICAL DISTANCE FROM MENU TO CONTEXT/BREADCRUMB LINE.
      Article reading pages are included explicitly so they cannot drift. */
@media (min-width:901px){
  html body main>.emkan-context-bar,
  html body .article-page>.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:22px!important;
    padding-top:0!important;
    padding-bottom:12px!important;
  }
  html body.emkan-v136-rd-article .article-page,
  html body.emkan-v136-rd-articles .articles-main--architecture-tools,
  html body.emkan-v136-rd-section .detail-main{
    padding-top:0!important;
    margin-top:0!important;
  }
  html body.emkan-v136-rd-article .article-page>.emkan-context-bar{
    margin-top:16px!important;
    margin-bottom:22px!important;
  }
}
@media (max-width:900px){
  html body main>.emkan-context-bar,
  html body .article-page>.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:13px!important;
    margin-bottom:18px!important;
    padding-bottom:10px!important;
  }
}

/* 3) CONTACT — remove the oversized central void; keep the same linear language. */
@media (min-width:761px){
  html body .contact-main--compact{
    width:min(840px,calc(100% - 48px))!important;
    max-width:840px!important;
    padding-top:42px!important;
  }
  html body .contact-composition{
    grid-template-columns:minmax(0,1.03fr) minmax(300px,.97fr)!important;
    gap:30px!important;
  }
  html body .contact-signal{padding-inline-start:16px!important;}
}

/* 4) DISCLOSURES — one plus/minus mark everywhere, always visible when open or closed. */
html body :is(
  .emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,
  .emkan-disclosure-mark,.category-chevron,.article-category-chevron,.detail-subcategory-chevron,
  .v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark,
  .message-subject-chevron
){
  position:relative!important;
  display:inline-block!important;
  visibility:visible!important;
  opacity:.72!important;
  flex:0 0 11px!important;
  width:11px!important;
  height:11px!important;
  border:0!important;
  background:transparent!important;
  transform:none!important;
}
html body :is(
  .emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,
  .emkan-disclosure-mark,.category-chevron,.article-category-chevron,.detail-subcategory-chevron,
  .v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark,
  .message-subject-chevron
)::before,
html body :is(
  .emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,
  .emkan-disclosure-mark,.category-chevron,.article-category-chevron,.detail-subcategory-chevron,
  .v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark,
  .message-subject-chevron
)::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  background:currentColor!important;
  transform:translate(-50%,-50%)!important;
  transform-origin:center!important;
  transition:opacity .18s ease!important;
}
html body :is(
  .emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,
  .emkan-disclosure-mark,.category-chevron,.article-category-chevron,.detail-subcategory-chevron,
  .v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark,
  .message-subject-chevron
)::before{width:10px!important;height:1px!important;}
html body :is(
  .emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,
  .emkan-disclosure-mark,.category-chevron,.article-category-chevron,.detail-subcategory-chevron,
  .v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark,
  .message-subject-chevron
)::after{width:1px!important;height:10px!important;}
html body details[open]>summary :is(.emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,.emkan-disclosure-mark,.detail-subcategory-chevron,.v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark)::after,
html body :is(.category-toggle,.article-category-toggle,.message-subject-trigger)[aria-expanded="true"] :is(.emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.category-chevron,.article-category-chevron,.message-subject-chevron)::after,
html body .category-panel.is-open .category-toggle :is(.emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.category-chevron)::after{
  opacity:0!important;
}
html body details[open]>summary :is(.emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.emkan-v131-disclosure-mark,.emkan-disclosure-mark,.detail-subcategory-chevron,.v49-filter-chevron,.store-subcategory-mark,.store-sort-mark,.store-sort-filter-mark),
html body :is(.category-toggle,.article-category-toggle,.message-subject-trigger)[aria-expanded="true"] :is(.emkan-v133-disclosure-mark,.emkan-v132-disclosure-mark,.category-chevron,.article-category-chevron,.message-subject-chevron){
  display:inline-block!important;visibility:visible!important;opacity:.9!important;
}

/* 5) CIVIL / SERVICES — four square covers before entering detailed sub-services. */
.emkan-v143-service-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:30px 24px!important;
  margin-top:28px!important;
}
.emkan-v143-service-card{display:block!important;color:var(--fg)!important;text-decoration:none!important;min-width:0!important;}
.emkan-v143-service-media{width:100%!important;aspect-ratio:1/1!important;overflow:hidden!important;background:var(--panel)!important;}
.emkan-v143-service-media img{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;filter:grayscale(100%)!important;transition:filter .5s ease,transform .6s ease!important;}
.emkan-v143-service-card:hover .emkan-v143-service-media img{filter:grayscale(0)!important;transform:scale(1.018)!important;}
.emkan-v143-service-copy{padding-top:9px!important;}
.emkan-v143-service-title{display:block!important;font-size:11.5px!important;font-weight:600!important;line-height:1.55!important;}
.emkan-v143-service-desc{display:block!important;margin-top:4px!important;color:var(--category-muted)!important;font-size:9px!important;line-height:1.75!important;}
@media(max-width:900px){.emkan-v143-service-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:26px 18px!important;}}
@media(max-width:520px){.emkan-v143-service-grid{grid-template-columns:1fr!important;max-width:320px!important;margin-inline:auto!important;}}

/* 6) STORE PRODUCT GRID — same compact row rhythm as Architecture. */
@media(min-width:901px){
  html body .store-category-content .product-grid{
    row-gap:32px!important;
    column-gap:36px!important;
  }
}
@media(min-width:601px) and (max-width:900px){
  html body .store-category-content .product-grid{row-gap:30px!important;column-gap:22px!important;}
}
@media(max-width:600px){
  html body .store-category-content .product-grid{row-gap:24px!important;column-gap:14px!important;}
}

/* 7) VIRTUAL LEARNING PASSWORD EYE — never inherit the submit-button underline. */
html body .emkan-v135-access-row .password-eye{
  border:0!important;
  border-bottom:0!important;
  box-shadow:none!important;
  background:var(--bg)!important;
  padding:4px!important;
  width:30px!important;
  height:30px!important;
  min-height:30px!important;
}

/* Desktop header width: another measured step inward, utilities stay inside the rails. */
@media (min-width:1280px){
  html body .site-header{width:min(calc(100% - 400px),1060px)!important;max-width:1060px!important;}
  html body .site-header .language-button{left:12px!important;right:auto!important;}
  html body .site-header .theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{right:12px!important;left:auto!important;}
  html body .site-header .primary-nav{padding-inline:72px!important;}
}
@media (min-width:901px) and (max-width:1279px){
  html body .site-header{width:min(calc(100% - 170px),920px)!important;max-width:920px!important;}
  html body .site-header .language-button{left:10px!important;right:auto!important;}
  html body .site-header .theme-button,
  html body .site-header .nav-frame>#themeButton.theme-button{right:10px!important;left:auto!important;}
  html body .site-header .primary-nav{padding-inline:66px!important;}
}
