/**
 * MO Museo - Galerías Frontend Styles
 *
 * @package MO_Museo
 */

/* ===========================================
   Gallery Card (link reset)
   =========================================== */
a.museo-gallery-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.museo-gallery-card:hover,
a.museo-gallery-card:focus {
    text-decoration: none;
    color: inherit;
}

/* ===========================================
   Gallery Card Placeholder (no cover)
   =========================================== */
.museo-gallery-card-placeholder {
    width: 100%;
    height: 200px;
    background: var(--mo-gray-200, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.museo-gallery-card-placeholder::after {
    content: '';
    width: 48px;
    height: 48px;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* ===========================================
   Photo Grid
   =========================================== */
.museo-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--mo-spacing-lg, 1.5rem);
}

.museo-photo-item {
    border-radius: var(--mo-radius-md, 8px);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.museo-photo-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.museo-photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* ===========================================
   Back Button
   =========================================== */
.museo-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--mo-primary, #8B5E3C);
    color: var(--mo-white, #fff);
    text-decoration: none;
    border-radius: var(--mo-radius-sm, 4px);
    font-weight: 500;
    transition: background 0.2s ease;
}

.museo-btn:hover,
.museo-btn:focus {
    background: var(--mo-primary-dark, #6B4226);
    color: var(--mo-white, #fff);
    text-decoration: none;
}

/* ===========================================
   Lightbox
   =========================================== */
.museo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.museo-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

.museo-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.museo-lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.museo-lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 12px 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.museo-lightbox-close,
.museo-lightbox-prev,
.museo-lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 10px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.museo-lightbox-close:hover,
.museo-lightbox-prev:hover,
.museo-lightbox-next:hover {
    opacity: 1;
}

.museo-lightbox-close {
    top: -50px;
    right: -10px;
    font-size: 32px;
}

.museo-lightbox-prev,
.museo-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.museo-lightbox-prev {
    left: -60px;
}

.museo-lightbox-next {
    right: -60px;
}

/* ===========================================
   Responsive
   =========================================== */
@media screen and (max-width: 768px) {
    .museo-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--mo-spacing-md, 1rem);
    }

    .museo-photo-item img {
        height: 150px;
    }

    .museo-lightbox-prev {
        left: 5px;
    }

    .museo-lightbox-next {
        right: 5px;
    }

    .museo-lightbox-close {
        top: 5px;
        right: 5px;
    }

    .museo-lightbox-content img {
        max-width: 95vw;
        max-height: 75vh;
    }
}
