/* Custom Grid Widget Styles */
.custom-grid-widget {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1024px) {
    .custom-grid-widget {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .custom-grid-widget {
        grid-template-columns: 1fr;
    }
}

.custom-grid-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background-color: #000;
    cursor: pointer;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    /* Remove underline from the main anchor */
}

/* Image Wrapper */
.custom-grid-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.custom-grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(.165, .84, .44, 1);
}

/* Overlay */
.custom-grid-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    transition: background 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* Default Hover Overlay Darkening */
.custom-grid-card:hover .custom-grid-card-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    background-blend-mode: overlay;
}

/* Content Wrapper */
.custom-grid-card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

/* Title */
.custom-grid-card-title {
    margin: 0;
    color: #FFFFFF;
    font-family: Sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 30px;
    line-height: 1.1em;
    pointer-events: auto;
    /* Keep auto if we want text selection, but parent is link so click works anyway */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Button Wrapper */
.custom-grid-card-button {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.5s ease, margin-top 0.4s ease;
    pointer-events: auto;
    margin-top: 0;
}

/* Button Text (was <a>) */
.custom-grid-card-button .custom-grid-btn-text {
    display: inline-flex;
    align-items: center;
    color: #FFDE00;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

/* Arrow Icon */
.custom-grid-card-button .custom-grid-btn-text::after {
    content: '\2192';
    font-family: sans-serif;
    margin-left: 8px;
    font-weight: 400;
    transition: margin-left 0.3s ease;
}

/* Hover Effects */

/* Zoom Image */
.custom-grid-card:hover .custom-grid-card-image img {
    transform: scale(1.1);
}

/* Show Button */
.custom-grid-card:hover .custom-grid-card-button {
    max-height: 60px;
    opacity: 1;
    margin-top: 5px;
}

/* Move Title Up */
.custom-grid-card:hover .custom-grid-card-title {
    transform: translateY(-2px);
}

/* Button Hover State targetting the span */
.custom-grid-card:hover .custom-grid-card-button .custom-grid-btn-text {
    color: #FFFFFF;
    letter-spacing: 1px;
}

.custom-grid-card:hover .custom-grid-card-button .custom-grid-btn-text::after {
    margin-left: 12px;
}