/*
 * Block Skin: image/hyetaek-card — 기획전 카드 (혜택의 차이)
 *
 * PC 열 배치는 mublo-item-layout(block.css)이 한다. 여기서는 간격, 카드
 * 한 장의 모양(16:10 이미지 + 태그·제목·설명), 그리고 모바일 1칸일 때의
 * 가로 스냅 레일(시안 m-rail)을 책임진다.
 */

.hy-xcard .mublo-item-layout:not(.is-slide) > ul {
    gap: 20px;
}

/* PC "자동" — 시안 그대로 320px 이상씩. */
.hy-xcard .mublo-item-layout:not(.is-slide)[data-pc-cols="auto"] > ul {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

.hy-xcard__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hy-xcard__item {
    min-width: 0;
}

.hy-xcard__link {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    color: var(--foreground, #111);
    text-decoration: none;
}

.hy-xcard__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    background: var(--muted, #F4F4F4);
}

.hy-xcard__thumb picture,
.hy-xcard__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}

.hy-xcard__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hy-xcard__tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--hy-accent, #C4001A);
}

.hy-xcard__title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.hy-xcard__sub {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted-foreground, #555);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

a.hy-xcard__link:hover .hy-xcard__title {
    color: var(--hy-accent, #C4001A);
}

@media (hover: hover) {
    .hy-xcard__thumb img {
        transition: transform 0.3s ease;
    }

    a.hy-xcard__link:hover .hy-xcard__thumb img {
        transform: scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hy-xcard__thumb img {
        transition: none;
    }

    a.hy-xcard__link:hover .hy-xcard__thumb img {
        transform: none;
    }
}

@media (max-width: 768px) {
    /* 모바일 list + 1칸 → 카드 80% 폭 가로 스냅 레일.
       다음 카드 끝이 보여 옆으로 넘길 수 있다는 걸 알린다. */
    .hy-xcard .mublo-item-layout:not(.is-slide)[data-mo-cols="1"] > ul {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .hy-xcard .mublo-item-layout:not(.is-slide)[data-mo-cols="1"] > ul::-webkit-scrollbar {
        display: none;
    }

    .hy-xcard .mublo-item-layout:not(.is-slide)[data-mo-cols="1"] > ul > li {
        flex: 0 0 80%;
        scroll-snap-align: start;
    }

    .hy-xcard .mublo-item-layout:not(.is-slide) > ul {
        gap: 12px;
    }

    .hy-xcard__title {
        font-size: 17px;
    }
}
