/*
|--------------------------------------------------------------------------
| CGEI Website: Responsive Styles
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Desktop layout
|--------------------------------------------------------------------------
*/

@media (min-width: 1151px) {

    /*
    |--------------------------------------------------------------------------
    | Header and logo
    |--------------------------------------------------------------------------
    */

    .header-container {
        min-height: 155px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .site-logo {
        display: flex;
        flex: 0 0 205px;
        align-items: center;
        justify-content: center;
        width: 205px;
        min-height: 135px;
        padding: 0;
        overflow: hidden;
    }

    .site-logo img {
        display: block;
        width: 178px;
        max-width: 178px;
        height: auto;
        max-height: 126px;
        object-fit: contain;
        transform: none;
    }

    .primary-navigation {
        align-self: center;
        margin-left: 8px;
    }

    .navigation-list {
        gap: 18px;
    }

    /*
    |--------------------------------------------------------------------------
    | Shared hero: 25% text and 75% image
    |--------------------------------------------------------------------------
    */

    .hero-banner,
    .home-hero,
    .about-hero {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            4px
            minmax(0, 3fr);
        align-items: stretch;
        min-height: 0 !important;
        height: auto !important;
    }

    .hero-text-panel,
    .home-hero .hero-text-panel,
    .about-hero .hero-text-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        min-height: 0 !important;
        height: auto !important;
        padding: 18px 24px;
        overflow: visible;
        background: #ffffff;
    }

    .hero-title {
        margin: 0 0 7px;
        color: #111111;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.3;
        white-space: normal;
    }

    .hero-subtitle {
        margin: 0 0 8px;
        color: #111111;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
    }

    .hero-description {
        width: 100%;
        max-width: 100%;
        margin: 0;
        color: #111111;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 14px;
        line-height: 1.45;
    }

    .hero-divider {
        align-self: stretch;
        width: 3px;
        height: calc(100% - 24px);
        margin: 12px 0;
        background: var(--ceig-orange);
    }

    .hero-image-panel,
    .home-hero .hero-image-panel,
    .about-hero .hero-image-panel {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden;
        background: var(--ceig-deep-blue);
    }

    .hero-image-panel img,
    .home-hero .hero-image-panel img,
    .about-hero .hero-image-panel img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto !important;
        min-height: 0 !important;
        object-fit: contain !important;
        object-position: center;
    }

    /*
    |--------------------------------------------------------------------------
    | Footer
    |--------------------------------------------------------------------------
    */

    .footer-container {
        grid-template-columns:
            minmax(220px, 1fr)
            minmax(190px, 0.85fr)
            4px
            minmax(540px, 2.25fr);
        gap: 36px;
        min-height: 205px;
    }

    .footer-logo-wrapper {
        display: flex;
        flex: 0 0 185px;
        align-items: center;
        justify-content: center;
        width: 185px;
        min-height: 150px;
        padding: 0;
        overflow: hidden;
    }

    .footer-logo-wrapper img {
        display: block;
        width: 158px;
        max-width: 158px;
        height: auto;
        max-height: 135px;
        object-fit: contain;
        transform: none;
    }

    .footer-copyright {
        margin-left: 215px;
    }
}

/*
|--------------------------------------------------------------------------
| Standard desktop screens
|--------------------------------------------------------------------------
*/

@media (min-width: 1151px) and (max-width: 1350px) {

    .site-logo {
        flex-basis: 190px;
        width: 190px;
    }

    .site-logo img {
        width: 164px;
        max-width: 164px;
    }

    .primary-navigation {
        margin-left: 5px;
    }

    .navigation-list {
        gap: 13px;
    }

    .navigation-link {
        font-size: 10.5px;
    }

    .hero-text-panel,
    .home-hero .hero-text-panel,
    .about-hero .hero-text-panel {
        padding: 16px 20px;
    }

    .footer-container {
        grid-template-columns:
            minmax(185px, 0.9fr)
            minmax(165px, 0.75fr)
            4px
            minmax(470px, 2fr);
        gap: 26px;
    }

    .footer-logo-wrapper {
        flex-basis: 165px;
        width: 165px;
    }

    .footer-logo-wrapper img {
        width: 142px;
        max-width: 142px;
    }

    .footer-copyright {
        margin-left: 191px;
    }
}

/*
|--------------------------------------------------------------------------
| Tablet navigation
|--------------------------------------------------------------------------
*/

