.spg-gallery-container {
    max-width: 1100px;
    margin: auto;
    font-family: sans-serif;
}

.spg-header h2 {
    text-align: center;
    font-family: "Fraunces", Sans-serif;
    font-size: 64px;
    font-weight: 400;
    font-style: italic;
    color: #000000;
}

.spg-filters {
    margin-bottom: 30px;
}

/* --- Search Bar and Icons --- */
.spg-search-container {
    position: relative;
    max-width: 1440px;
    margin: 0 auto 20px;
}

#spg-searchInput {
	font-family: 'Quicksand';
    width: 100%;
    padding: 12px 40px 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    box-sizing: border-box;
    font-size: 1em;
}

/* Search Icon (Image) */
.spg-search-container::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 20px;  /* Set the width of your icon */
    height: 20px; /* Set the height of your icon */
    background-image: url('/wp-content/uploads/2025/10/Frame-1400005431-1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Reset Icon ('x') */
.spg-reset-search {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 2em;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    display: none; /* Hidden by default */
}
.spg-reset-search:hover {
    color: #333;
}

/* When text is entered, hide search icon... */
.spg-search-container.search-active::after {
    opacity: 0;
}
/* ...and show the reset icon */
.spg-search-container.search-active .spg-reset-search {
    display: block;
}

/* --- Filter Tabs --- */
.spg-filter-tabs {
    text-align: center;
}

.spg-tab-button {
    background-color: #fff;
    border: 1px solid #ddd;
    color: #555;
    padding: 5px 20px;
    margin: 5px;
    cursor: pointer;
    border-radius: 10px !important;
    transition: all 0.3s ease;
	font-family: 'Quicksand';
}

.spg-tab-button:hover,
.spg-tab-button.active {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* --- Image Grid --- */
.spg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
}

.spg-gallery-item {
    overflow: hidden;
    border-radius: 8px;
    
    transition: transform 0.2s;
}

.spg-gallery-item:hover {
    transform: scale(1.03);
}

.spg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spg-gallery-item.hide {
    display: none;
}
.spg-gallery-grid img {
    min-height: 599px;
    max-height: 599px;
}

@media (max-width: 768px) {
    .spg-gallery-grid {
        grid-template-columns: 1fr;
    }
	.spg-header h2{font-size: 28px;}
	.spg-gallery-container{margin-top: 30%;}
	.spg-tab-button {
    padding: 5px 10px;font-size: 13.6px;
	}		
	
	.spg-gallery-grid img {
    min-height: auto;
    max-height: auto;
}

}


/* ==========================================================================
   Magnific Popup Lightbox Arrow Fix
   ========================================================================== */

/* This rule forces the right arrow to be visible and correctly positioned.
   The .mfp-container selector increases specificity to override theme styles. */
.mfp-container .mfp-arrow-right {
    right: 0; /* Position it on the right edge */
    opacity: 1; /* Ensure it is not transparent */
    visibility: visible; /* Ensure it is visible */
}

/* This rule ensures the arrow icon itself appears correctly.
   Some themes interfere with the '::after' pseudo-element used for the icon. */
.mfp-arrow-right::after {
    content: '›'; /* Use the HTML entity for the right arrow */
    margin-left: -2px; /* Fine-tune the icon's position inside the button */
    border: none !important; /* Remove any conflicting borders */
}

/* We'll also add a rule for the left arrow for consistency. */
.mfp-arrow-left::after {
    content: '‹'; /* Use the HTML entity for the left arrow */
    margin-left: -2px;
    border: none !important;
}



/* Styling for the "No Results" message */
.spg-no-results {
    display: none; /* Keep hidden by default */
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}










/* --- Image Grid (Masonry Layout) --- */
.spg-gallery-grid {
    /* Define the number of columns for the masonry layout */
    column-count: 3; 
    /* Set the gap between columns */
    column-gap: 15px;
}

.spg-gallery-item {
    /* Prevents an image from breaking across columns */
    break-inside: avoid;
    /* Add some space at the bottom of each image */
    margin-bottom: 15px; 
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.2s;
}

.spg-gallery-item:hover {
    transform: scale(1.03);
}

.spg-gallery-item img {
    width: 100%;
    /* Set height to auto to maintain aspect ratio */
    height: auto; 
    object-fit: cover;
    display: block;
}

.spg-gallery-item.hide {
    display: none;
}

/* --- Responsive Adjustments for Masonry --- */

/* For tablets */
@media (max-width: 768px) {
    .spg-gallery-grid {
        column-count: 2;
    }
}

/* For mobile phones */
@media (max-width: 480px) {
    .spg-gallery-grid {
        column-count: 1;
    }
}