:root {
    --bg-light: #08b9b9;
    --bg-main: #016171;
    --bg-dark: #00101f;
    --icon-color: var(--bg-light);
    --gap-body: 24px;
    --gap-content: 12px;
    --fs-content: 24px;
    --fs-menu: 20px;
    --logo-size: 64px;
}

* {
    box-sizing: border-box;
    /* word-break: break-all; */
}

html,
body {
    min-height: 100vh;
    width: 100%;
    margin: 0px;
    padding: 0px;
}

@media (max-width: 375px) { /* 374x812px iPhoneX landscape*/
    :root {
       --fs-content: 16px;
       --fs-menu: 10px;
    }
    /* * {color:red !important;} */
}
/* @media (max-width: 1304px) {
    body>div {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
} */

body {
    display: flex;
    flex-direction: column;
    gap: 24px;

    &>div:nth-last-of-type(2) {
        /* background-color: red; */
        flex: 1;
    }
}

/* body>div:nth-last-of-type(2) {
    background-color: red !important;
} */

a {
    color: inherit;
    text-decoration: inherit;
}

h1 {
    font-size: calc(var(--fs-content) * 1.5);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--bg-main);

    &+h2:nth-child(n+2) {
        margin-top: 0;
    }
}

h2 {
    font-size: calc(var(--fs-content) * 1.15); /* 28px;*/
    font-weight: 500;
    text-transform: uppercase;
    color: var(--bg-main);
    margin-top: 0;
    margin-bottom: 24px;

    &:nth-child(n+2) {
        margin-top: 24px;
    }
}

.content {
    /* max-width: 1366px; */
    /* max-width: 1280px; */
    max-width: 1304px;
    padding-left: var(--gap-content);
    padding-right: var(--gap-content);
    width: 100%;
    /* padding-right: .75rem; */
    /* padding-left: .75rem; */
    margin-right: auto;
    margin-left: auto;
}

.topmenu {
    background-color: var(--bg-main, darkcyan);
    padding: 6px 0;

    & .menu {
        display: flex;
        gap: 24px;
        align-items: center;
        text-transform: uppercase;
        color: white;
        /* --logo-size: 80px; */

        & .logo {
            min-height: var(--logo-size);
            min-width: var(--logo-size);
            background-color: white;
            border-radius: calc(var(--logo-size) / 5);;
            overflow: hidden;
            background-image: url('/images/logo.png');
            background-size: contain;
            background-size: calc(var(--logo-size) * 0.8);
            background-repeat: no-repeat;
            background-position: center;
        }

        &>* {
            cursor: pointer;
            font-size: var(--fs-menu);
            font-weight: 300;
            padding: 6px 0;
        }
        &>a.active {
            font-weight: 500;
            border-bottom: 2px solid white;
            /* text-decoration: underline; */
        }
    }
}

.bottommenu {
    background-color: var(--bg-dark);
    padding: 6px 0;
    position: sticky;

    & .menu {

        display: flex;
        gap: 24px;
        align-items: center;
        text-transform: uppercase;
        color: white;

        & .logo {
            height: 80px;
            width: 80px;
            background-color: white;
            border-radius: 12px;
            overflow: hidden;
            background-image: url('/images/logo.png');
            background-size: contain;
            background-size: 68px;
            background-repeat: no-repeat;
            background-position: center;
        }

        &>*:nth-last-child(2) {
            flex: 1;
        }
    }
}

.flex-1 {
    --flex-col: 1;
}

.flex-2 {
    --flex-col: 2;
}

.flex-3,
.flex-2-1,
.flex-1-2 {
    --flex-col: 3;
}

.flex-4 {
    --flex-col: 4;
}

.flex-1,
.flex-2,
.flex-3,
.flex-4,
.flex-2-1,
.flex-1-2 {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-content);

    &>* {
        --flex-width: calc((100% - var(--gap-content) * (var(--flex-col) - 1)) / var(--flex-col));
        flex-basis: var(--flex-width) !important;
        max-width: var(--flex-width);
        overflow: hidden;
    }
}

.flex-2-1 {
    &>*:nth-child(odd) {
        flex-grow: 2;
        max-width: calc(var(--flex-width) * 2);
    }
}

