@charset "utf-8";
.theme_index {
    --tidx-white: #fff;
    --tidx-gray10: #fafafa;
    --tidx-gray15: #f4f4f5;
    --tidx-gray20: #e9e9ed;
    --tidx-gray30: #dcdcdc;
    --tidx-gray60: #7e7f80;
    --tidx-gray80: #53565d;
    --tidx-gray100: #1e1e21;
    --tidx-navy: #444558;
    --tidx-blue: #0057ed;
    --tidx-violet: #5f68ff;
    --tidx-sky: #009dff;
    --tidx-overlay: #5d66ff;
    --tidx-pink: #f09;

    --tidx-radius-card-top: 18px;
    --tidx-radius-card-bottom: 12px;
    --tidx-radius-thumb: 12px;

    width: 1200px;
    margin: 0 auto;
    font-family :'Noto Sans Korean','AppleSDGothic Neo-Regular','Malgun Gothic', '맑은 고딕', 'dotum', '돋움', sans-serif;
    color: var(--tidx-gray100);
    box-sizing: border-box;
}

.theme_index *,
.theme_index *::before,
.theme_index *::after {
    box-sizing: border-box;
}

/* :where() 로 특이도를 0 으로 낮춰, 아래 컴포넌트 규칙이 항상 우선하도록 한다 */
.theme_index :where(ul, ol, li) {
    list-style: none;
    margin: 0;
    padding: 0;
}

.theme_index .blind {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme_kv {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: url('/resources/images/theme/index/bg_kv_repeat.png') 0 0 repeat-x;
}
.kv_inner {
    text-align: center;
    background: url('/resources/images/theme/index/bg_kv.png') 50% 0 no-repeat;
}

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

/* --------------------------------------------------------------------------
   인기 테마관 TOP
   -------------------------------------------------------------------------- */
.tidx_top {
    padding-top: 48px;
}

.tidx_top .tidx_card {
    width: 384px;
}

.tidx_head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    text-align: center;
}

.tidx_head_sub {
    margin: 0;
    font-family: "GmarketSansMedium", "Noto Sans KR", sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -0.24px;
    color: var(--tidx-gray80);
}

.tidx_head_tit {
    margin: 0;
    font-family: "GmarketSansBold", "Noto Sans KR", sans-serif;
    font-size: 38px;
    font-weight: 400;
    line-height: 1.28;
    letter-spacing: -0.38px;
    color: var(--tidx-navy);
}

.tidx_head_tit .point {
    margin-left: 8px;
    background: linear-gradient(90deg, #87fff5 0%, #3a0dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: inherit;
    font-size: inherit;
}

.tidx_head_tit .point .num {
    margin-left: 3px;
}

/* 엄지 오브제 : 원본이 1055 x 1008 이라 크기를 반드시 지정해야 한다 */
.tidx_head_deco {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 72px;
    margin: -70px 0 0 -291px;
    transform: rotate(-24deg);
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.1));
    pointer-events: none;
}

.tidx_head_deco img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tidx_top_list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

/* --------------------------------------------------------------------------
   필터 (교과 탭 + 유형 태그)
   -------------------------------------------------------------------------- */
.tidx_filter {
    margin-top: 80px;
}

.tidx_filter_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* 교과 : 단일 선택 */
.tidx_subj {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tidx_subj_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 43px;
    padding: 7px 14px;
    border: 1px solid var(--tidx-violet);
    border-radius: 90px;
    background: var(--tidx-white);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: var(--tidx-gray100);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

/*.tidx_subj_btn:hover {*/
/*    background: #f2f4ff;*/
/*}*/

.tidx_subj_btn:hover,
.tidx_subj_btn[aria-selected='true'] {
    position: relative;
    border-color: transparent;
    background: linear-gradient(180deg, var(--tidx-sky) 0%, var(--tidx-violet) 100%);
    box-shadow: 0 4px 5px rgba(52, 112, 208, 0.16);
    font-weight: 700;
    color: var(--tidx-white);
}

.tidx_subj_btn:hover:after,
.tidx_subj_btn[aria-selected='true']:after {
    content: '';
    display: block;
    position: absolute;
    top: 38px;
    left: 50%;
    margin-left: -6px;
    width: 12px;
    height: 11px;
    background: url('/resources/images/theme/index/filter_on.png') 0 0 no-repeat;

}

/* 하트 안내 문구 */
.tidx_guide {
    margin: 0;
    margin-left: auto;
    font-size: 14px;
    line-height: 1.3;
    color: var(--tidx-gray60);
    white-space: nowrap;
}

.tidx_guide .heart {
    color: var(--tidx-pink);
}

/* 유형 : 복수 선택 */
.tidx_type {
    display: flex;
    align-items: center;
    margin-top: 12px;
}

.tidx_type_list {
    display: inline-flex;
    align-items: center;
    padding: 10px 28px;
    border-radius: 117px;
    background: rgba(244, 244, 245, 0.8);
}

.tidx_type_list > li {
    display: flex;
    align-items: center;
}

.tidx_type_list > li + li::before {
    content: '';
    flex: none;
    width: 1px;
    height: 12px;
    margin: 0 14px;
    background: var(--tidx-gray30);
}

.tidx_type_btn {
    padding: 8px 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: var(--tidx-gray100);
    cursor: pointer;
    transition: color 0.2s;
}

.tidx_type_btn:hover {
    color: var(--tidx-blue);
}

.tidx_type_btn[aria-pressed='true'] {
    font-weight: 700;
    color: var(--tidx-gray100);
}

/* --------------------------------------------------------------------------
   전체 테마관 리스트
   -------------------------------------------------------------------------- */
.tidx_list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 16px;
    margin-top: 28px;
    padding-bottom: 100px;
}

