/**
 * RSGT Gallery Widget - Production CSS
 * Pinterest-style masonry layout with lightbox
 * 
 * @package RSGT_Elementor_Addons
 * @version 2.3.0
 */

/* ============================================================================
   1. WRAPPER & CONTAINER - ROOT FIX for Elementor
   ========================================================================= */

/* Force Elementor widget itself to have full width */
.elementor-widget-rsgt-gallery,
.elementor-widget-rsgt-gallery .elementor-widget-container {
    width: 100%;
}

/* Gallery wrapper */
.rsgt-gallery-wrapper,
.elementor-widget-rsgt-gallery .rsgt-gallery-wrapper,
.elementor-column .rsgt-gallery-wrapper,
.elementor-widget-container .rsgt-gallery-wrapper {
    width: 100%;
    max-width: none;
    min-width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

/* ============================================================================
   2. TABS - Glassmorphism Design (Matches News Filter)
   ========================================================================= */

.rsgt-gallery-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.rsgt-gallery-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rsgt-gallery-tab,
.rsgt-gallery-tabs .rsgt-gallery-tab,
button.rsgt-gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #172136;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    line-height: 1.4;
    min-height: 38px;
    text-decoration: none;
    text-shadow: none;
}

.rsgt-gallery-tab::before,
.rsgt-gallery-tabs .rsgt-gallery-tab::before,
button.rsgt-gallery-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: 8px;
    background: linear-gradient(112.71deg, rgba(145, 220, 213, 0.35) 0%, rgba(145, 220, 213, 0.15) 30%, rgba(255, 255, 255, 0) 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: add, add;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.rsgt-gallery-tab:hover,
.rsgt-gallery-tabs .rsgt-gallery-tab:hover {
    background: linear-gradient(276.93deg, #233446 0%, #172136 98.85%);
    border-color: #91DCD5;
    color: #91DCD5;
}

.rsgt-gallery-tab.active,
.rsgt-gallery-tabs .rsgt-gallery-tab.active {
    background: linear-gradient(276.93deg, #233446 0%, #172136 98.85%);
    border-color: #91DCD5;
    color: #91DCD5;
}

.rsgt-gallery-tab.active::before,
.rsgt-gallery-tabs .rsgt-gallery-tab.active::before,
button.rsgt-gallery-tab.active::before,
.rsgt-gallery-tab:hover::before,
.rsgt-gallery-tabs .rsgt-gallery-tab:hover::before,
button.rsgt-gallery-tab:hover::before {
    display: none;
}

/* Tab Count Styling - Hidden */
.rsgt-tab-count {
    display: none;
}

/* ============================================================================
   3. MASONRY GRID (CSS Columns)
   ========================================================================= */

/* Force masonry regardless of Elementor container type */
.rsgt-gallery-grid,
.elementor-widget-rsgt-gallery .rsgt-gallery-grid,
.elementor-column .rsgt-gallery-grid,
.elementor-container .rsgt-gallery-grid,
.elementor-element .rsgt-gallery-grid,
.elementor .rsgt-gallery-grid,
div.rsgt-gallery-grid,
section .rsgt-gallery-grid,
main .rsgt-gallery-grid {
    /* Force block display */
    display: block;
    width: 100%;

    /* Column masonry setup */
    orphans: 1;
    widows: 1;
    position: relative;
    gap: 34px;
    line-height: 0;
}

/* Column configuration - ROOT FIX: Use column-count directly without minimum width */
.rsgt-gallery-columns-2,
.elementor-widget-rsgt-gallery .rsgt-gallery-columns-2 {
    column-count: 2;
    -webkit-column-count: 2;
    -moz-column-count: 2;
}

.rsgt-gallery-columns-3,
.elementor-widget-rsgt-gallery .rsgt-gallery-columns-3 {
    column-count: 3;
    -webkit-column-count: 3;
    -moz-column-count: 3;
}

.rsgt-gallery-columns-4,
.elementor-widget-rsgt-gallery .rsgt-gallery-columns-4 {
    column-count: 4;
    -webkit-column-count: 4;
    -moz-column-count: 4;
}

.rsgt-gallery-columns-5,
.elementor-widget-rsgt-gallery .rsgt-gallery-columns-5 {
    column-count: 5;
    -webkit-column-count: 5;
    -moz-column-count: 5;
}

/* .rsgt-gallery-columns-3 > :nth-child(-n + 4) {
	border-left: 3px solid red;
} */

/* ============================================================================
   4. GALLERY ITEMS
   ========================================================================= */

.rsgt-gallery-item,
.rsgt-gallery-grid .rsgt-gallery-item,
.elementor .rsgt-gallery-item {
    /* Force inline-block for columns */
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;

    /* Prevent breaking inside columns */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;

    /* Visual styling */
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a2332 0%, #0d1420 100%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 24px;
}

.rsgt-gallery-item:hover {
    transform: translateY(-6px) scale(1.02);
}

.rsgt-gallery-item:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

.rsgt-gallery-item-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    display: block;
    height: 100%;
}

.rsgt-gallery-image,
.rsgt-gallery-item img,
.rsgt-gallery-item video {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
    transition: transform 0.4s ease;
    object-fit: cover;
    margin: 0;
    padding: 0;
}

.rsgt-gallery-item video.rsgt-gallery-image {
    background: #1a2332;
    min-height: 200px;
}

.rsgt-gallery-item:hover .rsgt-gallery-image {
    transform: scale(1.05);
}

/* Gallery Item Title Overlay */
.rsgt-gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 79.24%, rgba(23, 33, 54, 0.8) 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    height: 100%;
    display: flex;
    align-items: flex-end;

}

.rsgt-gallery-item:hover .rsgt-gallery-item-title {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   5. VIDEO PLAY ICON
   ========================================================================= */

.rsgt-gallery-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

.rsgt-gallery-item:hover .rsgt-gallery-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.rsgt-gallery-play-icon svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}
html[dir="rtl"] .rsgt-lightbox-prev, html[dir="rtl"] .rsgt-lightbox-next {
  transform: rotate(-180deg);
}
/* ============================================================================
   6. PAGINATION - Glassmorphism Style (Matches News Filter)
   ========================================================================= */

/* .rsgt-gallery-pagination {
	display: flex;
	justify-content: center;
	margin-top: 50px;
}

.rsgt-gallery-pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rsgt-gallery-pagination li {
	display: inline-block;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rsgt-gallery-pagination a,
.rsgt-gallery-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 8px 12px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 8px;
	color: rgba(255, 255, 255, 0.9);
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
}

.rsgt-gallery-pagination a:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.35);
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transform: translateY(-2px);
}

.rsgt-gallery-pagination .current {
	background: rgba(255, 255, 255, 0.2);
	border-color: #00d4ff;
	color: #fff;
	font-weight: 600;
	pointer-events: none;
}

.rsgt-gallery-pagination .dots {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	pointer-events: none;
	box-shadow: none;
} */

/* Previous / Next buttons */
/* .rsgt-gallery-pagination .prev a,
.rsgt-gallery-pagination .next a {
	padding: 8px 16px;
} */
/* Pagination */
.rsgt-gallery-pagination {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.rsgt-gallery-pagination ul {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rsgt-gallery-pagination li {
    margin: 0;
}

.rsgt-gallery-pagination a,
.rsgt-gallery-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 16px;
    color: #91DCD5;
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    z-index: 0;
}

/* Current/Active page */
.rsgt-gallery-pagination .current,
.rsgt-gallery-pagination span.current {
    background: #172136;
    color: #fff;
    background: linear-gradient(276.93deg, #233446 0%, #172136 98.85%);
}

.rsgt-gallery-pagination a::before,
.rsgt-gallery-pagination span::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    /* border thickness */
    border-radius: 16px;
    background: linear-gradient(112.71deg,
            rgba(145, 220, 213, 0.35) 0%,
            rgba(145, 220, 213, 0.15) 30%,
            rgba(255, 255, 255, 0) 70%);

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Previous/Next links */
.rsgt-gallery-pagination .prev,
.rsgt-gallery-pagination .next {
    padding: 0 4px;
    font-size: 18px;
    color: #91DCD5;
}

.rsgt-gallery-pagination .prev:before,
.rsgt-gallery-pagination .next:before,
.rsgt-gallery-pagination .dots:before {
    display: none;
}

.rsgt-gallery-pagination .prev:hover,
.rsgt-gallery-pagination .next:hover {
    color: #fff;
    background: transparent;
}

/* Dots/Ellipsis */
.rsgt-gallery-pagination .dots {
    color: #91DCD5;
    cursor: default;
    pointer-events: none;
    min-width: 30px;
    font-weight: 400;
    letter-spacing: 0;
    font-size: 62px;
    line-height: 0;
    height: 0;
    margin-top: -19px;
}

/* Disabled state */
.rsgt-gallery-pagination .disabled,
.rsgt-gallery-pagination span.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.rsgt-gallery-pagination:empty {
    display: none !important;
}

/* ============================================================================
   7. LIGHTBOX (Portal-style, completely independent)
   ========================================================================= */

.rsgt-gallery-lightbox {
    /* Position as portal - independent of parent containers */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    z-index: 999999;

    /* Hidden by default */
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /* Override any parent container styles */
    transform: none;
    flex: none;
    grid-column: initial;
    grid-row: initial;

    /* Smooth transitions */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rsgt-gallery-lightbox.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    align-items: center;
    justify-content: center;
}

.rsgt-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #17213694;
    backdrop-filter: blur(19.600000381469727px);
    -webkit-backdrop-filter: blur(19.600000381469727px);
    z-index: 0;
}

.rsgt-lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1;
    max-width: 1264px;
    margin: 0 auto;
}

.rsgt-lightbox-media-wrapper {
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Allow clicks to pass through empty space in wrapper */
    pointer-events: none;
}

.rsgt-lightbox-media-wrapper > * {
    /* Re-enable pointer events on actual media content */
    pointer-events: auto;
}

.rsgt-lightbox-media-wrapper img,
.rsgt-lightbox-media-wrapper video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

/* Lightbox Title */
.rsgt-lightbox-title {
    padding: 0;
    align-self: center;
}

.rsgt-lightbox-title h3 {
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
}

.rsgt-lightbox-media-wrapper-main {
    width: 100%;
    position: relative;
    z-index: 0;
    /* Allow clicks to pass through empty space */
    pointer-events: none;
}

.rsgt-lightbox-media-wrapper-main > * {
    /* Re-enable pointer events on actual content */
    pointer-events: auto;
}

/* Override: wrapper itself should allow clicks to pass through */
.rsgt-lightbox-media-wrapper-main .rsgt-lightbox-media-wrapper {
    pointer-events: none !important;
}

.rsgt-lightbox-bottom {
    display: flex;
    justify-content: space-between;
    padding: 17px 0 0;
    align-items: flex-start;
    gap: 8px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Lightbox Controls - Glassmorphism (Matches News Filter) */
.rsgt-lightbox-close,
.rsgt-lightbox-prev,
.rsgt-lightbox-next {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    padding: 10px !important;
    background: transparent !important;
    border: 1px solid #91DCD5 !important;
    border-radius: 8px;
    color: #91DCD5 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.rsgt-lightbox-close:hover,
.rsgt-lightbox-prev:hover,
.rsgt-lightbox-next:hover {
    background: #91DCD5 !important;
    border-color: #91DCD5 !important;
    color: #172136 !important;
}

.rsgt-lightbox-close svg,
.rsgt-lightbox-prev svg,
.rsgt-lightbox-next svg {
    width: 20px;
    height: 20px;
    /* stroke: currentColor;
    stroke-width: 2.5;
    fill: none; */
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rsgt-lightbox-close:hover svg,
.rsgt-lightbox-prev:hover svg,
.rsgt-lightbox-next:hover svg {
    fill: #172136;
}

.rsgt-lightbox-close {
    top: 10px;
    right: 10px;
}

.rsgt-lightbox-prev {
    /* left: 0;
    bottom: -5px;
    /* transform: translateY(-50%); */
    position: initial;
}

.rsgt-lightbox-next {
    /* right: 0;
    bottom: -5px; */
    /* transform: translateY(-50%); */
    position: initial;
}

.rsgt-lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    display: none;
}

/* ============================================================================
   8. LOADING & EMPTY STATES - Shimmer Skeleton
   ========================================================================= */

.rsgt-gallery-loading {
    position: relative;
    min-height: 400px;
}

.rsgt-gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    animation: fadeIn 0.6s ease;
}

/* Shimmer Skeleton - Masonry Layout */
.rsgt-gallery-skeleton {
    display: block;
    column-gap: 34px;
    -webkit-column-gap: 34px;
    -moz-column-gap: 34px;
    padding: 20px 0;
    width: 100%;
    /* Column count will be set dynamically via column classes */
}

/* Dynamic column classes for skeleton - matches gallery grid */
.rsgt-gallery-skeleton.rsgt-gallery-columns-2 {
    column-count: 2;
    -webkit-column-count: 2;
    -moz-column-count: 2;
}

.rsgt-gallery-skeleton.rsgt-gallery-columns-3 {
    column-count: 3;
    -webkit-column-count: 3;
    -moz-column-count: 3;
}

.rsgt-gallery-skeleton.rsgt-gallery-columns-4 {
    column-count: 4;
    -webkit-column-count: 4;
    -moz-column-count: 4;
}

.rsgt-gallery-skeleton.rsgt-gallery-columns-5 {
    column-count: 5;
    -webkit-column-count: 5;
    -moz-column-count: 5;
}

.rsgt-gallery-skeleton-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #1a2332 0%, #0d1420 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;

    /* Prevent breaking inside columns */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

/* Random heights for realistic masonry effect */
.rsgt-gallery-skeleton-item:nth-child(1) {
    height: 280px;
}

.rsgt-gallery-skeleton-item:nth-child(2) {
    height: 320px;
}

.rsgt-gallery-skeleton-item:nth-child(3) {
    height: 240px;
}

.rsgt-gallery-skeleton-item:nth-child(4) {
    height: 360px;
}

.rsgt-gallery-skeleton-item:nth-child(5) {
    height: 300px;
}

.rsgt-gallery-skeleton-item:nth-child(6) {
    height: 260px;
}

.rsgt-gallery-skeleton-item:nth-child(7) {
    height: 340px;
}

.rsgt-gallery-skeleton-item:nth-child(8) {
    height: 280px;
}

.rsgt-gallery-skeleton-item:nth-child(9) {
    height: 310px;
}

.rsgt-gallery-skeleton-item:nth-child(10) {
    height: 270px;
}

.rsgt-gallery-skeleton-item:nth-child(11) {
    height: 330px;
}

.rsgt-gallery-skeleton-item:nth-child(12) {
    height: 290px;
}

/* .rsgt-gallery-item:nth-child(1),
.rsgt-gallery-skeleton-item:nth-child(1) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(2),
.rsgt-gallery-skeleton-item:nth-child(2) {
	height: 419px;
}
.rsgt-gallery-item:nth-child(3),
.rsgt-gallery-skeleton-item:nth-child(3) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(4),
.rsgt-gallery-skeleton-item:nth-child(4) {
	height: 419px;
}
.rsgt-gallery-item:nth-child(5),
.rsgt-gallery-skeleton-item:nth-child(5) {
	height: 419px;
}
.rsgt-gallery-item:nth-child(6),
.rsgt-gallery-skeleton-item:nth-child(6) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(7),
.rsgt-gallery-skeleton-item:nth-child(7) {
	height: 419px;
}
.rsgt-gallery-item:nth-child(8),
.rsgt-gallery-skeleton-item:nth-child(8) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(9),
.rsgt-gallery-skeleton-item:nth-child(9) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(10),
.rsgt-gallery-skeleton-item:nth-child(10) {
	height: 419px;
}
.rsgt-gallery-item:nth-child(11),
.rsgt-gallery-skeleton-item:nth-child(11) {
	height: 245px;
}
.rsgt-gallery-item:nth-child(12),
.rsgt-gallery-skeleton-item:nth-child(12) {
	height: 419px;
} */

/* 245px height */
/* .rsgt-gallery-item:nth-child(12n + 1),
.rsgt-gallery-item:nth-child(12n + 3),
.rsgt-gallery-item:nth-child(12n + 6),
.rsgt-gallery-item:nth-child(12n + 8),
.rsgt-gallery-item:nth-child(12n + 9),
.rsgt-gallery-item:nth-child(12n + 11),
.rsgt-gallery-skeleton-item:nth-child(12n + 1),
.rsgt-gallery-skeleton-item:nth-child(12n + 3),
.rsgt-gallery-skeleton-item:nth-child(12n + 6),
.rsgt-gallery-skeleton-item:nth-child(12n + 8),
.rsgt-gallery-skeleton-item:nth-child(12n + 9),
.rsgt-gallery-skeleton-item:nth-child(12n + 11) {
	height: 245px;
} */

/* 419px height */
/* .rsgt-gallery-item:nth-child(12n + 2),
.rsgt-gallery-item:nth-child(12n + 4),
.rsgt-gallery-item:nth-child(12n + 5),
.rsgt-gallery-item:nth-child(12n + 7),
.rsgt-gallery-item:nth-child(12n + 10),
.rsgt-gallery-item:nth-child(12n + 12),
.rsgt-gallery-skeleton-item:nth-child(12n + 2),
.rsgt-gallery-skeleton-item:nth-child(12n + 4),
.rsgt-gallery-skeleton-item:nth-child(12n + 5),
.rsgt-gallery-skeleton-item:nth-child(12n + 7),
.rsgt-gallery-skeleton-item:nth-child(12n + 10),
.rsgt-gallery-skeleton-item:nth-child(12n + 12) {
	height: 419px;
} */

.rsgt-gallery-skeleton-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.08) 50%,
            transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* Show skeleton when loading */
.rsgt-gallery-loading .rsgt-gallery-grid {
    display: none;
}

.rsgt-gallery-loading::after {
    content: '';
    display: block;
}

/* ============================================================================
   9. RESPONSIVE DESIGN
   ========================================================================= */

@media (max-width: 1200px) {

    .rsgt-gallery-columns-5,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-5 {
        column-count: 4;
        -webkit-column-count: 4;
        -moz-column-count: 4;
    }
}

@media (max-width: 992px) {

    .rsgt-gallery-columns-4,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-4,
    .rsgt-gallery-columns-5,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-5,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-4,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-5 {
        column-count: 3;
        -webkit-column-count: 3;
        -moz-column-count: 3;
    }

    .rsgt-gallery-tabs {
        gap: 6px;
    }

    .rsgt-gallery-tab {
        font-size: 11px;
        padding: 6px 12px;
        min-height: 36px;
    }
}

@media (max-width: 767px) {

    .rsgt-gallery-columns-2,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-2,
    .rsgt-gallery-columns-3,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-3,
    .rsgt-gallery-columns-4,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-4,
    .rsgt-gallery-columns-5,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-5,
    .rsgt-gallery-skeleton {
        gap: 8px;
    }

    .rsgt-gallery-columns-3,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-3,
    .rsgt-gallery-columns-4,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-4,
    .rsgt-gallery-columns-5,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-5,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-3,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-4,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-5 {
        column-count: 2;
        -webkit-column-count: 2;
        -moz-column-count: 2;
    }

    .rsgt-gallery-item,
    .rsgt-gallery-grid .rsgt-gallery-item,
    .elementor .rsgt-gallery-item {
        margin-bottom: 8px;
    }

    .rsgt-gallery-item,
    .rsgt-gallery-skeleton-item {
        margin-bottom: 8px;
    }

    .rsgt-gallery-grid,
    .rsgt-gallery-skeleton {
        column-gap: 8px;
        -webkit-column-gap: 8px;
        -moz-column-gap: 8px;
    }

    .rsgt-gallery-tabs {
        gap: 4px;
    }

    .rsgt-gallery-tab {
        font-size: 11px;
        padding: 6px 12px;
        min-height: 36px;
    }

    .rsgt-lightbox-close {
        top: 10px;
        right: 10px;
    }

    .rsgt-lightbox-title h3 {
        font-size: 14px;
    }

    .rsgt-gallery-pagination .prev,
	.rsgt-gallery-pagination .next {
		font-size: 14px;
	}

	.rsgt-gallery-pagination a,
	.rsgt-gallery-pagination span {
		font-size: 14px;
		min-width: 40px;
		height: 40px;
	}

	.rsgt-gallery-pagination .dots {
		font-size: 50px;
		margin-top: -14px;
    }
}

@media (max-width: 479px) {

    /* .rsgt-gallery-columns-2,
	.rsgt-gallery-columns-3,
	.rsgt-gallery-columns-4,
	.rsgt-gallery-columns-5,
	.rsgt-gallery-skeleton {
		column-count: 1;
		-webkit-column-count: 1;
		-moz-column-count: 1;
	} */

    .rsgt-gallery-columns-2,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-2,
    .rsgt-gallery-columns-3,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-3,
    .rsgt-gallery-columns-4,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-4,
    .rsgt-gallery-columns-5,
    .elementor-widget-rsgt-gallery .rsgt-gallery-columns-5,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-2,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-3,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-4,
    .rsgt-gallery-skeleton.rsgt-gallery-columns-5 {
        column-count: 2;
        -webkit-column-count: 2;
        -moz-column-count: 2;
    }

    .rsgt-gallery-grid,
    .rsgt-gallery-skeleton {
        column-gap: 0;
        -webkit-column-gap: 0;
        -moz-column-gap: 0;
    }

    .rsgt-gallery-tabs {
        gap: 4px;
    }

    .rsgt-gallery-tab {
        font-size: 10px;
        padding: 6px 10px;
        min-height: 32px;
    }
}

/* ============================================================================
   10. MICRO-ANIMATIONS
   ========================================================================= */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Scale In with Subtle Bounce */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    60% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse Glow */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    50% {
        box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
    }
}

