/**
 * @author Steve Tibbetts <steve@itdsi.com>
 * @version 1.0.0
 * @copyright 2025 Dirigo Solutions, Inc (DSI)
 * @link https://DSI.guru DSI
 */

/* Gallery Section */
.gallery-section {
    background-color: #000000; /* Black base */
	margin-top: -100px;
	/* padding-top: 80px !important; */
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-form input, .search-form button {
    padding: 10px;
    border: 1px solid #4CAF50;
    background-color: #1a1a1a;
    color: #D3D3D3;
}

.sort-buttons a {
    color: #D3D3D3;
    text-decoration: none;
    margin: 0 10px;
}

.sort-buttons a:hover {
    color: #800080;
}

/* Grid Layout - Responsive with More Columns on Wide Screens */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Smaller min for more flexibility */
    gap: 20px;
}

/* Force More Columns on Wider Screens */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Tablet: Slightly larger */
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr); /* Desktop: Fixed 4 columns */
    }
}

/* @media (min-width: 1600px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr); Ultra-wide: 5 columns
    }
} */

.gallery-item {
    background-color: #1a1a1a;
    border: 1px solid #4CAF50;
    padding: 5px;
    text-align: center;
    display: flex;  /* Added: Enables flexbox for column layout */
    flex-direction: column;  /* Stacks thumbnail and info vertically */
    min-height: 320px;  /* Added: Ensures consistent item height (adjust if needed for your content) */
}
.gallery-info {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;  /* Pack from top */
    height: 100% !important;
    gap: 0 !important;  /* No gap between elements */
}

.gallery-info p {
    height: 100px;  /* Fixed height for exactly 4 lines (no min/max needed) */
    flex-grow: 0;  /* Prevents expansion */
    margin-bottom: 20px;
    overflow: hidden;  /* Hides any overflow text */
    text-overflow: ellipsis;  /* Adds "..." for clamped text */
    display: -webkit-box;  /* Enables multi-line ellipsis */
    -webkit-line-clamp: 4;  /* Clamps to exactly 4 lines */
    -webkit-box-orient: vertical;
}

.gallery-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

.rating .star {
    color: #D3D3D3;
    font-size: 20px;
	margin-top: -5 !important;
}

.rating .star.filled {
    color: #800080;
}
.views-count, #modal-views {
    color: #D3D3D3;  /* Light grey to match theme */
    font-size: 14px;  /* Keep this for the number text */
    margin: 0 0 -5px 0 !important;
}
.eye-icon {
    font-size: 18px;  /* Bigger eye only */
}

/* Gallery Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #1a1a1a;
    padding: 20px;
    border: 2px solid #4CAF50;
    width: 100%;  /* Changed: Fills full width of the screen */
    height: 100%;  /* Changed: Fills full height of the screen */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;  /* Centers content horizontally */
    justify-content: center;  /* Centers content vertically */
    position: relative;  /* For absolute positioning of the close 'X' */
    box-sizing: border-box;  /* Ensures padding doesn't overflow */
}
#modal-image {
    width: 100%;
    max-height: 80vh;  /* Adjusted: Limits height to 80% of viewport for better fit, prevents overflow on small screens */
    object-fit: contain;
    margin-bottom: 10px;
}
.close {
    color: #D3D3D3;
    position: absolute;
    top: 0;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
}
.close:hover {
    color: #FF6347;
}

.star.rate {
    cursor: pointer;
    color: #D3D3D3;
	font-size: 20px;
}

.star.rate:hover, .star.rate.active {
    color: #800080;
	font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-controls {
        flex-direction: column;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

