@charset "utf-8";

/* #contentWrap 베이스·반응형은 common.css로 이관(공통). */

/* 배너박스 */
#promoBox {
    position: relative;
}

#promoBox .promoList {
    margin-top: 30px;
}

#promoBox .promoList:has(.slick-dots) {
    padding-bottom: 40px !important;
}

#promoBox .promoList .slick-list {
    margin: 0 -20px;
}

/* 슬라이드 높이 균일화 설정 */
#promoBox .promoList .slick-track {
    display: flex !important;
    align-items: stretch;
}

#promoBox .promoList .slick-slide {
    height: auto !important;
}

#promoBox .promoList .slick-slide>div {
    height: 100%;
}

#promoBox .promoList .cardWrap {
    height: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    outline: none;
}

#promoBox .promoList .card {
    position: relative;
    padding: 20px;
    background-color: #fff;
    border-radius: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0px;
}

#promoBox .promoList h2 {
    width: 100%;
    height: 2.5em;
    font-size: 20px;
    color: #000;
    font-weight: 600;
    word-break: keep-all;
    text-align: center;
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: center;
}

#promoBox .promoList .brandBox {
    position: relative;
    width: 100%;
    aspect-ratio: 1.6 / 1;
}

#promoBox .promoList .brandBox .tagBox {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#promoBox .promoList .brandImg {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}
#promoBox .promoList .brandImg:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    transition: transform 0.6s ease-in-out;
}
#promoBox .promoList .card:hover .brandImg:before {
    transform: scale(1.1);
}


#promoBox .promoList .quizBox {
    position: relative;
    width: 100%;
    aspect-ratio: 1.6 / 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
}
#promoBox .promoList .quizBox > .label {
    color: #fff;
    z-index: 2;
    pointer-events: none;
    text-transform: uppercase;
}
#promoBox .promoList .quizBox > .label:before {
    background-color: var(--pointColor);
}

#promoBox .promoList .quizImg {
    margin: 0;
    border-radius: 20px;
    flex: 1;
    position: relative;
    overflow: hidden;
}
#promoBox .promoList .quizImg:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--bg-img);
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    transition: transform 0.6s ease-in-out;
}
#promoBox .promoList .card:hover .quizImg:before {
    transform: scale(1.1);
}

#promoBox .promoList .btnTake {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    padding: 6px 15px 6px 15px;
    background-color: var(--pointColor);
    border: 0;
    border-radius: 100vh;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    margin-top:15px;
}
#promoBox .promoList .btnTake .takePoint {
    position: relative;
    font-size: 16px;
    color: #fff;
    font-weight: 900;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#promoBox .promoList .btnTake .takePoint:before {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("../images/icon_point.svg");
    background-size: cover;
    background-position: 0 50%;
    background-repeat: no-repeat;
}

/* 미디어 */
#mediaBox {
    margin-top: 40px;
}
#mediaBox h2 {
    font-size: 24px;
    color: #000;
    font-weight: 700;
}
#mediaBox .mediaList:has(.slick-dots) {
    padding-bottom: 20px !important;
}

#mediaBox .mediaList .slick-list {
    margin: 0 -40px;
    padding: 20px 0 !important;
}

#mediaBox .mediaList .mediaCard {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 9 / 16;
    margin: 0 10px;
    border-radius: 20px;
    overflow: hidden;
    align-self: flex-start;
}

#mediaBox .mediaList .mediaCard .mediaImg {
    width: 100%;
    height: 100%;
    margin: 0;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}

/* 제목 오버레이 — 메인 1집발견 카드와 동일(하단 그라데이션 + 좌하단 흰 제목) */
#mediaBox .mediaList .mediaCard:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 50%);
    pointer-events: none;
    z-index: 1;
}
#mediaBox .mediaList .mediaCard .textWrap {
    position: absolute;
    left: 20px;
    bottom: 20px;
    max-width: calc(100% - 40px);
    z-index: 2;
    pointer-events: none;
}
#mediaBox .mediaList .mediaCard .textWrap h2 {
    font-size: 18px;
    color: #fff;
    font-weight: 600;
    word-break: keep-all;
}

/* #tagList 라인 베이스(래퍼·태그칩 스크롤·.tag)는 common.css로 이관. 아래는 1집발견 특이사항만. */

/* 카테고리 탭 — 탭이 늘면(코드플레이 추가) 모바일에서 2줄로 넘쳐 → 1줄 가로 스크롤.
   slick 대신 네이티브 overflow-x + JS scrollIntoView(끝 탭 선택 시 우측 끝 클램프, 앞 탭도 보임).
   PC는 common.css 기본 flex-wrap:wrap 유지(다 보임). 카테고리 多는 1집발견만. */
@media (max-width: 767px) {
    #tagList .tagCate {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    #tagList .tagCate::-webkit-scrollbar { display: none; }
}
#tagList .tagCate .cate {
    flex-shrink: 0;
}

/* 1집발견 */
#homeDscv {
    margin-top: 30px;
}

#homeDscv .homePostList {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

#homeDscv .homePost {
    position: relative;
    width: 100%;
    height: auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 30px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease-in-out;
    /* 태그가 여러 줄로 늘어도 카드 높이가 가변으로 늘도록 flex 컬럼 */
    display: flex;
    flex-direction: column;
}

#homeDscv .homePost:nth-child(odd) {
    background-color: var(--keyColor);
}
#homeDscv .homePost:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#homeDscv .homePost .postImg {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.8;
    background-color: #eaeaea;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    border-radius: 20px;
    overflow: hidden;
}

/* 반응형 <img> (background-image 대체) — 컨테이너 채움, 오버레이 아래 */
#homeDscv .homePost .postImg .coverImg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

