/**
 * Mission Block Styles
 * Блок "Наша місія" - текст + зображення
 * Базується на Tilda дизайні (ABSOLUTE позиціонування)
 * 
 * @package MyFood
 * @since 1.0
 */

/* ==========================================================================
   BASE BLOCK STYLES (як Tilda t396__artboard)
   ========================================================================== */

.block-mission {
    position: relative;
    width: 100%;
    height: 760px;
    background-color: #ffffff;
    overflow: hidden;
}

/* Container (як grid) */
.block-mission .container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

/* Wrapper */
.mission__wrapper {
    position: relative;
    height: 100%;
}

/* ==========================================================================
   DECORATIVE IMAGE (перчик зліва, z-index:2)
   ========================================================================== */

.mission__deco {
    position: absolute;
    z-index: 2;
    top: 26px;
    left: calc(50% - 600px + -122px);
    width: 249px;
    height: 202px;
}

.mission__deco-img {
    width: 100%;
    height: auto;
    display: block;
    background-position: center center;
    background-size: cover;
}

/* ==========================================================================
   WHITE CARD (білий блок з тінню ПІД текстом, z-index:8)
   ========================================================================== */

.mission__white-card {
    position: absolute;
    z-index: 8;
    top: 182px;
    left: calc(50% - 600px + 31px);
    width: 746px;
    height: 392px;
    border-radius: 25px;
    background-color: #ffffff;
    box-shadow: 0px 10px 50px 0px rgba(0,0,0,0.1);
}

/* ==========================================================================
   TEXT CONTENT (ліворуч, z-index:11-12)
   ========================================================================== */

.mission__content {
    position: absolute;
    z-index: 11;
    top: 219px;
    left: calc(50% - 600px + 79px);
}

/* Заголовок (z-index:11) */
.mission__title {
    color: #3a3d4e;
    font-size: 24px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 1.55;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0 0 41px;
    width: 500px;
}

/* Текст місії (z-index:12 - найвище!) */
.mission__text {
    position: absolute;
    z-index: 12;
    top: 41px; /* 260px - 219px = 41px offset від заголовка */
    left: 0;
    color: #000000;
    font-size: 16px;
    font-family: 'Gilroy', Arial, sans-serif;
    line-height: 2;
    font-weight: 400;
    margin: 0;
    width: 660px;
}

/* Параграфи */
.mission__text p {
    margin: 0 0 16px;
}

.mission__text p:last-child {
    margin-bottom: 0;
}

/* Bold текст */
.mission__text strong,
.mission__text b {
    font-weight: 600;
    color: #3a3d4e;
}

/* Italic текст */
.mission__text em,
.mission__text i {
    font-style: italic;
}

