.dc-evson-mosaic,
.dc-evson-mosaic *,
.dc-evson-mosaic *::before,
.dc-evson-mosaic *::after {
    box-sizing: border-box;
}

.dc-evson-mosaic {
    --dc-mosaic-bg: #fff;
    --dc-mosaic-responsive-gap: 0px;
    --dc-mosaic-image-fit: cover;
    --dc-mosaic-orange: #ff9600;
    --dc-mosaic-yellow: #feca01;
    --dc-mosaic-peach: #ffcf8a;
    --dc-c1-image-width: 315%;
    --dc-c1-image-min-width: 100%;
    --dc-c1-image-x: 65.8%;
    --dc-c3-start: #ff9600;
    --dc-c3-end: #feca01;
    --dc-c3-circle: rgba(255,255,255,.15);
    --dc-c3-circle-size: 470px;
    --dc-c3-circle-left: -147px;
    --dc-c3-circle-bottom: -33px;
    --dc-c5-start: #feca01;
    --dc-c5-end: #ff9600;

    width: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--dc-mosaic-bg);
}

/*
 * Desktop: đúng 5 container SVG, tổng 1920×686.
 * 350 + 353 + 520 + 525 + 172 = 1920.
 */
.dc-evson-mosaic__stage {
    display: grid;
    grid-template-columns: 350fr 353fr 520fr 525fr 172fr;
    width: 100%;
    aspect-ratio: 1920 / 686;
    gap: 0;
    min-width: 0;
    background: var(--dc-mosaic-bg);
}

.dc-evson-mosaic__container {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
}

.dc-evson-mosaic__image,
.dc-evson-mosaic__c1-image {
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.dc-evson-mosaic__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: var(--dc-mosaic-image-fit);
    object-position: center center;
}

/* ==================== Container 1 — 350×686 ==================== */
.dc-evson-mosaic__c1-ornament {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 49.142857%; /* 172 / 350 */
    height: 25.072886%; /* 172 / 686 */
    overflow: hidden;
    background: var(--dc-mosaic-orange);
}

.dc-evson-mosaic__c1-ornament span {
    position: absolute;
    top: 0;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--dc-mosaic-yellow);
}

.dc-evson-mosaic__c1-ornament span:first-child { left: -50.581395%; }
.dc-evson-mosaic__c1-ornament span:last-child { left: 50.581395%; }

.dc-evson-mosaic__c1-photo {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: 25.072886%;
    bottom: 0;
    overflow: hidden;
    border-bottom-right-radius: 45.714286% 31.128405%; /* 160×160 on 350×514 */
    background: #ececec;
}

/*
 * C1 dùng đúng crop từ SVG gốc: ảnh rộng ~315% khung 350px và cao ~620px.
 * Elementor/theme thường có `.elementor img { max-width:100%; }`; nếu không khóa
 * lại ở scope này ảnh sẽ bị co về 100%, tụt xuống đáy và lộ nền xám.
 */
.dc-evson-mosaic .dc-evson-mosaic__c1-photo > img.dc-evson-mosaic__c1-image {
    position: absolute;
    left: var(--dc-c1-image-x);
    bottom: 0;
    width: max(var(--dc-c1-image-width), var(--dc-c1-image-min-width));
    height: auto;
    min-width: 0;
    max-width: none !important;
    max-height: none;
    transform: translateX(-50%);
}

/* ==================== Container 2 — 353×686 ==================== */
.dc-evson-mosaic__c2-shape {
    position: absolute;
    inset: 0 0 auto;
    height: 25.072886%; /* 172 */
    background: var(--dc-mosaic-peach);
    border-top-left-radius: 45.325779% 93.023256%; /* 160×160 */
}

.dc-evson-mosaic__c2-photo {
    position: absolute;
    left: 0;
    right: 0;
    top: 49.562682%; /* 340 */
    bottom: 0;
    overflow: hidden;
    background: #ececec;
}

/* ==================== Container 3 — 520×686 ==================== */
.dc-evson-mosaic__c3-photo {
    position: absolute;
    inset: 0 0 auto;
    height: 49.562682%; /* 340 */
    overflow: hidden;
    background: #ececec;
}

