/**
 * WPBakery Post Image Grid - Styles
 */

/* Main Container */
.wpb-post-image-grid {
    width: 100%;
    margin: 0 auto;
}

/* Toolbar */
.wpb-pig-toolbar {
    margin-bottom: 20px;
    text-align: center;
}

.wpb-pig-post-type-selector {
    display: inline-flex;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wpb-pig-post-type-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.wpb-pig-post-type-btn:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}

.wpb-pig-post-type-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Grid Container */
.wpb-pig-grid-container {
    position: relative;
    min-height: 200px;
}

/* Grid */
.wpb-pig-grid {
    width: 100%;
}

/* Grid Items */
.wpb-pig-item {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 0;
}

.wpb-pig-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.wpb-pig-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.wpb-pig-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wpb-pig-item:hover img {
    transform: scale(1.05);
}

/* Hover Overlay */
.wpb-pig-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2;
}

.wpb-pig-item:hover .wpb-pig-overlay {
    opacity: 1;
    visibility: visible;
}

.wpb-pig-overlay-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    padding: 0 20px;
    line-height: 1.3;
}

.wpb-pig-overlay-button {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.wpb-pig-overlay-button:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* Loading Spinner */
.wpb-pig-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    margin-top: 20px;
}

.wpb-pig-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: wpb-pig-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes wpb-pig-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wpb-pig-loading p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Pagination */
.wpb-pig-pagination {
    text-align: center;
    margin-top: 30px;
}

.wpb-pig-load-more {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpb-pig-load-more:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.wpb-pig-page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.wpb-pig-page-number {
    background: #f5f5f5;
    color: #666;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.wpb-pig-page-number:hover,
.wpb-pig-page-number.active {
    background: #007cba;
    color: #fff;
}

.wpb-pig-page-number.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
.wpb-pig-grid.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.wpb-pig-grid.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.wpb-pig-item.animate-in {
    animation: wpb-pig-item-appear 0.5s ease forwards;
}

@keyframes wpb-pig-item-appear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpb-pig-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .wpb-pig-post-type-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .wpb-pig-overlay-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .wpb-pig-overlay-button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wpb-pig-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .wpb-pig-post-type-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .wpb-pig-post-type-btn {
        padding: 6px 12px;
        font-size: 12px;
        margin: 2px;
    }
}

/* Accessibility */
.wpb-pig-post-type-btn:focus,
.wpb-pig-load-more:focus,
.wpb-pig-page-number:focus,
.wpb-pig-overlay-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .wpb-pig-toolbar,
    .wpb-pig-pagination {
        display: none !important;
    }
}