/**
 * 작품 보기 페이지 스타일
 * 깔끔하고 읽기 쉬운 레이아웃
 */

/* CSS 변수 */
:root {
    --primary: #E91E8C;
    --primary-dark: #C71A75;
    --primary-light: #FF4DA6;
    --radius-full: 9999px;
    --radius-2xl: 24px;
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

.project-view-page {
    min-height: 100vh;
    background: white;
}

/* ========================================
   프로젝트 헤더
   ======================================== */
.project-header {
    background: var(--gray-50);
    padding: 32px 0;
    border-bottom: 1px solid #eeeeee;
}

.project-header .container {
    max-width: 900px;
}

.project-header-content {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* 썸네일 */
.project-thumbnail {
    width: 200px;
    height: 280px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #FF6B6B);
    color: white;
    font-size: 48px;
    font-weight: 700;
}

/* 정보 영역 */
.project-info {
    flex: 1;
    padding-top: 8px;
}

/* 배지 */
.project-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.project-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.project-badge.type {
    background: var(--primary);
    color: white;
}

.project-badge.category {
    background: rgba(233, 30, 140, 0.1);
    color: var(--primary);
    border: 1px solid rgba(233, 30, 140, 0.2);
}

/* 제목 */
.project-title {
    font-size: 32px;
    font-weight: 800;
    color: #212121;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* 설명 */
.project-description {
    font-size: 15px;
    color: #616161;
    line-height: 1.8;
    margin: 0 0 20px 0;
}

/* 메타 정보 */
.project-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #9e9e9e;
}

.meta-item svg {
    opacity: 0.6;
}

/* 크리에이터 & 액션 */
.project-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
}

.creator-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s;
}

.creator-link:hover {
    background: #eeeeee;
}

.creator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.creator-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #FF6B6B);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.creator-name {
    font-size: 14px;
    font-weight: 600;
    color: #424242;
}

/* 좋아요 버튼 */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #eeeeee;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: #616161;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.like-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.like-btn.liked {
    background: #fff0f5;
    border-color: var(--primary);
    color: var(--primary);
}

.like-btn.disabled {
    cursor: default;
    opacity: 0.7;
}

.like-btn .like-icon {
    transition: transform 0.2s;
}

.like-btn:hover .like-icon {
    transform: scale(1.1);
}

.like-btn .like-count {
    font-weight: 700;
}

/* 북마크 버튼 */
.bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #eeeeee;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: #616161;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.bookmark-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.bookmark-btn.bookmarked {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.bookmark-btn .bookmark-icon {
    transition: transform 0.2s;
}

.bookmark-btn:hover .bookmark-icon {
    transform: scale(1.1);
}

/* ========================================
   콘텐츠 영역
   ======================================== */
.project-content {
    padding: 48px 0;
    background: white;
}

.project-content .container {
    max-width: 900px;
}

/* 블록 스타일 */
.blocks-container {
    background: white;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.block {
    margin-bottom: 0;
    /* 웹툰 형식: 이미지들을 붙여서 표시하기 위해 여백 제거 */
}

.block:last-child {
    margin-bottom: 0;
}

/* 텍스트 블록만 여백 추가 */
.block-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #424242;
    margin: 32px 0;
    /* 텍스트는 상하 여백 유지 */
}

/* Quill 정렬 스타일 */
.block-text .ql-align-center {
    text-align: center;
}

.block-text .ql-align-right {
    text-align: right;
}

.block-text .ql-align-justify {
    text-align: justify;
}

.block-text .ql-indent-1 {
    padding-left: 3em;
}

.block-text .ql-indent-2 {
    padding-left: 6em;
}

.block-text .ql-indent-3 {
    padding-left: 9em;
}

/* 이미지 블록 */
.block-image {
    text-align: center;
    margin: 0;
    /* 상하 여백 제거 */
}

.block-image img {
    max-width: 100%;
    display: block;
    margin: 0 auto;
    border-radius: 0;
    /* 라운드 제거 */
}

.block-image.img-align-left img {
    margin-left: 0;
    margin-right: auto;
}

.block-image.img-align-right img {
    margin-left: auto;
    margin-right: 0;
}

.block-image img.img-size-small {
    max-width: 50%;
}

.block-image img.img-size-medium {
    max-width: 75%;
}

/* 캡션이 있는 경우만 하단 여백 추가 */
.block-image.has-caption {
    margin-bottom: 32px;
}

.image-caption {
    margin: 12px 0 0;
    font-size: 14px;
    color: #9e9e9e;
}

.block-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212121;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #eeeeee;
}

.block-divider {
    border: none;
    height: 1px;
    background: #eeeeee;
    margin: 32px 0;
}

/* 대사 블록 */
.block-dialogue {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dialogue-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.dialogue-character {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e0e0e0;
}

.dialogue-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.8;
    color: #424242;
    max-width: 400px;
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 12px;
}

.dialogue-item.dialogue-right {
    flex-direction: row-reverse;
}

.dialogue-item.dialogue-right .dialogue-text {
    text-align: right;
    background: #f5f5f5;
}

.dialogue-center-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dialogue-characters {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialogue-text-center {
    max-width: 500px;
    text-align: center;
    font-size: 15px;
    line-height: 1.8;
    color: #424242;
    background: #f5f5f5;
    padding: 16px 24px;
    border-radius: 12px;
}

/* 비디오 블록 */
.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-link {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

/* 링크 블록 */
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.link-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.link-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-icon svg {
    stroke: white;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-text {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #212121;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-url {
    display: block;
    font-size: 12px;
    color: #9e9e9e;
}

.link-arrow {
    color: var(--primary);
    flex-shrink: 0;
}

/* 오디오 블록 */
.audio-player {
    padding: 16px;
    background: #fafafa;
    border: 1px solid #eeeeee;
    border-radius: 8px;
}

.audio-filename {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #212121;
}

.audio-player audio {
    width: 100%;
}

/* 코드 블록 */
.code-language {
    background: #21252b;
    color: #9da5b4;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
}

.block-code pre {
    background: #282c34;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    margin: 0;
}

.block-code code {
    font-family: 'Nanum Gothic Coding', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #abb2bf;
}

/* PDF 블록 */
.pdf-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #eeeeee;
    border-radius: 8px;
}

.pdf-icon {
    font-size: 24px;
}

.pdf-filename {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #212121;
}

/* ========================================
   에피소드 목록
   ======================================== */
.episodes-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212121;
    margin: 0 0 24px 0;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.episode-item:hover {
    background: #f0f0f0;
    transform: translateX(4px);
}

.episode-thumbnail {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-number-badge {
    font-size: 18px;
    font-weight: 700;
    color: #bdbdbd;
}

.episode-info {
    flex: 1;
}

.episode-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.episode-title {
    font-size: 15px;
    font-weight: 600;
    color: #424242;
}

.episode-arrow {
    color: #bdbdbd;
}

.no-episodes {
    text-align: center;
    padding: 40px;
    color: #9e9e9e;
}

/* ========================================
   반응형
   ======================================== */
@media (max-width: 768px) {
    .project-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-thumbnail {
        width: 160px;
        height: 224px;
    }

    .project-title {
        font-size: 24px;
    }

    .project-meta {
        justify-content: center;
    }

    .project-actions {
        justify-content: center;
    }

    .blocks-container {
        padding: 0;
    }

    .dialogue-text {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .project-thumbnail {
        width: 140px;
        height: 196px;
    }

    .project-badges {
        justify-content: center;
    }

    .blocks-container {
        padding: 0;
        border-radius: 0;
    }

    .block-text {
        font-size: 1rem;
    }
}