/* Custom Header Builder - Gallery Grid Styles */

.chb-gallery-wrap {
    --chb-cols-d: 3;
    --chb-cols-t: 2;
    --chb-cols-m: 2;
    direction: rtl;
    text-align: center;
}

.chb-gallery-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.chb-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--chb-cols-d), 1fr);
    gap: 20px;
}

.chb-gallery-card {
    display: block;
    background: #f7f5f2;
    border: 1px solid #e5e0d8;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.chb-gallery-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.chb-gallery-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eeeeee;
}

.chb-gallery-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.chb-gallery-zoom .chb-gallery-card:hover img {
    transform: scale(1.06);
}

.chb-gallery-caption {
    padding: 12px 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333333;
}

@media (max-width: 1024px) {
    .chb-gallery-grid {
        grid-template-columns: repeat(var(--chb-cols-t), 1fr);
    }
}

@media (max-width: 600px) {
    .chb-gallery-grid {
        grid-template-columns: repeat(var(--chb-cols-m), 1fr);
        gap: 12px;
    }

    .chb-gallery-caption {
        font-size: 13px;
        padding: 10px 6px;
    }
}

.chb-gallery-clickable {
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.chb-gallery-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.14);
    border-color: #2e9e2e;
}

.chb-gallery-image-wrap {
    position: relative;
}

.chb-gallery-cta {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(46, 158, 46, 0.94);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 9px 10px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.chb-gallery-clickable:hover .chb-gallery-cta {
    opacity: 1;
    transform: translateY(0);
}

.chb-gallery-cta-arrow {
    transition: transform 0.2s ease;
}

.chb-gallery-clickable:hover .chb-gallery-cta-arrow {
    transform: translateX(-3px);
}

@media (max-width: 782px) {
    .chb-gallery-cta {
        opacity: 1;
        transform: translateY(0);
    }
}