#homeDscv .homePost .postImg:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 50%);
}

/* 코드플레이 세그먼트 배지 — 썸네일 위 클릭 시 Fancybox 팝업(링크영역보다 위) */
.previewBadges {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 5;
}
.previewBadges.leftTop {
    top: 10px;
    left: 10px;
}
.previewBadges.leftBottom {
    bottom: 10px;
    left: 10px;
}
/* 쇼츠 칩 — 태그 칩(둥근 pill)과 구분되게 정사각형 박스 + 아이콘(위)·텍스트(아래) 세로 배열. 기본 흰 배경/검정 글(오버 시 반전) */
.previewBadge {
    padding:10px;
    min-width:60px;
    font-size: 13px;
    color: #fff;
    font-weight: 400;
    white-space: nowrap;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* 기본 아이콘 — 검정(SVG 기본색), 텍스트 위 */
.previewBadge .badgeIcon {
    filter: brightness(0) invert(1);
    width: 18px;
    height: 18px;
}

/* hover 시 반전(검정 배경 + 흰 글/아이콘) — 마우스 기기에만(모바일 터치 잔상 방지) */
@media (hover: hover) {
    .previewBadge:hover {
        background-color: rgba(255, 255, 2550, 0.6);
        color: #000;
    }
    .previewBadge:hover .badgeIcon {
        filter: none;
    }
}

#mediaBox .previewBadge,
#homeCoding .previewBadge { cursor: default; }
#mediaBox .previewBadge:hover,
#homeCoding .previewBadge:hover {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.6);
}
#mediaBox .previewBadge:hover .badgeIcon,
#homeCoding .previewBadge:hover .badgeIcon { filter: brightness(0) invert(1); }

/* 코드플레이 탭 — 미디어 슬라이더 카드(.mediaCard)를 4열 그리드로 재사용(12개 페이징) */
#homeCoding {
    margin-top: 30px;
}
#homeCoding .codingList {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
#homeCoding .codingList .mediaCard {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    overflow: hidden;
}
#homeCoding .codingList .mediaCard .mediaImg {
    width: 100%;
    height: 100%;
    margin: 0;
    background-color: #eee;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}
/* 제목 오버레이 — 메인 1집발견 카드와 동일(하단 그라데이션 + 좌하단 흰 제목) */
#homeCoding .codingList .mediaCard:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 50%);
    pointer-events: none;
    z-index: 1;
}
#homeCoding .codingList .mediaCard .textWrap {
    position: absolute;
    left: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
    z-index: 2;
    pointer-events: none;
}
#homeCoding .codingList .mediaCard .textWrap h2 {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
    word-break: keep-all;
}
/* 재생 버튼(.btnPlay)은 common.css의 카드 중앙 원형 버튼 그대로 사용(미디어 슬라이더와 동일). */

/* .f-caption(미디어 캡션) 스타일은 base.css의 FancyBox 섹션으로 이동(디자이너 소스). */

#homeDscv .postImg .linkArea {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#homeDscv .postImg .link {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}

#homeDscv .homePost .textWrap {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

#homeDscv .homePost .textWrap h2 {
    font-size: 18px;
    color: #000;
    font-weight: 600;
    word-break: keep-all;
}

#homeDscv .homePost .textWrap p {
    min-height: 50px;
    font-size: 16px;
    color: #515151;
    font-weight: 400;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

#homeDscv .homePost .tagBox {
    /* 절대배치 → 정상 흐름. margin-top:auto로 카드 바닥에 정렬(그리드 stretch로 같은 행 정렬 유지),
       태그가 2줄+이 되면 카드 높이가 가변으로 늘어남(본문 침범 X). */
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/*
Tablet Device Less than 1023px or greater than 768px
*/
@media all and (min-width:768px) and (max-width:1023px) {
    #tagList {
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        padding: 5px 20px;
    }

    #promoBox .promoList .card {
        padding: 15px;
    }

    #mediaBox .mediaList .mediaCard {
        max-width: 240px;
    }

    #homeDscv .homePostList {
        grid-template-columns: repeat(2, 1fr);
        /* 2열 배치 변경 */
        gap: 20px;
        /* 여백을 20px로 줄임 */
    }

    #homeDscv .homePost {
        padding: 15px;
    }

    #homeCoding .codingList {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/*
Mobile Device Less than 768px
*/
@media all and (max-width:767px) {
    #tagList {
        width: calc(100% + 30px);
        margin-top: 15px;
        margin-left: -15px;
        margin-right: -15px;
        padding: 5px 15px;
    }

    /* 슬라이더 .slick-list 음수마진이 모바일 패딩(15)보다 크면 가로 오버플로 → 패딩에 맞춰 -15로 */
    #promoBox .promoList .slick-list,
    #mediaBox .mediaList .slick-list {
        margin: 0 -15px;
    }

    #promoBox .promoList .card {
        padding: 15px 10px;
    }

    #mediaBox .mediaList .mediaCard {
        max-width: 180px;
    }

    #homeDscv .homePostList {
        grid-template-columns: 1fr;
        /* 1열로 꽉 차게 배치 */
        gap: 16px;
        /* 모바일 화면에 맞춰 여백을 조금 줄여주는 것이 좋습니다 */
    }

    #homeDscv .homePost {
        padding: 10px;
        border-radius: 20px;
    }

    #homeCoding .codingList {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #homeDscv .homePost .postImg {
        border-radius: 15px;
    }

    #homeDscv .postImg .link {
        top: 10px;
        right: 10px;
    }

    #homeDscv .homePost .textWrap h2 {
        font-size: 16px;
    }

    #homeDscv .homePost .textWrap p {
        min-height: auto;
        font-size: 14px;
    }


}
