.mse-movie-grid-wrapper {
    width: 100%;
}

.mse-movie-grid {
    display: grid;
    width: 100%;
}

.mse-movie-card {
    display: block;
}

.mse-movie-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.mse-movie-card__link:hover {
    transform: translateY(-4px);
}

.mse-movie-card__image-wrap {
    position: relative;
    width: 100%;
    
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
}

.mse-movie-card__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.mse-movie-card__image-wrap:hover .mse-movie-card__play-btn {
    opacity: 1;
}

.mse-movie-card__play-btn:hover {
    background: rgba(220, 20, 20, 0.85);
}

/* บนมือถือให้ปุ่ม Play แสดงตลอด เพราะไม่มี hover */
@media (hover: none) {
    .mse-movie-card__play-btn {
        opacity: 1;
    }
}

.mse-movie-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mse-movie-card__title {
    margin: 8px 0 2px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mse-movie-card__rating {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffc107;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

.mse-movie-card__rating .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.mse-movie-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.mse-movie-card__actor {
    font-size: 13px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.mse-movie-card__views {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.mse-movie-card__views .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.mse-movie-grid-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.mse-movie-grid-loadmore {
    padding: 10px 28px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.mse-movie-grid-loadmore:hover {
    background: #f5f5f5;
}

.mse-movie-grid-loadmore:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==== Inline Player (แทนที่โปสเตอร์ตรงจุดเดิมเมื่อกด Play ไม่ใช้ modal) ==== */
.mse-inline-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.mse-inline-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ตอนกด Play แล้ว: ดันให้ player กว้างเต็ม 100vw (edge-to-edge) ไม่ติดกรอบ 900px ของหน้า
   ใช้เทคนิค full-bleed breakout — ใช้หน่วย vw ไม่พึ่ง containing block ของ parent
   จึงทำงานได้แน่นอนไม่ว่า parent จะมี position อะไรอยู่ */
.mse-single-movie__player-area.is-playing {
    grid-column: 1 / -1; /* ยึดเต็มแถวของ grid ก่อน แล้วค่อย breakout อีกที */
}

.mse-single-movie__player-area.is-playing .mse-inline-player {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    border-radius: 0;
}

/* กันเกิด scrollbar แนวนอนจากการ breakout เต็มจอ */
body {
    overflow-x: hidden;
}

.mse-play-error {
    color: #dc1414;
    font-size: 13px;
    margin: 8px 0 0;
}

/* ==== หน้ารายละเอียดหนัง (single movie) ==== */
.mse-single-movie {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 640px) {
    .mse-single-movie {
        grid-template-columns: 1fr;
    }
}

.mse-single-movie__poster {
    position: relative;
}

.mse-single-movie__image {
    width: 100%;
    border-radius: 8px;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #eee;
}

.mse-single-play-btn {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-top: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    gap: 8px;
    opacity: 1;
    background: #dc1414;
}

.mse-single-play-btn:hover {
    background: #b30f0f;
}

.mse-single-movie__title {
    margin: 0 0 12px;
    font-size: 24px;
}

.mse-single-movie__actor,
.mse-single-movie__categories,
.mse-single-movie__date {
    margin: 0 0 8px;
    font-size: 15px;
    color: #444;
}

.mse-single-movie__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #b8860b;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
}

.mse-single-movie__rating .dashicons {
    color: #ffc107;
}