/* ============================================================
   AI Community Pages — community.css
   Scope: #ai-community-page
   Naming: .ai-comm-*
   ============================================================ */

/* ---------- Reset & Base ---------- */
#ai-community-page * {
    box-sizing: border-box;
}

#ai-community-page {
    font-family: 'Paperlogy', 'Pretendard', sans-serif;
    background: #FAFAFA;
    padding-bottom: 100px;
}

/* 1320px 중앙 정렬 그리드 컨테이너 */
#ai-community-page .wd1320 {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ---------- sub_top 배너 ---------- */
#ai-community-page .sub_top {
    background: #1a1a2e;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

#ai-community-page .sub_top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(159, 129, 86, 0.15) 0%, transparent 60%);
}

#ai-community-page .sub_nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

#ai-community-page .sub_nav p {
    margin: 0;
}

#ai-community-page .sub_nav p::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.4);
}

#ai-community-page .sub_nav p:last-child::after {
    display: none;
}

#ai-community-page .sub_nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

#ai-community-page .sub_nav a:hover {
    color: #9F8156;
}

#ai-community-page .sub_nav img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.7);
}

#ai-community-page .sub_top_content {
    position: relative;
    z-index: 1;
}

#ai-community-page .sub_top_depth {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -1px;
}

#ai-community-page .sub_top_title {
    font-size: 16px;
    color: #9F8156;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

#ai-community-page .sub_top_desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.7;
}

/* ---------- 커뮤니티 공통 서브 탭 메뉴 (Tab Bar) ---------- */
.ai-comm-tabs-wrapper {
    background: #ffffff;
    border-bottom: 1px solid #E4E4E7;
    margin-bottom: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.ai-comm-tabs {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 900px;
}

.ai-comm-tab-item {
    flex: 1;
    text-align: center;
}

.ai-comm-tab-link {
    display: block;
    padding: 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #71717A;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.ai-comm-tab-link:hover {
    color: #9F8156;
}

.ai-comm-tab-link.active {
    color: #9F8156;
    font-weight: 700;
}

.ai-comm-tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #9F8156;
    border-radius: 3px 3px 0 0;
}

/* ---------- 카테고리 필터링 필터바 (사건분류) ---------- */
.ai-comm-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 60px; /* 배너와 필터바 사이 세련된 여백 조성 */
    margin-bottom: 40px;
}

.ai-comm-filter-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #52525B;
    background: #ffffff;
    border: 1px solid #E4E4E7;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ai-comm-filter-btn:hover {
    border-color: #9F8156;
    color: #9F8156;
}

.ai-comm-filter-btn.active {
    background: #9F8156;
    border-color: #9F8156;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(159, 129, 86, 0.2);
}

/* ---------- 그리드 레이아웃 ---------- */
.ai-comm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* ---------- 성공사례 카드 스타일 ---------- */
.ai-comm-case-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.ai-comm-case-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(159, 129, 86, 0.08);
    border-color: #D4C3AC;
}

.ai-comm-case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #F4F4F5;
}

.ai-comm-case-tag {
    font-size: 12px;
    font-weight: 700;
    color: #9F8156;
    background: #FDFBF7;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(159, 129, 86, 0.15);
}

.ai-comm-case-arrow {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-comm-case-card:hover .ai-comm-case-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.ai-comm-case-img-wrap {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.ai-comm-case-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ai-comm-case-card:hover .ai-comm-case-img {
    transform: scale(1.05);
}

.ai-comm-case-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-comm-case-title {
    font-size: 18px;
    font-weight: 700;
    color: #18181B;
    line-height: 1.4;
    margin: 0 0 8px 0;
    word-break: keep-all;
}

.ai-comm-case-result {
    font-size: 14px;
    font-weight: 700;
    color: #9F8156;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-comm-case-result::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9F8156;
}

.ai-comm-case-excerpt {
    font-size: 14px;
    color: #71717A;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

/* ---------- 의뢰인 후기 카드 스타일 ---------- */
.ai-comm-review-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
    padding: 30px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    position: relative;
}

.ai-comm-review-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(159, 129, 86, 0.08);
    border-color: #D4C3AC;
}

.ai-comm-review-quote {
    position: absolute;
    top: 24px;
    right: 30px;
    font-size: 48px;
    line-height: 1;
    font-family: Georgia, serif;
    color: rgba(159, 129, 86, 0.1);
    user-select: none;
}

.ai-comm-review-subject {
    font-size: 16px;
    font-weight: 700;
    color: #18181B;
    line-height: 1.4;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #F4F4F5;
    word-break: keep-all;
}

.ai-comm-review-content {
    font-size: 14px;
    color: #52525B;
    line-height: 1.6;
    margin: 0 0 24px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-comm-review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-comm-review-author {
    font-size: 13px;
    color: #A1A1AA;
}

.ai-comm-review-more {
    font-size: 13px;
    font-weight: 600;
    color: #9F8156;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-comm-review-more img {
    width: 12px;
    height: 12px;
    opacity: 0.8;
}

/* ---------- 칼럼 카드 스타일 ---------- */
.ai-comm-column-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.ai-comm-column-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(159, 129, 86, 0.08);
}

.ai-comm-column-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.ai-comm-column-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-comm-column-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ai-comm-column-title {
    font-size: 18px;
    font-weight: 700;
    color: #18181B;
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

.ai-comm-column-excerpt {
    font-size: 14px;
    color: #71717A;
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-comm-column-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F4F4F5;
    padding-top: 16px;
    font-size: 13px;
    color: #A1A1AA;
}

.ai-comm-column-author {
    color: #52525B;
    font-weight: 600;
}

/* ---------- 파트원 TV (비디오) 카드 스타일 ---------- */
.ai-comm-tv-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-comm-tv-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}

.ai-comm-tv-video-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #000;
    overflow: hidden;
}

