/*
Theme Name: NewsUp Child
Template: newsup
Version: 1.4.0
Description: Child theme for NewsUp with complete image centering (Featured + Content)
*/

/* ============================================
   완전한 이미지 중앙 정렬 (v1.4.0)
   - 피처드 이미지 (Featured Image)
   - 콘텐츠 내 이미지 (Content Images)
   ============================================ */

/* ═══════════════════════════════════════════
   1. 피처드 이미지 중앙 정렬 (Featured Image)
   ═══════════════════════════════════════════ */

/* 모든 디바이스 공통 */
.mg-blog-post-box > .img-fluid,
.mg-blog-post-box > img.single-featured-image {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    max-width: 100% !important;
    height: auto !important;
}

/* PC 버전 (768px 이상) - 피처드 이미지 */
@media screen and (min-width: 768px) {
    .mg-blog-post-box > .img-fluid,
    .mg-blog-post-box > img.single-featured-image {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 20px !important;
    }
}

/* ═══════════════════════════════════════════
   2. 콘텐츠 내 이미지 중앙 정렬 (Content Images)
   ═══════════════════════════════════════════ */

/* 모든 디바이스 공통 */
.mg-blog-post-box .small figure {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    max-width: 800px !important;
    float: none !important;
}

.mg-blog-post-box .small figure img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    height: auto !important;
    float: none !important;
}

.mg-blog-post-box .small figcaption {
    text-align: center !important;
    margin-top: 8px !important;
}

article.page-content-single figure {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

article.page-content-single img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    float: none !important;
}

/* PC 버전 (768px 이상) - 콘텐츠 이미지 */
@media screen and (min-width: 768px) {
    .mg-blog-post-box .small figure {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-top: 20px !important;
        margin-bottom: 20px !important;
        max-width: 800px !important;
        float: none !important;
        text-align: center !important;
    }
    
    .mg-blog-post-box .small figure img {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        height: auto !important;
        float: none !important;
    }
    
    article.page-content-single figure {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        float: none !important;
        text-align: center !important;
    }
    
    article.page-content-single img {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
        float: none !important;
    }
    
    /* wrapper div도 중앙 정렬 확실히 */
    article.page-content-single div[style*="max-width"] {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* 데스크톱 버전 (992px 이상) 추가 보강 */
@media screen and (min-width: 992px) {
    .mg-blog-post-box > .img-fluid,
    .mg-blog-post-box > img.single-featured-image {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .mg-blog-post-box .small figure {
        display: block !important;
        margin: 20px auto !important;
        max-width: 800px !important;
        float: none !important;
    }
    
    .mg-blog-post-box .small figure img {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ═══════════════════════════════════════════
   3. 기사 요약 박스 스타일 (Post Excerpt Box)
   ═══════════════════════════════════════════ */

/* 공통 스타일 */
.post-excerpt-box {
    margin-bottom: 30px;
    margin-top: 20px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ──────────────────────────────────────────
   옵션 1: 클래식 스타일 (Classic)
   ────────────────────────────────────────── */
.excerpt-style-classic {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 5px solid #0284c7;
    border-radius: 8px;
    padding: 20px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.excerpt-style-classic:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.excerpt-style-classic .excerpt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(2, 132, 199, 0.2);
}

.excerpt-style-classic .excerpt-icon {
    font-size: 24px;
    line-height: 1;
}

.excerpt-style-classic .excerpt-label {
    font-size: 16px;
    font-weight: 700;
    color: #0284c7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.excerpt-style-classic .excerpt-content {
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
    font-weight: 400;
}

/* ──────────────────────────────────────────
   옵션 2: 모던 스타일 (Modern)
   ────────────────────────────────────────── */
.excerpt-style-modern {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.12);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.excerpt-style-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #9333ea 0%, #c084fc 100%);
}

.excerpt-style-modern:hover {
    box-shadow: 0 12px 32px rgba(147, 51, 234, 0.18);
    transform: translateY(-3px);
}

.excerpt-style-modern .excerpt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.excerpt-style-modern .excerpt-icon {
    font-size: 28px;
    line-height: 1;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.excerpt-style-modern .excerpt-label {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #9333ea 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.excerpt-style-modern .excerpt-content {
    font-size: 16px;
    line-height: 1.8;
    color: #1e293b;
    font-weight: 400;
}

/* ──────────────────────────────────────────
   옵션 3: 인용구 스타일 (Quote)
   ────────────────────────────────────────── */
.excerpt-style-quote {
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.excerpt-style-quote .excerpt-quote {
    border-left: 6px solid #ea580c;
    padding: 20px 20px 20px 30px;
    margin: 0;
    background: linear-gradient(to right, #fff7ed 0%, transparent 100%);
    position: relative;
    font-style: italic;
    transition: all 0.3s ease;
}

.excerpt-style-quote .excerpt-quote:hover {
    border-left-width: 8px;
    padding-left: 35px;
}

.excerpt-style-quote .excerpt-quote::before {
    content: '"';
    position: absolute;
    left: 8px;
    top: 0;
    font-size: 72px;
    color: rgba(234, 88, 12, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
}

.excerpt-style-quote .excerpt-text {
    font-size: 17px;
    line-height: 1.8;
    color: #292524;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.excerpt-style-quote .excerpt-cite {
    display: block;
    font-size: 14px;
    color: #ea580c;
    font-weight: 600;
    font-style: normal;
    text-align: right;
    margin-top: 10px;
}

/* ──────────────────────────────────────────
   반응형 디자인 (Responsive)
   ────────────────────────────────────────── */

/* 모바일 (768px 이하) */
@media screen and (max-width: 768px) {
    .post-excerpt-box {
        margin-bottom: 20px;
        margin-top: 15px;
    }

    .excerpt-style-classic,
    .excerpt-style-modern {
        padding: 15px 20px;
        border-radius: 8px;
    }

    .excerpt-style-classic .excerpt-label,
    .excerpt-style-modern .excerpt-label {
        font-size: 14px;
    }

    .excerpt-style-classic .excerpt-icon,
    .excerpt-style-modern .excerpt-icon {
        font-size: 20px;
    }

    .excerpt-style-classic .excerpt-content,
    .excerpt-style-modern .excerpt-content,
    .excerpt-style-quote .excerpt-text {
        font-size: 15px;
        line-height: 1.6;
    }

    .excerpt-style-quote .excerpt-quote {
        padding: 15px 15px 15px 25px;
    }

    .excerpt-style-quote .excerpt-quote::before {
        font-size: 48px;
    }
}

/* 태블릿 (768px ~ 992px) */
@media screen and (min-width: 768px) and (max-width: 992px) {
    .excerpt-style-classic,
    .excerpt-style-modern {
        padding: 18px 22px;
    }
}

/* 큰 화면 (1200px 이상) */
@media screen and (min-width: 1200px) {
    .post-excerpt-box {
        margin-bottom: 35px;
    }

    .excerpt-style-classic .excerpt-content,
    .excerpt-style-modern .excerpt-content,
    .excerpt-style-quote .excerpt-text {
        font-size: 17px;
        line-height: 1.9;
    }
}
