/*
Theme Name: 인포메이션 리빙 (InformationLiving)
Theme URI: https://example.com/
Author: 사용자님
Author URI: https://example.com/
Description: 더 나은 삶을 위한 정보와 라이프스타일 팁을 제공하는 블로그 테마입니다.
Version: 1.0.0
...
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: finance-insight
Tags: custom-theme, finance, investment, responsive-layout

이 테마는 스마트홈 라이프 테마를 기반으로 재테크 전문 블로그용으로 재설계되었습니다.
*/

/* --- 1. 기본 초기화 및 공통 스타일 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f8f9fa;
    font-size: 16px; /* 기본 폰트 크기 설정 */
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* 단일 포스트 페이지용 container */
body.single .container {
    max-width: 900px;
}


img {
    max-width: 100%;
    height: auto;
    display: block;
    border-style: none; /* IE 테두리 제거 */
}

a {
    text-decoration: none;
    color: #1a73e8;
}

a:hover {
    text-decoration: underline;
}

/* 화면 리더기 전용 텍스트 */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* --- 2. 헤더 (`header.php`) --- */
.site-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding .site-title a,
.logo-text a { /* 로고 텍스트용 클래스 */
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a73e8;
    text-decoration: none;
}
.site-branding .custom-logo-link img { /* 커스텀 로고 이미지 */
    max-height: 50px; /* 로고 이미지 높이 제한 */
    width: auto;
}


.main-navigation ul.nav-menu { /* wp_nav_menu 기본 출력 ul에 적용 */
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0; padding: 0; /* ul 기본 스타일 제거 */
}
.main-navigation ul.nav-menu li {
    margin: 0; padding: 0;
}

.main-navigation ul.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5em 0; /* 클릭 영역 확보 */
}

.main-navigation ul.nav-menu a:hover,
.main-navigation ul.nav-menu .current-menu-item > a { /* 현재 활성 메뉴 */
    color: #1a73e8;
}

/* 모바일 메뉴 토글 버튼 (기본 숨김) */
.menu-toggle {
    display: none;
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    cursor: pointer;
}

/* style.css 파일에 추가 */
.homepage-hero-section .hero-partners-notice {
    font-size: 0.8rem;
    color: #e0e0e0;
    margin-top: 15px;
    opacity: 0.9;
}

/* --- 3. 홈페이지 (`front-page.php`) --- */
.homepage-hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 20px;
    text-align: center;
}
.homepage-hero-section h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.homepage-hero-section p { font-size: 1.2rem; margin-bottom: 2rem; }

/* 공통 CTA 버튼 */
.cta-button {
    display: inline-block;
    background: #1a73e8;
    color: white !important;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s, transform 0.3s;
}
.cta-button:hover {
    background: #1256b1;
    text-decoration: none;
    transform: translateY(-2px);
}