.ai-comm-tv-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.5s ease;
}

.ai-comm-tv-card:hover .ai-comm-tv-thumb {
    transform: scale(1.04);
}

.ai-comm-tv-play-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 54px;
    height: 54px;
    background: rgba(159, 129, 86, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: background 0.3s, transform 0.3s;
}

.ai-comm-tv-play-btn svg {
    margin-left: 4px;
}

.ai-comm-tv-card:hover .ai-comm-tv-play-btn {
    background: #9F8156;
    transform: scale(1.1);
}

.ai-comm-tv-body {
    padding: 20px 24px;
    flex: 1;
}

.ai-comm-tv-title {
    font-size: 16px;
    font-weight: 700;
    color: #18181B;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

/* ---------- 언론보도 (Press) 카드 스타일 ---------- */
.ai-comm-press-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
    padding: 24px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.ai-comm-press-card:hover {
    transform: translateY(-4px);
    border-color: #9F8156;
}

.ai-comm-press-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #A1A1AA;
    margin-bottom: 12px;
}

.ai-comm-press-outlet {
    color: #9F8156;
    font-weight: 700;
}

.ai-comm-press-title {
    font-size: 16px;
    font-weight: 700;
    color: #18181B;
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: keep-all;
}

.ai-comm-press-excerpt {
    font-size: 13px;
    color: #71717A;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 페이지네이션 (Pagination) ---------- */
.ai-comm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.ai-comm-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #E4E4E7;
    background: #ffffff;
    color: #52525B;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ai-comm-page-link:hover {
    border-color: #9F8156;
    color: #9F8156;
}

.ai-comm-page-link.active {
    background: #9F8156;
    border-color: #9F8156;
    color: #ffffff;
}

.ai-comm-page-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #E4E4E7;
    background: #ffffff;
    color: #71717A;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ai-comm-page-arrow:hover {
    border-color: #9F8156;
    color: #9F8156;
}

/* ---------- 동영상 플레이어 팝업 레이어 (Modal) ---------- */
.ai-comm-video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.ai-comm-video-modal.open {
    display: flex;
    opacity: 1;
}

.ai-comm-video-modal-content {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.ai-comm-video-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-comm-video-modal-close:hover {
    color: #9F8156;
}

.ai-comm-video-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------- empty_list (결과 없음) ---------- */
.ai-comm-empty-list {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: #71717A;
    font-size: 16px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #E4E4E7;
}

/* ============================================================
   반응형 미디어 쿼리 (Responsive Queries)
   ============================================================ */
@media (max-width: 1024px) {
    .ai-comm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #ai-community-page .sub_top {
        padding: 60px 0 40px;
    }
    #ai-community-page .sub_top_depth {
        font-size: 26px;
    }
    .ai-comm-tabs-wrapper {
        margin-bottom: 30px;
    }
    .ai-comm-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        padding: 0 16px;
        gap: 20px;
    }
    .ai-comm-tab-link {
        padding: 15px 0;
        font-size: 14px;
        white-space: nowrap;
    }
    .ai-comm-tab-link.active::after {
        height: 2px;
    }
    .ai-comm-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ai-comm-filter-bar {
        padding: 0 16px;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        margin-top: 30px; /* 모바일 배너와의 간격 조율 */
        margin-bottom: 24px;
        gap: 6px;
    }
    .ai-comm-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    .ai-comm-case-img-wrap,
    .ai-comm-tv-video-wrap {
        height: 200px;
    }
}
