/* Drugestan Health Magazine v1.44.1 — SCIENTIFIC SOURCES / SECONDARY GRID OWNER
   Loaded last. This file owns only the lower scientific follow-up area and sources.
   Goal: sources always has one deterministic half-row position, never floats between rows.
*/

html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid{
  box-sizing:border-box!important;
  min-width:0!important;
}

@media(min-width:1180px){
  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:20px 18px!important;
    align-items:start!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
    direction:rtl!important;
  }

  /* Follow-up scientific blocks use one normal card each. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > .dhm-v46-info{
    grid-column:span 1!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    order:1!important;
  }

  /* Sources has a fixed two-card width and fixed half-row slot. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources{
    grid-column:3 / 5!important;
    grid-row:1!important;
    order:2!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    align-self:start!important;
  }

  /* Reserve the two right-hand cells for up to two info cards. Additional cards continue below. */
  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 > h2{
    height:134px!important;
    min-height:134px!important;
    max-height:134px!important;
    margin:0 0 10px!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > h2::before{
    width:100%!important;
    max-width:none!important;
    height:88px!important;
    min-height:88px!important;
  }

  /* Closed card has the same visual height as other lower cards. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > .dhm-section-card{
    display:flex!important;
    flex-direction:column!important;
    justify-content:space-between!important;
    width:100%!important;
    min-width:0!important;
    min-height:228px!important;
    height:228px!important;
    max-height:228px!important;
    overflow:hidden!important;
    padding:17px!important;
    box-sizing:border-box!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources .dhm-v43-source-body{
    width:100%!important;
    min-width:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources .dhm-v43-source-body.is-collapsed{
    max-height:142px!important;
    overflow:hidden!important;
    position:relative!important;
  }

  /* Expanded sources actually expand; no fixed parent height is allowed to clip them. */
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources.is-expanded > .dhm-section-card{
    height:auto!important;
    min-height:228px!important;
    max-height:none!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources.is-expanded .dhm-v43-source-body{
    max-height:none!important;
    overflow:visible!important;
  }
}

@media(min-width:700px) and (max-width:1179px){
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v16-modules > .dhm-v47-secondary-grid{
    grid-column:1/-1!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:18px!important;
    width:100%!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources{
    grid-column:1/-1!important;
    width:100%!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > .dhm-section-card{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources .dhm-v43-source-body.is-collapsed{
    max-height:155px!important;
    overflow:hidden!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources.is-expanded .dhm-v43-source-body{
    max-height:none!important;
    overflow:visible!important;
  }
}

@media(max-width:699px){
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid{display:block!important;width:100%!important;}
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > *{margin:18px 0!important;}
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources > .dhm-section-card{
    height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
  }
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources .dhm-v43-source-body.is-collapsed{max-height:165px!important;overflow:hidden!important;}
  html body[class*="single-dhms_"] .dhm-single-article .dhm-v47-secondary-grid > #dhm-scientific-sources.is-expanded .dhm-v43-source-body{max-height:none!important;overflow:visible!important;}
}
