/**
 * Premium Blog Pro - Modern CSS Additions
 * @version 2.0.0
 */

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ==================== Hero Section ==================== */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 80px 0;
    margin-bottom: 60px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease;
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    animation: fadeIn 1s ease 0.2s both;
}

/* ==================== Cards & Grid ==================== */
.posts-grid {
    animation: fadeIn 0.6s ease;
}

.post-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    border-radius: var(--border-radius-lg);
    z-index: -1;
}

.post-card:hover::before {
    opacity: 0.05;
}

.post-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    transition: gap var(--transition-fast);
}

.read-more:hover {
    gap: 12px;
}

/* ==================== Back to Top Button ==================== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* ==================== Search Suggestions ==================== */
.search-suggestions {
    margin-top: 20px;
    max-width: 600px;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-list li {
    margin-bottom: 10px;
}

.suggestions-list a {
    display: block;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    transition: all var(--transition-fast);
}

.suggestions-list a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(10px);
}

/* ==================== Pagination ==================== */
.pagination-wrapper {
    margin-top: 60px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.page-numbers:hover {
    background: var(--primary-color);
    color: white;
}

.page-numbers.current {
    background: var(--gradient-primary);
    color: white;
}

/* ==================== Comments Styling ==================== */
.comments-area {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.75rem;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-body {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.comment-author img {
    border-radius: 50%;
}

.comment-form {
    margin-top: 40px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    transition: all var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.submit-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==================== Author Bio ==================== */
.author-bio {
    display: flex;
    gap: 24px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    margin-top: 40px;
}

.author-avatar img {
    border-radius: 50%;
    border: 4px solid var(--primary-color);
}

.author-name {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.author-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== Related Posts ==================== */
.related-posts {
    margin-top: 60px;
}

.related-posts-title {
    font-size: 1.75rem;
    margin-bottom: 30px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.related-post {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-base);
}

.related-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.related-post:hover .related-post-thumbnail img {
    transform: scale(1.1);
}

.related-post-title {
    padding: 20px;
    font-size: 1.125rem;
}

/* ==================== Sidebar Widgets ==================== */
.widget {
    animation: fadeIn 0.8s ease;
}

.widget-search .search-wrapper {
    position: relative;
}

.widget-search .search-field {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    transition: all var(--transition-fast);
}

.widget-search .search-field:focus {
    border-color: var(--primary-color);
}

.widget-search .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-post-item,
.popular-post-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.recent-post-item:last-child,
.popular-post-item:last-child {
    border-bottom: none;
}

.post-thumbnail-small {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.post-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.tag-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==================== Loading Spinner ==================== */
.loading-spinner {
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}
/* ==================== 긴급 레이아웃 수정 - 최우선 순위로 덮어쓰기 ==================== */
/* 이 CSS를 style.css 맨 마지막에 추가하세요 */

/* 1. 모든 오버레이 완전 제거 */
body::after,
body::before,
body.menu-open::after,
body.menu-open::before,
.mobile-menu-overlay,
.menu-overlay,
*::after[content=""],
*::before[content=""] {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: static !important;
    z-index: -1 !important;
}

/* 2. body.menu-open 상태에서도 정상 동작 */
body.menu-open {
    overflow: auto !important;
    position: static !important;
}

/* 3. 모든 레이아웃 강제 수정 - 최우선 순위 */
.content-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 데스크톱 (1025px 이상) */
@media (min-width: 1025px) {
    .content-wrapper {
        display: flex !important;
        flex-direction: row !important;
        gap: 40px !important;
        align-items: flex-start !important;
        width: 100% !important;
    }
    
    .content-area {
        flex: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important; /* calc 제거 */
    }
    
    .sidebar {
        width: 320px !important;
        flex: 0 0 320px !important;
        min-width: 320px !important;
        max-width: 320px !important;
        display: block !important;
    }
}

/* 태블릿 (769px ~ 1024px) - 사이드바 아래로, 콘텐츠 100% 너비 */
@media (max-width: 1024px) and (min-width: 769px) {
    .content-wrapper {
        display: block !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .content-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        display: block !important;
        margin-bottom: 40px !important;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        display: block !important;
        position: static !important;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .content-wrapper {
        display: block !important;
        width: 100% !important;
    }
    
    .content-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        display: block !important;
        margin-bottom: 30px !important;
    }
    
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        display: block !important;
        position: static !important;
    }
}

/* 4. Archive 카드 레이아웃 완전 수정 */
.archive-posts-cards {
    width: 100% !important;
    max-width: 100% !important;
}

.archive-post-card {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
}

@media (max-width: 768px) {
    .archive-post-card {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .card-image {
        width: 100% !important;
        height: 180px !important;
    }
    
    .card-content {
        width: 100% !important;
        padding: 15px !important;
    }
}

/* 5. Posts Grid 수정 */
.posts-grid,
.posts-grid-3col {
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 1200px) and (min-width: 769px) {
    .posts-grid-3col {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .posts-grid,
    .posts-grid-3col {
        grid-template-columns: 1fr !important;
    }
}

/* 6. Single Post 수정 */
.single-post .entry-content {
    width: 100% !important;
    max-width: 100% !important;
}

/* 7. no-sidebar 클래스 처리 */
.no-sidebar .content-wrapper {
    display: block !important;
}

.no-sidebar .content-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

.no-sidebar .sidebar {
    display: none !important;
}

/* 8. 게시판 페이지는 항상 사이드바 표시 */
.page-template-board-template .sidebar,
.board-page .sidebar {
    display: block !important;
}

/* 9. 모바일 메뉴 완전 수정 */
.mobile-navigation {
    position: fixed !important;
    top: var(--header-height, 70px) !important;
    right: -100% !important;
    width: 85% !important;
    max-width: 320px !important;
    height: calc(100vh - var(--header-height, 70px)) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: -10px 0 30px rgba(0,0,0,0.3) !important;
    z-index: 999 !important;
    pointer-events: auto !important;
    transition: right 0.4s ease !important;
}

.mobile-navigation.active {
    right: 0 !important;
}

/* 다크모드에서 모바일 메뉴 */
[data-theme="dark"] .mobile-navigation {
    background: rgba(31, 41, 55, 0.98) !important;
}

/* 모든 모바일 메뉴 요소 클릭 가능 */
.mobile-menu,
.mobile-menu *,
.mobile-menu-inner,
.mobile-menu-inner *,
.mobile-dark-mode,
.mobile-dark-mode *,
.mobile-user-section,
.mobile-user-section * {
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 10. 컨테이너 수정 */
.container {
    width: 100% !important;
    max-width: var(--container-max, 1280px) !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.site-content,
.site-main {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 11. 모바일에서 햄버거 버튼 표시 */
@media (max-width: 768px) {
    .main-navigation,
    .header-actions > *:not(.mobile-menu-toggle) {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        pointer-events: auto !important;
        z-index: 1001 !important;
        position: relative !important;
    }
}

/* 12. 디버깅을 위한 임시 표시 (문제 해결 후 제거) */
/*
.content-area {
    outline: 2px solid red !important;
}
.sidebar {
    outline: 2px solid green !important;
}
.content-wrapper {
    outline: 2px solid blue !important;
}
*/