@media (max-width: 1150px) {

    .header-container {
        min-height: 130px;
        padding: 9px 22px;
    }

    .site-logo {
        display: flex;
        flex: 0 0 170px;
        align-items: center;
        justify-content: center;
        width: 170px;
        min-height: 110px;
        padding: 0;
        overflow: hidden;
    }

    .site-logo img {
        display: block;
        width: 148px;
        max-width: 148px;
        height: auto;
        max-height: 102px;
        object-fit: contain;
        transform: none;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .primary-navigation {
        position: absolute;
        top: 100%;
        right: 20px;
        left: 20px;
        z-index: 1000;
        display: none;
        flex-direction: column;
        align-items: stretch;
        margin: 0;
        padding: 14px 20px 18px;
        border-top: 3px solid var(--ceig-orange);
        border-radius: 0 0 10px 10px;
        background: var(--ceig-white);
        box-shadow: 0 10px 24px rgba(0, 18, 53, 0.18);
    }

    .primary-navigation.is-open {
        display: flex;
    }

    .navigation-list {
        display: block;
        width: 100%;
    }

    .navigation-item {
        width: 100%;
        border-bottom: 1px solid var(--ceig-light-grey);
    }

    .navigation-link {
        display: flex;
        width: 100%;
        min-height: 42px;
        font-size: 12px;
    }

    .navigation-link::after {
        display: none;
    }

    .navigation-link.is-active {
        color: var(--ceig-orange);
    }

    .social-navigation {
        justify-content: flex-start;
        margin-top: 15px;
    }

    /*
    |--------------------------------------------------------------------------
    | Tablet hero
    |--------------------------------------------------------------------------
    | The hero stacks because a 25% text column would be too narrow.
    |--------------------------------------------------------------------------
    */

    .hero-banner,
    .home-hero,
    .about-hero {
        display: grid;
        grid-template-columns: 1fr;
        min-height: 0 !important;
        height: auto !important;
    }

    .hero-text-panel,
    .home-hero .hero-text-panel,
    .about-hero .hero-text-panel {
        min-height: 0 !important;
        height: auto !important;
        padding: 18px 24px;
        overflow: visible;
        background: #ffffff;
    }

    .hero-title {
        margin: 0 0 7px;
        color: #111111;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.3;
        white-space: normal;
    }

    .hero-subtitle {
        margin: 0 0 8px;
        color: #111111;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
    }

    .hero-description {
        width: 100%;
        max-width: 100%;
        margin: 0;
        color: #111111;
        font-size: 14px;
        line-height: 1.45;
    }

    .hero-divider {
        width: calc(100% - 48px);
        height: 3px;
        margin: 0 24px;
        background: var(--ceig-orange);
    }

    .hero-image-panel,
    .home-hero .hero-image-panel,
    .about-hero .hero-image-panel {
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden;
        background: var(--ceig-deep-blue);
    }

    .hero-image-panel img,
    .home-hero .hero-image-panel img,
    .about-hero .hero-image-panel img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto !important;
        min-height: 0 !important;
        object-fit: contain !important;
    }

    /*
    |--------------------------------------------------------------------------
    | Cards and footer
    |--------------------------------------------------------------------------
    */

    .principal-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-card:last-child {
        grid-column: 1 / -1;
    }

    .footer-container {
        grid-template-columns:
            minmax(170px, 1fr)
            minmax(160px, 1fr)
            3px
            minmax(350px, 1.8fr);
        gap: 24px;
    }

    .footer-logo-wrapper {
        flex: 0 0 150px;
        width: 150px;
        min-height: 120px;
        padding: 0;
        overflow: hidden;
    }

    .footer-logo-wrapper img {
        width: 128px;
        max-width: 128px;
        height: auto;
        max-height: 108px;
        object-fit: contain;
        transform: none;
    }

    .footer-organisation-name {
        white-space: normal;
    }

    .footer-copyright {
        margin-left: 180px;
    }
}

/*
|--------------------------------------------------------------------------
| Standard tablet layout
|--------------------------------------------------------------------------
*/

@media (max-width: 850px) {

    .ceig-lens-section {
        padding-right: 20px;
        padding-left: 20px;
    }

    .ceig-lens-image img {
        width: min(680px, 90%);
    }

    .principal-services {
        grid-template-columns: 1fr;
    }

    .service-card:last-child {
        grid-column: auto;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 28px 40px;
    }

    .footer-divider {
        display: none;
    }

    .footer-identity {
        grid-column: 1 / -1;
        padding-top: 18px;
        border-top: 2px solid var(--ceig-orange);
    }

    .footer-logo-wrapper {
        flex-basis: 130px;
        width: 130px;
    }

    .footer-logo-wrapper img {
        width: 112px;
        max-width: 112px;
    }

    .footer-organisation-name {
        white-space: nowrap;
    }

    .footer-copyright {
        margin-left: 160px;
    }
}

