/* ================================================
   공용 카드 컴포넌트
   BEM 유틸리티 — 각 페이지별 카드가 조합해서 사용
   ================================================ */

/* ---- 컨테이너 ---- */
.card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 호버 — 리프트 + 섀도우 강화 */
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

/* ---- 이미지 래퍼 ---- */
.card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--gray-100);
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* 이미지 호버 줌 */
.card:hover .card__image img {
    transform: scale(1.05);
}

/* ---- 좋아요 버튼 ---- */
.card__like {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 6px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    border: 0;
    cursor: pointer;
    z-index: 2;
    gap: 1px;
    transition: background var(--ease-default), transform var(--ease-default);
}

.card__like:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: scale(1.08);
}

.card__like img {
    width: 22px;
    height: 22px;
}

/* ---- 콘텐츠 영역 ---- */
.card__body {
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 카테고리·장르 — 최상단 메타 텍스트 */
.card__meta {
    font-size: 12px;
    color: var(--text-desc);
    margin-bottom: 2px;
}

/* 제목 — 한 줄 말줄임 */
.card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* 설명 — 2줄 말줄임 */
.card__desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* ---- 태그 ---- */
.card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    list-style: none;
}

.card__tag {
    background-color: #f5f5f7;
    color: #828c94;
    padding: 3px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}


/* ---- 장르 브레드크럼 ---- */
.card-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
    color: var(--text-sub);
}

.card-crumb > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-crumb > span:last-child {
    font-weight: 600;
    color: var(--text-main);
}

/* 구분자는 FA 글리프가 아니라 테두리로 그린다 — 글리프 잉크는 글자 중심보다 낮게 찍혀 크기마다 보정값이 달라진다 */
.card-crumb > span + span::before {
    content: "";
    width: 5px;
    height: 5px;
    border-top: 1.5px solid var(--gray-400);
    border-right: 1.5px solid var(--gray-400);
    transform: rotate(45deg);
}

/* ================================================
   다크모드
   ================================================ */

/* ---- 컨테이너 ---- */
body.theme-dark .card {
    background: var(--surface-glass);
    border-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-card-hover);
}

/* ---- 이미지 ---- */
body.theme-dark .card__image {
    background: var(--surface-2);
}

/* ---- 좋아요 ---- */
body.theme-dark .card__like {
    background: rgba(0, 0, 0, 0.45);
}

body.theme-dark .card__like:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* ---- 타이포그래피 ---- */
body.theme-dark .card__meta {
    color: var(--text-desc);
}

body.theme-dark .card__title {
    color: var(--text-main);
}

body.theme-dark .card__desc {
    color: var(--text-sub);
}

/* ---- 태그 ---- */
body.theme-dark .card__tag {
    background-color: var(--surface-3);
    color: var(--text-sub);
}

.program-price {
    display: inline-flex;
    align-items: baseline;
    gap: .25em;
}

.program-price__hint {
    align-self: center;
    /* 카드 전체를 덮는 링크(.pp-program__go 등)보다 위에 있어야 호버가 닿는다. */
    z-index: 1;
}

.program-price__hint .ui-tooltip__trigger,
.program-price__hint .ui-tooltip__icon {
    width: 1em;
    height: 1em;
    color: currentColor;
}