.tidx_empty {
    grid-column: 1 / -1;
    padding: 100px 0;
    text-align: center;
    font-size: 16px;
    color: var(--tidx-gray60);
}

/* --------------------------------------------------------------------------
   카드 (공통)
   -------------------------------------------------------------------------- */
.tidx_card {
    /* 기본 상태 썸네일 창의 높이 */
    --tidx-thumb-h: 150px;
    /* 기본 상태 썸네일 창이 카드 안쪽 테두리에서 들어온 거리. 카드 padding 과 같게 유지한다.
       호버 시 대표 배너를 원래 자리에 붙잡아 두는 데 쓴다. */
    --tidx-thumb-inset: 6px;
    width: 288px;
    position: relative;
    display: block;
    height: 243px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--tidx-gray20);
    border-radius: var(--tidx-radius-card-top) var(--tidx-radius-card-top) var(--tidx-radius-card-bottom) var(--tidx-radius-card-bottom);
    background: var(--tidx-white);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* 썸네일 : 이미지가 보이는 창.
   기본 상태는 가로로 긴 배너 영역이고, 호버 시 카드 테두리 안쪽 전체로 넓어진다.
   창 안에는 대표 배너(.tidx_banner)와 롤링(.tidx_roll)이 겹쳐 있다. */
.tidx_thumb {
    --tidx-thumb-pos: 50% 50%;

    position: relative;
    height: var(--tidx-thumb-h);
    overflow: hidden;
    border-radius: var(--tidx-radius-thumb);
    background: var(--tidx-gray15);
    transition: border-radius 0.2s;
}

/* 원본 비율이 다른 이미지를 넣으면 이 단계에서 잘린다.
   잘리는 위치는 카드별로 --tidx-thumb-pos 를 덮어써서 조정한다. */
.tidx_thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--tidx-thumb-pos);
}

/* 대표 배너 (736 x 400) : 기본 상태에 노출된다.
   롤링 위에 겹쳐 두고 호버 시 제자리에서 서서히 사라지게 해, 그 아래 롤링이 드러난다. */
.tidx_thumb .tidx_banner {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    transition: opacity 0.25s ease;
}

/* 호버 롤링 (768 x 650) : 배너 아래에 깔아 두고 넓어진 창을 그대로 채운다 */
.tidx_roll {
    position: absolute;
    inset: 0;
}

.tidx_roll_item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.tidx_roll_item.is-active {
    opacity: 1;
}

/* 교과 뱃지 (공통/국어/수학...) */
.tidx_flag {
    position: absolute;
    bottom: 94px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 28px;
    padding: 4px 8px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--tidx-gray80);
    transition: bottom 0.2s;
}

/* 즐겨찾기 하트 */
.tidx_fav {
    position: absolute;
    bottom: 94px;
    right: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: bottom 0.2s, transform 0.15s;
}

.tidx_fav:hover {
    transform: scale(1.08);
}

.tidx_fav::before {
    content: '';
    display: block;
    width: 17px;
    height: 16px;
    background: url('/resources/images/theme/index/ico_heart_off.svg') no-repeat 50% 50%;
    background-size: 17px 16px;
}

.tidx_fav[aria-pressed='true']::before {
    background-image: url('/resources/images/theme/index/ico_heart_on.svg');
}

/* NEW / UPDATE / 추천 뱃지 */
.tidx_badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 28px;
    padding: 2px 10px;
    border-radius: var(--tidx-radius-thumb) 0 var(--tidx-radius-thumb) 0;
    background: var(--tidx-navy);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: var(--tidx-white);
    text-shadow: 0 0.73px 2.04px rgba(0, 0, 0, 0.14);
    transition: top 0.2s, left 0.2s, border-radius 0.2s;
}

/* 테마관 정보 */
.tidx_info {
    position: relative;
    padding: 18px 12px 14px;
    overflow: hidden;
}

