/* Drugestan Health Magazine v1.45.10.1
   VISUAL LAYOUT REBUILD ONLY.
   This file intentionally changes presentation only. It does not alter fields,
   content import, REST, metadata, or article data semantics.
*/

/* ---------- universal visual reset for the lower article modules ---------- */
html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules *{box-sizing:border-box!important}

html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > section,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > aside,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > *{
  float:none!important;
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  clear:none!important;
  max-width:none!important;
  min-width:0!important;
}

/* Never let the product area float upward into the scientific/source area. */
html body[class*="single-dhms_"] .dhm-single-article #dhm-products,
html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-products{
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  clear:both!important;
  width:100%!important;
  max-width:none!important;
  overflow:visible!important;
  z-index:1!important;
}

/* One clipping owner: the content body created by the existing visual JS. */
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  margin:0!important;
  overflow:hidden!important;
}
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card > .dhm-v1499-body{
  flex:1 1 auto!important;
  min-height:0!important;
  width:100%!important;
  overflow:hidden!important;
}
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card.dhm-v1499-expanded,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card.dhm-v1499-expanded > .dhm-v1499-body{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}

/* Neutralize all older nested source clamps when our outer card is active. */
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v43-source-body,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v43-source-body.is-collapsed,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1455-source-body,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1456-body,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1459-source-body{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  opacity:1!important;
  mask-image:none!important;
  -webkit-mask-image:none!important;
}

/* Plain text expand/collapse control. */
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-more{
  position:relative!important;
  z-index:3!important;
  display:block!important;
  align-self:center!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  margin:7px auto 0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#31556f!important;
  font:inherit!important;
  font-size:13px!important;
  line-height:1.5!important;
  font-weight:800!important;
  cursor:pointer!important;
}
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-more.dhm-v1499-not-needed{display:none!important}

/* Warning visual identity is explicit because the section may be legacy/meta-generated. */
html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:flex-start!important;
  color:#173553!important;
  font-weight:800!important;
  text-align:center!important;
  white-space:normal!important;
  overflow:visible!important;
}
html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2::before{
  content:""!important;
  display:block!important;
  flex:0 0 auto!important;
  width:100%!important;
  background-image:url('photos-v41/article-warning.jpg')!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  background-size:cover!important;
  box-shadow:inset 0 0 0 1px rgba(216,226,232,.95)!important;
}

/* ---------- desktop ---------- */
@media(min-width:1180px){
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules{
    display:grid!important;
    grid-template-columns:repeat(12,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:20px 18px!important;
    align-items:start!important;
    width:100%!important;
    overflow:visible!important;
  }

  /* Primary support row: exact four equal columns. */
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > #dhm-action,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > #dhm-pharmacist-answer,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > #dhm-professional,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > .dhm-professional,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > #dhm-warning,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning{
    grid-column:span 3!important;
    order:30!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    align-self:start!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2{
    width:100%!important;
    height:126px!important;
    min-height:126px!important;
    max-height:126px!important;
    margin:0 0 10px!important;
    padding:0!important;
    font-size:15px!important;
    line-height:1.45!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2::before{
    width:100%!important;
    height:82px!important;
    min-height:82px!important;
    max-height:82px!important;
    margin:0 0 8px!important;
    border-radius:11px!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > .dhm-section-card.dhm-v1499-card{
    height:238px!important;
    min-height:238px!important;
    max-height:238px!important;
    padding:17px!important;
    overflow:hidden!important;
  }

  /* Secondary row: two small cards + one two-column source card. */
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > .dhm-v47-secondary-grid{
    grid-column:1/-1!important;
    order:40!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:18px!important;
    align-items:start!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    direction:rtl!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info{
    grid-column:span 1!important;
    grid-row:auto!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    margin:0!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info:nth-of-type(1){grid-column:1!important;grid-row:1!important}
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info:nth-of-type(2){grid-column:2!important;grid-row:1!important}
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources{
    grid-column:3/5!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > h2{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    width:100%!important;
    height:134px!important;
    min-height:134px!important;
    max-height:134px!important;
    margin:0 0 10px!important;
    padding:0!important;
    font-size:18px!important;
    line-height:1.45!important;
    text-align:center!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > h2::before{
    width:100%!important;
    height:88px!important;
    min-height:88px!important;
    max-height:88px!important;
    margin:0 0 8px!important;
    border-radius:11px!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info > .dhm-section-card.dhm-v1499-card,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > .dhm-section-card.dhm-v1499-card{
    height:228px!important;
    min-height:228px!important;
    max-height:228px!important;
    padding:17px!important;
    overflow:hidden!important;
  }

  /* Expanded cards grow naturally and therefore grow their grid row. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-section-card.dhm-v1499-card.dhm-v1499-expanded{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > #dhm-products,
  html body[class*="single-dhms_"] .dhm-single-article.dhm-v22-refine .dhm-v16-modules > .dhm-sync-products{
    grid-column:1/-1!important;
    order:50!important;
    margin:8px 0 0!important;
  }
}

/* ---------- mobile + tablet ---------- */
@media(max-width:1179px){
  /* The fixed "مشاهده محصولات" banner was covering article cards and photos.
     Keep the actual products section; remove only this floating visual duplicate. */
  html body[class*="single-dhms_"] .dhm-v25-products-only.dhm-v19-mobile-actions{display:none!important}

  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules{
    display:block!important;
    width:100%!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > section,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > aside,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > *{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:22px 0!important;
    padding:0!important;
    overflow:visible!important;
    clear:both!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v46-info > h2,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources > h2{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 0 12px!important;
    padding:0!important;
    font-size:17px!important;
    line-height:1.5!important;
    text-align:center!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v46-info > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources > h2::before{
    content:""!important;
    display:block!important;
    flex:0 0 auto!important;
    width:100%!important;
    height:120px!important;
    min-height:120px!important;
    max-height:120px!important;
    margin:0 0 10px!important;
    border-radius:12px!important;
    background-position:center!important;
    background-repeat:no-repeat!important;
    background-size:cover!important;
    overflow:hidden!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article .dhm-section-card.dhm-v1499-card{
    width:100%!important;
    height:300px!important;
    min-height:300px!important;
    max-height:300px!important;
    margin:0!important;
    padding:22px 20px!important;
    overflow:hidden!important;
    transform:none!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources > .dhm-section-card.dhm-v1499-card{
    height:360px!important;
    min-height:360px!important;
    max-height:360px!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-section-card.dhm-v1499-card.dhm-v1499-expanded,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources > .dhm-section-card.dhm-v1499-card.dhm-v1499-expanded{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }

  /* Products starts after the natural height of every preceding section. */
  html body[class*="single-dhms_"] .dhm-single-article #dhm-products,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-products{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:30px 0 0!important;
    padding:0!important;
    overflow:visible!important;
  }
}

@media(max-width:699px){
  html body[class*="single-dhms_"] .dhm-single-article #dhm-action > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v46-info > h2::before,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources > h2::before{
    height:105px!important;
    min-height:105px!important;
    max-height:105px!important;
  }
}