/* 카테고리 섹션 */
.homepage-categories-section { padding: 3rem 0; background: #fff; }
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}
.category-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid #eee;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.category-icon { font-size: 3rem; margin-bottom: 1rem; }
.category-card h3 { color: #2c3e50; margin-bottom: 0.5rem; font-size: 1.1rem; }
.category-card p { color: #666; font-size: 0.9rem; margin:0; }

/* 인기 포스트 & 최신 포스트 공통 카드 스타일 */
.homepage-popular-products-section,
.homepage-recent-reviews-section {
    padding: 3rem 0;
}
.homepage-popular-products-section { background-color: #f8f9fa; }
.homepage-recent-reviews-section { background-color: #fff; }

.posts-grid, /* 새 이름 */
.products-grid { /* 기존 이름 호환 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.archive-post-card, /* 새 이름 */
.homepage-product-card { /* 기존 이름 호환 */
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9e9e9;
}
.archive-post-card:hover,
.homepage-product-card:hover { transform: translateY(-5px); }

.post-image-wrapper,
.product-image-wrapper {
    position: relative;
    width: 100%;
    background-color: #f0f0f0;
}
.post-image-wrapper::before,
.product-image-wrapper::before {
    content: "";
    display: block;
    padding-top: 65%; /* 16:9 비율에 가깝게 */
}

.post-image, .placeholder-image,
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
}
.post-info,
.product-info { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }

.post-title,
.product-title { font-size: 1.1rem; line-height: 1.4; margin-bottom: 0.5rem; color: #2c3e50; font-weight: bold; }
.post-title a,
.product-title a { color: inherit; text-decoration: none; }
.post-title a:hover,
.product-title a:hover { color: #1a73e8; }

.post-meta { font-size: 0.85rem; color: #666; margin-bottom: 1rem; }

.read-more-button {
    display: inline-block; color: #1a73e8; font-weight: bold; text-decoration:none; font-size:0.9rem;
    margin-top: auto;
}
.read-more-button:hover { text-decoration: underline; }


/* 최신 리뷰 섹션 (홈페이지용) -> 최신 포스트 카드 스타일 */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.homepage-recent-reviews-section .review-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* --- 4. 아카이브 페이지 --- */
.archive .page-header,
.category .page-header,
.tag .page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    text-align: center;
}
.archive .page-title,
.category .page-title,
.tag .page-title { font-size: 2.2rem; color: #2c3e50; margin-bottom: 0.5rem;}
.archive .taxonomy-description,
.category .taxonomy-description,
.tag .taxonomy-description { font-size: 1rem; color: #666; max-width: 700px; margin-left:auto; margin-right:auto; }

.archive-post-card .post-excerpt,
.archive-product-card .product-excerpt {
    font-size: 0.9rem;
    color: #555;
    margin: 1rem 0;
    line-height: 1.6;
    flex-grow: 1;
}

/* 페이지네이션 */
.pagination { margin-top: 3rem; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; align-items: center; gap: 0.5rem; }
.pagination .nav-links .page-numbers {
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
}
.pagination .nav-links .page-numbers:hover,
.pagination .nav-links .page-numbers.current {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}


/* --- 5. 단일 포스트 페이지 (`single.php`) --- */
.breadcrumb-wrapper {
    background: #f8f9fa; padding: 1rem 0; font-size: 0.9rem; margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
body.single .breadcrumb-wrapper .container a { color: #666; }
body.single .breadcrumb-wrapper .container a:hover { color: #1a73e8; }
body.single .breadcrumb-wrapper .container span { color: #333; font-weight: 500; }

.article-wrapper {
    background: white; margin: 1rem 0 2rem 0; padding: 2rem; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
@media (max-width: 768px) {
    .article-wrapper { padding: 1.5rem; }
}

.article-header { margin-bottom: 2rem; }
.article-title.entry-title {
    font-size: 2rem; color: #2c3e50; margin-bottom: 0.75rem; line-height: 1.3;
}
.article-meta.entry-meta {
    display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; color: #666; font-size: 0.9rem;
    padding-bottom: 1rem; border-bottom: 1px dashed #eee;
}

/* 본문 내용 (the_content() 출력 영역) */
.entry-content { margin-bottom: 2.5rem; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content table {
    margin-bottom: 1.5em;
}
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
    margin-top: 1.8em; margin-bottom: 1em; line-height: 1.4; color: #2c3e50;
}
.entry-content h2 { font-size: 1.5em; border-bottom: 2px solid #f0f0f0; padding-bottom: 0.3em; }
.entry-content h3 { font-size: 1.3em; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: decimal; }
.entry-content blockquote {
    margin: 1.5em 0; padding: 1em 1.5em; border-left: 4px solid #1a73e8;
    background-color: #f9f9f9; font-style: italic;
}
.entry-content table { width:100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border: 1px solid #ddd; padding: 0.5em 0.75em; }
.entry-content th { background-color: #f5f5f5; font-weight: bold; }


/* 관련 포스트 */
.related-posts-section { margin-top: 3rem; padding-top: 2rem; border-top:1px solid #eee; }
.related-posts-section .section-title {
    font-size: 1.3rem; color: #2c3e50; margin-bottom: 1rem; text-align: left;
    padding-bottom: 0.5rem; border-bottom: 2px solid #1a73e8;
}
.related-products-grid { /* 클래스명 호환 */
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.5rem;
}
.related-product-card {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    text-align: center; transition: transform 0.3s, box-shadow 0.3s;
    display: flex; flex-direction: column;
}
.related-product-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.related-product-card a {text-decoration:none; color:inherit; display:flex; flex-direction: column; flex-grow: 1; padding: 1rem;}
.related-image-wrapper {
    width: 100%; padding-top: 75%; position:relative; margin-bottom: 0.75rem; background-color:#f0f0f0; border-radius: 4px; overflow: hidden;
}
.related-image-wrapper img.related-image {
    position:absolute; top:0; left:0; width:100%; height:100%; object-fit: cover;
}
.related-title { font-size: 0.9rem; margin-bottom: 0.5rem; color: #2c3e50; font-weight:500; line-height:1.4; flex-grow:1; }


/* 최종 CTA 박스 */
.final-cta-box {
    background: #f0f3f5; color: #333; padding: 1.5rem; border-radius: 8px;
    text-align: center; margin-top: 2.5rem; border: 2px dashed #1a73e8;
}
.final-cta-box h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: #2c3e50; }
.final-cta-box p { margin-bottom: 1rem; }


/* --- 6. 푸터 (`footer.php`) --- */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 3rem;
    font-size: 0.9rem;
}
.footer-links { display: flex; justify-content: center; gap: 0.75rem 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.footer-links a { color: #f0f0f0; text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: white; text-decoration: underline; }
.site-footer .copyright, .site-footer .partners-notice {
    opacity: 0.8; margin-bottom: 0.5rem;
}
.site-footer .partners-notice { font-size: 0.8rem; }


/* --- 7. 댓글 영역 스타일 --- */
#comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #eee; }
.comments-title,
#reply-title { font-size: 1.5rem; margin-bottom: 1.5rem; color: #2c3e50;}
.comment-list { list-style: none; padding: 0; }
.comment-list li.comment { padding: 1.5em 0; border-bottom: 1px solid #f0f0f0; }
.comment-list li.comment:last-child { border-bottom: none; }
.comment-author { display: flex; align-items: center; margin-bottom: 0.5em; }
.comment-author img.avatar { margin-right: 10px; border-radius: 50%; width: 48px; height: 48px;}
.comment-author .fn { font-weight: bold; font-size: 1rem; }
.comment-author .fn a { color: #333; text-decoration: none; }
.comment-author .says { display: none; }
.comment-metadata { font-size: 0.85em; color: #777; margin-left: 58px; }
.comment-metadata a { color: #777; }
.comment-content { margin-left: 58px; font-size: 0.95rem; }
.reply { margin-left: 58px; margin-top: 0.5em; }
.reply a { font-size: 0.85em; background-color: #f5f5f5; padding: 0.3em 0.7em; border-radius:3px; text-decoration:none; color:#333; }
.reply a:hover { background-color: #1a73e8; color:white; }

#respond { margin-top: 2rem; }
.comment-form p { margin-bottom: 1em; }
.comment-form label { display: block; margin-bottom: 0.3em; font-weight: 500; font-size: 0.9rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%; padding: 0.6em 0.8em; border: 1px solid #ccc; border-radius: 4px;
    font-size: 0.95rem;
}
.comment-form textarea { min-height: 120px; }
.comment-form .required { color: red; }
.form-submit input#submit {
    background: #1a73e8; color: white; border: none; padding: 0.75em 1.5em;
    border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: 500;
    transition: background-color 0.3s;
}
.form-submit input#submit:hover { background: #1256b1; }
.comment-notes, .logged-in-as { font-size: 0.85rem; color: #777; }


/* --- 8. 반응형 --- */
@media (max-width: 992px) {
    .container,
    body.single .container {
        max-width: 100%; padding-left: 15px; padding-right: 15px;
    }
}

@media (max-width: 768px) {
    /* 모바일 메뉴 */
    .site-header .container { position: relative; }
    .main-navigation { width: 100%; }
    .main-navigation ul.nav-menu {
        display: none;
        flex-direction: column; gap: 0; width:100%; text-align:left;
        background: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    .main-navigation.toggled ul.nav-menu { display: flex; }
    .main-navigation ul.nav-menu li { width: 100%; border-bottom: 1px solid #f0f0f0; }
    .main-navigation ul.nav-menu li:last-child { border-bottom: none; }
    .main-navigation ul.nav-menu a { padding: 0.8em 1em; display: block; width: 100%;}
    .menu-toggle { display: block; position: absolute; top: 50%; right: 15px; transform: translateY(-50%);}


    .homepage-hero-section h1 { font-size: 2rem; }
    .homepage-hero-section p { font-size: 1rem; }
    .section-title { font-size: 1.7rem; margin-bottom: 1.5rem; }

    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .posts-grid,
    .products-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .review-grid { grid-template-columns: 1fr; gap: 1.5rem; }

    .article-title.entry-title { font-size: 1.7rem; }
    .article-meta.entry-meta { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
    .related-products-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
}

@media (max-width: 480px) {
    .homepage-hero-section { padding: 2.5rem 15px; }
    .homepage-hero-section h1 { font-size: 1.6rem; }

    .article-title.entry-title { font-size: 1.4rem; }

    .footer-links { flex-direction: column; gap: 0.5rem; align-items: center;}
}

/* --- 9. 블로그 글쓰기용 추가 스타일 --- */
/* 제휴/광고 안내 문구 */
.content-affiliate-notice {
    background-color: #f0f0f0;
    color: #555;
    font-size: 0.85em;
    font-weight: normal;
    padding: 10px 15px;
    margin: 0 0 2em 0;
    text-align: center;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* 핵심 요약 박스 */
.key-takeaway-box {
    background-color: #e3f2fd;
    border-left: 5px solid #1a73e8;
    padding: 20px;
    margin: 1.5em 0 2em 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.key-takeaway-box h3 {
    margin-top: 0;
    color: #1565c0;
    font-size: 1.4rem;
    margin-bottom: 0.5em;
}
.key-takeaway-box p:last-child {
    margin-bottom: 0;
}

/* 스타일링된 테이블 */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    border: 1px solid #ddd;
    margin: 1.5em 0;
    font-size: 0.95rem;
}
.styled-table caption {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
    caption-side: top;
    text-align: left;
}
.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}
.styled-table thead tr {
    background-color: #f5f5f5;
}
.styled-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
.styled-table tbody tr:hover {
    background-color: #f0f0f0;
}


/* 본문 내 이미지 스타일 */
.entry-content figure.aligncenter {
    text-align: center;
}
.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.entry-content figcaption {
    text-align: center;
    font-size: 0.9em;
    color: #555;
    margin-top: -0.5em;
    margin-bottom: 1.5em;
}

/* 애니메이션 CTA 버튼 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.content-cta-button-wrapper {
    text-align: center;
    margin: 30px 0;
}

.cta-button-animated {
    display: inline-block;
    background-color: #1a73e8;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.25rem;
    padding: 15px 30px;
    border: none;
    text-decoration: none;
    animation: pulse 2s infinite;
    border-radius: 50px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
}

.cta-button-animated:hover {
    background-color: #1256b1;
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.5);
}

/* FAQ 박스 스타일 */
.faq-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 1.5em 0;
    overflow: hidden;
}
.faq-box-item {
    border-bottom: 1px solid #e0e0e0;
}
.faq-box-item:last-child {
    border-bottom: none;
}
.faq-box-question {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    position: relative;
}
.faq-box-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.5em;
    transition: transform 0.3s;
}
.faq-box-answer {
    padding: 0 20px 20px 20px;
    display: none;
    background: #f9f9f9;
}
.faq-box-item.active .faq-box-question::after {
    transform: rotate(45deg);
}
.faq-box-item.active .faq-box-answer {
    display: block;
}

/* --- 홈페이지 카테고리 레이아웃 (균일 크기) --- */
.category-grid {
    display: grid;
    /* 데스크톱에서는 한 줄에 3개의 열을 만들고, 자동으로 다음 줄로 넘어갑니다. */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* 카드 사이의 간격 */
}

/* 768px 이하 태블릿 화면에서는 한 줄에 3개씩 표시 */
@media (max-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 768px 이하 모바일 화면에서는 한 줄에 2개씩 표시 */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}