/* blog.css - 워드프레스 스타일 블로그 테마 */

/* ===== CSS 변수 ===== */
:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ee5a5a;
    --secondary-color: #339af0;
    --accent-color: #fab005;
    --text-color: #333;
    --text-light: #868e96;
    --text-muted: #adb5bd;
    --bg-color: #f8f9fa;
    --bg-white: #fff;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --max-width: 1200px;
    --content-width: 800px;
    --sidebar-width: 320px;
}

/* ===== 리셋 및 기본 ===== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 헤더 ===== */
.blog-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
}

.blog-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-logo:hover {
    color: var(--primary-dark);
}

/* 네비게이션 */
.blog-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-nav a {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.blog-nav a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.blog-nav a.active {
    background: var(--primary-color);
    color: #fff;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ===== 히어로 섹션 ===== */
.blog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    text-align: center;
    color: #fff;
}

.blog-hero h1 {
    margin: 0 0 15px 0;
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.blog-hero p {
    margin: 0;
    font-size: 1.15rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== 메인 레이아웃 (2컬럼) ===== */
.blog-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 40px;
}

/* 메인 콘텐츠 영역 */
.blog-main {
    min-width: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.section-title::before {
    content: '';
    display: block;
    width: 5px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 3px;
}

/* ===== 아티클 카드 그리드 ===== */
.article-grid {
    display: grid;
    gap: 25px;
}

/* 아티클 카드 */
.article-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.article-card-horizontal {
    flex-direction: row;
}

.article-card-horizontal .article-thumbnail {
    width: 280px;
    min-width: 280px;
    height: 200px;
}

.article-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}

/* 이미지가 있는 썸네일 */
.article-thumbnail.has-image {
    background: #f1f3f5;
}

.article-thumbnail .thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.article-card:hover .thumbnail-img {
    transform: scale(1.05);
}

.article-thumbnail .thumbnail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.03) 100%);
    pointer-events: none;
}

.article-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.category-life {
    background: #e7f5ff;
    color: #1971c2;
}

.category-productivity {
    background: #d3f9d8;
    color: #2f9e44;
}

.category-money {
    background: #fff3bf;
    color: #e67700;
}

.category-health {
    background: #ffe3e3;
    color: #e03131;
}

.category-tech {
    background: #e5dbff;
    color: #7048e8;
}

.category-tip {
    background: #ffd8a8;
    color: #d9480f;
}

.category-game {
    background: #d0ebff;
    color: #1864ab;
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-color);
    transition: color 0.2s;
}

.article-card:hover .article-title {
    color: var(--primary-color);
}

.article-excerpt {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.65;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-read-more {
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-read-more:hover {
    gap: 10px;
}

/* 더보기 버튼 */
.load-more-btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 30px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ===== 사이드바 ===== */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 프로필 위젯 */
.profile-widget {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 15px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.profile-link {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-link:hover {
    background: var(--primary-dark);
}

/* 카테고리 위젯 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.category-list a:hover {
    background: var(--primary-color);
    color: #fff;
}

.category-count {
    font-size: 0.8rem;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* 인기 글 위젯 */
.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.popular-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.popular-content h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-item:hover h4 {
    color: var(--primary-color);
}

.popular-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 도구 바로가기 위젯 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 10px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s;
}

.tool-card:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.03);
}

.tool-icon {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.tool-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== 광고 영역 ===== */
.ad-container {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* ===== 푸터 ===== */
.blog-footer {
    background: #343a40;
    color: #adb5bd;
    padding: 50px 20px 30px;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #495057;
}

.footer-section h4 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 15px 0;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
}

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

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 0.9rem;
    color: #adb5bd;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: 25px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom a {
    color: #ced4da;
    text-decoration: underline;
}

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-nav {
        display: none;
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .blog-nav.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .blog-container {
        padding: 25px 15px;
    }

    .blog-sidebar {
        grid-template-columns: 1fr;
    }

    .article-card-horizontal {
        flex-direction: column;
    }

    .article-card-horizontal .article-thumbnail {
        width: 100%;
        min-width: auto;
        height: 160px;
    }

    .article-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 15px;
    }

    .blog-logo {
        font-size: 1.3rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}