/* Image Gallery Styles */
.media-gallery-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 300px;
}

.media-gallery-wrapper .gallery-image {
    width: 100%;
    height: auto;
    display: block;
}

/* When the wrapper has fixed dimensions, contain the image without stretch/crop */
.media-gallery-wrapper.media-gallery-fixed .gallery-image,
.media-gallery-wrapper.media-gallery-fixed img:not(.gallery-image) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.media-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    z-index: 2;
    padding: 0;
    outline: none;
}

.media-gallery-wrapper:hover .media-gallery-btn {
    opacity: 1;
}

.media-gallery-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--colore-accento);
}

.media-gallery-btn .material-symbols-rounded {
    font-size: 28px;
    color: #fff;
}

.media-gallery-btn-left {
    left: 8px;
}

.media-gallery-btn-right {
    right: 8px;
}

.media-gallery-counter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 4px;
    user-select: none;
}

@media (max-width: 768px) {
    .media-gallery-wrapper {
        max-width: 250px;
    }

    .media-gallery-btn {
        width: 38px;
        height: 38px;
    }

    .media-gallery-btn .material-symbols-rounded {
        font-size: 24px;
    }
}