/*
 * tg-cta-recommend.css  v1.0.0
 * ─────────────────────────────────────────
 * 게시판 하단 공통 추천 CTA 컴포넌트
 * 모든 게시판(basics, tips, premium 등)에서 재사용
 *
 * 의존: Bootstrap(container 등 그리드 유틸), Noto Sans KR,
 *       Material Symbols Outlined, FA6 (head.sub.php에서 로드)
 * 격리: #tg-cta-recommend 래퍼 내부로 한정
 * ─────────────────────────────────────────
 */

/* ═══════════════════════════════════════════
   1. 래퍼 리셋 (그누보드5 CSS 충돌 방지)
═══════════════════════════════════════════ */
#tg-cta-recommend,
#tg-cta-recommend *,
#tg-cta-recommend *::before,
#tg-cta-recommend *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    text-decoration: none;
    list-style: none;
    font-style: normal;
}

/* ═══════════════════════════════════════════
   2. 디자인 토큰
═══════════════════════════════════════════ */
#tg-cta-recommend {
    /* 사이트 브랜드 컬러 연동 */
    --cta-brand:      #1d98dc;
    --cta-brand-dark: #1578ad;
    --cta-brand-glow: rgba(29,152,220,.18);
    --cta-brand-soft: rgba(29,152,220,.06);

    /* 다크 그라데이션 */
    --cta-dark-from:  #0a0e1a;
    --cta-dark-to:    #111827;

    /* 중립 톤 */
    --cta-slate-50:   #f8fafc;
    --cta-slate-100:  #f1f5f9;
    --cta-slate-200:  #e2e8f0;
    --cta-slate-300:  #cbd5e1;
    --cta-slate-400:  #94a3b8;
    --cta-slate-500:  #64748b;
    --cta-slate-700:  #334155;
    --cta-slate-800:  #1e293b;
    --cta-slate-900:  #0f172a;

    /* 엑센트 */
    --cta-amber:      #f59e0b;
    --cta-emerald:    #10b981;
    --cta-rose:       #f43f5e;

    /* 타이포 */
    --cta-font: 'Noto Sans KR', 'Inter', sans-serif;

    /* 레이아웃 */
    max-width: 1100px;
    width: 100%;
    margin: 48px auto 0;
    font-family: var(--cta-font);
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   3. 섹션 외곽 (다크 그라데이션 배경)
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__section {
    position: relative;
    background: linear-gradient(160deg, var(--cta-dark-from) 0%, var(--cta-dark-to) 100%);
    border-radius: 20px;
    padding: 44px 28px 40px;
    overflow: hidden;
}

/* 배경 장식: 소프트 블러 닷 */
#tg-cta-recommend .tg-cta__section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(29,152,220,.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
#tg-cta-recommend .tg-cta__section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -8%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(16,185,129,.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ═══════════════════════════════════════════
   4. 헤더 (제목 + 설명)
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 32px;
}

#tg-cta-recommend .tg-cta__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--cta-brand-glow);
    border: 1px solid rgba(29,152,220,.28);
    color: var(--cta-brand);
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
    letter-spacing: .02em;
}
#tg-cta-recommend .tg-cta__badge .material-symbols-outlined {
    font-size: .95rem;
}

#tg-cta-recommend .tg-cta__title {
    font-size: clamp(1.15rem, 3vw, 1.4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    letter-spacing: -.01em;
    margin-bottom: 8px;
}

#tg-cta-recommend .tg-cta__subtitle {
    font-size: .88rem;
    color: var(--cta-slate-400);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════
   5. 카드 그리드 (3열 → 모바일 1열)
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

/* ═══════════════════════════════════════════
   6. 개별 카드
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__card {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 22px 20px;
    transition: all .28s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
#tg-cta-recommend .tg-cta__card:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(29,152,220,.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.25), 0 0 0 1px rgba(29,152,220,.12);
}

/* 카드 상단: 번호 뱃지 + 제목 */
#tg-cta-recommend .tg-cta__card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

