/**
 * Card Hover Effect Widget Styles
 */

.wml-card-hover {
    padding: 40px 0;
    width: 100%;
}

.wml-ch-grid {
    display: grid;
    gap: 8px;
    position: relative;
}

/* Responsive columns */
@media (max-width: 768px) {
    .wml-ch-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wml-ch-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.wml-ch-item {
    position: relative;
    display: block;
    padding: 8px;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: inherit;
    z-index: 10;
}

/* Shared Hover background */
.wml-ch-shared-bg {
    position: absolute;
    background-color: #1e293b;
    border-radius: 24px;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition:
        opacity 0.5s ease,
        width 0.2s ease,
        height 0.2s ease,
        top 0.2s ease,
        left 0.2s ease;
}

/* Card */
.wml-ch-card {
    position: relative;
    z-index: 20;
    height: 100%;
    width: 100%;
    padding: 16px;
    overflow: hidden;
    background-color: #000000;
    border: 1px solid transparent;
    border-radius: 16px;
    transition: border-color 0.3s ease;
}

.wml-ch-item:hover .wml-ch-card {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Content */
.wml-ch-content {
    position: relative;
    z-index: 50;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Default, overridden by control */
}

.wml-ch-title {
    margin: 16px 0 0 0;
    letter-spacing: 0.025em;
}

.wml-ch-description {
    line-height: 1.6;
    margin: 32px 0 0 0;
    letter-spacing: 0.025em;
}

/* Remove default link styles */
a.wml-ch-item {
    cursor: pointer;
}

a.wml-ch-item:hover {
    text-decoration: none;
}

/* Top Image */
.wml-ch-top-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin: -16px -16px 16px -16px;
    width: calc(100% + 32px);
}

.wml-ch-top-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.wml-ch-item:hover .wml-ch-top-image img {
    transform: scale(1.05);
}

/* Background Image */
.wml-ch-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: transform 0.3s ease;
}

.wml-ch-item:hover .wml-ch-bg-image {
    transform: scale(1.05);
}

.wml-ch-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2;
    transition: background-color 0.3s ease;
}

/* Content z-index adjustment for background images */
.wml-card-hover[data-image-placement="background"] .wml-ch-content {
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}