/*
Theme Name: Irene Theme
Theme URI: https://blog.hello-irene.com
Description: Bootstrap 5 기반 미니멀 블로그 테마 - 가독성 최우선
Author: Irene
Version: 1.0.0
Text Domain: irene-theme
*/

/* ===== Base ===== */
:root {
    --primary: #6c5ce7;
    --primary-hover: #5a4bd1;
    --text: #2d3436;
    --text-light: #636e72;
    --bg: #fafafa;
    --card-bg: #ffffff;
    --border: #eee;
    --max-content: 720px;
}

body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text);
    background: var(--bg);
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout: 좌측 사이드바 + 우측 콘텐츠 ===== */
.site-layout {
    display: flex;
    min-height: 100vh;
}

.site-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-inner {
    padding: 36px 24px;
}

.site-logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
    display: block;
    letter-spacing: -0.5px;
}

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

.site-desc {
    font-size: 13px;
    color: var(--text-light);
    margin: 6px 0 28px;
    line-height: 1.5;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.sidebar-nav li a:hover {
    background: rgba(108, 92, 231, 0.06);
    color: var(--primary);
}

.sidebar-nav li a.active {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.cat-count {
    font-size: 12px;
    color: #b2bec3;
    font-weight: 400;
}

.site-content {
    flex: 1;
    margin-left: 240px;
}

/* 모바일 헤더 */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 99;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text);
}

/* ===== Main Content ===== */
.site-main {
    min-height: calc(100vh - 80px);
    padding: 40px 0;
}

