/* Roofing Portfolio Gallery - Elementor Widget Styles */

.rfg-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 220px;
    gap: 10px;
}

.rfg-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: #111;
    grid-column: span 1;
    grid-row: span 1;
    text-decoration: none;
}

.rfg-tile--large {
    grid-column: span 2;
    grid-row: span 2;
}

.rfg-tile--tall {
    grid-column: span 1;
    grid-row: span 2;
}

.rfg-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
}

.rfg-tile:hover .rfg-tile-img,
.rfg-tile:hover .rfg-ba-img {
    transform: scale(1.06);
}

.rfg-ba-stack {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.rfg-ba-half {
    position: relative;
    flex: 1 1 50%;
    overflow: hidden;
}

.rfg-ba-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
    display: block;
}

.rfg-ba-label {
    position: absolute;
    left: 16px;
    top: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.rfg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.rfg-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 22px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rfg-tag {
    color: #D85A30;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.rfg-title {
    margin: 0;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-size: 26px;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.rfg-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #cfcfcf;
    font-size: 13px;
}

.rfg-location svg {
    flex-shrink: 0;
    opacity: 0.8;
}

@media (max-width: 900px) {
    .rfg-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
}

@media (max-width: 600px) {
    .rfg-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: 260px;
    }
    .rfg-tile--large,
    .rfg-tile--tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    .rfg-title {
        font-size: 22px;
    }
}

.rfg-gallery .rfg-tile[role="button"] {
    cursor: pointer;
}

/* ---------------- Lightbox ---------------- */

body.rfg-lb-open {
    overflow: hidden;
}

.rfg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.rfg-lightbox.rfg-lb-active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.rfg-lb-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
    box-sizing: border-box;
}

.rfg-lb-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 74vh;
}

.rfg-lb-image {
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rfg-lb-toggle-ba {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(216, 90, 48, 0.92);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-transform: uppercase;
}

.rfg-lb-toggle-ba:hover {
    background: #c2492a;
}

.rfg-lb-caption {
    margin-top: 18px;
    text-align: center;
    max-width: 600px;
}

.rfg-lb-tag {
    display: block;
    color: #D85A30;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.rfg-lb-title {
    margin: 0 0 6px;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 700;
}

.rfg-lb-location {
    color: #cfcfcf;
    font-size: 14px;
}

.rfg-lb-close,
.rfg-lb-prev,
.rfg-lb-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 1000000;
}

.rfg-lb-close:hover,
.rfg-lb-prev:hover,
.rfg-lb-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rfg-lb-close {
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
}

.rfg-lb-prev,
.rfg-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 18px;
}

.rfg-lb-prev {
    left: 24px;
}

.rfg-lb-next {
    right: 24px;
}

@media (max-width: 600px) {
    .rfg-lb-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
    .rfg-lb-prev,
    .rfg-lb-next {
        width: 40px;
        height: 40px;
    }
    .rfg-lb-prev {
        left: 8px;
    }
    .rfg-lb-next {
        right: 8px;
    }
    .rfg-lb-title {
        font-size: 20px;
    }
}