.tidx_info_tit {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tidx-gray100);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tidx_info_desc {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--tidx-gray60);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 썸네일 롤링 인디케이터 */
.tidx_dots {
    position: absolute;
    bottom: 7px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.tidx_dots li {
    width: 8px;
    height: 8px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.25s, background-color 0.25s;
}

.tidx_dots li.is-active {
    width: 20px;
    background: var(--tidx-white);
}

/* 슬라이드가 1장인 카드는 인디케이터를 노출하지 않는다.
   :has() 를 지원하지 않는 환경에서는 스크립트가 hidden 을 붙인다. */
.tidx_card:not(:has(.tidx_roll_item + .tidx_roll_item)) .tidx_dots,
.tidx_dots[hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   카드 : 호버 (썸네일 확장 + 정보 오버레이)
   -------------------------------------------------------------------------- */
.tidx_card:hover,
.tidx_card:focus-visible,
.tidx_card.is-hover {
    padding: 0;
    border-color: var(--tidx-blue);
    box-shadow: 0 13px 17.6px rgba(144, 144, 144, 0.2);
    outline: 2px solid var(--tidx-blue);
}

.tidx_card:hover .tidx_thumb,
.tidx_card:focus-visible .tidx_thumb,
.tidx_card.is-hover .tidx_thumb {
    position: absolute;
    inset: 0;
    height: auto;
    border-radius: 15px 15px 9px 9px;
}

/* 썸네일 창이 넓어진 만큼 배너 위치를 안쪽으로 밀어, 배너는 기본 상태 자리에 그대로 둔다.
   위치와 크기는 즉시 바뀌고 opacity 만 전환되므로 배너가 확대되거나 흔들리지 않는다. */
.tidx_card:hover .tidx_thumb .tidx_banner,
.tidx_card:focus-visible .tidx_thumb .tidx_banner,
.tidx_card.is-hover .tidx_thumb .tidx_banner {
    top: var(--tidx-thumb-inset);
    left: var(--tidx-thumb-inset);
    width: calc(100% - 2 * var(--tidx-thumb-inset));
    height: var(--tidx-thumb-h);
    opacity: 0;
}


.tidx_card:hover .tidx_info,
.tidx_card:focus-visible .tidx_info,
.tidx_card.is-hover .tidx_info {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 126px;
    padding: 24px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--tidx-overlay) 100%);
}

.tidx_card:hover .tidx_info_tit,
.tidx_card:focus-visible .tidx_info_tit,
.tidx_card.is-hover .tidx_info_tit {
    font-size: 22px;
    color: var(--tidx-white);
}

.tidx_card:hover .tidx_info_desc,
.tidx_card:focus-visible .tidx_info_desc,
.tidx_card.is-hover .tidx_info_desc {
    margin-top: 8px;
    font-size: 16px;
    color: var(--tidx-white);
}

.tidx_card:hover .tidx_dots,
.tidx_card:focus-visible .tidx_dots,
.tidx_card.is-hover .tidx_dots {
    opacity: 1;
}

.tidx_card:hover .tidx_flag,
.tidx_card:focus-visible .tidx_flag,
.tidx_card.is-hover .tidx_flag {
    bottom: 106px;
    left: 12px;
}

.tidx_card:hover .tidx_fav,
.tidx_card:focus-visible .tidx_fav,
.tidx_card.is-hover .tidx_fav {
    bottom: 106px;
    right: 12px;
}

/* --------------------------------------------------------------------------
   카드 : 인기 TOP 사이즈 (384 x 325)
   -------------------------------------------------------------------------- */
.tidx_card--top {
    --tidx-radius-card-top: 24px;
    --tidx-radius-card-bottom: 16px;
    --tidx-radius-thumb: 16px;
    --tidx-thumb-h: 200px;
    --tidx-thumb-inset: 8px;

    height: 325px;
    padding: 8px;
    border-color: var(--tidx-gray20);
    background: var(--tidx-gray10);
}

.tidx_card--top .tidx_flag,
.tidx_card--top .tidx_fav {
    bottom: 125px;
    left: auto;
    right: auto;
}

.tidx_card--top .tidx_flag {
    left: 18px;
}

.tidx_card--top .tidx_fav {
    right: 18px;
}

.tidx_card--top .tidx_info {
    padding: 24px 16px;
}

.tidx_card--top .tidx_info_tit {
    font-size: 22px;
    color: #000;
}

.tidx_card--top .tidx_info_desc {
    margin-top: 8px;
    font-size: 16px;
}

.tidx_card--top:hover .tidx_thumb,
.tidx_card--top:focus-visible .tidx_thumb,
.tidx_card--top.is-hover .tidx_thumb {
    border-radius: 21px 21px 13px 13px;
}

.tidx_card--top:hover .tidx_info,
.tidx_card--top:focus-visible .tidx_info,
.tidx_card--top.is-hover .tidx_info {
    height: 150px;
}

.tidx_card--top:hover .tidx_flag,
.tidx_card--top:focus-visible .tidx_flag,
.tidx_card--top.is-hover .tidx_flag {
    bottom: 140px;
    left: 16px;
}

.tidx_card--top:hover .tidx_fav,
.tidx_card--top:focus-visible .tidx_fav,
.tidx_card--top.is-hover .tidx_fav {
    bottom: 140px;
    right: 16px;
}

/*.tidx_card--top:hover .tidx_badge,*/
/*.tidx_card--top:focus-visible .tidx_badge,*/
/*.tidx_card--top.is-hover .tidx_badge {*/
/*    border-radius: 24px 0 16px 0;*/
/*}*/

/* --------------------------------------------------------------------------
   모션 최소화 환경
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .theme_index * {
        transition-duration: 0.01ms !important;
    }
}
