/* ============================================
   GALLERY THUMBNAIL STYLES
   These styles control the appearance of the
   gallery thumbnail before the lightbox opens
   ============================================ */

/* This is a wierd one as this class isn't used by the plugin, but it's there to HOLD plugin shortcodes */
.dir-gallery-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 5px;
    margin-top: 35px;
    @media (width >= 800px) {            
        flex-direction: row;
        justify-content: center;
        row-gap: 35px;
        column-gap: 15px;
    }
}

/* Container that wraps the gallery thumbnail */
.dir-gallery-container {
	display: flex;
	position: relative;
	z-index: 1;
}

/* The clickable thumbnail element */
.dir-gallery-thumbnail {
	position: relative;
	z-index: 1;
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border: 8px solid #fff;
	box-shadow: 0px 0px 5px #777;
	border-radius: 5px;
	cursor: pointer;
}

/* Hover effect - slightly enlarges the thumbnail */
.dir-gallery-thumbnail:hover > .dir-gallery-image-container {
	transform: scale(1.1);
	filter: brightness(60%);
}

.dir-gallery-thumbnail:hover > .dir-gallery-zoom-icon::before {
	display: block;
}

/* Container for the cover image to allow zoom effect */
.dir-gallery-image-container {
	position: absolute;
	top: 0px;
	z-index: 1;
	width: 100%;
	aspect-ratio: 3 / 2;
	transition: transform 0.4s ease;
}

/* The cover image inside the thumbnail */
.dir-gallery-image {
	height: 100%;
	width: 100%;
}

/* The container that holds both caption and count */
.dir-gallery-caption-container {
	position: absolute;
	z-index: 2;
	bottom: 0px;
	left: 0px;
	width: 100%;
	height: 60px;
	background-color: rgba(0, 0, 0, 0.5);
}

/* Gallery title/caption overlay */
.dir-gallery-caption {
	position: absolute;
	top: 8px;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	width: 100%;
	color: white;
	font-size: 16px;
	font-weight: 500;
}

/* Image count badge */
.dir-gallery-count {
	position: absolute;
	top: 35px;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	width: 100%;
	color: #ccc;
	font-size: 13px;
	font-weight: 300;
}

/* Zoom icon that appears on hover */
.dir-gallery-zoom-icon::before {
	content: "‹‹ zoom ››";   /* "\f10f"; */
	position: absolute;
	z-index: 2;
	top: 70px;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	width: 100%;
	color: white;
	font-size: 20px;
	transition: transform 0.4s ease;
	display: none;
}

/* Decorative frames behind the thumbnail */
.dir-gallery-frame-1 {
	position: absolute;
	z-index: -1;
	top: 0px;
	left: 1px;
	width: 100%;
	aspect-ratio: 3 / 2;
	background: white;
	border: 8px solid #fff;
	box-shadow: 0px 0px 5px #777;
	border-radius: 5px;
	transform: rotate(3deg);
}

/* Decorative frames behind the thumbnail */
.dir-gallery-frame-2 {
	position: absolute;
	z-index: -1;
	top: 0px;
	left: -1px;
	width: 100%;
	aspect-ratio: 3 / 2;
	background: white;
	border: 8px solid #fff;
	box-shadow: 0px 0px 5px #777;
	border-radius: 5px;
	transform: rotate(-3deg);
}

/* ============================================
   LIGHTBOX CONTAINER STYLES
   The full-screen overlay that displays when
   a gallery thumbnail is clicked
   ============================================ */

/* Main lightbox container - hidden by default */
.dir-lightbox {
    display: none;          /* Hidden until activated */
    position: fixed;        /* Fixed positioning covers entire viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;          /* Very high z-index to appear above all other content */
}

/* Active state - shows the lightbox */
.dir-lightbox.active {
    display: flex;          /* Uses flexbox for layout */
    flex-direction: column; /* Stacks children vertically */
}

/* Dark theme background */
.dir-lightbox.dark {
    background: rgba(0, 0, 0, 0.95);  /* Nearly opaque black */
}

/* Light theme background */
.dir-lightbox.light {
    background: rgba(255, 255, 255, 0.95);  /* Nearly opaque white */
}

/* ============================================
   MOBILE HEADER CONTROLS
   Navigation buttons shown only on mobile
   ============================================ */

/* Mobile header - hidden on desktop, shown on mobile */
.dir-lightbox-header {
    display: none;          /* Hidden by default (desktop) */
    justify-content: space-between;  /* Spreads buttons apart */
    align-items: center;
    padding: 10px 15px;
    position: absolute;     /* Positioned at top of lightbox */
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;            /* Above the main image */
}

/* ============================================
   DESKTOP CLOSE BUTTON
   X button in top-right corner (desktop only)
   ============================================ */

