/**
 * Image Gallery â€” Modern Grid & Design System
 * Replaces legacy Flexbox with high-performance CSS Grid and Variables.
 */

:root {
    --npg-primary: #4f46e5;
    --npg-white: #ffffff;
    --npg-radius: 12px;
    --npg-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --npg-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --npg-glass: rgba(255, 255, 255, 0.05);
    
    /* Variables injected via Shortcode */
    --npg-gutter: 20px;
    --npg-cols-lg: 4;
    --npg-cols-md: 3;
    --npg-cols-sm: 2;
    --npg-cols-xs: 1;
    --npg-overlay-color: rgba(0,0,0,0.7);
    --npg-text-color: #ffffff;
    --npg-title-bg: transparent;
    --npg-title-font-size: 16px;
}

/* Base Responsive Logic for Gutters */
@media (max-width: 575px) {
    :root {
        --npg-gutter: 10px !important;
    }
}

/* Grid Configuration & Variable Scaling */
.npg-row {
    display: block;
    position: relative; /* Positioning context for Isotope */
    --npg-cols-current: var(--npg-cols-xs, 1);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.npg-row.npg-loaded {
    opacity: 1;
}

/* Breakpoint Scaling - Industry Standard Intervals */
@media (min-width: 576px)  { .npg-row { --npg-cols-current: var(--npg-cols-sm, 2); } }
@media (min-width: 768px)  { .npg-row { --npg-cols-current: var(--npg-cols-md, 3); } }
@media (min-width: 992px)  { .npg-row { --npg-cols-current: var(--npg-cols-lg, 4); } }
@media (min-width: 1200px) { .npg-row { --npg-cols-current: var(--npg-cols-lg, 4); } }

/* Base Column & Grid Sizer - Using Clean Widths */
.npg-col, .grid-sizer {
    width: calc(100% / var(--npg-cols-current));
    box-sizing: border-box;
    float: left;
}

.npg-col {
    padding: calc(var(--npg-gutter, 20px) / 2);
    /* No transitions on positioning properties to prevent Isotope lag */
}

/* Image Card */
.npg-image-card {
    position: relative;
    border-radius: var(--npg-radius);
    background: transparent;
    transition: var(--npg-transition);
    will-change: transform;
}
/*
.npg-image-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--npg-shadow);
    z-index: 5;
}*/

/*
.npg-image-card.npg-has-card-border:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12); 
} */

/* Card Border logic */
.npg-image-card.npg-has-card-border {
    padding: var(--npg-card-padding, 12px);
    background: #ffffff66;
    border: 1px solid #e1e1e1;
    border-radius: var(--npg-card-radius, var(--npg-radius));
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08); /* Sophisticated card shadow */
}

.npg-image-card.npg-has-card-border .npg-image-container {
    border-radius: max(0px, calc(var(--npg-card-radius, var(--npg-radius)) - 4px)); /* Proportional internal rounding */
}

.npg-image-container {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    border-radius: var(--npg-radius);
}

.npg-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--npg-transition);
}

/* Hover Effects Logic */
.npg-hover-zoom:hover .npg-thumbnail { transform: scale(1.1); }
.npg-hover-grayscale .npg-thumbnail { filter: grayscale(100%); }
.npg-hover-grayscale:hover .npg-thumbnail { filter: grayscale(0%); }
.npg-hover-blur:hover .npg-thumbnail { filter: blur(4px); }

/* Overlay Design */
/* Overlay Positioning & Variants */
.npg-overlay {
    position: absolute;
    left: 0;
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 50%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0) 100%);
    transition: var(--npg-transition);
}

/* Bottom Bar Overlay */
.npg-overlay-bottom {
    transform: translateY(0);
}

.npg-overlay-bottom .npg-item-title {
    background: transparent !important;
    padding: 0 !important;
    text-align: center;
    margin: 0;
    display: block;
}

/* Typography for Layout Titles */
.npg-item-title {
    color: #ffffff !important;
    font-family: 'Outfit', 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4) !important;
    display: block;
    width: 100%;
    line-height: 1.3;
}

/* Entry Animation */
@keyframes igFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.single-image {
    opacity: 0;
    will-change: transform, opacity;
}

.npg-row.npg-loaded .single-image {
    animation: igFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Cleanup */
.text-center { text-align: center; }
.npg-image-card a { text-decoration: none !important; color: inherit; }

/* ========================================
   Optimized Hover Effects (Ported from hover.css)
   ======================================== */
.hvr-glow, .hvr-grow-shadow, .hvr-box-shadow-outset, .hvr-float-shadow {
    /*display: inline-block;*/
    vertical-align: middle;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -moz-osx-font-smoothing: grayscale;
    -webkit-transition-duration: 0.3s;
    transition-duration: 0.3s;
}

.hvr-glow { transition-property: box-shadow; }
.hvr-glow:hover { box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }

.hvr-grow-shadow { transition-property: box-shadow, transform; }
.hvr-grow-shadow:hover { 
    box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.5); 
    -webkit-transform: scale(1.1); 
    transform: scale(1.1); 
}

.hvr-box-shadow-outset { transition-property: box-shadow; }
.hvr-box-shadow-outset:hover { box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.6); }

.hvr-float-shadow { position: relative; transition-property: transform; }
.hvr-float-shadow:before {
    pointer-events: none;
    position: absolute;
    z-index: -1;
    content: '';
    top: 100%;
    left: 5%;
    height: 10px;
    width: 90%;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 80%);
    -webkit-transition-duration: 0.3s;
    transition-duration: 0.3s;
    -webkit-transition-property: transform, opacity;
    transition-property: transform, opacity;
}
.hvr-float-shadow:hover { -webkit-transform: translateY(-5px); transform: translateY(-5px); }
.hvr-float-shadow:hover:before { 
    opacity: 1; 
    -webkit-transform: translateY(5px); 
    transform: translateY(5px); 
}