/* ===== Post Cards (목록) ===== */
.post-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.post-card:hover {
    border-color: #ddd;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}

.post-card .post-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.post-card .post-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

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

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

.post-card .post-excerpt {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-meta {
    font-size: 13px;
    color: #b2bec3;
}

.post-card .post-meta span + span::before {
    content: '·';
    margin: 0 8px;
}

/* ===== Post Card with Thumbnail ===== */
.post-card--has-thumb {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.post-thumb {
    flex-shrink: 0;
    width: 160px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    display: block;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .post-card--has-thumb {
        gap: 16px;
    }

    .post-thumb {
        width: 120px;
        height: 90px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .post-card--has-thumb {
        flex-direction: column;
    }

    .post-thumb {
        width: 100%;
        height: 180px;
    }
}

/* ===== Single Post ===== */
.single-header {
    text-align: center;
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.single-header .post-category {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.single-header .entry-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.single-header .post-meta {
    font-size: 14px;
    color: var(--text-light);
}

/* 본문 스타일 */
.entry-content {
    max-width: var(--max-content);
    margin: 0 auto;
    padding-bottom: 60px;
}

.entry-content p {
    margin-bottom: 1.6em;
    letter-spacing: -0.01em;
}

.entry-content h2 {
    margin-top: 2.8em;
    margin-bottom: 0.8em;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.entry-content h3 {
    margin-top: 2em;
    margin-bottom: 0.6em;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.entry-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.entry-content a:hover {
    color: var(--primary-hover);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.entry-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(108, 92, 231, 0.04);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-light);
}

.entry-content ul, .entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.6em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.entry-content table th,
.entry-content table td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.entry-content table th {
    background: var(--bg);
    font-weight: 600;
}

.entry-content pre,
.entry-content code {
    background: #f1f2f6;
    border-radius: 6px;
    font-size: 14px;
}

.entry-content code {
    padding: 2px 6px;
}

.entry-content pre {
    padding: 20px;
    overflow-x: auto;
}

/* ===== 자동 생성 글 이미지 (figure + figcaption) ===== */
.entry-content figure.post-image {
    margin: 28px auto;
    text-align: center;
    max-width: 720px;
}
.entry-content figure.post-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    display: block;
}
.entry-content figure.post-image figcaption.img-credit {
    margin-top: 6px;
    font-size: 11.5px;
    color: #9ca3af;
    line-height: 1.4;
    text-align: right;
    padding-right: 4px;
    letter-spacing: -.01em;
}
.entry-content figure.post-image figcaption.img-credit a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.entry-content figure.post-image figcaption.img-credit a:hover {
    color: #6c5ce7;
}

/* ===== Content Components ===== */
.entry-content .tip-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    border-left: 4px solid #00b894;
    font-size: 15px;
    line-height: 1.75;
}

/* 본문 테이블 공통 폴백 (plain <table>에도 항상 적용) */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: #ffffff;
    border: 1px solid #e0e0e8;
    border-radius: 10px;
    overflow: hidden;
}
.entry-content table th {
    background: #5a4bd1 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-align: left !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    border: none !important;
}
.entry-content table td {
    color: #2d3436;
    padding: 11px 16px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    background: transparent;
}
.entry-content table tbody tr:nth-child(even) td {
    background: #f8f9ff;
}
.entry-content table tbody tr:last-child td {
    border-bottom: none;
}

/* compare-table 클래스는 그라디언트 스타일 유지 (더 강한 우선순위로) */
.entry-content .compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.entry-content .compare-table thead tr {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe) !important;
}

.entry-content .compare-table th {
    padding: 12px 16px !important;
    color: #ffffff !important;
    background: transparent !important;
    font-weight: 700 !important;
    text-align: left !important;
    font-size: 14px !important;
    border: none !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.entry-content .compare-table td {
    padding: 11px 16px;
    color: #2d3436;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    background: #ffffff;
}

.entry-content .compare-table tbody tr:nth-child(even) td {
    background: #f8f9ff;
}

.entry-content .compare-table tbody tr:last-child td {
    border-bottom: none;
}

.entry-content .highlight {
    color: #e17055;
    font-weight: 700;
}

/* ===== FAQ Section ===== */
.faq-wrap {
    margin-top: 48px;
}

.faq-wrap-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text);
}

.faq-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 5px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item .faq-q {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.faq-item .faq-a {
    font-size: 15.5px;
    font-weight: 400;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}

/* ===== Post Tags ===== */
.post-tags {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags a {
    background: #f0efff;
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.post-tags a:hover {
    background: var(--primary);
    color: white;
}

/* ===== Related Posts ===== */
.related-posts {
    margin-top: 8px;
}

.related-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text);
}

.related-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts li {
    margin-bottom: 2px;
}

.related-posts li:last-child {
    margin-bottom: 0;
}

.related-posts a {
    display: block;
    padding: 6px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
}

.related-posts a:hover {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.06);
}

/* ===== Post Navigation ===== */
.post-navigation {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 20px;
}

.post-navigation a {
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
}

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

.post-navigation .nav-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* ===== Pagination ===== */
.pagination .page-link {
    border: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    margin: 0 2px;
}

.pagination .page-link:hover {
    background: rgba(108, 92, 231, 0.08);
    color: var(--primary);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    font-size: 13px;
    color: #b2bec3;
    background: var(--card-bg);
}

.site-footer p {
    margin: 0;
}

.footer-links {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    color: #b2bec3;
    text-decoration: none !important;
    transition: color 0.15s;
    font-size: 12px;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-sep {
    color: #ddd;
    font-size: 12px;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 80px 0;
}

.error-404 h1 {
    font-size: 120px;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
}

.error-404 p {
    font-size: 18px;
    color: var(--text-light);
    margin: 20px 0 32px;
}

/* ===== Comments ===== */
.comments-area .comments-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

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

.comment-list .comment {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author .fn {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.comment-author .says {
    display: none;
}

.comment-author img.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.comment-metadata {
    font-size: 12px;
    color: #b2bec3;
    margin-bottom: 6px;
}

.comment-metadata a {
    color: #b2bec3;
    text-decoration: none;
}

.comment-body p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.comment-reply-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.comment-respond {
    margin-top: 0;
    padding-top: 20px;
}

.comment-respond .comment-reply-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.comment-fields-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.comment-field-item {
    flex: 1;
}

.comment-form label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.comment-form textarea {
    min-height: 0;
    height: 2.8em;
    resize: vertical;
}

.comment-form .submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 9px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: var(--primary-hover);
}

.comment-form p {
    margin-bottom: 0;
}

@media (max-width: 576px) {
    .comment-fields-row {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .site-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .site-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    }

    .site-content {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
    }
}

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

    .single-header { padding: 32px 0 24px; }
    .single-header .entry-title { font-size: 26px; }

    .post-card { padding: 24px; }
    .post-card .post-title { font-size: 19px; }

    .entry-content h2 { font-size: 21px; }
    .entry-content h3 { font-size: 18px; }

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