/*
Theme Name: WellAges
Description: 웰니스 라이프스타일 블로그를 위한 미니멀 테마. Well+Good 스타일의 카드형 레이아웃과 깔끔한 디자인.
Version: 1.0
Author: WellAges Team
Text Domain: wellages
*/

/* ========================================
   CSS RESET & BASE STYLES
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden; /* 가로 스크롤 방지 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* 가로 스크롤 방지 */
}

/* ========================================
   TYPOGRAPHY
======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #666;
}

/* ========================================
   LAYOUT CONTAINER
======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow-x: hidden;
}

.wide-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow-x: hidden;
}

/* ========================================
   HEADER STYLES
======================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
    width: 100%;
    overflow-x: hidden;
}

.breadcrumb {
    color: #333;
    padding-bottom: 3%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-logo a {
    color: #1a1a1a;
}

/* 메인 네비게이션 */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 0;
    position: relative;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #1a1a1a;
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after,
.nav-menu li.current-menu-item a::after {
    width: 100%;
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.custom-logo-link img {
    width: 50%;
    height: auto;
}

/* ========================================
   MAIN CONTENT AREA
======================================== */
.site-main {
    padding: 60px 0;
    min-height: 60vh;
    width: 100%;
    overflow-x: hidden;
}

/* ========================================
   POST GRID (카드형 레이아웃)
======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
    width: 100%;
}

.post-card {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 30px;
    width: 100%;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-thumbnail {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.post-card:hover .post-thumbnail img {
    transform: scale(1.02);
}

.post-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
}

.post-content {
    padding: 0 5px;
}

.post-title {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 115%;
    margin-bottom: 12px;
}

.post-title a {
    color: #1a1a1a;
}

.post-title a:hover {
    color: #666;
}

.post-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
    gap: 15px;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-numbers {
    list-style: none;
    display: flex;
    gap: 10px;
}

/* ========================================
   SINGLE POST STYLES
======================================== */
.single-post-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
}

.single-post-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.single-post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: #666;
    /* margin-bottom: 30px; */
}

.single-post-featured-image {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
    border-radius: 8px;
    overflow: hidden;
}

.single-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content-wrapper {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

.post-content {
    font-size: 1.2rem;
    line-height: 1.8;
    width: 100%;
    overflow-x: hidden;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 4px solid #1a1a1a;
    padding-left: 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    font-size: 1.3rem;
    color: #666;
}

/* ========================================
   RELATED POSTS SECTION
======================================== */
.related-posts {
    background: #fafafa;
    padding: 60px 30px;
    margin: 80px 0 60px; /* 좌우 마진 제거 */
    border-radius: 8px;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.related-posts-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: #1a1a1a;
}

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

.related-post-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.related-post-card:hover {
    transform: translateY(-3px);
}

.related-post-card .post-thumbnail {
    height: 180px;
    margin-bottom: 0;
    width: 100%;
}

.related-post-card .post-content {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.related-post-card .post-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* ========================================
   COMMENTS SECTION
======================================== */
.comments-area {
    max-width: 720px;
    margin: 80px auto 0;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    overflow-x: hidden;
}

.comments-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
}

.comment-form {
    margin-bottom: 50px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 20px;
    font-family: inherit;
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .form-submit input {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
    width: auto;
}

.comment-form .form-submit input:hover {
    background: #333;
}

/* ========================================
   SOCIAL SHARE BUTTONS
======================================== */
.social-share {
    display: flex;
    gap: 15px;
    margin: 40px 0;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
    overflow-x: hidden;
}

.social-share-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.social-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    color: #666;
    transition: all 0.3s ease;
}

.social-share a:hover {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 80px 0 40px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 1px solid #ddd;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .current {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

/* ========================================
   FOOTER STYLES
======================================== */
.site-footer {
    background: #1a1a1a;
    color: #ffffff;
    padding: 60px 0 30px;
    margin-top: 10px;
    width: 100%;
    overflow-x: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    color: #999;
    font-size: 0.9rem;
}

/* ========================================
   AD INSERTION AREAS
======================================== */
.ad-container {
    text-align: center;
    margin: 40px 0;
    padding: 20px 0;
    width: 100%;
    overflow-x: hidden;
}

.ad-container.in-content {
    margin: 60px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 40px 0;
}

.ad-container .ad-label {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* 태블릿 (768px ~ 1023px) */
@media (max-width: 1023px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .single-post-title {
        font-size: 2.5rem;
    }
    
    .container {
        padding: 0 30px;
        max-width: 100%;
    }
    
    .related-posts {
        margin: 80px 0 60px;
        padding: 40px 20px;
    }
}

/* 모바일 (767px 이하) */
@media (max-width: 767px) {
    /* 헤더 모바일 스타일 */
    .main-navigation .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background: #ffffff;
        flex-direction: column;
        justify-content: start;
        align-items: start;
        padding: 80px 40px 40px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1000;
    }
    
    .main-navigation .nav-menu.active {
        right: 0;
        display: flex;
    }
    
    .main-navigation .nav-menu li {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .main-navigation .nav-menu li a {
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid #f0f0f0;
        display: block;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* 컨텐츠 모바일 스타일 */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        grid-template-columns: minmax(0, 1fr); /* 최소값 0으로 설정 */
    }
    
    .site-main {
        padding: 40px 0;
    }
    
    .single-post-title {
        font-size: 2rem;
    }
    
    .post-content-wrapper {
        padding: 0 10px;
        max-width: 100%;
    }
    
    .post-content {
        font-size: 1.1rem;
    }
    
    .related-posts {
        margin: 80px 0 60px; /* 좌우 마진 제거 */
        padding: 40px 20px;
        width: 100vw; /* 뷰포트 전체 너비 사용 */
        margin-left: calc(-50vw + 50%); /* 중앙 정렬 */
        margin-right: calc(-50vw + 50%);
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: calc(100vw - 40px); /* 패딩 고려 */
        margin: 0 auto;
    }
    
    .related-post-card {
        max-width: 100%;
    }
    
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* 폰트 크기 조정 */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    h3 {font-size: 1.5rem;}
    
    .post-card .post-title {
        font-size: 27px;
    }
}

/* 아주 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .header-content {
        height: 50px;
    }
    
    .site-logo {
        font-size: 1.3rem;
    }
    
    .post-thumbnail {
        height: 200px;
    }
    
    .single-post-title {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .related-posts {
        margin: 60px 0 40px;
        padding: 30px 15px;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }
    
    .related-posts-grid {
        max-width: calc(100vw - 30px);
        margin: 0 auto;
    }
    
    .related-post-card .post-content {
        padding: 15px;
    }
    
    .related-post-card .post-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .related-post-card .post-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }
}

/* ========================================
   UTILITY CLASSES
======================================== */
.screen-reader-text {
    position: absolute !important;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 1rem !important; }
.mb-2 { margin-bottom: 2rem !important; }
.mb-3 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 1rem !important; }
.mt-2 { margin-top: 2rem !important; }
.mt-3 { margin-top: 3rem !important; }

/* ========================================
   LOADING & ANIMATIONS
======================================== */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

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