@import "base/layout.css";
@import "fonts/font.css";
@import "components/modal.css";

.global-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: #ffffff;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
}
.top-menu {
    display: flex;
    gap: 46px;
    padding: 0 70px;
    position: relative;
    z-index: 50;
    & .top-menu__logo {
        margin-bottom: -10px;
        & img {
            width: 140px;
            height: 70px;
        }
    }
    & .menu__list {
        display: flex;
        align-items: stretch;
        gap: 15px 32px;
        flex-wrap: wrap;
        & .menu__list-item {
            display: flex;
            align-items: center;
            font-size: 20px;
            line-height: 24px;
            font-weight: bold;
            color: #000;
            text-decoration: none;
            position: relative;
            transition: 200ms;
            &:is(:hover) {
                color: #00000091;
            } &:is(:active) {
                color: #ddd;
            }
            &:is(:focus-visible) {
                color: #8098a7;
            }
            &::after {
                --active-line: #adafa7;
                content: '';
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 2px;
                background: var(--active-line);
                transform: scaleX(0);
                transform-origin: center;
                transition: transform 400ms ease, background-color 400ms ease;
            }
            &:hover::after {
                transform: scaleX(1);
            }
            &.is-active::after {
                --active-line: #756157;
                transform: scaleX(1);
            }
        }
    }
    & .top-menu__action {
        display: flex;
        align-items: center;
        gap: 30px;
        margin-left: auto;
        min-width: 252px;
        & .icon {
            --icon-size: 18px;
        }
        & .top-menu__action-items {
            display: flex;
            align-items: center;
            gap: 26px;
            & .top-menu__action-search {}
            & .top-menu__action-favorite {
                position: relative;
                .favorite-count {
                    --size: 20px;
                    --font-ratio: 1.6667;
                    --position: -10px;
                    position: absolute;
                    top: var(--position);
                    right: var(--position);
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    width: var(--size);
                    height: var(--size);
                    color: #ffffff;
                    background: #7DB54F;
                    border-radius: 100%;
                    font-size: calc(var(--size) / var(--font-ratio));
                    line-height: 10px;
                    font-weight: 400;
                }
                & .icon {
                    cursor: pointer;
                }
            }
        }

        & .top-menu__action-button {
            max-width: 160px;
        }
    }
}

.callback-form__container {
    position: relative;
    padding: 97px 0 105px;
    background-image: url(../images/subscribe.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    & .p__heading {
        position: relative;
        text-align: center;
        max-width: 475px;
        margin: 0 auto 54px;
        .title {
            text-transform: uppercase;
            color: #ffffff;
            margin-bottom: 20px;
        }
        .sub {
            font-size: 22px;
            line-height: 26px;
            font-weight: 400;
            color: #ffffff;
        }
    }
    .callback-form {
        position: relative;
        & .form {
            display: flex;
            max-width: 684px;
            margin: 0 auto;
            & .form__input {
                flex-grow: 1;
                min-width: 0;
                background: #f2f2f2;
                border: none;
                border-radius: 4px 0 0 4px;
                padding: 14px 22px;
                font-family: inherit;
                font-size: 18px;
                line-height: 24px;
                color: #000;
                transition: background 200ms ease;
                outline: none;
                &::placeholder {
                    color: rgba(0, 0, 0, 0.6);
                }
                &:is(:hover) {
                    background: #e6e6e6;
                }
                &:is(:focus-visible) {
                   /* outline: 3px solid #83b3d3;
                    outline-offset: -3px; */
                }
            }
            & .form__button {
                --bg: #83b3d3;
                --padding: 8px 50px;
                --font-size: 20px;
                --line-height: 36px;
                border: none;
                border-radius: 0 4px 4px 0;
                justify-content: center;
            }
        }
    }
    &.light {
        background-image: none;
        background-color: #ffffff;
        padding-top: 105px;
        & .p__heading {
            margin-bottom: 57px;
            .title {
                color: #000000;
            }
            .sub {
                color: #333333;
            }
        }
    }
}

.footer {
    padding: 45px 70px 45px 81px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 41px;
    & .socials {
        display: flex;
        gap: 0 28px;
        align-items: center;
        /* фиксированная колонка: иконки прижаты влево, а телефон
           в средней колонке встаёт на макетную позицию */
        width: 132px;
        flex-wrap: wrap;
        .socials__link {
            --icon-color: #83B3D3;
            text-decoration: none;
            transition: 200ms;
            .icon {
                --icon-size: 21px;
                fill: var(--icon-color);
            }
            &:is(:hover) {
                .icon{
                    fill: color-mix(in srgb, var(--icon-color) 90%, #000);
                }
            }
            &:is(:active) {
                .icon{
                    fill: color-mix(in srgb, var(--icon-color) 80%, #000);
                }
            }
        }
    }
    & .phone__box {
        display: flex;
        justify-content: center;
        flex-direction: column;
        flex-wrap: wrap;
        .phone {
            text-decoration: none;
            text-align: center;
            font-size: 40px;
            line-height: 1em;
            font-weight: 400;
            color: #000000;
            transition: 200ms;
            &:hover {
                color: #756157;
            }
            &:active {
                color: #756157;
                opacity: 0.3;
            }
        }
    }

    & .logo-htmlAcademy {
        --icon-color: #000000;
        --icon-color-hover: #756157;
        --icon-color-active: rgba(117, 97, 87, 0.3);
        display: flex;
        text-decoration: none;

        & .icon {
            /* размеры прежнего PNG-логотипа, совпадают с viewBox спрайта */
            width: 115px;
            height: 33px;
            fill: var(--icon-color);
            transition: fill 200ms;
        }
        &:is(:hover) {
            --icon-color: var(--icon-color-hover);
        }
        /* фокус браузерный: обводку не переопределяем, меняем только цвет */
        &:is(:focus-visible) {
            --icon-color: var(--icon-color-hover);
        }
        &:is(:active) {
            --icon-color: var(--icon-color-active);
        }
    }
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
