/* coupairpage_up — view */

/* ===== 툴바 (상단 고정) ===== */
.cpage-toolbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    min-height: 44px;
    gap: 8px;
}
.cpage-toolbar-left,
.cpage-toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 목록 버튼 */
.cpage-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px 5px 8px;
    border: 0;
    border-radius: 20px;
    font-size: 13px;
    color: var(--c-sub);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
    line-height: 1;
}
.cpage-back-btn:hover { background: var(--c-bg2); color: var(--c-text); }
.cpage-back-btn svg { flex-shrink: 0; }

/* BGM 영역 */
.cpage-bgm-area { flex-shrink: 0; line-height: 0; height: 30px;}
.cpage-bgm-area iframe {
    display: block;
    height: 36px;
    width: auto;
    min-width: 350px;
    border: none;
    overflow: visible;
}

/* 연계 페어 썸네일 */
.cpage-linked-pairs { display: flex; align-items: center; gap: 5px; }
.cpage-linked-pair-thumb {
    width: 30px; height: 30px;
    border-radius: 40%; overflow: hidden;
    border: 2px solid var(--c-border);
    background: var(--c-bg2);
    text-decoration: none; color: var(--c-text);
    font-size: 11px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s, transform .15s;
}
.cpage-linked-pair-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpage-linked-pair-thumb:hover { border-color: var(--c-text); transform: scale(1.08); }
.cpage-linked-pair-thumb.active {
    border-color: var(--c-text);
    box-shadow: 0 0 0 2px var(--c-bg), 0 0 0 4px var(--c-text);
}

/* 더보기 드롭다운 */
.cpage-more-wrap { position: relative; }
.cpage-more-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 17px; line-height: 1;
    color: var(--c-sub);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cpage-more-btn:hover { background: var(--c-bg2); color: var(--c-text); }
.cpage-more-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px); right: 0;
    min-width: 110px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 200;
    overflow: hidden;
}
.cpage-more-menu.open { display: block; }
.cpage-more-item {
    display: block; padding: 10px 16px;
    font-size: 13px; color: var(--c-text); text-decoration: none;
    cursor: pointer; white-space: nowrap;
    background: transparent; border: none; width: 100%; text-align: left;
    transition: background .1s;
}
.cpage-more-item:hover { background: var(--c-bg2); }
.cpage-more-item--danger { color: #ef4444; }

/* ===== 브랜드 영역 ===== */
.cpage-brand {
    position: relative;
    margin-top: 0;
    min-height: 450px;
    height: 35vh;
    background: transparent;
    overflow: hidden;
}
.cpage-brand-img {
    position: absolute;
    inset: 0;
    background-image: var(--brand-bg-url);
    background-size: cover;
    background-position: center 40%;
}
.cpage-brand-grad {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 55%;
    background: linear-gradient(to top,
        rgba(0,0,0,.72) 0%,
        rgba(0,0,0,.32) 55%,
        transparent 100%);
    pointer-events: none;
}
.cpage-brand-content {
    position: absolute;
    bottom: 35px;
    left: 50px;
    z-index: 2;
    text-align: left;
    max-width: calc(100% - 56px);
}
.cpage-pair-name {
    display: block;
    font-size: clamp(18px, 4vw, 50px);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--c-text);
    line-height: 1.15;
    text-shadow: 0 0 2px var(--black), 0 0 10px var(--gray-500);

}
.cpage-brand.has-bg .cpage-pair-name { color: #fff; }
.cpage-logo-img {
    max-height: 52px; max-width: 280px;
    object-fit: contain; display: block;
}
.cpage-brand-summary {
    font-size: 12px;
    color: var(--c-sub);
    line-height: 1.65;
    margin-top: 5px;
    font-style: italic;
    text-shadow: 0 0 2px var(--black), 0 0 10px var(--gray-500);
}
.cpage-brand.has-bg .cpage-brand-summary { color: rgba(255,255,255,.8); }
.cpage-brand-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }

/* ===== 태그 공통 ===== */
.cpage-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    background: var(--c-bg2);
    color: var(--c-sub);
    border: 1px solid var(--c-border);
    line-height: 1.5;
    margin: 0;
}
.cpage-brand.has-bg .cpage-brand-tags .cpage-tag {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-color: rgba(255,255,255,.3);
}

