.ypgl {
    margin: 2rem 0;
}

body.ypgl-is-modal-open {
    overflow: hidden;
}

.ypgl__modal[hidden] {
    display: none;
}

.ypgl__modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.78);
}

.ypgl__modal-dialog {
    position: relative;
    width: min(960px, 100%);
    padding: 4rem 1rem 1rem;
    border-radius: 16px;
    background-color: #111;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.ypgl__modal-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    min-width: 44px;
    min-height: 30px;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background-color: #fff;
    color: #111;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
}

.ypgl__modal-close:hover,
.ypgl__modal-close:focus-visible {
    background-color: #1779c4;
    color: #fff;
    outline: none;
}

.ypgl__modal-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 12px;
    background-color: #000;
}

.ypgl__modal-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.ypgl__modal-title {
    margin: 0.875rem 0 0;
    color: #fff;
    line-height: 1.6;
}

.ypgl__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ypgl__card {
    width: 100%;
    overflow: hidden;
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ypgl__card:hover,
.ypgl__card:focus-within {
    /* border-color: #1779c4; */
    box-shadow: 2px 4px 10px -2px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.ypgl__card.is-active {
    border-color: #1779c4;
    box-shadow: 0 0 0 2px rgba(23, 121, 196, 0.2);
}

.ypgl__card-button {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.ypgl__card-button:focus, 
.ypgl__card-button:hover {
    background: none;
}

.ypgl__card-button:focus-visible {
    outline: none;
}

.ypgl__thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: #f2f2f2;
}

.ypgl__thumb::before,
.ypgl__thumb::after {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    content: "";
    transform: translate(-50%, -50%);
}

.ypgl__thumb::before {
    width: 60px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.72);
    transition: background 0.2s ease, transform 0.2s ease;
}

.ypgl__thumb::after {
    margin-left: 1px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 17px solid #fff;
    transition: transform 0.2s ease;
}

.ypgl__card:hover .ypgl__thumb::before,
.ypgl__card:focus-within .ypgl__thumb::before,
.ypgl__card.is-active .ypgl__thumb::before {
    background-color: rgba(230, 33, 23, 0.92);
    transform: translate(-50%, -50%) scale(1.04);
}

.ypgl__card:hover .ypgl__thumb::after,
.ypgl__card:focus-within .ypgl__thumb::after,
.ypgl__card.is-active .ypgl__thumb::after {
    transform: translate(-50%, -50%) scale(1.04);
}

.ypgl__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ypgl__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #666;
    font-size: 0.875rem;
}

.ypgl__title {
    display: block;
    padding: 0.875rem 1rem 1rem;
    line-height: 1.6;
}

.ypgl__message {
    margin: 0;
    padding: 1rem;
    border: 1px solid #d7d7d7;
    border-radius: 12px;
    background-color: #f8f8f8;
}

.ypgl__noscript {
    margin-top: 1rem;
}

.ypgl__noscript-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

@media (max-width: 767px) {
    .ypgl__modal {
        padding: 1rem;
    }

    .ypgl__modal-dialog {
        padding: 3.25rem 0.75rem 0.75rem;
    }

    .ypgl__modal-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .ypgl__grid {
        grid-template-columns: 1fr;
    }
}
