/* ============================================
   MASONRY CARDS - DESKTOP & TABLET ONLY
   ============================================ */

.elementor-widget-container {
    padding: 0 !important;
    margin: 0 !important;
}

.mcw-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mcw-masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 140px;
    gap: 15px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mcw-card {
    position: relative;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: white;
}

.mcw-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(30, 58, 138, 0.3);
}

.mcw-card:active {
    transform: translateY(-2px);
}

.mcw-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
}

.mcw-card-logo {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
}

.mcw-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.mcw-card:hover .mcw-card-logo {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.25);
}

.mcw-card-title {
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
    color: white;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.mcw-card-description {
    font-size: 13px;
    text-align: center;
    opacity: 0.95;
    line-height: 1.6;
    color: white;
    position: relative;
    z-index: 1;
}

.mcw-card-tag {
    text-align: center;
    margin-top: auto;
    font-size: 12px;
    opacity: 0.85;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    margin-left: -25px;
    margin-right: -25px;
    margin-bottom: -25px;
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 1;
}

.mcw-span-2x2 {
    grid-column: span 1;
    grid-row: span 2;
}

.mcw-span-2x1 {
    grid-column: span 2;
    grid-row: span 1;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.mcw-span-2x1 .mcw-card-logo {
    margin: 0;
    flex-shrink: 0;
}

.mcw-span-2x1 .mcw-card-content {
    flex: 1;
    text-align: right;
}

.mcw-span-2x1 .mcw-card-title,
.mcw-span-2x1 .mcw-card-description {
    text-align: right;
}

.mcw-span-2x1 .mcw-card-tag {
    position: absolute;
    bottom: 15px;
    left: 15px;
    margin: 0;
    padding: 5px 15px;
    border-radius: 20px;
    border: none;
}

.mcw-span-1x2 {
    grid-column: span 1;
    grid-row: span 2;
}

.mcw-span-1x1 {
    grid-column: span 1;
    grid-row: span 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mcw-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.mcw-card:nth-child(1) { animation-delay: 0.1s; }
.mcw-card:nth-child(2) { animation-delay: 0.2s; }
.mcw-card:nth-child(3) { animation-delay: 0.3s; }
.mcw-card:nth-child(4) { animation-delay: 0.4s; }
.mcw-card:nth-child(5) { animation-delay: 0.5s; }
.mcw-card:nth-child(6) { animation-delay: 0.6s; }

.mcw-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mcw-card:hover::before {
    opacity: 1;
}

.mcw-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.mcw-card-title,
.mcw-card-description,
.mcw-card-tag {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* TABLET ONLY */
@media (max-width: 1024px) and (min-width: 769px) {
    .mcw-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .mcw-span-2x2 {
        grid-column: span 2;
    }

    .mcw-card-title {
        font-size: 16px;
    }

    .mcw-card-description {
        font-size: 12px;
    }
}

/* RTL Support */
[dir="rtl"] .mcw-span-2x1 {
    flex-direction: row-reverse;
}

[dir="rtl"] .mcw-span-2x1 .mcw-card-content {
    text-align: left;
}

[dir="rtl"] .mcw-span-2x1 .mcw-card-title,
[dir="rtl"] .mcw-span-2x1 .mcw-card-description {
    text-align: left;
}

[dir="rtl"] .mcw-span-2x1 .mcw-card-tag {
    left: auto;
    right: 15px;
}