/* ===== 브랜드 SD 이미지 ===== */
.cpage-brand-sd-imgs {
    position: absolute;
    bottom: 0;
    right: 20px;
    display: flex;
    gap: 4px;
    align-items: flex-end;
    z-index: 3;
    filter: drop-shadow(5px 1px 1px rgba(0,0,0,.5));
    pointer-events: none;
}
.cpage-brand-sd-thumb {
    transition: transform .2s ease;
    position: relative;
    transform-origin: center bottom;
    pointer-events: auto;
    padding: 10px;
    margin: -10px;
}
.cpage-brand-sd-thumb img {
    max-height: 340px;
    display: block;
}
.cpage-brand-sd-thumb:hover {
    animation: cpage-kong-jump .4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    animation-iteration-count: 1;
}
@keyframes cpage-kong-jump {
    0%   { transform: translateY(0) scale(1); }
    30%  { transform: translateY(-15px) scale(1.05); }
    50%  { transform: translateY(-18px) scale(1.05); }
    80%  { transform: translateY(-5px) scale(.98); }
    100% { transform: translateY(0) scale(1); }
}

/* ===== 3컬럼 레이아웃 ===== */
.cpage-layout {
    display: grid;
    grid-template-columns: 400px 1fr 400px;
    align-items: start;
    min-height: 60vh;
    position: relative;
    z-index: 1;
}

/* 왼쪽 컬럼 */
.cpage-col-left {
    padding: 8px 20px;
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 44px;
    max-height: calc(100vh - 44px);
    overflow: visible;
}

/* 가운데 컬럼 */
.cpage-col-center {
    padding: 28px 32px;
}

/* 오른쪽 컬럼 */
.cpage-col-right {
    padding: 28px 20px;
    border-left: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 44px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    overflow-x: visible;
}
.cpage-col-right-heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3em;
    color: var(--c-sub);
    text-transform: uppercase;
    margin: 0 0 4px;
}

/* ===== 캐릭터 카드 ===== */
.cpage-char-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--c-border);
}
.cpage-char-card:last-child { border-bottom: none; }

/* 두상 래퍼 */
.cpage-char-avatar-wrap { flex-shrink: 0; position: relative; }

/* 두상 이미지 */
.cpage-char-avatar {
    width: 100px; height: 100px;
    border-radius: 40%;
    overflow: visible; /* 툴팁이 넘쳐도 보이도록 */
    border: 2px solid var(--ch-color, var(--c-border));
    flex-shrink: 0;
    position: relative;
    cursor: default;
}
.cpage-char-avatar.has-tooltip { cursor: pointer; }
.cpage-char-avatar img {
    width: 100%; height: 100%;
    border-radius: 40%;
    object-fit: cover;
    display: block;
}

/* 두상 없을 때 플레이스홀더 */
.cpage-char-avatar-placeholder {
    width: 100%; height: 100%;
    border-radius: 40%;
    background: var(--c-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    color: var(--c-sub);
    flex-shrink: 0;
}

/* 한마디 툴팁 */
.cpage-char-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    transform: none;
    background: rgba(20, 20, 20, .88);
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: normal;
    width: max-content;
    max-width: 200px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s;
    z-index: 50;
}
.cpage-char-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 44px;
    transform: none;
    border: 6px solid transparent;
    border-top-color: rgba(20, 20, 20, .88);
}
.cpage-char-avatar.has-tooltip:hover .cpage-char-tooltip,
.cpage-char-tooltip.visible { opacity: 1; }

/* 카드 우측 정보 영역 */
.cpage-char-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* 이름판 */
.cpage-char-nameplate { display: flex; flex-direction: column; gap: 2px; }
.cpage-char-name { font-size: 17px; font-weight: 700; color: var(--c-text); }
.cpage-char-en {
    font-size: 10px; color: var(--c-sub);
    letter-spacing: .14em; text-transform: uppercase;
}

/* 프로필 정보 목록 */
.cpage-char-info {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.cpage-char-info li {
    display: flex; gap: 7px;
    font-size: 12px; color: var(--c-text);
    align-items: baseline;
}
.cpage-info-key {
    color: var(--c-sub);
    flex-shrink: 0;
    min-width: 2.5em;
}
.cpage-info-val { min-width: 0; word-break: break-word; }

/* 색상 닷 */
.cpage-char-colors { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cpage-color-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 1.5px solid rgba(128,128,128,.25);
    display: inline-block;
    flex-shrink: 0;
}

/* 태그 */
.cpage-char-tags { display: flex; flex-wrap: wrap; gap: 3px; }

/* ===== 탭 네비게이션 ===== */
.cpage-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.cpage-tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--c-sub);
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.cpage-tab-btn:hover { color: var(--c-text); }
.cpage-tab-btn.active {
    color: var(--c-text);
    border-bottom-color: var(--c-text);
}

