/* Shared media result card used by search and contextual credit lists. */

.result-card-grid
{
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    grid-template-areas: "poster title actions";
    align-items: start;
    column-gap: 18px;
    width: 100%;
}

.result-card-grid--without-action
{
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-areas: "poster title";
}

.result-card-grid > .result-card-poster
{
    grid-area: poster;
    position: relative;
    align-self: start;
    justify-self: start;
}

.result-card-grid > .result-card-title-wrap
{
    grid-area: title;
    align-self: start;
}

.result-card-grid > .icon-btn
{
    grid-area: actions;
    align-self: start;
    margin-top: 1.5rem;
}

.result-card-title-wrap
{
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.result-card-title
{
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card-meta
{
    max-width: 100%;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-card
{
    border-color: var(--rf-list-border);
    transition: background-color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.result-card-edge-to-edge
{
    margin: 0 calc(var(--result-card-bleed-x, var(--main-padding-x, 0px)) * -1) !important;
    border: 0;
    border-top: 1px solid var(--rf-list-border);
    border-radius: 0;
    box-shadow: none;
}

.result-card-content
{
    padding-inline: var(--main-padding-x);
}

.list-group .result-card:last-child
{
    border-bottom: 1px solid var(--bs-border-color);
}

.result-card:active
{
    background-color: var(--rf-list-interaction-bg);
    box-shadow: var(--rf-list-interaction-shadow);
}

.result-card-edge-to-edge:active
{
    box-shadow: none;
}

.result-card-poster
{
    width: 54px;
    height: 81px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-card-poster img
{
    display: block;
    width: 54px;
    height: 81px;
    border: 1px solid var(--bs-border-color);
    object-fit: cover;
    transform-origin: center center;
    transition: border 0.2s ease;
}

.result-card-poster-overlay
{
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    border: 3px solid var(--rf-accent);
    background: rgba(0, 0, 0, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.result-card-poster-placeholder
{
    width: 61px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rf-poster-placeholder-border);
    border-radius: 0;
    background: var(--rf-poster-placeholder-bg);
    color: var(--bs-secondary-color);
    opacity: 0.75;
}

.result-card-poster-placeholder i
{
    font-size: 1rem;
}

@media (max-width: 576px)
{
    .result-card-grid
    {
        grid-template-columns: 48px minmax(0, 1fr) auto;
    }

    .result-card-grid--without-action
    {
        grid-template-columns: 48px minmax(0, 1fr);
    }
}

@media (hover: hover) and (pointer: fine)
{
    .result-card:hover
    {
        background-color: var(--rf-list-interaction-bg);
        box-shadow: var(--rf-list-interaction-shadow);
    }

    .result-card-edge-to-edge:hover
    {
        box-shadow: none;
    }

    .result-card:hover .result-card-poster-overlay
    {
        opacity: 1;
    }
}

@media (hover: none)
{
    .result-card:hover
    {
        background-color: inherit;
        box-shadow: none;
    }

    .result-card:active
    {
        background-color: var(--rf-list-interaction-bg);
        box-shadow: var(--rf-list-interaction-shadow);
    }

    .result-card-edge-to-edge:active
    {
        box-shadow: none;
    }

    .result-card:active .result-card-poster-overlay
    {
        opacity: 1;
    }
}
