.hoc-ms-container {
    width: 100%;
    position: relative;
    overflow: hidden; 
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hoc-ms-grid-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.hoc-ms-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 250px; /* Base row height */
    gap: 15px;
    width: 100%;
}

/* Item Spans (Desktop) */
.hoc-ms-span-1x1 {
    grid-column: span 2;
    grid-row: span 1;
}

.hoc-ms-span-2x1 {
    grid-column: span 4;
    grid-row: span 1;
}

.hoc-ms-span-1x2 {
    grid-column: span 2;
    grid-row: span 2;
}

.hoc-ms-span-2x2 {
    grid-column: span 4;
    grid-row: span 2;
}

.hoc-ms-span-half {
    grid-column: span 3;
    grid-row: span 1;
}

.hoc-ms-span-half-tall {
    grid-column: span 3;
    grid-row: span 2;
}

.hoc-ms-span-full {
    grid-column: span 6;
    grid-row: span 1;
}

.hoc-ms-item {
    position: relative;
    text-decoration: none;
    display: block;
    /* GSAP will control overall item visibility */
}

.hoc-ms-item-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Initially hidden for GSAP to animate */
    opacity: 0;
    will-change: transform, opacity;
}

.hoc-ms-bg-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.43); /* default fallback */
}

.hoc-ms-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hoc-ms-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    /* Initially hidden for GSAP */
    opacity: 0;
    will-change: opacity, transform;
}

.hoc-ms-icon {
    margin-bottom: 15px;
}

.hoc-ms-icon svg {
    width: 50px;
    height: 50px;
    display: block;
}

.hoc-ms-title {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    color: #1a1a1a;
}

/* Tablet and Mobile Responsive */
@media (max-width: 1024px) {
    .hoc-ms-container {
        width: 100%;
    }

    .hoc-ms-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    
    /* Everything stacks in 1 column on mobile/tablet */
    .hoc-ms-span-1x1,
    .hoc-ms-span-2x1,
    .hoc-ms-span-1x2,
    .hoc-ms-span-2x2,
    .hoc-ms-span-half,
    .hoc-ms-span-half-tall,
    .hoc-ms-span-full {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* Elementor Editor Visibility Override */
body.elementor-editor-active .hoc-ms-item-bg-wrapper {
    opacity: 1 !important;
    transform: none !important;
}
body.elementor-editor-active .hoc-ms-content {
    opacity: 1 !important;
    transform: none !important;
}