/* 탭 패널 */
.cpage-tab-panel { display: none; }
.cpage-tab-panel.active { display: block; }

/* ===== 가운데: 섹션 공통 ===== */
.cpage-section { margin-bottom: 40px; }
.cpage-section-heading {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .36em;
    text-transform: uppercase;
    color: var(--c-sub);
    text-align: center;
    padding: 0 0 12px;
    margin: 0 0 22px;
    border-bottom: 1px solid var(--c-border);
}

/* ===== 타임라인 ===== */
.cpage-timeline { display: flex; flex-direction: column; }
.cpage-tl-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0 16px;
    padding-bottom: 28px;
    position: relative;
}
.cpage-tl-item::before {
    content: '';
    position: absolute;
    left: 17px; top: 30px; bottom: 0;
    width: 1px;
    background: var(--c-border);
}
.cpage-tl-item:last-child::before { display: none; }
.cpage-tl-num {
    font-size: 20px;
    font-weight: 900;
    color: var(--c-border);
    text-align: center;
    line-height: 1.2;
    padding-top: 1px;
}
.cpage-tl-body { min-width: 0; }
.cpage-tl-date { font-size: 11px; color: var(--c-sub); margin-bottom: 3px; letter-spacing: .04em; }
.cpage-tl-title { font-size: 15px; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
.cpage-tl-content { font-size: 13px; color: var(--c-text); line-height: 1.8; }
.cpage-tl-image { margin-top: 10px; }
.cpage-tl-image img { max-width: 100%; max-height: 220px; border-radius: 6px; object-fit: cover; display: block; }

/* ===== 갤러리 / 무드보드 ===== */
.cpage-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}
.cpage-gallery-item img {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 4px; display: block;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.cpage-gallery-item img:hover { opacity: .85; transform: scale(1.03); }

/* ===== 이미지 뷰어 모달 ===== */
.cpage-img-viewer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}
.cpage-img-viewer.open { display: flex; }
.cpage-img-viewer-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
.cpage-img-viewer-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.cpage-img-viewer-close:hover { background: rgba(255,255,255,.3); }
.cpage-img-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 72px;
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: background .15s;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.cpage-img-viewer-nav:hover { background: rgba(255,255,255,.25); }
.cpage-img-viewer-prev { left: 12px; }
.cpage-img-viewer-next { right: 12px; }
.cpage-img-viewer-nav[hidden] { display: none; }

/* ===== 북마크 ===== */
.cpage-bookmarks { display: flex; flex-direction: column; gap: 6px; }
.cpage-bookmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: var(--c-bg2);
    color: var(--c-text);
    text-decoration: none;
    font-size: 13px;
    transition: background .12s, border-color .12s;
    min-width: 0;
}
.cpage-bookmark-item:hover { background: var(--c-bg); border-color: var(--c-text); }
.cpage-bookmark-thumb {
    width: 36px; height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--c-border);
}
.cpage-bookmark-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpage-bookmark-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 자유탭 / 외부탭 섹션 ===== */
.cpage-iframe-wrap { width: 100%; }
.cpage-board-iframe { width: 100%; min-height: 480px; border: none; display: block; }
.cpage-tab-text { font-size: 13px; line-height: 1.85; color: var(--c-text); }
.cpage-empty-state { font-size: 13px; color: var(--c-sub); text-align: center; padding: 24px 0; }

/* ===== 모바일 (1080px 이하: 오른쪽 컬럼 숨김) ===== */
@media (max-width: 1080px) {
    .cpage-layout {
        grid-template-columns: 400px 1fr;
    }
    .cpage-col-right { display: none; }
}

/* ===== 모바일 (860px 이하) ===== */
@media (max-width: 860px) {
    .cpage-layout {
        grid-template-columns: 1fr;
    }
    .cpage-col-left {
        position: static;
        max-height: none;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 16px;
    }
    .cpage-col-center { padding: 24px 20px; }
    .cpage-brand-content { left: 20px; bottom: 18px; }
    .cpage-brand-sd-thumb img { max-height: 220px; }
}

@media (max-width: 520px) {
    .cpage-col-left { grid-template-columns: 1fr; }
    .cpage-col-center { padding: 20px 16px; }
    .cpage-char-avatar,
    .cpage-char-avatar img { width: 60px; height: 60px; }
    .cpage-char-avatar-placeholder { width: 60px; height: 60px; }
    .cpage-back-btn span { display: none; }
    .cpage-bgm-area iframe { min-width: 120px; }
}
