:root {
  --gallery_background_color: hsl(240, 18%, 77%);
}

body {
}

/* Below property will override the property from style.css */
.body_container {
  background: var(--website_background_image_gradient);
  background-size: 100% 100%;
  background-attachment: fixed;
  background-position: top center;
}

/* This class is defined in style.css. Below are some additional properties */
.introduction_container {
  margin-top: 0rem;
}

.introduction_container h1 {}

.introduction_container h3 {
  margin-top: 0;
  margin-bottom: 0;
}

.villa_gallery_heading {
  padding: 0 1rem;
  font-weight: normal;
  text-align: left;
}

.gallery_container {
  /* background: lightblue url("./images/photos/view_of_sea.jpg") no-repeat fixed center; */
  background-color: transparent;
  margin: 2rem;
  margin-top: 1rem;
}

/* Gallery page */
.image_gallery_grid {
  display: grid;
  /* Use auto-fit with minmax for responsive columns */
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Adjusted for better small screen display */
  padding: .5rem;
  padding-top: 0;
  justify-content: center;
}

div.gallery_cell {
  margin: 3px;
  border: 1px solid #ccc;
  text-align: center;
  /* Removed float: left; as it conflicts with display: grid */
  /* Removed fixed width; grid will manage sizing */
  background-color: var(--gallery_background_color);
}


div.gallery_cell img {
  width: 100%; /* Ensure images fill their grid cells */
  height: auto;
}

div.gallery_cell img:hover {
  opacity: .9;
}

div.desc {
  padding: 15px;
  text-align: center;
}

div.gallery_cell img.hover-shadow {
  transition: 0.3s;
}

.hover-shadow:hover {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.image_gallery_grid > .gallery_cell {
  padding: 1px;
}

/* Removed this as it's not needed with display: grid */
/* .image_gallery_grid:after {
  content: "";
  display: table;
  clear: both;
} */

/* Removed this as float conflicts with grid, and grid will handle layout */
/* .gallery_cell {
  float: left;
  width: 25%;
} */

/* The Modal (background) */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  padding-top: 2rem;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.8);
}

/* Modal Content */
.modal-content {
  position: relative;
  background-color: #fefefe;
  margin: auto;
  margin-top: 2%;
  padding: 0;
  width: 90%;
  max-width: 90%;
  background: transparent;
}



.image_fullsize {
  max-width: 90%; /* Adjusted for better responsiveness */
  max-height: 80vh; /* Adjusted for better responsiveness */
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
  border-radius: 10px;
}

.image_lighthouse_thumbnail {
  width: 40%;
  margin: .1rem;
  background: rgba(0, 0, 0, 0.7);
}

/* The Close Button */
.close {
  color: white;
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #999;
  text-decoration: none;
  cursor: pointer;
}

.mySlides {
  display: none;
  text-align: center;
}

.cursor {
  cursor: pointer;
}

/* Next & previous buttons */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 30%;
  width: auto;
  padding: 1rem;
  margin-top: 1rem;
  color: white;
  font-weight: bold;
  font-size: xx-large;
  transition: 0.6s ease;
  border-radius: 5px 0 0 5px;

  user-select: none;
  -webkit-user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  /* border-radius: 3px 0 0 3px; */
  border-radius: 0 5px 5px 0;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Number text (1/3 etc) */
.numbertext {
  color: #f2f2f2;
  font-size: 12px;
  padding: 8px 12px;
  position: absolute;
  top: 0;
}

img {
  margin-bottom: -4px;
}

.caption-container {
  text-align: center;
  background-color: black;
  padding: 2px 16px;
  color: white;
}

.demo {
  opacity: 0.5;
}

.active,
.demo:hover {
  opacity: 1;
}

.lighthouse_thumbnails_container {
  display: flex;
}



/* (A) RESPONSIVE IMAGE */


/* (B) POSITION CAPTION */
.hover_caption {
  /* (B1) PLACE AT BOTTOM */
  position: absolute; bottom: 0; left: 0;

  /* (B2) DIMENSIONS + COLORS */
  width: 100%; padding: 10px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
}

/* (C) ONLY SHOW CAPTION ON HOVER */
.hover_caption {
  visibility: hidden; /* Changed from none to hidden for transition */
  opacity: 0;
  transition: opacity 0.3s;
}
.mySlides:hover .hover_caption {
  visibility: visible;
  opacity: 1;
}


