/* Media presentation corrections for mixed photography, product screenshots and diagrams. */

/* ERMS flagship: never force photography into an invented aspect ratio. Let the source
   image establish its own height so faces, screens and maps are not cropped or enlarged. */
.erms-hero__visual{
    aspect-ratio:auto!important;
}
.erms-hero__visual img{
    display:block;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
}
.erms-field figure{
    min-height:0!important;
    aspect-ratio:auto!important;
    align-self:start;
    background:#eef1f2;
}
.erms-field figure img{
    display:block;
    width:100%!important;
    height:auto!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
}
.erms-intelligence figure{
    aspect-ratio:auto!important;
    align-self:center;
    background:#0c1822;
}
.erms-intelligence figure img{
    display:block;
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
}
.erms-tour-grid img{
    display:block;
    width:100%;
    aspect-ratio:16 / 10;
    object-fit:contain!important;
    object-position:center!important;
    padding:10px;
    background:#0d1a24;
}

/* Shared module cards: photographs may crop, interface captures and SVG diagrams must not. */
.hs-module-entry__media img{
    display:block;
    object-position:center 44%;
}
.hs-module-entry__media img[src*=".svg"]{
    width:100%;
    height:100%;
    object-fit:contain!important;
    object-position:center!important;
    padding:24px;
    background:#f4f5f2;
    filter:none!important;
    transform:none!important;
}
.hs-module-entry:hover .hs-module-entry__media img[src*=".svg"]{
    transform:none!important;
    filter:none!important;
}

/* Dashboard analysis modes use square SVG artwork. Keep the artwork itself square and
   centered instead of stretching its img box across the full card width. */
