/* Drugestan Health Magazine v1.45.10.0 — FLOW + EXPAND VISUAL FIX
   Presentation-only owner for lower support cards.
   No content fields, import schema, REST/API, taxonomy or rendering data are changed.
*/

/* 1) Keep every visual support section in normal document flow.
      This prevents a fixed/clipped legacy owner from visually sitting over the next card. */
html body[class*="single-dhms_"] .dhm-single-article #dhm-action,
html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer,
html body[class*="single-dhms_"] .dhm-single-article #dhm-professional,
html body[class*="single-dhms_"] .dhm-single-article .dhm-professional,
html body[class*="single-dhms_"] .dhm-single-article #dhm-warning,
html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v46-info,
html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources{
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  z-index:auto!important;
}

/* 2) Heading/photo is always a complete block above its own content card. */
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{
  position:relative!important;
  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;
  overflow:visible!important;
  flex:0 0 auto!important;
  box-sizing:border-box!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{
  display:block!important;
  flex:0 0 auto!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}

/* The legacy/meta warning may not carry #dhm-warning after it is moved.
   Give that exact visual section its photo/title treatment explicitly. */
html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning > h2::before{
  content:""!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;
}

/* 3) One owner for clipping: the outer v1499 body.  Old nested source clamps
      are neutralized so expanded sources can actually reveal every line. */
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-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;
}
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v43-source-body::after,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1455-source-body::after,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1456-body::after,
html body[class*="single-dhms_"] .dhm-single-article .dhm-v1499-card .dhm-v1459-source-body::after{
  display:none!important;
  content:none!important;
}

/* Expanded means natural height — not merely an opened outer shell with a
   still-clipped inner body. */
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;
}

/* Desktop: preserve the approved grid dimensions while fixing warning and expansion. */
@media(min-width:1180px){
  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;
    align-self:start!important;
    width:100%!important;
  }

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

  /* Collapsed dimensions stay exactly controlled. */
  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;
    overflow:hidden!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;
    overflow:hidden!important;
  }

  /* Clicking «بیشتر» explicitly releases every collapsed dimension. */
  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;
  }
}

/* Mobile/tablet: each section is a complete vertical block; no overlap or photo crop
   caused by inherited fixed section heights. */
@media(max-width:1179px){
  html body[class*="single-dhms_"] .dhm-single-article #dhm-action,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-pharmacist-answer,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-professional,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-professional,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-warning,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-sync-warning,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v46-info,
  html body[class*="single-dhms_"] .dhm-single-article #dhm-scientific-sources{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    margin:22px 0!important;
    padding:0!important;
    clear:both!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{
    margin:0 0 12px!important;
    padding:0!important;
    font-size:17px!important;
    line-height:1.5!important;
    text-align:center!important;
    flex:0 0 auto!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{
    width:100%!important;
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    margin:0 0 9px!important;
    border-radius:11px!important;
  }

  html body[class*="single-dhms_"] .dhm-single-article .dhm-section-card.dhm-v1499-card{
    position:relative!important;
    flex:0 0 auto!important;
    width:100%!important;
    height:300px!important;
    min-height:300px!important;
    max-height:300px!important;
    margin:0!important;
    overflow:hidden!important;
    transform:none!important;
    box-sizing:border-box!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{
    height:auto!important;
    min-height:300px!important;
    max-height:none!important;
    overflow:visible!important;
  }
  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:360px!important;
    max-height:none!important;
    overflow:visible!important;
  }

  /* Guarantee visible separation between the card and the next section/image. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > section + section,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > section + aside,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > aside + section,
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > aside + aside{
    margin-top:22px!important;
  }
}

@media(max-width:699px){
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid{
    display:block!important;
    width:100%!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > *{
    width:100%!important;
    margin:22px 0!important;
  }
}
