/*
 * Styles for the Experience Tour Gallery Elementor Widget
 */

/* Main widget container */
.etc-tour-gallery {
    position: relative; /* Needed for positioning the 'View All' button */
    overflow: hidden;
    border-radius: 12px;
}

/* The grid container that holds all image items */
.etc-tour-gallery .gallery-grid-container {
    display: grid;
    height: 100%;
    gap: 8px; /* The space between images */
}

/* Generic styles for each gallery item and the image inside */
.etc-tour-gallery .gallery-item {
    overflow: hidden;
    position: relative;
}

.etc-tour-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Prevents image distortion */
    transition: transform 0.4s ease;
}

.etc-tour-gallery .gallery-item:hover img {
    transform: scale(1.05); /* Slight zoom effect on hover */
}

/* 
 * Layout definitions based on the number of images.
 * This is where we create the specific grid from your design.
 */

/* Layout for 1 image */
.etc-tour-gallery .gallery-layout-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* Layout for 2 images */
.etc-tour-gallery .gallery-layout-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

/* Layout for 3 images */
.etc-tour-gallery .gallery-layout-3 {
    grid-template-columns: 2fr 1fr; /* First column is twice as wide */
    grid-template-rows: repeat(2, 1fr);
}
.etc-tour-gallery .gallery-layout-3 .gallery-item-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 3; /* First image spans 2 rows */
}

/* Layout for 4 images */
.etc-tour-gallery .gallery-layout-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* Layout for 5 images (THE MAIN DESIGN) */
.etc-tour-gallery .gallery-layout-5 {
    grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
    grid-template-rows: repeat(2, 1fr);    /* 2 equal rows */
}
.etc-tour-gallery .gallery-layout-5 .gallery-item-1 {
    grid-column: 1 / 3; /* First image starts at line 1, ends before 3 */
    grid-row: 1 / 3;    /* First image starts at line 1, ends before 3 */
}
.etc-tour-gallery .gallery-layout-5 .gallery-item-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}
.etc-tour-gallery .gallery-layout-5 .gallery-item-3 {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
}
.etc-tour-gallery .gallery-layout-5 .gallery-item-4 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}
.etc-tour-gallery .gallery-layout-5 .gallery-item-5 {
    grid-column: 4 / 5;
    grid-row: 2 / 3;
}


/* 'View All Photos' Button */
.etc-tour-gallery .view-all-photos-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background-color: rgba(15, 15, 15, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.etc-tour-gallery .view-all-photos-btn:hover {
    background-color: rgba(0, 0, 0, 1);
}

/* Dark overlay on the last image (for the 5-image layout) */
.etc-tour-gallery .gallery-layout-5 .gallery-item-5::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Show the overlay when hovering the whole gallery */
.etc-tour-gallery:hover .gallery-layout-5 .gallery-item-5::after {
    opacity: 1;
}