/* Media queries for gallery grid adjustments */
@media (max-width: 499px) { /* Added for very small screens */
  .image_gallery_grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
}

@media (min-width: 500px) { /* Added for small screens */
  .image_gallery_grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (min-width: 820px) {
  .image_gallery_grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 2rem;
  }
}

@media (min-width: 1200px) {
  .image_gallery_grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 2rem;
  }
}

@media (min-width: 1600px) {
  .image_gallery_grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 2rem;
  }
}



















/* *************** START AI Generated Gallery code */

        .gallery-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .gallery-title {
            text-align: center;
            margin-bottom: 40px;
            color: #333;
            font-size: 2.5rem;
        }

        .category-section {
            margin-bottom: 50px;
        }

        .category-title {
            font-size: 2rem;
            color: #444;
            margin-bottom: 25px;
            padding-bottom: 10px;
            border-bottom: 3px solid #667eea;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        /* Responsive Grid Gallery */
        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
        }

        .gallery-item {
            position: relative;
            overflow: hidden;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
        }

        .gallery-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        }

        .gallery-item img {
            width: 100%;
            height: 200px;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .gallery-item:hover img {
            transform: scale(1.05);
        }

        .gallery-item .overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .gallery-item:hover .overlay {
            opacity: 1;
        }

        .overlay-text {
            color: white;
            font-size: 1.1rem;
            text-align: center;
            padding: 10px;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.9);
        }

        .modal-content {
            position: relative;
            margin: auto;
            padding: 0;
            width: 90%;
            max-width: 1200px;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .modal-image {
            width: 100%;
            max-height: 80vh;
            object-fit: contain;
            margin: auto;
        }

        .close {
            position: absolute;
            top: 15px;
            right: 35px;
            color: #f1f1f1;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            z-index: 1001;
        }

        .close:hover {
            color: #bbb;
        }

        .prev, .next {
            cursor: pointer;
            position: absolute;
            top: 50%;
            width: auto;
            padding: 16px;
            margin-top: -50px;
            color: white;
            font-weight: bold;
            font-size: 20px;
            background: rgba(0,0,0,0.5);
            border: none;
            user-select: none;
            transition: 0.3s;
        }

        .next {
            right: 0;
            border-radius: 3px 0 0 3px;
        }

        .prev {
            left: 0;
            border-radius: 0 3px 3px 0;
        }

        .prev:hover, .next:hover {
            background: rgba(0,0,0,0.8);
        }

        .caption-container {
            text-align: center;
            background-color: rgba(0,0,0,0.7);
            padding: 15px;
            color: white;
        }

        .caption {
            font-size: 1.1rem;
            margin-bottom: 10px;
        }

        .counter {
            font-size: 0.9rem;
            color: #ccc;
        }

        /* Thumbnail row */
        .thumbnail-row {
            display: flex;
            justify-content: center;
            padding: 10px;
            background: rgba(0,0,0,0.7);
            overflow-x: auto;
            gap: 5px;
        }

        .thumbnail {
            width: 60px;
            height: 40px;
            object-fit: cover;
            cursor: pointer;
            border: 2px solid transparent;
            border-radius: 4px;
            transition: border-color 0.3s ease;
        }

        .thumbnail.active {
            border-color: #fff;
        }

        .thumbnail:hover {
            border-color: #ccc;
        }

        /* Mobile Responsive */
        @media screen and (max-width: 768px) {
            .gallery-grid {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
                gap: 15px;
            }

            .gallery-item img {
                height: 150px;
            }

            .gallery-title {
                font-size: 2rem;
            }

            .category-title {
                font-size: 1.5rem;
            }

            .modal-content {
                width: 100%;
                padding: 0;
            }

            .prev, .next {
                padding: 12px;
                font-size: 18px;
            }

            .close {
                font-size: 35px;
                top: 10px;
                right: 25px;
            }

            .thumbnail {
                width: 50px;
                height: 35px;
            }
        }

        @media screen and (max-width: 480px) {
            body {
                padding: 10px;
            }

            .gallery-grid {
                grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
                gap: 10px;
            }

            .gallery-item img {
                height: 120px;
            }

            .overlay-text {
                font-size: 0.9rem;
            }

            .thumbnail-row {
                padding: 5px;
            }

            .thumbnail {
                width: 40px;
                height: 30px;
            }
        }


/* *************** END of AI Generated Code */