/* Посилання */
.mission__text a {
    color: #ff8562;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.mission__text a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Списки */
.mission__text ul,
.mission__text ol {
    margin: 0 0 16px;
    padding-left: 30px;
}

.mission__text li {
    margin-bottom: 8px;
}

/* ==========================================================================
   STATIC IMAGE (праворуч, z-index:1 - найнижче)
   ========================================================================== */

.mission__image-wrapper {
    position: absolute;
    z-index: 1;
    top: 71px;
    left: calc(50% - 600px + 332px);
    width: 849px;
    height: 587px;
}

/* Image container */
.mission__image {
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #fff705; /* Fallback колір як в Tilda */
    overflow: hidden;
}

/* Прихований img для SEO та accessibility */
.mission__img {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (як в Tilda)
   ========================================================================== */

/* Tablet Large: <= 1199px */
@media screen and (max-width: 1199px) {
    .block-mission {
        height: 740px;
    }
    
    /* White card (залишається видимим) */
    .mission__white-card {
        top: 77px;
        left: calc(50% - 480px + -1202px); /* ПРИХОВУЄМО за межами екрану */
    }
    
    /* Deco image */
    .mission__deco {
        top: 0;
        left: calc(50% - 480px + -417px); /* ПРИХОВУЄМО за межами екрану */
    }
    
    /* Content */
    .mission__content {
        top: 75px;
        left: calc(50% - 480px + 11px);
    }
    
    /* Title */
    .mission__title {
        width: 500px;
    }
    
    /* Text */
    .mission__text {
        top: 40px; /* 115px - 75px = 40px */
        width: 390px;
    }
    
    /* Image */
    .mission__image-wrapper {
        top: 74px;
        left: calc(50% - 480px + 436px);
        width: 529px;
        height: 366px;
    }
}

/* Tablet: <= 959px */
@media screen and (max-width: 959px) {
    .block-mission {
        height: 830px;
    }
    
    /* White card - ПРИХОВАНИЙ */
    .mission__white-card {
        top: 67px;
        left: calc(50% - 320px + -1202px);
    }
    
    /* Deco image - ПРИХОВАНИЙ */
    .mission__deco {
        top: -10px;
        left: calc(50% - 320px + -417px);
    }
    
    /* Content - ПЕРЕМІЩУЄТЬСЯ ВНИЗ і ЦЕНТРУЄТЬСЯ */
    .mission__content {
        top: 450px;
        left: calc(50% - 320px + 10px);
        text-align: center;
    }
    
    /* Title */
    .mission__title {
        font-size: 45px;
        text-align: center;
        width: auto;
        max-width: 620px;
    }
    
    /* Text */
    .mission__text {
        position: relative;
        top: 0;
        left: 0;
        text-align: center;
        width: 620px;
    }
    
    /* Image - ПЕРЕМІЩУЄТЬСЯ ВГОРУ */
    .mission__image-wrapper {
        top: 132px;
        left: calc(50% - 320px + 116px);
        width: 410px;
        height: 284px;
    }
}

/* Mobile Large: <= 639px */
@media screen and (max-width: 639px) {
    .block-mission {
        height: 1070px;
    }
    
    /* Content */
    .mission__content {
        top: 450px;
        left: calc(50% - 240px + 55px);
    }
    
    /* Title */
    .mission__title {
        font-size: 38px;
        max-width: 370px;
    }
    
    /* Text */
    .mission__text {
        width: 370px;
    }
    
    /* Image */
    .mission__image-wrapper {
        top: 125px;
        left: calc(50% - 240px + 35px);
    }
}

/* Mobile: <= 479px */
@media screen and (max-width: 479px) {
    .block-mission {
        height: 1100px;
    }
    
    /* Content */
    .mission__content {
        top: 395px;
        left: calc(50% - 160px + 10px);
    }
    
    /* Title */
    .mission__title {
        font-size: 26px;
        max-width: 300px;
        margin-bottom: 20px;
    }
    
    /* Text */
    .mission__text {
        width: 300px;
    }
    
    /* Image */
    .mission__image-wrapper {
        top: 87px;
        left: calc(50% - 160px + 10px);
        width: 300px;
        height: 208px;
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS (Google PageSpeed)
   ========================================================================== */

/* CSS Containment для ізоляції (покращує rendering performance) */
.block-mission {
    contain: style;
    content-visibility: auto; /* Lazy rendering для off-screen блоків */
    contain-intrinsic-size: auto 760px; /* Резервний розмір для content-visibility */
}

/* Prevent layout shift (CLS optimization) */
.mission__image {
    aspect-ratio: 849 / 587; /* Резервує простір до завантаження */
    contain-intrinsic-size: 849px 587px; /* Explicit size для content-visibility */
    will-change: transform; /* GPU hint для можливих анімацій */
    transform: translateZ(0); /* Створює окремий GPU layer */
}

.mission__deco-img {
    aspect-ratio: 249 / 202;
}

/* Оптимізація для білого блоку (box-shadow на GPU) */
.mission__white-card {
    will-change: box-shadow;
    transform: translateZ(0); /* GPU layer для тіні */
}

/* Оптимізація для rich text елементів */
.mission__text {
    contain: style; /* Ізолює стилі параграфів */
}

/* GPU acceleration для links hover */
.mission__text a {
    will-change: opacity;
    backface-visibility: hidden;
}

.mission__text a:hover {
    transform: translateZ(0); /* GPU layer */
}
