/* view_episode.php */


/* 블록 기본 스타일 */
.canvas {
    position: relative;
}

/* 대화 블록 스타일 */
.dialogue-block {
    margin-top: 80px;
    margin-bottom: 80px;
}

/* 대화 텍스트 정렬 */
.dialogue-block .dialogue-text {
    text-align: justify;
    text-justify: inter-character;
}

/* text-center 클래스가 있을 때만 중앙 정렬 허용 */
.dialogue-block.text-center .dialogue-text {
    text-align: center;
}

/* 캐릭터 이름은 부모 요소의 정렬을 따름 */
.dialogue-content.text-end .character-name {
    text-align: right;
}

/* 캐릭터 아바타 스타일 */
.character-avatar img,
.character-avatar .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background-color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 블록 자체에 행간 설정 */
.narrative-block {
    margin-bottom: 20px;
}

.narrative-block,
.narrative-block .narrative-body {
  line-height: var(--content-line-height, 1.6) !important;
}


/* 자식 요소들은 부모의 line-height를 상속받도록 처리 */
.narrative-title {
    font-size: calc(var(--content-font-size, 1rem) * 1.5) !important;
    line-height: inherit;
}

.narrative-subtitle {
    font-size: calc(var(--content-font-size, 1rem) * 1.25) !important;
    line-height: inherit;
}

.narrative-body {
    font-size: var(--content-font-size, 1rem) !important;
    line-height: inherit;
}

.narrative-small {
    font-size: calc(var(--content-font-size, 1rem) * 0.875) !important;
    line-height: inherit;
}




/* 삽화 이미지 크기 */
.illustration-container.small-size img {
    max-width: 50%;
}

.illustration-container.medium-size img {
    max-width: 75%;
}

.illustration-container.large-size img {
    max-width: 100%;
}

/* 여백과 구분선 */
.spacing-block {
    height: 50px;
    width: 100%;
}

.divider {
    border: none;
    height: 2px;
    background-color: white;
    margin: 50px 0;
}

.character-name{
    font-size: var(--content-font-size, 0.8rem);
    font-weight: bold;
}

.episode-navigation{
    margin-top: 100px;
    margin-bottom: 50px;
}

/* 텍스트 크기 전환 애니메이션 */
.episode-content,
.episode-content .narrative-block,
.episode-content .dialogue-text,
.episode-content .character-name {
    transition: font-size 0.3s ease;
}

.episode-content {
    background-color: transparent;
    padding: 5px;
    overflow-wrap: break-word;
  text-align: justify;
  text-justify: inter-character;
    line-height: var(--content-line-height, 1.6);
    font-size: var(--content-font-size, 1rem);  /* 기본값 1rem으로 설정 */
}

/* 모든 텍스트 컨테이너가 episode-content의 font-size를 상속 */
.episode-content .narrative-block,
.episode-content .dialogue-block,
.episode-content .dialogue-text {
    font-size: inherit;
}

/* 라이트 모드 스타일 */
body.bg-white .divider {
    background-color: #333;
}

/* 라이트 모드에서 펼쳐진 메뉴의 링크 색을 검정(#000)으로 고정 */
body.bg-white .navbar-collapse.show .nav-link {
    color: #000 !important;
}

.bg-dark.text-light::placeholder {
    color: #ccc; /* 원하는 색상 */
    opacity: 0.5;  /* 브라우저에 따라 기본값이 0.5일 수 있으므로 필요하다면 설정 */
}

/* 모바일 터치 액션 최적화 */
.episode-content {
    touch-action: pan-y pinch-zoom;
    -webkit-touch-callout: none;
    user-select: text;  /* 텍스트 선택은 허용 */
}

/* 슬라이더 스타일링 */
.form-range {
    height: 1.5rem;
    padding: 0;
    background: transparent;
}

.form-range::-webkit-slider-thumb {
    width: 1rem;
    height: 1rem;
    margin-top: -0.25rem;
    background-color: #fff;
    border: 0;
    border-radius: 1rem;
    appearance: none;
}

.form-range::-webkit-slider-runnable-track {
    height: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

/* 다크모드/라이트모드 전환 애니메이션 */
body,
.navbar,
.episode-content,
.text-light,
.text-black {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 광고 컨테이너 스타일 */
.ad-container {
    padding: 1rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}


/* 링크 블록 스타일 */
.link-display {
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 20px;
}

.link-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 오디오 블록 스타일 */
.audio-container {
    background-color: #222;
    border-radius: 8px;
}

.audio-title {
    font-weight: 500;
    color: #fff;
}

.toggle-audio-btn {
    transition: all 0.2s ease;
}

.toggle-audio-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

