html, body {
    overflow-x: hidden; /* Prevent horizontal scroll */
    background-color: #121212; /* dark page background */
    color: #eee; /* default text colour */
    font-family: 'Lato', sans-serif;
}

/* Wrapper excluding footer */
.gallery-wrapper > :not(.pfine-gallery-footer) {
    max-width: 1400px;
    margin: auto;
    padding: 50px 20px;
}

/* Page Heading */
h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #f5f5f5;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3em;
    letter-spacing: 1px;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.filters select {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #1e1e1e;
    color: #eee;
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch;
}

/* Card */
.gallery-item {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #1c1c1c;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 450px;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
}

/* Image */
.image-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    flex-shrink: 0;
}
.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.gallery-item:hover .image-wrapper img {
    transform: scale(1.05);
}

/* Overlay */
.overlay {
    padding: 15px;
    background: rgba(18,18,18,0.85);
    color: #f5f5f5;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    font-size: 0.9em;
}

/* Titles and description truncation */
.overlay h3 {
    font-size: 1.2em;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: #f5f5f5;
}
.overlay p {
    margin: 3px 0;
    font-size: 0.85em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
}
.overlay .desc {
    font-size: 0.8em;
    line-height: 1.3em;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #ddd;
}

/* Buttons */
.read-more-btn, .view-btn {
    margin-top: auto;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s ease;
}
.read-more-btn {
    background: #ff9800;
    color: #fff;
}
.view-btn {
    background: #4caf50;
    color: #fff;
}
.read-more-btn:hover { background: #e68a00; }
.view-btn:hover { background: #3e8e41; }

/* Lightbox */
#lightboxModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95);
    overflow-y: auto;
    padding: 40px 20px;
}

.lightbox-content {
    max-width: 900px;
    margin: 60px auto;
    background: #1c1c1c;
    color: #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.lightbox-content img {
    width: 100%;
    height: auto;
    display: block;
}

.lightbox-details {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: #ddd;
}

.lightbox-details h3 { margin-top: 0; color: #fff; }
.lightbox-details p { margin: 5px 0; }

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
}

/* Responsive */
@media screen and (max-width:768px) {
    .gallery-wrapper { padding: 30px 15px; }
    .overlay { padding: 12px; }
}
