/* Photos and videos of a diada (modules/Media), under its castells */

.edicio-media {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
    gap: 0.75rem;

    @media (width >= 768px) {
        grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
        gap: 1rem;
    }
    list-style: none;
    padding: 0;
    margin: 0;

    > li {
        position: relative;
        display: flex;
        flex-direction: column;
        min-width: 0;
        padding: 0.5rem;
        border-radius: 0.5rem;
        background-color: var(--color-white);
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

.edicio-media-enllac {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;

    &:hover {
        color: inherit;
        text-decoration: none;
    }

    &:hover .edicio-media-titol {
        text-decoration: underline;
    }
}

.edicio-media-miniatura {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 0.375rem;
    background-color: var(--color-gray-lighter);

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.edicio-media-icona {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-white);

    .edicio-media-miniatura:not(:has(img)) & {
        color: var(--color-gray-darker);
    }

    .edicio-media-miniatura:has(img) & {
        background: radial-gradient(circle, rgba(0, 0, 0, 0.45) 0 1.5rem, transparent 1.6rem);
    }
}

.edicio-media-titol {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.edicio-media-peu {
    overflow: hidden;
    padding-right: 1.75rem;
    font-size: 0.8125rem;
    color: var(--color-gray-darkest);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* «⋯», at the end of the footer line: reporting it, out of the way */
.edicio-media-mes {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
}

.edicio-media-mes-boto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-gray-darker);
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.15s, background-color 0.15s;

    &:hover,
    &:focus-visible,
    &[aria-expanded="true"] {
        opacity: 1;
        background-color: var(--color-gray-lighter);
    }
}
