/* WordPress Image Gallery Pro Styles */

.wpig-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.wpig-gallery-grid {
    display: grid;
    gap: 24px;
    grid-auto-rows: 1fr;
}

/* Desktop - 4 columns */
.wpig-cols-desktop-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wpig-cols-desktop-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wpig-cols-desktop-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Tablet - 3 columns */
@media (max-width: 1024px) {
    .wpig-cols-tablet-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .wpig-cols-tablet-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .wpig-cols-tablet-1 {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

/* Mobile - 2 columns */
@media (max-width: 768px) {
    .wpig-cols-mobile-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .wpig-cols-mobile-1 {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .wpig-gallery-grid {
        gap: 16px;
    }
}

.wpig-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s ease-in-out;
    aspect-ratio: 1;
}

.wpig-gallery-item:hover {
    /* box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px); */
}

.wpig-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.wpig-image {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
    background-color: #f3f4f6;
}

.wpig-gallery-item:hover .wpig-image {
    /* transform: scale(1.1); */
}

.wpig-overlay {
    position: absolute;
    inset: 0;
   background: rgb(0 0 0 / 33%);
    /* backdrop-filter: blur(4px); */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 16px;
}

.wpig-gallery-item:hover .wpig-overlay {
    opacity: 1;
}

.wpig-overlay-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    justify-content: flex-start;
    align-content: flex-end;
}

.wpig-view-icon {
    margin-bottom: 8px;
}

.wpig-eye-icon {
    width: 32px;
    height: 32px;
    color: white;
    transition: color 0.2s ease-in-out;
    background: transparent !important;
}

.wpig-eye-icon:hover {
    /* color: #93c5fd; */
}

.wpig-caption {
    color: white !important;
    margin:  0 !important;
    line-height: 1.2;
    font-family: "Outfit", Sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.wpig-description {
    color: #e5e7eb;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
    font-family: "Outfit", Sans-serif;
    font-size: 12px;
    font-weight: 300;
}

.wpig-external-link {
    /* display: inline-flex; */
    /* align-items: center; */
    /* gap: 8px;
    padding: 8px 16px; */
    /* background-color: #2563eb00;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease-in-out; */
}

a.wpig-external-link {
    display: block !important;
    text-align: center !important;
    width: 100%;
    margin-bottom: 50px;
}

.wpig-external-link:hover {
    background-color: #1d4ed800;
    /* transform: translateY(-1px); */
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); */
    color: white;
    text-decoration: none;
}

/* Lightbox Styles */
.wpig-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wpig-fade-in 0.2s ease-out;
}

.wpig-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.wpig-lightbox-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.wpig-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.wpig-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.wpig-prev-btn,
.wpig-next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.wpig-prev-btn {
    left: 16px;
}

.wpig-next-btn {
    right: 16px;
}

.wpig-prev-btn:hover,
.wpig-next-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.wpig-image-wrapper {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpig-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: wpig-zoom-in 0.3s ease-out;
}

.wpig-image-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    text-align: center;
    color: white;
}

.wpig-info-content {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 16px;
    margin: 0 auto;
    max-width: 600px;
}

.wpig-lightbox-caption {
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin: 0 0 8px 0;
}

.wpig-lightbox-description {
    font-size: 14px;
    color: #e5e7eb;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.wpig-counter {
    font-size: 12px;
    color: #d1d5db;
}

/* Animations */
@keyframes wpig-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes wpig-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .wpig-prev-btn,
    .wpig-next-btn {
        padding: 20px;
    }
    
    .wpig-close-btn {
        padding: 16px;
        top: 8px;
        right: 8px;
    }
    
    .wpig-image-info {
        bottom: 8px;
        left: 8px;
        right: 8px;
    }
    
    .wpig-prev-btn {
        left: 8px;
    }
    
    .wpig-next-btn {
        right: 8px;
    }
    
    .wpig-caption {
        font-size: 16px;
    }
    
    .wpig-description {
        font-size: 13px;
    }
}

/* Focus states for accessibility */
.wpig-gallery-item:focus,
.wpig-close-btn:focus,
.wpig-prev-btn:focus,
.wpig-next-btn:focus,
.wpig-external-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Loading state */
.wpig-image {
    background-color: #f3f4f6;
}

/* Smooth transitions */
.wpig-gallery-item,
.wpig-image,
.wpig-overlay,
.wpig-close-btn,
.wpig-prev-btn,
.wpig-next-btn {
    transition: all 0.3s ease-in-out;
}

/* Custom scrollbar for webkit browsers */
.wpig-lightbox::-webkit-scrollbar {
    display: none;
}

.wpig-lightbox {
    -ms-overflow-style: none;
    scrollbar-width: none;
}


/* -----------------------------------------------
 *  LOAD‑MORE
 * --------------------------------------------- */
.wpig-hidden            { display: none; }
.wpig-load-more         { 
    display: block; 
    margin: 2rem auto; 
    padding: 0.65rem 2rem;
    background: #0691af;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.25s ease;
}
.wpig-load-more:hover   { background: #047b8e; }

/* -----------------------------------------------
 *  LIGHTBOX (desktop only)
 * --------------------------------------------- */
@media (min-width:1024px) {
    .wpig-lightbox {
        display: none;       /* shown via JS */
        position: fixed;
        z-index: 99999;
        inset: 0;
        background: rgba(0,0,0,0.9);
        text-align: center;
        overflow: hidden;
    }
    .wpig-lightbox-img     { 
        max-width: 90%;
        max-height: 80%;
        margin: 4rem auto 1rem;
    }
    .wpig-lightbox-caption {
        color: #fff;
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    .wpig-close {
        position: absolute;
        top: 1.2rem;
        right: 1.8rem;
        font-size: 2.5rem;
        color: #fff;
        cursor: pointer;
    }
    .wpig-prev,
    .wpig-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-size: 3rem;
        color: #fff;
        background: none;
        border: none;
        cursor: pointer;
        user-select: none;
    }
    .wpig-prev { left: 1.2rem; }
    .wpig-next { right: 1.2rem; }
}



/* === Gallery Grid Layout === */
.wpig-gallery-grid {
  display: grid;
  grid-gap: 20px;
}

.wpig-cols-desktop-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .wpig-cols-tablet-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .wpig-cols-mobile-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Gallery Item === */
.wpig-gallery-item {
  position: relative;
  overflow: hidden;
}

/* === Hidden Items for Load More === */
.wpig-gallery-item.wpig-hidden {
  display: none;
}

/* === Image Styling === */
.wpig-image-container img.wpig-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.wpig-image-container:hover img.wpig-image {
  transform: scale(1.05);
}

/* === Overlay Styling === */
.wpig-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wpig-image-container:hover .wpig-overlay {
  opacity: 1;
}

/* === Overlay Content === */
.wpig-overlay-content {
  color: #fff;
  padding: 10px;
}

.wpig-caption {
  margin: 10px 0 5px;
  font-size: 16px;
  font-weight: 600;
}

.wpig-description {
  font-size: 14px;
}

/* === External Link Icon === */
.wpig-external-link img {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
}