.hs-module-editorial--analytics-modes .hs-module-entry__media--icon{
    height:210px;
    display:grid;
    place-items:center;
    padding:26px;
    background:linear-gradient(180deg,#f2f3f1 0%,#e8ebe8 100%);
}
.hs-module-editorial--analytics-modes .hs-module-entry__media--icon::after{
    display:none;
}
.hs-module-editorial--analytics-modes .hs-module-entry__media--icon img{
    width:136px!important;
    height:136px!important;
    max-width:48%!important;
    max-height:100%!important;
    aspect-ratio:1 / 1!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
    filter:none!important;
    transform:none!important;
}
.hs-module-editorial--analytics-modes .hs-module-entry:hover .hs-module-entry__media--icon img{
    transform:none!important;
    filter:none!important;
}

/* NGO evidence flow: keep all three cards on one visual baseline while preserving
   the different media types. The field card is a photo, GIS is a square icon and
   Analytics is a landscape dashboard illustration. */
.hs-module-editorial--evidence-flow .hs-module-entry__media{
    height:205px;
    overflow:hidden;
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--photo{
    padding:0;
    background:#e9ece9;
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--photo img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
    object-position:center 46%!important;
    padding:0!important;
    margin:0!important;
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--map-icon,
.hs-module-editorial--evidence-flow .hs-module-entry__media--dashboard-icon{
    display:grid;
    place-items:center;
    padding:22px 28px;
    background:linear-gradient(180deg,#f5f6f4 0%,#e9ece9 100%);
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--map-icon::after,
.hs-module-editorial--evidence-flow .hs-module-entry__media--dashboard-icon::after{
    display:none;
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--map-icon img{
    width:132px!important;
    height:132px!important;
    max-width:42%!important;
    max-height:100%!important;
    aspect-ratio:1 / 1!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
}
.hs-module-editorial--evidence-flow .hs-module-entry__media--dashboard-icon img{
    width:min(250px,74%)!important;
    height:auto!important;
    max-height:154px!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
}
.hs-module-editorial--evidence-flow .hs-module-entry:hover .hs-module-entry__media img{
    transform:none!important;
    filter:none!important;
}

/* Government internal operations: ERMS is a product screen, Analytics is a landscape
   illustration and GIS is a square icon. Align all three on the same visual baseline. */
.hs-module-editorial--government-ops .hs-module-entry__media{
    height:205px;
    display:grid;
    place-items:center;
    overflow:hidden;
    padding:22px 28px;
    background:linear-gradient(180deg,#f5f6f4 0%,#e9ece9 100%);
}
.hs-module-editorial--government-ops .hs-module-entry__media::after{
    display:none;
}
.hs-module-editorial--government-ops .hs-module-entry__media--screen img{
    width:min(330px,88%)!important;
    height:auto!important;
    max-height:166px!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
    filter:none!important;
    transform:none!important;
}
.hs-module-editorial--government-ops .hs-module-entry__media--dashboard-icon img{
    width:min(250px,74%)!important;
    height:auto!important;
    max-height:154px!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
    filter:none!important;
    transform:none!important;
}
.hs-module-editorial--government-ops .hs-module-entry__media--map-icon img{
    width:132px!important;
    height:132px!important;
    max-width:42%!important;
    max-height:100%!important;
    aspect-ratio:1 / 1!important;
    object-fit:contain!important;
    object-position:center!important;
    padding:0!important;
    margin:0!important;
    background:transparent!important;
    filter:none!important;
    transform:none!important;
}
.hs-module-editorial--government-ops .hs-module-entry:hover .hs-module-entry__media img{
    transform:none!important;
    filter:none!important;
}

.hs-module-entry__media img[src*="ProgramProjects.png"],
.hs-module-entry__media img[src*="Finance.png"],
.hs-module-entry__media img[src*="Compliance.png"],
.hs-module-entry__media img[src*="DocumentManagement.png"]{
    width:100%;
    height:100%;
    object-fit:contain!important;
    object-position:center!important;
    padding:12px;
    background:#eef1f2;
    filter:none!important;
    transform:none!important;
}
.hs-module-entry:hover .hs-module-entry__media img[src*="ProgramProjects.png"],
.hs-module-entry:hover .hs-module-entry__media img[src*="Finance.png"],
.hs-module-entry:hover .hs-module-entry__media img[src*="Compliance.png"],
.hs-module-entry:hover .hs-module-entry__media img[src*="DocumentManagement.png"]{
    transform:none!important;
    filter:none!important;
}
.hs-module-entry__media img[src*="field-sync-banner.jpg"]{
    object-fit:cover!important;
    object-position:46% 44%!important;
    padding:0!important;
}

/* Insights: the feed itself must be the 12-column grid expected by the card rules. */
.hs-resource-feed{
    display:grid;
    grid-template-columns:repeat(12,minmax(0,1fr));
    gap:16px;
}
.hs-resource-card__media img{
    object-position:center 42%!important;
}
.hs-resource-card:first-child .hs-resource-card__media img{
    object-position:center 38%!important;
}
.hs-resource-card:nth-child(2) .hs-resource-card__media img{
    object-position:42% 46%!important;
}
.hs-resource-card:nth-child(3) .hs-resource-card__media img{
    object-position:55% 42%!important;
}
.hs-resource-card:hover .hs-resource-card__media img{
    transform:scale(1.012)!important;
}

/* Keep resource feeds readable when only one card is returned asynchronously. */
.hs-resource-feed>.hs-resource-empty,
.hs-resource-feed>.hs-resource-load-error,
.hs-resource-feed>.hs-resource-skeleton{
    grid-column:1/-1;
}

@media(max-width:1100px){
    .erms-hero__visual,
    .erms-field figure,
    .erms-intelligence figure{aspect-ratio:auto!important}
}

@media(max-width:980px){
    .hs-resource-feed{grid-template-columns:1fr}
    .hs-resource-feed>.hs-resource-card,
    .hs-resource-feed>.hs-resource-card:first-child,
    .hs-resource-feed>.hs-resource-skeleton{
        grid-column:1!important;
    }
}

@media(max-width:720px){
    .erms-hero__visual,
    .erms-field figure,
    .erms-intelligence figure{aspect-ratio:auto!important}
    .erms-hero__visual img,
    .erms-field figure img,
    .erms-intelligence figure img{
        width:100%!important;
        height:auto!important;
        object-fit:contain!important;
        object-position:center!important;
    }
    .hs-module-entry__media img[src*=".svg"]{padding:18px}
    .hs-module-editorial--analytics-modes .hs-module-entry__media--icon{
        height:180px;
        padding:22px;
    }
    .hs-module-editorial--analytics-modes .hs-module-entry__media--icon img{
        width:116px!important;
        height:116px!important;
        max-width:42%!important;
        padding:0!important;
    }
    .hs-module-editorial--evidence-flow .hs-module-entry__media,
    .hs-module-editorial--government-ops .hs-module-entry__media{
        height:190px;
    }
    .hs-module-editorial--evidence-flow .hs-module-entry__media--map-icon img,
    .hs-module-editorial--government-ops .hs-module-entry__media--map-icon img{
        width:116px!important;
        height:116px!important;
    }
    .hs-module-editorial--evidence-flow .hs-module-entry__media--dashboard-icon img,
    .hs-module-editorial--government-ops .hs-module-entry__media--dashboard-icon img{
        width:min(230px,76%)!important;
        max-height:142px!important;
    }
    .hs-module-editorial--government-ops .hs-module-entry__media--screen img{
        width:min(300px,88%)!important;
        max-height:150px!important;
    }
}
