/**
 * ✨ RB Editor - 추가 블록 스타일
 * 인용, 내부인용, 미디어&텍스트, 슬라이드 블록
 */

/* ========================================
   인용 블록 (Quote)
======================================== */

.rb-quote {
    position: relative;
    margin: 24px 0;
    padding: 20px 24px 20px 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.8;
    color: #374d6e;
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rb-quote::before {
    content: '"';
    position: absolute;
    left: 16px;
    top: 12px;
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.rb-quote p {
    margin: 0;
}

.rb-quote cite {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    font-style: normal;
    font-weight: 600;
}

.rb-quote cite::before {
    content: '— ';
}

/* ========================================
   내부인용 블록 (Pull Quote)
======================================== */

.rb-pullquote {
    position: relative;
    margin: 32px auto;
    padding: 32px 48px;
    max-width: 640px;
    text-align: center;
    background: #ffffff;
    border-top: 3px solid #667eea;
    border-bottom: 3px solid #667eea;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.rb-pullquote::before,
.rb-pullquote::after {
    content: '❝';
    position: absolute;
    font-size: 64px;
    color: #667eea;
    opacity: 0.2;
    font-weight: 700;
}

.rb-pullquote::before {
    top: -10px;
    left: 20px;
}

.rb-pullquote::after {
    content: '❞';
    bottom: -30px;
    right: 20px;
}

.rb-pullquote p {
    margin: 0;
    font-size: 20px;
    line-height: 1.6;
    font-weight: 600;
    color: #09244B;
    font-style: italic;
}

.rb-pullquote cite {
    display: block;
    margin-top: 16px;
    font-size: 14px;
    color: #666;
    font-style: normal;
    font-weight: 400;
}

/* ========================================
   미디어&텍스트 블록 (Media & Text)
======================================== */

.rb-media-text {
    display: flex;
    gap: 32px;
    align-items: center;
    margin: 24px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.rb-media-text:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.rb-media-text-media {
    flex: 0 0 45%;
    max-width: 45%;
}

.rb-media-text-media img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

.rb-media-text-content {
    flex: 1;
    min-width: 0;
}

.rb-media-text-content h2,
.rb-media-text-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #09244B;
}

.rb-media-text-content p {
    margin: 0 0 12px 0;
    line-height: 1.7;
    color: #374d6e;
}

.rb-media-text-content p:last-child {
    margin-bottom: 0;
}

/* 미디어 왼쪽/오른쪽 정렬 옵션 */
.rb-media-text.media-right {
    flex-direction: row-reverse;
}

/* ========================================
   슬라이드 블록 (Slideshow)
======================================== */

.rb-slideshow {
    position: relative;
    margin: 32px 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.rb-slide {
    display: none;
    position: relative;
    width: 100%;
}

.rb-slide.active {
    display: block;
}

.rb-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px 12px 0 0;
}

.rb-slideshow-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.rb-slide-prev,
.rb-slide-next {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.rb-slide-prev:hover,
.rb-slide-next:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: scale(1.1);
}

.rb-slide-prev:active,
.rb-slide-next:active {
    transform: scale(0.95);
}

.rb-slideshow-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
}

.rb-slideshow-indicators span {
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rb-slideshow-indicators span.active {
    background: #667eea;
    width: 32px;
    border-radius: 6px;
}

.rb-slideshow-indicators span:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* ========================================
   리스트 블록 개선
======================================== */

#editor ul,
#editor ol {
    margin: 16px 0;
    padding-left: 32px;
    line-height: 1.8;
}

#editor ul li,
#editor ol li {
    margin: 8px 0;
    padding-left: 8px;
}

#editor ul li::marker {
    color: #667eea;
    font-size: 1.2em;
}

#editor ol li::marker {
    color: #667eea;
    font-weight: 700;
}

/* 중첩 리스트 */
#editor ul ul,
#editor ol ol,
#editor ul ol,
#editor ol ul {
    margin: 8px 0;
    padding-left: 24px;
}

/* ========================================
   반응형 디자인
======================================== */

/* 태블릿 (768px 이하) */
@media screen and (max-width: 768px) {
    .rb-quote {
        padding: 16px 16px 16px 50px;
        font-size: 15px;
    }

    .rb-quote::before {
        font-size: 36px;
        left: 12px;
    }

    .rb-pullquote {
        padding: 24px 32px;
        margin: 24px 0;
    }

    .rb-pullquote p {
        font-size: 18px;
    }

    .rb-pullquote::before,
    .rb-pullquote::after {
        font-size: 48px;
    }

    .rb-media-text {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
    }

    .rb-media-text-media {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .rb-media-text.media-right {
        flex-direction: column;
    }

    .rb-slide-prev,
    .rb-slide-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .rb-slideshow-controls {
        padding: 0 8px;
    }
}

/* 모바일 (480px 이하) */
@media screen and (max-width: 480px) {
    .rb-quote {
        padding: 12px 12px 12px 45px;
        font-size: 14px;
    }

    .rb-quote::before {
        font-size: 32px;
        left: 8px;
    }

    .rb-pullquote {
        padding: 20px 24px;
    }

    .rb-pullquote p {
        font-size: 16px;
    }

    .rb-pullquote::before {
        top: -8px;
        left: 10px;
    }

    .rb-pullquote::after {
        bottom: -22px;
        right: 10px;
    }

    .rb-media-text {
        padding: 12px;
        gap: 16px;
    }

    .rb-slide-prev,
    .rb-slide-next {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .rb-slideshow-indicators span {
        width: 10px;
        height: 10px;
    }

    .rb-slideshow-indicators span.active {
        width: 24px;
    }
}

/* ========================================
   다크 모드 지원
======================================== */

@media (prefers-color-scheme: dark) {
    .rb-quote {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-left-color: #93c5fd;
        color: #e2e8f0;
    }

    .rb-quote::before {
        color: #93c5fd;
    }

    .rb-pullquote {
        background: #1e293b;
        border-top-color: #93c5fd;
        border-bottom-color: #93c5fd;
    }

    .rb-pullquote::before,
    .rb-pullquote::after {
        color: #93c5fd;
    }

    .rb-pullquote p {
        color: #f1f5f9;
    }

    .rb-media-text {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .rb-media-text-content h2,
    .rb-media-text-content h3 {
        color: #f1f5f9;
    }

    .rb-media-text-content p {
        color: #e2e8f0;
    }

    .rb-slideshow {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .rb-slideshow-indicators {
        background: rgba(255, 255, 255, 0.05);
    }

    #editor ul li::marker,
    #editor ol li::marker {
        color: #93c5fd;
    }
}

/* ========================================
   인쇄 스타일
======================================== */

@media print {
    .rb-slideshow-controls,
    .rb-slideshow-indicators {
        display: none !important;
    }

    .rb-slide {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .rb-media-text {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .rb-quote,
    .rb-pullquote {
        page-break-inside: avoid;
        box-shadow: none;
    }
}