#tg-cta-recommend .tg-cta__card-num {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 900;
    color: #fff;
}
/* 번호 뱃지 색상 변형 (3가지) */
#tg-cta-recommend .tg-cta__card-num--brand {
    background: linear-gradient(135deg, var(--cta-brand), var(--cta-brand-dark));
    box-shadow: 0 4px 14px rgba(29,152,220,.3);
}
#tg-cta-recommend .tg-cta__card-num--amber {
    background: linear-gradient(135deg, var(--cta-amber), #d97706);
    box-shadow: 0 4px 14px rgba(245,158,11,.3);
}
#tg-cta-recommend .tg-cta__card-num--emerald {
    background: linear-gradient(135deg, var(--cta-emerald), #059669);
    box-shadow: 0 4px 14px rgba(16,185,129,.3);
}

#tg-cta-recommend .tg-cta__card-title {
    font-size: .95rem;
    font-weight: 800;
    color: rgba(255,255,255,.9);
    line-height: 1.45;
    flex: 1;
}

/* 카드 본문: 설명 텍스트 */
#tg-cta-recommend .tg-cta__card-desc {
    font-size: .84rem;
    color: var(--cta-slate-400);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

/* 카드 하단: 링크 인디케이터 */
#tg-cta-recommend .tg-cta__card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--cta-brand);
    transition: gap .2s ease;
}
#tg-cta-recommend .tg-cta__card:hover .tg-cta__card-link {
    gap: 10px;
}
#tg-cta-recommend .tg-cta__card-link .material-symbols-outlined {
    font-size: 1rem;
    transition: transform .2s ease;
}
#tg-cta-recommend .tg-cta__card:hover .tg-cta__card-link .material-symbols-outlined {
    transform: translateX(3px);
}

/* ═══════════════════════════════════════════
   7. 하단 구분선 + 안내
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__footer {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    border-top: 1px solid rgba(255,255,255,.06);
    padding-top: 20px;
    text-align: center;
}
#tg-cta-recommend .tg-cta__footer-text {
    font-size: .76rem;
    color: var(--cta-slate-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
#tg-cta-recommend .tg-cta__footer-text .material-symbols-outlined {
    font-size: .9rem;
    color: var(--cta-brand);
}
#tg-cta-recommend .tg-cta__footer-link {
    color: var(--cta-brand) !important;
    font-weight: 700;
    text-decoration: none !important;
    transition: color .2s;
}
#tg-cta-recommend .tg-cta__footer-link:hover {
    color: #5cb9e6 !important;
}

/* ═══════════════════════════════════════════
   8. 애니메이션 (카드 순차 등장)
═══════════════════════════════════════════ */
#tg-cta-recommend .tg-cta__card {
    opacity: 0;
    transform: translateY(18px);
    animation: ctaCardIn .45s ease forwards;
}
#tg-cta-recommend .tg-cta__card:nth-child(1) { animation-delay: .1s; }
#tg-cta-recommend .tg-cta__card:nth-child(2) { animation-delay: .22s; }
#tg-cta-recommend .tg-cta__card:nth-child(3) { animation-delay: .34s; }

@keyframes ctaCardIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   9. 반응형
═══════════════════════════════════════════ */

/* 태블릿 이상: 3열 그리드 */
@media (min-width: 768px) {
    #tg-cta-recommend .tg-cta__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    #tg-cta-recommend .tg-cta__section {
        padding: 52px 40px 44px;
        border-radius: 24px;
    }
}

/* 중간 사이즈: 카드 내부 여유 */
@media (min-width: 480px) and (max-width: 767px) {
    #tg-cta-recommend .tg-cta__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    #tg-cta-recommend .tg-cta__card {
        flex-direction: row;
        align-items: center;
        padding: 18px 20px;
    }
    #tg-cta-recommend .tg-cta__card-top {
        margin-bottom: 0;
        flex: 1;
    }
    #tg-cta-recommend .tg-cta__card-desc {
        display: none;
    }
    #tg-cta-recommend .tg-cta__card-link {
        flex-shrink: 0;
        margin-left: 12px;
    }
}

/* 모바일: 컴팩트 */
@media (max-width: 479px) {
    #tg-cta-recommend .tg-cta__section {
        padding: 32px 18px 28px;
        border-radius: 16px;
    }
    #tg-cta-recommend .tg-cta__card {
        padding: 18px 16px;
    }
    #tg-cta-recommend .tg-cta__card-num {
        width: 34px;
        height: 34px;
        font-size: .72rem;
    }
    #tg-cta-recommend .tg-cta__title {
        font-size: 1.1rem;
    }
}
