/* Grid Container */
.rez-grid-container {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Dynamic Columns */
.rez-grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.rez-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.rez-grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.rez-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.rez-grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.rez-grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Mobile Stack */
@media (max-width: 768px) {
    .rez-grid-container.rez-grid-mobile-cols-1 {
        grid-template-columns: 1fr !important;
    }

    .rez-grid-container.rez-grid-mobile-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Grid Item */
.rez-grid-item-frontend {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.rez-grid-item-frontend:hover {
    transform: translateY(-5px);
}

.rez-grid-image-wrapper {
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f0f0f0;
    /* Aspect ratio hack or implementation */
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rez-grid-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rez-grid-title {
    font-weight: 700;
    margin: 10px 0 0 0;
    color: #333;
    line-height: 1.2;
}

/* Dynamic Font Sizing based on Columns */
.rez-grid-cols-1 .rez-grid-title,
.rez-grid-cols-2 .rez-grid-title {
    font-size: 26px;
}

.rez-grid-cols-3 .rez-grid-title {
    font-size: 22px;
    /* Base size */
}

.rez-grid-cols-4 .rez-grid-title,
.rez-grid-cols-5 .rez-grid-title,
.rez-grid-cols-6 .rez-grid-title {
    font-size: 18px;
}

/* Popup Modal */
.rez-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rez-popup-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.rez-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.rez-popup-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 2;
    padding: 40px;
    animation: rezSlideUp 0.3s ease-out;
}

@keyframes rezSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rez-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.rez-popup-category {
    display: inline-block;
    background: #dba585;
    /* Color from screenshot */
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

a.rez-popup-category-link {
    text-decoration: none;
    color: #fff;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

a.rez-popup-category-link:hover {
    background: #c48b6c;
    transform: scale(1.05);
}

.rez-popup-title {
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 20px 0;
    font-family: serif;
    /* Match screenshot serif font */
    color: #333;
}

.rez-popup-body {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.rez-popup-body p {
    margin-bottom: 15px;
}

.rez-popup-actions {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 25px;
}

.rez-popup-button {
    display: inline-block;
    background: #dba585;
    /* Same as category tag */
    color: #fff;
    font-size: 16px;
    /* Larger than category tag */
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 1px;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.rez-popup-button:hover {
    background: #c48b6c;
    transform: translateY(-2px);
    color: #fff;
}