/* Mast Photo Gallery - Full Width Everything - No Margins */

/* Force full width on pages with shortcode or single album */
.mast-pg-albums-fullwidth,
.mast-pg-single-wrapper,
.mast-pg-single-container,
.mast-pg-gallery-grid,
.mast-pg-filter-bar,
#mast-pg-album-list,
.mast-pg-pagination {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Remove padding/margins from common theme wrappers */
.mast-pg-active .site,
.mast-pg-active .site-content,
.mast-pg-active .site-main,
.mast-pg-active #primary,
.mast-pg-active #content,
.mast-pg-active .container,
.mast-pg-active .entry-content,
.mast-pg-active .hentry,
.mast-pg-active .post,
.mast-pg-active .page,
.mast-pg-active .wrap,
.mast-pg-active .main,
.mast-pg-active .content-area,
.mast-pg-active article,
.mast-pg-active .entry,
.mast-pg-active .entry-wrapper,
.mast-pg-active .inner-wrap,
.mast-pg-active .page-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.mast-pg-active body {
    overflow-x: hidden;
}

.mast-pg-albums-fullwidth {
    padding: 20px !important;
}

/* Filter bar - center category buttons */
.mast-pg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px !important;
    width: 100%;
}

.mast-pg-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* Filter buttons - inactive state MORE VISIBLE */
.mast-pg-filter-btn {
    background: #e0e0e0;      /* darker gray for better visibility */
    border: 1px solid #b0b0b0; /* visible border */
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 50px !important;
    transition: 0.2s;
    font-size: 0.9rem;
    color: #222;               /* dark text for contrast */
    font-weight: 500;
}

/* Active/hover state - same as before but now inactive is clearly different */
.mast-pg-filter-btn.active,
.mast-pg-filter-btn:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Search and sort inputs */
#mast-pg-search,
#mast-pg-sort {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Grid layout */
.mast-pg-grid {
    display: grid;
    gap: 20px;
    width: 100%;
}

/* Album card - overlay button on hover */
.mast-pg-album-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mast-pg-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mast-pg-card-link {
    text-decoration: none;
    color: #333;
    display: block;
}

/* Thumbnail wrapper for overlay */
.mast-pg-thumb-wrapper {
    position: relative;
    overflow: hidden;
}

.mast-pg-thumb-wrapper img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mast-pg-album-card:hover .mast-pg-thumb-wrapper img {
    transform: scale(1.05);
}

/* Overlay button */
.mast-pg-overlay-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 115, 170, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.mast-pg-album-card:hover .mast-pg-overlay-btn {
    opacity: 1;
}

/* Album title and description */
.mast-pg-album-card h3 {
    margin: 12px;
    font-size: 1.2rem;
}

.mast-pg-album-card p {
    margin: 0 12px 12px;
    font-size: 0.9rem;
    color: #666;
}

/* Pagination */
.mast-pg-pagination {
    margin-top: 30px !important;
    text-align: center;
}

.mast-pg-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    background: #f1f1f1;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.mast-pg-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
}

/* Single Gallery - Hero Image */
.mast-pg-hero-image {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    overflow: hidden;
    max-height: 70vh;
}

.mast-pg-hero-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mast-pg-single-container {
    width: 100%;
    padding: 20px !important;
    box-sizing: border-box;
}

.mast-pg-single-title {
    font-size: 2.5rem;
    margin: 20px 0 !important;
}

.mast-pg-single-description {
    font-size: 1.1rem;
    line-height: 1.6;
}

.mast-pg-gallery-grid {
    display: grid;
    gap: 15px;
    margin-top: 30px !important;
}

/* Lightbox slideshow styles */
.mast-pg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mast-pg-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
}

.mast-pg-lightbox-prev,
.mast-pg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 40px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s;
    user-select: none;
}

.mast-pg-lightbox-prev:hover,
.mast-pg-lightbox-next:hover {
    background: rgba(255,255,255,0.4);
}

.mast-pg-lightbox-prev {
    left: 20px;
}

.mast-pg-lightbox-next {
    right: 20px;
}

.mast-pg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    z-index: 100000;
}

.mast-pg-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 5px 10px;
    width: fit-content;
    margin: 0 auto;
    border-radius: 20px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .mast-pg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .mast-pg-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mast-pg-single-title {
        font-size: 1.8rem;
    }
    .mast-pg-lightbox-prev,
    .mast-pg-lightbox-next {
        font-size: 30px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .mast-pg-grid {
        grid-template-columns: 1fr !important;
    }
}