/* Gallery Items Stagger Animation */
.rsgt-gallery-item {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.rsgt-gallery-item:nth-child(1) {
    animation-delay: 0.05s;
}

.rsgt-gallery-item:nth-child(2) {
    animation-delay: 0.1s;
}

.rsgt-gallery-item:nth-child(3) {
    animation-delay: 0.15s;
}

.rsgt-gallery-item:nth-child(4) {
    animation-delay: 0.2s;
}

.rsgt-gallery-item:nth-child(5) {
    animation-delay: 0.25s;
}

.rsgt-gallery-item:nth-child(6) {
    animation-delay: 0.3s;
}

.rsgt-gallery-item:nth-child(7) {
    animation-delay: 0.35s;
}

.rsgt-gallery-item:nth-child(8) {
    animation-delay: 0.4s;
}

.rsgt-gallery-item:nth-child(9) {
    animation-delay: 0.45s;
}

.rsgt-gallery-item:nth-child(10) {
    animation-delay: 0.5s;
}

.rsgt-gallery-item:nth-child(11) {
    animation-delay: 0.55s;
}

.rsgt-gallery-item:nth-child(12) {
    animation-delay: 0.6s;
}

/* Tabs Animation */
/* .rsgt-gallery-tab {
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rsgt-gallery-tab.active {
	animation: pulseGlow 2s ease-in-out infinite;
} */

/* Lightbox Entrance */
.rsgt-gallery-lightbox.active {
    animation: fadeIn 0.3s ease;
}

.rsgt-gallery-lightbox.active .rsgt-lightbox-container {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pagination Animation */
.rsgt-gallery-pagination a,
.rsgt-gallery-pagination span {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Play Icon Pulse */
.rsgt-gallery-play-icon {
    animation: playIconPulse 2s ease-in-out infinite;
}

@keyframes playIconPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

/* ============================================================================
   11. ACCESSIBILITY
   ========================================================================= */

.rsgt-gallery-tab:focus,
.rsgt-lightbox-close:focus,
.rsgt-lightbox-prev:focus,
.rsgt-lightbox-next:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}