.dir-lightbox-close-desktop {
    position: absolute;
    top: 10px;
    right: 20px;
    border: none;
    color: white;
    font-size: 50px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 10;            /* Above the main image */
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hover effect for close button */
.dir-lightbox-close-desktop:hover {
    /* background: rgba(255, 255, 255, 0.3);  /* Slightly more opaque on hover */
    transform: scale(1.2);
    opacity: 0.8;
}

/* Close button styling for light theme */
.dir-lightbox.light .dir-lightbox-close-desktop {
    color: #333;            /* Dark text for light background */
}

/* ============================================
   MAIN IMAGE DISPLAY AREA
   Central area where the large image is shown
   ============================================ */

.dir-lightbox-main {
    flex: 1;                /* Takes up all available vertical space */
    display: flex;
    align-items: center;    /* Centers image vertically */
    justify-content: center; /* Centers image horizontally */
    position: relative;     /* For absolute positioning of nav arrows */
    padding: 80px 100px 140px;  /* Space for controls and thumbnails */
    overflow: hidden;       /* Prevents content from extending beyond */
}

/* Container that holds the displayed image */
.dir-lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The actual displayed image */
.dir-lightbox-image {
    max-width: 100%;        /* Never wider than container */
    max-height: 100%;       /* Never taller than container */
    width: auto;            /* Maintains aspect ratio */
    height: auto;           /* Maintains aspect ratio */
    object-fit: contain;    /* Fits entire image within bounds */
}

/* ============================================
   IMAGE NAVIGATION ARROWS (Desktop)
   Left/right arrows for navigating images
   ============================================ */

.dir-lightbox-nav {
    position: absolute;     /* Positioned on left/right of main area */
    top: 45%;               /* Vertically centered */
    transform: translateY(-50%);  /* Adjusts for button height */
    border: none;
    color: white;
    font-size: 60px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 5;             /* Above image, below close button */
}

/* Hover effect for navigation arrows */
.dir-lightbox-nav:hover {
    transform: translateY(-55%) scale(1.2);
    opacity: 0.8;
}

/* Navigation arrows styling for light theme */
.dir-lightbox.light .dir-lightbox-nav {
    color: #333;
}

/* Position the previous button on the left */
.dir-lightbox-prev {
    left: 20px;
}

/* Position the next button on the right */
.dir-lightbox-next {
    right: 20px;
}

/* ============================================
   THUMBNAIL STRIP AT BOTTOM
   Shows all images for quick navigation
   ============================================ */

/* Wrapper that contains thumbnails and navigation arrows */
.dir-lightbox-thumbnails-wrapper {
    position: absolute;     /* Fixed at bottom of lightbox */
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);  /* Dark background */
    padding: 15px;
    display: flex;          /* Horizontal layout */
    align-items: center;
    z-index: 10;
}

/* Light theme styling for thumbnail wrapper */
.dir-lightbox.light .dir-lightbox-thumbnails-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #ddd;
}

/* Thumbnail navigation arrows (left/right) */
.dir-lightbox-thumb-nav {
    border: none;
    color: white;
    font-size: 50px;
    width: 50px;
    cursor: pointer;
    flex-shrink: 0;         /* Prevents buttons from shrinking */
    transition: transform 0.2s ease, opacity 0.2s ease;
    padding-bottom: 20px;
}

/* Hover effect for thumbnail navigation */
.dir-lightbox-thumb-nav:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* Disabled state for thumbnail navigation (at start/end) */
.dir-lightbox-thumb-nav:disabled {
    opacity: 0.3;           /* Faded appearance */
    cursor: not-allowed;    /* Shows "not allowed" cursor */
}

/* Light theme styling for thumbnail nav buttons */
.dir-lightbox.light .dir-lightbox-thumb-nav {
    color: #333;
}

/* Scrollable container for thumbnails */
.dir-lightbox-thumbnails {
    flex: 1;                /* Takes remaining horizontal space */
    overflow-x: auto;       /* Allows horizontal scrolling */
    overflow-y: hidden;     /* No vertical scrolling */
    white-space: nowrap;    /* Keeps thumbnails in a single row */
    scroll-behavior: smooth; /* Smooth scrolling animation */
}

/* Custom scrollbar styling for webkit browsers */
.dir-lightbox-thumbnails::-webkit-scrollbar {
    height: 8px;            /* Scrollbar height */
}

.dir-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);  /* Scrollbar handle color */
    border-radius: 4px;
}

.dir-lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);  /* Scrollbar track color */
}

/* Individual thumbnail item */
.dir-thumbnail {
    display: inline-block;  /* Allows side-by-side layout */
    width: 80px;
    height: 80px;
    margin: 0 5px;
    cursor: pointer;
    opacity: 0.6;           /* Slightly transparent by default */
    transition: opacity 0.3s;
    border: 2px solid transparent;  /* Invisible border (shown when active) */
}

/* Hover effect for thumbnails */
.dir-thumbnail:hover {
    opacity: 1;             /* Full opacity on hover */
}

/* Active thumbnail (currently displayed image) */
.dir-thumbnail.active {
    opacity: 1;
    border-color: white;    /* White border to highlight */
}

/* Active thumbnail border color for light theme */
.dir-lightbox.light .dir-thumbnail.active {
    border-color: #333;
}

/* Thumbnail image */
.dir-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* Crops to fill square thumbnail */
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   Adjustments for smaller screens
   ============================================ */

@media (max-width: 768px) {
    /* Hide desktop-only controls on mobile */
    .dir-lightbox-close-desktop,
    .dir-lightbox-prev,
    .dir-lightbox-next,
    .dir-lightbox-mobile-prev,
    .dir-lightbox-mobile-next,
    .dir-lightbox-thumb-nav {
        display: none;
    }
    
    /* Show mobile header with controls */
    .dir-lightbox-header {
        display: flex;
        justify-content: end;
    }
    
    /* Mobile control buttons styling */
    .dir-lightbox-header button {
        position: absolute;
        height: 50px;
        font-size: 50px;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        color: white;
        padding-right: 20px;
        top: 5px;
        transition: transform 0.2s ease, opacity 0.2s ease;
        cursor: pointer;
    }
    
    .dir-lightbox-mobile-close:hover {
        transform: scale(1.2);
        opacity: 0.8;
    }

    /* Mobile button styling for light theme */
    .dir-lightbox.light .dir-lightbox-header button {
        color: #333;
        background: rgba(0, 0, 0, 0.1);
    }
    
    /* Reduce padding on mobile */
    .dir-lightbox-main {
        padding: 60px 20px 100px;
    }
    
    /* Smaller thumbnails on mobile */
    .dir-thumbnail {
        width: 60px;
        height: 60px;
    }
}