/* ===========================
   기본 설정
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #FFF8F2;
    --card-bg: #FFFFFF;
    --primary: #F4845F;
    --primary-dark: #e06b44;
    --yellow: #FFD166;
    --mint: #06C89A;
    --blue: #4A90D9;
    --purple: #9B72CF;
    --text: #2D2D2D;
    --text-light: #666;
    --text-muted: #999;
    --border: #F0E8DF;
    --shadow: 0 4px 20px rgba(244, 132, 95, 0.12);
    --shadow-hover: 0 12px 40px rgba(244, 132, 95, 0.22);
    --radius: 20px;
    --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

/* ===========================
   헤더
=========================== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon { font-size: 1.8rem; }

.logo-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}

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

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 12px 24px;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: block;
}

.mobile-menu a:last-child { border-bottom: none; }

.mobile-menu.open { display: flex; }

/* ===========================
   히어로
=========================== */
.hero {
    background: linear-gradient(135deg, #FFF0E8 0%, #FFF8F2 50%, #F0FFF8 100%);
    padding: 60px 24px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244,132,95,0.1) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.hero-inner {
    max-width: 600px;
    flex: 1;
}

.hero-tag {
    display: inline-block;
    background: var(--yellow);
    color: #7a5c00;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-desc {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 24px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 80px;
}

.stat strong {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.stat span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.hero-emoji-wrap {
    display: flex;
    align-items: center;
    padding-left: 40px;
}

.hero-emoji {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ===========================
   필터
=========================== */
.filter-section {
    padding: 24px 24px 0;
}

.filter-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #fff;
    border: 2px solid var(--border);
    color: var(--text-light);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.25s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(244,132,95,0.35);
}

/* ===========================
   검색
=========================== */
.search-section {
    padding: 16px 24px 0;
}

.search-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.search-inner input {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 30px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-inner input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(244,132,95,0.12);
}

/* ===========================
   공통 섹션
=========================== */
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.featured-section { padding: 36px 0 0; }
.posts-section { padding: 36px 0 60px; }

/* ===========================
   추천 카드 (featured)
=========================== */
.featured-card {
    background: linear-gradient(135deg, #fff 0%, #FFF5EE 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    gap: 28px;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '✨ 추천글';
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--yellow);
    color: #7a5c00;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.featured-emoji {
    font-size: 4rem;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-body { flex: 1; }

.featured-body .category-tag {
    margin-bottom: 10px;
}

.featured-body h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.featured-body .post-summary {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================
   카드 그리드
=========================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    animation: cardIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(16px);
}

@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.card-emoji {
    font-size: 2.2rem;
    margin-bottom: 14px;
    width: 56px;
    height: 56px;
    background: var(--bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    flex: 1;
}

.post-summary {
    color: var(--text-light);
    font-size: 0.87rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

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

.read-more {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===========================
   카테고리 태그
=========================== */
.category-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.tag-주말연구소 { background: #FFE8E8; color: #D63031; }
.tag-육아인사이트 { background: #FFF3CD; color: #856404; }
.tag-도도형제일상 { background: #D4EDDA; color: #155724; }
.tag-AI육아 { background: #D1ECF1; color: #0C5460; }

/* ===========================
   빈 상태
=========================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p { font-size: 1.1rem; margin-bottom: 16px; }

.empty-state button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.empty-state button:hover { background: var(--primary-dark); }

/* ===========================
   상세 페이지
=========================== */
.detail-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.detail-header-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 0;
}

.back-btn {
    background: none;
    border: 2px solid var(--border);
    color: var(--text-light);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.detail-article {
    padding: 40px 24px 80px;
}

.detail-inner {
    max-width: 800px;
    margin: 0 auto;
}

.detail-cover {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #FFF0E8, #FFE4D4);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    margin-bottom: 32px;
}

.detail-meta {
    margin-bottom: 8px;
}

.detail-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 24px;
    display: block;
}

.detail-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 6px;
    color: var(--text);
}

.detail-lead {
    font-size: 1.05rem;
    color: var(--text-light);
    background: var(--bg);
    padding: 16px 20px;
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 36px;
    line-height: 1.8;
}

.detail-body { line-height: 1.9; font-size: 1rem; }

.detail-body .section-block {
    margin-bottom: 36px;
}

.detail-body .section-block h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-body .section-block p {
    color: var(--text);
    line-height: 1.9;
}

.detail-body .section-block p + p {
    margin-top: 12px;
}

.insight-box {
    background: linear-gradient(135deg, #FFF5EE, #FFF8F2);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    margin-top: 36px;
}

.insight-box h3 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.insight-box p {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.8;
}

.detail-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border);
}

.back-btn-bottom {
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 40px;
    display: inline-block;
}

.back-btn-bottom:hover {
    background: var(--primary);
    color: #fff;
}

.related-posts h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.related-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s;
}

.related-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.related-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    line-height: 1.4;
    color: var(--text);
}

/* ===========================
   푸터
=========================== */
.site-footer {
    background: #2D2D2D;
    color: #ccc;
    text-align: center;
    padding: 40px 24px;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.site-footer p {
    font-size: 0.88rem;
    line-height: 1.8;
}

.footer-small {
    color: #888;
    margin-top: 8px;
    font-size: 0.8rem !important;
}

/* ===========================
   반응형
=========================== */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .hamburger { display: block; }

    .hero {
        flex-direction: column;
        padding: 40px 20px;
        text-align: center;
    }

    .hero-stats { justify-content: center; }
    .hero-emoji-wrap { padding: 24px 0 0; }
    .hero-emoji { font-size: 3.5rem; }

    .featured-card {
        flex-direction: column;
        text-align: center;
    }

    .featured-card::before { top: 12px; right: 12px; }

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

    .detail-cover { height: 160px; font-size: 3.5rem; }
}

@media (max-width: 400px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-stats { gap: 12px; }
    .stat { padding: 10px 14px; min-width: 70px; }
}
