/*
============================================================
 BHPE Foundation Layer V1.2.0-RC2

 Responsibility:
 - Joomla template compatibility
 - Container normalization
 - Full bleed foundation
 - Browser-safe foundation

 Forbidden:
 - Brand colors
 - Typography system
 - Component design
 - Animation

 History:
 - V1.1.1 Existing Foundation Layer
 - V1.2.0-RC1 Full Bleed Template Compatibility
 - V1.2.0-RC2 Full Bleed padding and horizontal compensation refinement

============================================================
*/


/*
============================================================
 F-001
 Joomla Template Container Override

 !important allowed:
 Joomla template conflict resolution only.
============================================================
*/


body.bhpe-active #s5_body_padding,
body.bhpe-active #s5_body_padding2,
body.bhpe-active .s5_inner_padding,
body.bhpe-active #s5_center_area1,
body.bhpe-active #s5_center_area2,
body.bhpe-active #s5_columns_wrap,
body.bhpe-active #s5_component_wrap,
body.bhpe-active main,
body.bhpe-active .container,
body.bhpe-active .container-fluid,
body.bhpe-active .com-content-article,
body.bhpe-active .com-content-article__body,
body.bhpe-active .item-page {

    width:100% !important;

    max-width:none !important;

    margin-left:0 !important;

    margin-right:0 !important;

    padding-left:0 !important;

    padding-right:0 !important;

}


/*
============================================================
 F-002
 BHPE Runtime Root Foundation
============================================================
*/


[data-ieera-runtime-page="true"] {

    position:relative;

    display:block;

    width:100%;

}


/*
============================================================
 F-003
 Universal Box Model
============================================================
*/


[data-ieera-runtime-page="true"],
[data-ieera-runtime-page="true"] *,
[data-ieera-runtime-page="true"] *::before,
[data-ieera-runtime-page="true"] *::after {

    box-sizing:border-box;

}


/*
============================================================
 F-004
 Media Safety
============================================================
*/


[data-ieera-runtime-page="true"] img,
[data-ieera-runtime-page="true"] svg,
[data-ieera-runtime-page="true"] video {

    max-width:100%;

    height:auto;

}


/*
============================================================
 F-005
 Full Bleed Capability

 NOTE:
 AI pages MUST NOT manually add this class.
 PHP Runtime may assign:
 data-bh-full-bleed="true"

============================================================
*/


[data-bh-full-bleed="true"] {

    width:100vw;

    max-width:100vw;

    margin-left:calc(50% - 50vw);

    overflow-x:clip;

}


/*
 BHPE Foundation Layer V1.2.0-RC1
 Full Bleed Template Compatibility Override

 Anchored on body.bhpe-active (BHPE runtime entry).
 Supports both states:
 - data-bh-full-bleed="true"  (PHP state)
 - .bhpe-full-bleed-active    (Runtime state)

 !important is required here because some Joomla templates
 (e.g. IEERA University) enforce a content max-width with
 !important. This rule only widens physical space.
*/


html body.bhpe-active [data-ieera-runtime-page="true"][data-bh-runtime-required="true"][data-bh-full-bleed="true"],
html body.bhpe-active [data-ieera-runtime-page="true"][data-bh-runtime-required="true"].bhpe-full-bleed-active {

    width:100vw !important;

    max-width:100vw !important;

    margin-left:calc(50% - 50vw) !important;

    margin-right:calc(50% - 50vw) !important;

    padding-left:0 !important;

    padding-right:0 !important;

}


/*
============================================================
 F-006
 Global Horizontal Overflow Protection

 Foundation level only.
============================================================
*/


html,
body {

    max-width:100%;

    overflow-x:hidden;

}