.dc-evson-mosaic__c3-content {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    top: 49.562682%;
    bottom: 0;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, var(--dc-c3-start) 0%, var(--dc-c3-end) 100%);
    border-bottom-left-radius: 38.461538% 57.803468%; /* 200×200 on 520×346 */
}

.dc-evson-mosaic__c3-circle {
    position: absolute;
    z-index: -1;
    left: var(--dc-c3-circle-left);
    bottom: var(--dc-c3-circle-bottom);
    width: var(--dc-c3-circle-size);
    height: var(--dc-c3-circle-size);
    border-radius: 50%;
    background: var(--dc-c3-circle);
    pointer-events: none;
}

.dc-evson-mosaic__title {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff;
    overflow-wrap: normal;
    word-break: normal;
}

/* ==================== Container 4 — 525×686 ==================== */
.dc-evson-mosaic__c4-top,
.dc-evson-mosaic__c4-bottom {
    position: absolute;
    left: 0;
    right: 0;
    overflow: hidden;
    background: #ececec;
}

.dc-evson-mosaic__c4-top {
    top: 0;
    height: 74.927114%; /* 514 */
}

.dc-evson-mosaic__c4-bottom {
    bottom: 0;
    height: 25.072886%; /* 172 */
}

/* ==================== Container 5 — 172×686 ==================== */
.dc-evson-mosaic__c5-gradient {
    position: absolute;
    left: 0;
    right: 0;
    top: 49.708455%; /* 341 */
    bottom: 0;
    background: linear-gradient(180deg, var(--dc-c5-start) 0%, var(--dc-c5-end) 100%);
}

/* Progressive enhancement: CSS không bao giờ ẩn content chờ JS. */
.dc-evson-mosaic [data-dc-mosaic-item] {
    will-change: auto;
}

/* Tablet: chuyển thành composition 2 cột, không co nguyên desktop. */
@media (max-width: 1199px) {
    .dc-evson-mosaic__stage {
        aspect-ratio: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row;
        gap: var(--dc-mosaic-responsive-gap);
    }

    .dc-evson-mosaic__container { height: auto; }

    .dc-evson-mosaic__container--3 {
        order: 1;
        grid-column: 1 / -1;
        height: 560px;
    }

    .dc-evson-mosaic__container--1 {
        order: 2;
        height: 480px;
    }

    .dc-evson-mosaic__container--2 {
        order: 3;
        height: 480px;
    }

    .dc-evson-mosaic__container--4 {
        order: 4;
        grid-column: 1 / -1;
        height: 560px;
    }

    .dc-evson-mosaic__container--5 {
        order: 5;
        grid-column: 1 / -1;
        height: 150px;
    }

    .dc-evson-mosaic {
        --dc-c1-image-min-width: 220%;
    }
}

/* Mobile: title/worker trước, sau đó các project images; không horizontal page overflow. */
@media (max-width: 767px) {
    .dc-evson-mosaic__stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .dc-evson-mosaic__container--1,
    .dc-evson-mosaic__container--2,
    .dc-evson-mosaic__container--3,
    .dc-evson-mosaic__container--4,
    .dc-evson-mosaic__container--5 {
        grid-column: 1;
    }

    .dc-evson-mosaic__container--3 { height: 520px; }
    .dc-evson-mosaic__container--1 { height: 500px; }
    .dc-evson-mosaic__container--2 { height: 470px; }
    .dc-evson-mosaic__container--4 { height: 590px; }
    .dc-evson-mosaic__container--5 { height: 120px; }

    .dc-evson-mosaic[data-dc-mobile-shapes="no"] .dc-evson-mosaic__c1-ornament,
    .dc-evson-mosaic[data-dc-mobile-shapes="no"] .dc-evson-mosaic__c2-shape {
        display: none;
    }

    .dc-evson-mosaic {
        --dc-c1-image-min-width: 250%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dc-evson-mosaic *,
    .dc-evson-mosaic *::before,
    .dc-evson-mosaic *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
