/* 홈 카드 미리보기 오버레이 */
.preview-slideshow-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 50;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.75);
}

.preview-slideshow-overlay.visible {
    display: block;
}

.preview-slideshow-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.preview-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}

.preview-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

.preview-slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    line-height: 1;
    padding: 0;
}

.preview-slide-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.preview-slide-prev {
    left: 6px;
}

.preview-slide-next {
    right: 6px;
}

.preview-slide-dots {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 5;
}

.preview-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.preview-dot.active {
    background: #fff;
}

.preview-action-buttons {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

@keyframes preview-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.preview-slideshow-overlay.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: preview-spin 0.7s linear infinite;
    z-index: 20;
    pointer-events: none;
}

.worksheetsCard.-type-1 {
    position: relative;
}

.home-news-thumb-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    overflow: hidden;
    background: #f6f8fc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-news-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.home-video-popup {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    display: none;
    width: min(360px, calc(100vw - 24px));
}

.home-video-popup.is-visible {
    display: block;
}

.home-video-popup__backdrop {
    display: none;
}

.home-video-popup__dialog {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    z-index: 1;
}

.home-video-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #eef2f7;
}

.home-video-popup__title {
    font-size: 10px;
    font-weight: 700;
    color: #1f2937;
}

.home-video-popup__close {
    border: 0;
    background: #f3f4f6;
    color: #111827;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.home-video-popup__body {
    padding: 8px 10px;
}

.home-video-popup__frame-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
}

.home-video-popup__frame-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.home-video-popup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px 8px;
}

.home-video-popup__today,
.home-video-popup__dismiss {
    border: 0;
    background: transparent;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
}

.home-video-popup__today {
    color: #7c3aed;
}

.home-video-popup__dismiss {
    color: #4b5563;
}

body.home-video-popup-open {
    overflow-y: auto;
}

@media (max-width: 767px) {
    .home-video-popup {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }

    .home-video-popup__footer {
        flex-direction: column;
        align-items: stretch;
    }
}
