/*
Theme Name: BuBuild Starter
Theme URI: https://bubuild.mycafe24.com
Description: 애드센스 승인 최적화 워드프레스 테마 - 깔끔하고 빠른 한국어 블로그 테마
Author: BuBuild
Author URI: https://bubuild.mycafe24.com
Template: twentytwentyfive
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bubuild-starter
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
*/

/* ===== 기본 리셋 및 변수 ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --max-width: 1200px;
    --content-width: 800px;
}

/* ===== 타이포그래피 ===== */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-color);
    background-color: var(--bg-color);
    word-break: keep-all;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1.5em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== 레이아웃 ===== */
.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* ===== 헤더 ===== */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

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

/* ===== 네비게이션 ===== */
.main-navigation ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.main-navigation a:hover,
.main-navigation a.current {
    color: var(--primary-color);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.2s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

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

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
    }
}

/* ===== 메인 콘텐츠 ===== */
.site-main {
    padding: 40px 0;
    min-height: 60vh;
}

/* ===== 포스트 카드 ===== */
.post-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 30px;
    transition: box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
}

.post-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

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

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 25px;
}

.post-card-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.post-card-title a {
    color: var(--text-color);
}

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

.post-card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.post-card-meta {
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== 싱글 포스트 ===== */
.single-post-header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.single-post-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.single-post-meta {
    color: var(--text-light);
    font-size: 0.95rem;
}

.single-post-content {
    max-width: var(--content-width);
    margin: 0 auto;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 20px 0;
}

.single-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-light);
}

.single-post-content ul,
.single-post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.single-post-content li {
    margin-bottom: 10px;
}

/* ===== 사이드바 ===== */
.sidebar {
    padding: 30px;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ===== 애드센스 광고 영역 ===== */
.ad-container {
    background: var(--bg-light);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin: 30px 0;
    text-align: center;
    min-height: 100px;
}

.ad-container-header {
    margin: 20px 0 40px;
}

.ad-container-content {
    margin: 30px 0;
}

.ad-container-sidebar {
    margin-bottom: 20px;
}

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

/* ===== 푸터 ===== */
.site-footer {
    background: var(--text-color);
    color: white;
    padding: 50px 0 30px;
    margin-top: 60px;
}

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

.footer-section h4 {
    color: white;
    margin-bottom: 20px;
}

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

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

.footer-section a {
    color: #9ca3af;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: white;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-links a {
    color: #9ca3af;
}

.footer-links a:hover {
    color: white;
}

/* ===== 검색 폼 ===== */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
}

.search-form button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* ===== 페이지네이션 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== 버튼 ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== 폼 스타일 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* ===== 유틸리티 ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden { display: none; }

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
    :root {
        --max-width: 100%;
    }

    .site-container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .single-post-title {
        font-size: 1.75rem;
    }

    .site-main {
        padding: 30px 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ===== 인쇄 스타일 ===== */
@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .ad-container,
    .main-navigation {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}

/* 브레드크럼 숨기기 */
.breadcrumb {
    display: none !important;
}

/* 로고 크기 조정 */
.site-branding img,
.custom-logo,
.site-logo img {
    max-height: 60px;
    width: auto;
}
