/* Drugestan Health Magazine v1.26.0
   Hard layout correction based on the approved desktop/mobile target.
   This file intentionally overrides all previous article styles. */
:root{
  --d26-navy:#0b315d;
  --d26-teal:#0b918f;
  --d26-violet:#6c3db7;
  --d26-orange:#d96f16;
  --d26-green:#21886f;
  --d26-line:#d8e4ec;
}

/* Never show the obsolete scientific-review footer. */
.dhm-v13-review-footer{display:none!important}

@media (min-width:1180px){
  /* The lower reading area is always a strict four-column system. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    column-gap:16px!important;
    row-gap:22px!important;
    align-items:start!important;
  }

  /* The four requested support cards MUST occupy one complete row. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional{
    grid-column:span 1!important;
    order:30!important;
    min-width:0!important;
    width:100%!important;
    margin:0!important;
    align-self:start!important;
  }

  /* One-line headings: the long professional title can no longer make its column taller. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action > h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning > h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section > h2,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional > h2{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0 0 8px!important;
    padding:0!important;
    font-size:16px!important;
    line-height:1.35!important;
    font-weight:900!important;
    letter-spacing:-.15px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    color:var(--d26-navy)!important;
  }

  /* Equal boxes. Height itself is written by v1.26 JS from the shortest content, capped at 8 lines. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action > .dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning > .dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section > .dhm-section-card,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional > .dhm-section-card{
    box-sizing:border-box!important;
    min-height:0!important;
    margin:0!important;
    padding:16px 16px 13px!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    font-size:13.5px!important;
    line-height:1.9!important;
    border-radius:14px!important;
    box-shadow:0 5px 16px rgba(13,48,82,.045)!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-action > .dhm-section-card{background:#f1faf7!important;border-color:#cce8df!important;border-right-color:#25876e!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-warning > .dhm-section-card{background:#fff8f0!important;border-color:#f0dcc8!important;border-right-color:#d96f16!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-pharmacist-section > .dhm-section-card{background:#f0fbfb!important;border-color:#cce7e7!important;border-right-color:#0b918f!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-professional > .dhm-section-card{background:#faf6ff!important;border-color:#e3d8f1!important;border-right-color:#6c3db7!important}

  body[class*="single-dhms_"] .dhm-v26-card-body{
    display:block!important;
    overflow:hidden!important;
    flex:0 0 auto!important;
  }
  body[class*="single-dhms_"] .dhm-v26-card-body.is-open{overflow:visible!important;max-height:none!important}
  body[class*="single-dhms_"] .dhm-v26-more{
    display:block!important;
    margin-top:auto!important;
    padding:7px 0 0!important;
    min-height:25px!important;
    border:0!important;
    background:transparent!important;
    cursor:pointer!important;
    text-align:right!important;
    font-size:11.5px!important;
    line-height:1.4!important;
    font-weight:900!important;
  }
  body[class*="single-dhms_"] .dhm-sync-action .dhm-v26-more{color:var(--d26-green)!important}
  body[class*="single-dhms_"] .dhm-sync-warning .dhm-v26-more{color:var(--d26-orange)!important}
  body[class*="single-dhms_"] .dhm-pharmacist-section .dhm-v26-more{color:var(--d26-teal)!important}
  body[class*="single-dhms_"] .dhm-professional .dhm-v26-more{color:var(--d26-violet)!important}
  body[class*="single-dhms_"] .dhm-v26-more.is-placeholder{visibility:hidden!important;pointer-events:none!important}

  /* Products: exactly five equal cards in view, every extra product continues horizontally. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-products{
    grid-column:1/-1!important;
    order:50!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products > h2{
    margin:0 0 10px!important;
    font-size:24px!important;
    line-height:1.4!important;
    color:var(--d26-navy)!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products > .dhm-section-card{
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:15px!important;
    overflow:hidden!important;
    background:#f1fafb!important;
    border:1px solid #c7e3e6!important;
    border-right:5px solid var(--d26-teal)!important;
    border-radius:15px!important;
    box-shadow:0 6px 18px rgba(9,91,103,.06)!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products{
    display:flex!important;
    flex-flow:row nowrap!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:12px!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:2px 1px 10px!important;
    margin:0!important;
    scroll-snap-type:x mandatory!important;
    scrollbar-width:thin!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid > .dhm-sync-product,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products > .dhm-related-product,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products > *{
    flex:0 0 calc((100% - 48px)/5)!important;
    width:calc((100% - 48px)/5)!important;
    min-width:calc((100% - 48px)/5)!important;
    max-width:calc((100% - 48px)/5)!important;
    box-sizing:border-box!important;
    align-self:stretch!important;
    scroll-snap-align:start!important;
    border:1px solid #d3e4e8!important;
    border-radius:13px!important;
    background:#fff!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-product{
    display:flex!important;
    flex-direction:column!important;
    padding:11px!important;
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-product > a{display:block!important;width:100%!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-product-main{display:flex!important;flex-direction:column!important;align-items:center!important;text-align:center!important;gap:7px!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-product-main img,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-product img{
    display:block!important;width:82px!important;height:82px!important;max-width:82px!important;max-height:82px!important;object-fit:contain!important;margin:0 auto 5px!important
  }

  /* Sources do not interfere with the equal four-card row. */
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-v16-modules > .dhm-sync-sources{
    order:60!important;
    grid-column:span 1!important;
    margin:0!important;
  }
}

@media (min-width:900px) and (max-width:1179px){
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products{display:flex!important;flex-flow:row nowrap!important;gap:10px!important;overflow-x:auto!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid > .dhm-sync-product,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products > *{flex:0 0 calc((100% - 20px)/3)!important;min-width:calc((100% - 20px)/3)!important;max-width:calc((100% - 20px)/3)!important}
}

@media (max-width:899px){
  /* Keep the approved mobile reading flow. */
  body[class*="single-dhms_"] .dhm-v26-more{display:none!important}
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products{
    display:flex!important;flex-flow:row nowrap!important;gap:10px!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory!important
  }
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-sync-products-grid > .dhm-sync-product,
  body[class*="single-dhms_"] .dhm-v22-refine .dhm-related-products > *{
    flex:0 0 78vw!important;width:78vw!important;min-width:78vw!important;max-width:78vw!important;scroll-snap-align:center!important
  }
  /* One working action only. */
  body[class*="single-dhms_"] .dhm-v25-products-only.dhm-v19-mobile-actions{display:block!important}
  body[class*="single-dhms_"] .dhm-v25-products-only .dhm-v19-products{display:flex!important}
  body[class*="single-dhms_"] .dhm-v25-products-only .dhm-v19-save,
  body[class*="single-dhms_"] .dhm-v25-products-only .dhm-v19-round{display:none!important}
}