/*
|--------------------------------------------------------------------------
| Mobile devices
|--------------------------------------------------------------------------
*/

@media (max-width: 600px) {

    :root {
        --page-spacing: 14px;
        --body-font-size: 13px;
    }

    .header-container {
        min-height: 108px;
        padding: 7px 14px;
    }

    .site-logo {
        display: flex;
        flex: 0 0 135px;
        align-items: center;
        justify-content: center;
        width: 135px;
        min-height: 92px;
        padding: 0;
        overflow: hidden;
    }

    .site-logo img {
        display: block;
        width: 118px;
        max-width: 118px;
        height: auto;
        max-height: 82px;
        object-fit: contain;
        transform: none;
    }

    .primary-navigation {
        right: 14px;
        left: 14px;
    }

    .hero-banner,
    .home-hero,
    .about-hero {
        width: calc(100% - 28px);
        min-height: 0 !important;
        height: auto !important;
        margin-right: 14px;
        margin-left: 14px;
        border-radius: 8px;
    }

    .hero-text-panel,
    .home-hero .hero-text-panel,
    .about-hero .hero-text-panel {
        min-height: 0 !important;
        height: auto !important;
        padding: 16px 18px;
    }

    .hero-title {
        margin-bottom: 7px;
        font-size: 16px;
        line-height: 1.3;
    }

    .hero-subtitle {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .hero-description {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
        line-height: 1.45;
    }

    .hero-divider {
        width: calc(100% - 36px);
        height: 3px;
        margin: 0 18px;
    }

    .hero-image-panel,
    .home-hero .hero-image-panel,
    .about-hero .hero-image-panel {
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
    }

    .hero-image-panel img,
    .home-hero .hero-image-panel img,
    .about-hero .hero-image-panel img {
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        object-fit: contain !important;
    }

    .ceig-lens-section {
        width: calc(100% - 28px);
        padding: 12px 6px 10px;
    }

    .ceig-lens-heading {
        margin-bottom: 7px;
        font-size: 16px;
    }

    .ceig-lens-image img {
        width: 100%;
        max-height: 170px;
    }

    .ceig-lens-content p {
        font-size: 13px;
        line-height: 1.55;
        text-align: left;
    }

    .principal-services {
        width: calc(100% - 28px);
        gap: 12px;
        margin-bottom: 14px;
    }

    .service-card {
        min-height: 160px;
        border-radius: 8px;
    }

    .service-card-content {
        padding: 17px 19px 14px;
    }

    .service-card h2 {
        font-size: 14px;
    }

    .service-card p {
        max-width: 100%;
        font-size: 12.5px;
    }

    .service-card-with-image {
        grid-template-columns: minmax(0, 1fr) 110px;
    }

    .service-card-image {
        padding-right: 10px;
    }

    .service-card-image img {
        width: 95px;
        max-height: 125px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 20px;
    }

    .footer-identity {
        grid-column: auto;
    }

    .footer-brand {
        gap: 16px;
    }

    .footer-logo-wrapper {
        flex: 0 0 120px;
        width: 120px;
        min-height: 100px;
        padding: 0;
        overflow: hidden;
    }

    .footer-logo-wrapper img {
        width: 104px;
        max-width: 104px;
        height: auto;
        max-height: 90px;
        object-fit: contain;
        transform: none;
    }

    .footer-organisation-name {
        font-size: 16px;
        white-space: normal;
    }

    .footer-copyright {
        margin: 10px 0 0;
        font-size: 11px;
    }
}

/*
|--------------------------------------------------------------------------
| Very small mobile devices
|--------------------------------------------------------------------------
*/

@media (max-width: 390px) {

    .hero-text-panel,
    .home-hero .hero-text-panel,
    .about-hero .hero-text-panel {
        padding-right: 14px;
        padding-left: 14px;
    }

    .service-card-with-image {
        grid-template-columns: 1fr;
    }

    .service-card-image {
        justify-content: flex-start;
        padding: 0 19px 15px;
    }

    .service-card-image img {
        width: 90px;
    }

    .footer-brand {
        align-items: flex-start;
    }

    .footer-logo-wrapper {
        flex-basis: 105px;
        width: 105px;
    }

    .footer-logo-wrapper img {
        width: 92px;
        max-width: 92px;
    }
}