/* Rome Gallery Elementor - 5 image layout with equal height columns */

.rge-gallery-wrapper {
    width: 100%;
}

.rge-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* big left, 2 middle, 2 right */
    grid-template-rows: repeat(2, minmax(0, 1fr)); /* two equal rows */
    gap: 12px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.rge-gallery-main,
.rge-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
}

.rge-gallery-main img,
.rge-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main image spans both rows */
.rge-gallery-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    min-height: 260px;
}

/* Middle column images */
.rge-item-2 {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.rge-item-3 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

/* Right column images */
.rge-item-4 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.rge-item-5 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

/* Button container */
.rge-gallery-side-item-button {
    position: relative;
}

/* Gallery button (on bottom-right image) */
.rge-gallery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: #0f2759;
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: absolute;
    right: 16px;
    bottom: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.rge-gallery-button-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rge-gallery-button-icon-inner {
    width: 14px;
    height: 10px;
    border-radius: 3px;
    border: 2px solid #ffffff;
    box-sizing: border-box;
    position: relative;
}

.rge-gallery-button-icon-inner:before {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    top: -4px;
    right: -4px;
}

.rge-gallery-button-count {
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffffff;
    color: #0f2759;
    font-size: 12px;
}

/* Mobile counter over main image */
.rge-gallery-counter-mobile {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    display: none; /* shown on mobile only */
    align-items: center;
    gap: 3px;
}

/* Hover effect */
.rge-gallery-link img {
    transition: transform 0.3s ease;
}

.rge-gallery-link:hover img {
    transform: scale(1.03);
}

/* Responsive styles */
@media (max-width: 767px) {
    .rge-gallery-grid {
        display: block;
        border-radius: 0;
    }

    .rge-gallery-main {
        border-radius: 0;
        min-height: 220px;
    }

    .rge-gallery-item {
        display: none;
    }

    .rge-gallery-counter-mobile {
        display: inline-flex;
    }

    .rge-gallery-button {
        display: none;
    }
}
