/* Gallery Section (for archive page) */
.gallery-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid #e5e5e5;
}

.gallery-section:last-child {
    border-bottom: none;
}

.gallery-section-header {
    margin-bottom: 30px;
}

.gallery-section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 15px;
    color: #333;
}

.gallery-section-description {
    color: #666;
    line-height: 1.6;
}

.gallery-section-description p:last-child {
    margin-bottom: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 30px 0;
}

.gallery-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-grid-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Card Image Container */
.gallery-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f5f5f5;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-grid-item:hover .gallery-card-image img {
    transform: scale(1.08);
}

/* Video Thumbnails & Placeholder */
.gallery-video-thumb,
.gallery-vimeo-thumb,
.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gallery-placeholder {
    background: linear-gradient(135deg, #ddd 0%, #bbb 100%);
}

.gallery-video-thumb .dashicons,
.gallery-vimeo-thumb .dashicons,
.gallery-placeholder .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: white;
    opacity: 0.9;
}

.gallery-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Card Overlay */
.gallery-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-grid-item:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-grid-item:hover .gallery-card-icon {
    transform: scale(1);
}

.gallery-card-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #333;
}

.gallery-card-icon-play .dashicons {
    color: #e74c3c;
    margin-left: 4px;
}

/* Card Content */
.gallery-card-content {
    padding: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0073aa;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-card-link:hover {
    color: #005177;
}

.gallery-card-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.gallery-modal-content {
    position: relative;
    max-width: 1200px;
    margin: 50px auto;
    padding: 20px;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 48px;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.gallery-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-modal-prev,
.gallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 10;
    transition: background 0.3s ease;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-modal-prev {
    left: 20px;
}

.gallery-modal-next {
    right: 20px;
}

.gallery-modal-media {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    margin-bottom: 20px;
}

.gallery-modal-media img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    border-radius: 8px;
}

.gallery-modal-media video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.gallery-modal-media iframe {
    width: 100%;
    max-width: 900px;
    height: 500px;
    border-radius: 8px;
}

.gallery-modal-info {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.gallery-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 10px;
}

.gallery-modal-description {
    font-size: 1rem;
    color: #ccc;
    margin: 0;
    line-height: 1.6;
}

.gallery-modal-share {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gallery-modal-share p {
    color: white;
    margin: 0;
    font-weight: 500;
}

.gallery-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gallery-share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.gallery-share-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.gallery-share-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.gallery-share-twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.gallery-share-linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.gallery-share-copy {
    cursor: pointer;
}

.gallery-share-copy:hover {
    background: #28a745;
    border-color: #28a745;
}

/* Entry Featured Image */
.entry-featured-image {
    margin: 30px 0;
}

.entry-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .gallery-card-image {
        height: 220px;
    }

    .gallery-modal-content {
        margin: 20px;
        padding: 10px;
    }

    .gallery-modal-prev,
    .gallery-modal-next {
        font-size: 40px;
        padding: 5px 10px;
    }

    .gallery-modal-prev {
        left: 10px;
    }

    .gallery-modal-next {
        right: 10px;
    }

    .gallery-modal-media iframe {
        height: 300px;
    }

    .gallery-modal-share {
        flex-direction: column;
        gap: 10px;
    }

    .gallery-share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-card-image {
        height: 250px;
    }
}