.flex-1-2 {
    &>*:nth-child(even) {
        flex-grow: 2;
        max-width: calc(var(--flex-width) * 2);
    }
}

.main,
.about {
    display: flex;
    flex-direction: column;
    gap: var(--gap-body);
    font-size: var(--fs-content);

    & a {
        color: var(--bg-main);
        font-weight: 500;
    }

    &>div {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--gap-content);

        /**
        * Устанавливаем ширину FLEX блоков в зависимости от их количества в контейнере 
        * 3 - 33%
        * 2 и больше 3-х - 50% с переносом
        */

        &:has(> *:nth-child(3):last-child)>*,
        &.column3:has(> *:nth-child(3))>*,
        &.flex-3:has(> *:nth-child(3))>* {
            max-width: calc(33.333% - var(--gap-content)*2/3);
            flex-basis: calc(33.333% - var(--gap-content)*2/3);
            
        }

        &.flex-4:has(> *:nth-child(3))>* {
            --flex-col: 4;
            flex-basis: calc((100% - var(--gap-content) * (var(--flex-col) - 1)) / var(--flex-col));
            min-height: 480px;
        }

        &.flex-2:has(> *:nth-child(2))>*,
        &:has(> *:nth-child(2):last-child)>*,
        &:has(> *:nth-child(4))>* {
            flex-basis: calc(50% - var(--gap-content)/2);
        }

        &>*:only-child {
            flex-basis: 100%;
        }

        &>div {
            display: flex;
            flex-direction: column;
            gap: var(--gap-content);
            /* min-height: 300px; */
            /* font-size: 24px; */

            /* text-align: justify; */
            &>h2 {
                margin: 0;
            }
        }
    }
}

.work {
    font-size: var(--fs-content);

    & h1 {
        margin-top: 0;
    }

    &>div {
        margin-bottom: calc(var(--gap-body)*2);
    }

    &>div:last-child {
        margin-bottom: 0;
    }
}

.img {
    border-radius: 24px;
    overflow: hidden;
    background-color: azure;
    border: 1px solid lightgray;
    min-height: 300px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.slider {
    position: relative;
    width: 100%;
    height: 560px;

    &>span {
        position: absolute;
        right: 48px;
        padding-left:48px;
        bottom: 40px;
        font-size: calc(var(--fs-content) * 2.5); /* 64px */
        font-weight: 500;
        text-align: right;
    }
}

div:has(> * > .about_logo) {

    /* background-color: #08b9b9; */
    &>div {
        flex-basis: calc(33.333% - var(--gap-content)*2/3);
    }
}

div:has(> .about_logo) {
    padding: 12px 0px;
    border-radius: 24px;
    border: 1px solid lightgray;
    background-color: var(--bg-color, white);
    color: var(--text-color, inherit);
}

.about_logo {
    background-image: var(--bg-logo);
    /* background-color: red; */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 128px;
    margin: 0 24px;
    /* min-height: 128px; */
    /* flex-basis: 128px; */
    +div {
        text-align: center;
        vertical-align: middle;
        flex: 1;
        overflow: hidden;
        margin: 0 6px;
        /* line-height: 100%; */
    }
}

.ul {
    display: flex;
    column-gap: var(--gap-content);
    row-gap: calc(var(--gap-content) * 2);

    &>div {
        display: flex;
        flex-direction: row !important;
        gap: var(--gap-content);
        align-items: center;

        &>div:first-child {
            flex-basis: 48px;
            /* min-height: 70px;
        background-position-y: 6px; */
            margin: 12px;
            height: 64px;
            min-width: 48px;
            background-position-y: center;
            background-position-x: center;
            background-repeat: no-repeat;
            background-size: contain;
            position: relative;
        }

        &>div:last-child {
            flex-basis: calc(100% - var(--gap-content) - 64px);
            position: relative;

            &::before {
                border-radius: 4px;
                content: '';
                position: absolute;
                left: -12px;
                top: 50%;
                /* bottom: 0; */
                transform: translateY(-50%);
                width: 4px;
                min-width: 4px;
                min-height: 88px;
                height: 100%;
                background-color: var(--bg-light);
            }
        }
    }

}