/* Jekyll Hyde Style Tistory Skin - style.css */

/* Core Typography */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap");

/* 🔒 PROTECTED: DO NOT MODIFY CORE LAYOUT/COLOR */
:root {
    --primary: #30638e; /* Purple Point */
    --sidebar-bg: rgba(48, 99, 142, .03);
    --text-color: #333;
    --text-muted: #888;
    --bg-color: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --sidebar-width: 300px;
}

* { box-sizing: border-box; }

a {
    text-decoration: none !important;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: none !important;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
    background-color: var(--bg-color);
}

/* Layout Structures */
.container-fluid { width: 100%; }
.row { display: flex; flex-wrap: wrap; margin: 0; }
.no-gutters { margin: 0; }

/* Header & Top Menu */
.td-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px; /* Mobile Default */
    background-color: var(--primary);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    height: 100%;
    padding: 0 !important; /* Reset Bootstrap default */
    margin: 0;
}

.td-header .container-fluid {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .td-header {
        height: 70px; /* Desktop Height */
    }
    .td-header .container-fluid {
        padding: 0 2rem;
    }
}

.header-brand .navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
    letter-spacing: 2.5px;
}

@media (min-width: 768px) {
    .header-brand .navbar-brand {
        font-size: 1.3rem;
    }
}

.top-menu {
    display: flex;
    align-items: center;
}

.top-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    margin-left: 1.5rem;
    transition: color 0.2s, opacity 0.2s;
}

@media (min-width: 768px) {
    .top-menu a {
        margin-left: 2.5rem;
    }
}

.top-menu a:hover {
    color: #ffffff;
    opacity: 1;
}

/* Tistory Toolbar Support (PC) */
@media (min-width: 768px) {
    /* menubar와 menu_toolbar 클래스를 가진 요소가 있을 때만 메뉴를 왼쪽으로 밀기 */
    body:has(.btn_tool_type1) .td-header .container-fluid {
        padding-right: 100px !important; 
    }
    body:has(.btn_subscription) .td-header .container-fluid {
        padding-right: 300px !important; 
    }
}

/* Sidebar - Fixed on Desktop (Responsive Control) */
.td-sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    display: block; /* Default */
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.td-right-sidebar {
    display: none; /* Default hidden */
}

@media (min-width: 768px) {
    /* 1단 레이아웃 설정 */
    .layout-1 .td-sidebar { display: none; }
    .layout-1 .td-content-wrapper { margin-left: 0; padding: 4rem 15% 4rem !important; }

    /* 2단 & 3단 레이아웃 공통 (좌측 사이드바 고정) */
    .layout-2 .td-sidebar, 
    .layout-3 .td-sidebar {
        position: fixed;
        top: 70px; /* 헤더 높이에 맞춤 */
        bottom: 0;
        left: 0;
        width: var(--sidebar-width);
        height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 100;
        padding: 3rem 2rem 2rem;
    }

    .layout-2 .td-content-wrapper,
    .layout-3 .td-content-wrapper {
        margin-left: var(--sidebar-width);
    }

    /* 2단 전용 (본문 확장) */
    .layout-2 .td-content-wrapper {
        width: calc(100% - var(--sidebar-width));
        padding: 5.5rem 8% 4rem !important;
    }

    /* 3단 전용 (우측 사이드바 활성화) */
    @media (min-width: 992px) {
        .layout-3 .td-right-sidebar {
            display: block;
            width: 280px;
            flex: 0 0 280px;
        }
        .layout-3 .td-content-wrapper {
            width: calc(100% - var(--sidebar-width) - 280px);
            padding: 5.5rem 5% 4rem !important;
        }
    }
    
    /* 992px 미만에서는 3단도 2단으로 자동 전환 */
    @media (max-width: 991px) {
        .layout-3 .td-content-wrapper {
            width: calc(100% - var(--sidebar-width));
        }
    }
}

/* Sidebar Elements */
.profile { 
    margin-bottom: 2.5rem; 
    text-align: center; 
    padding: 2rem 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}
.profile img { 
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    margin-bottom: 1.2rem; 
    border: 3px solid #fff; 
    box-shadow: 0 4px 12px rgba(110, 68, 255, 0.15); 
}
.blogger { 
    font-weight: 800; 
    margin: 0; 
    font-size: 1.1rem; 
    color: #222;
    letter-spacing: -0.5px;
}
.desc { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-top: 0.6rem; 
    line-height: 1.6;
    word-break: keep-all;
}

.search-box { margin-bottom: 2rem; }
.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    transition: border-color 0.2s;
}
.search-box input:focus { outline: none; border-color: var(--primary); }
.search-box button { display: none; }

.category .tt_category, .category .category_list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.category li { 
    margin-bottom: 0.6rem; 
    position: relative;
    padding-left: 1.2rem; /* 공간 확보 */
}

/* Custom Bullet Indicator */
.category li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ddd; /* 기본 색상 */
    transition: all 0.2s ease;
}

/* Remove bullet only from 'All Categories' link tit */
.category .link_tit::before,
.category li:has(> .link_tit)::before {
    display: none !important;
}

.category .link_tit {
    padding-left: 0 !important;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem; /* 간격 소폭 확대 */
    display: block;
    font-size: 1rem;
    border-bottom: none; /* 구분선 제거 */
    padding-bottom: 0;
}

/* Ensure normal category items (even the first one) have bullets */
.category .category_list li::before,
.category .sub_category_list li::before {
    display: block;
}

.category li:hover::before {
    background-color: var(--primary);
    transform: translateY(-50%) scale(1.3);
}

.category a { 
    color: #555; 
    text-decoration: none; 
    font-size: 0.95rem; 
    transition: color 0.2s; 
    display: block;
    font-weight: 500;
}

.category a:hover { 
    color: var(--primary); 
}

/* Sub Category Styling */
.category .sub_category_list {
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.category .sub_category_list li {
    margin-bottom: 0.4rem;
}

.category .sub_category_list li::before {
    width: 4px;
    height: 4px;
    background-color: #eee;
}

.link_tit { margin-bottom: 0.5rem; display: block; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 3rem;
    font-size: 0.75rem;
    color: #aaa;
}

/* TOC Area & Right Sidebar */
.td-right-sidebar {
    padding: 4rem 1.5rem 4rem 0;
}

.right-sidebar-inner {
    position: sticky;
    top: 100px;
    min-height: 200px;
}

.ad-banner-right {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.ad-box {
    width: 100%;
    min-height: 250px;
    background: #f9f9fb;
    border: 1px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #bbb;
    font-weight: 700;
    letter-spacing: 1px;
}

.toc-wrapper {
    border-left: 1px solid var(--border-color);
    padding-left: 1.2rem;
}

#toc:empty::before {
    content: "Table of Contents";
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ddd;
    margin-bottom: 1rem;
}

/* Main Content Wrapper */
.td-content-wrapper {
    width: 100%;
    padding: 2rem 1rem;
}

.post-header { margin-bottom: 3.5rem; }
.post-title {
    letter-spacing: -1.5px;
    color: #1a1a1a;
}

.post-meta { color: var(--text-muted); font-size: 0.9rem; }
.post-meta span { margin-right: 1.5rem; }
.post-meta a { color: var(--primary); text-decoration: none; font-weight: 600; }

.post-body {
    color: #444;
    line-height: 1.8;
}

.post-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 2rem 0; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }

/* Post Divider */
.post-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0 1rem; /* 상단 여백을 넓게 주어 개방감 확보 */
    opacity: 0.6;
}

/* Protected Post Form */
.protected-form {
    background-color: #f9f9fb;
    padding: 3rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    margin: 2rem 0;
}

.protected-form p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.protected-form .input-group {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 10px;
}

.protected-form input[type="password"] {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #e1e1e7;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.protected-form input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
}

.protected-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.protected-form button:hover {
    background: #9a85ff;
}

.tags { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-color); font-size: 0.85rem; color: var(--text-muted); }
.tags a { color: var(--text-color); text-decoration: none; margin-left: 0.5rem; }

/* Post List */
.post-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.post-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: baseline;
}

.post-list li:last-child { border-bottom: none; }

.post-list .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
    font-family: monospace;
}

.post-list a {
    font-size: 1.1rem;
    color: #222;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.post-list a:hover { color: var(--primary); }

/* Paging - Fixed Overlapping */
.paging {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4rem 0;
    gap: 8px;
}

.paging .num-box {
    display: flex;
    gap: 8px;
}

/* Only style the direct children to prevent overlapping styles */
.paging .num-box > a, 
.paging .num-box > span, 
.paging .num-box > strong,
.paging > .prev,
.paging > .next {
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Reset any potentially nested tags inside buttons */
.paging .num-box > a *, 
.paging > a * {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: inherit;
    font-weight: inherit;
}

.paging a:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: rgba(110, 68, 255, 0.05);
}

/* Selected / Current Page */
.paging .num-box > .selected, 
.paging .num-box > strong, 
.paging .num-box > span:not(.prev):not(.next) {
    color: #fff !important;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(110, 68, 255, 0.15);
}

.paging .prev, .paging .next {
    font-weight: 600;
    color: #333;
    width: auto;
    padding: 0 15px;
}

.paging .prev.no-more, .paging .next.no-more {
    display: none !important;
}

/* Sidebar Profile Buttons */
.profile-btns {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.profile-btns .btn_subscription {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #fff !important;
    color: #666 !important;
    border: 1px solid #ddd !important;
    border-radius: 24px !important;
    padding: 0 20px !important;
    height: 36px !important; /* 높이 소폭 조정 */
    min-width: 110px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    font-style: normal !important; /* Added to fix italic issue */
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
    line-height: 1 !important; /* 삐뚤어짐 방지: line-height 초기화 */
}

/* "구독중" 또는 이미 구독한 상태일 때 --primary 컬러 적용 */
.profile-btns .btn_subscription.following, 
.profile-btns .btn_subscription[data-state="following"],
.profile-btns .btn_subscription:has(.txt_state:contains('중')) {
    background-color: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.profile-btns .btn_subscription:hover {
    background-color: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(110, 68, 255, 0.2) !important;
    transform: translateY(-1px);
}

/* Internal text elements */
.profile-btns .btn_subscription span,
.profile-btns .btn_subscription em,
.profile-btns .btn_subscription i {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-style: normal !important; /* Force normal style on all children */
}

/* Hide default icons and specific blog ID text */
.profile-btns .btn_subscription .ico_ts,
.profile-btns .btn_subscription .txt_tool_id {
    display: none !important;
}

/* Comments */
.comments { margin-top: 2rem; padding-top: 3.5rem; border-top: 1px solid var(--border-color); }
.comments h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 2rem; color: #222; }

/* Tistory Comment Form Overrides */
.comment-form { background: #f9f9fb; padding: 2rem; border-radius: 12px; margin-bottom: 3rem; border: 1px solid var(--border-color); }
.comment-guest-info {
    display: none; /* 기본 숨김 */
    gap: 10px;
    margin-bottom: 15px;
}
.comment-guest-info input {
    flex: 1;
}
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="password"] {
    width: 100%;
    border: 1px solid #eee; /* 더 연한 테두리 */
    padding: 0.9rem 1.2rem; /* 패딩 소폭 확대 */
    border-radius: 10px; /* 더 둥글게 */
    font-family: inherit;
    font-size: 0.92rem;
    background: #fff;
    transition: all 0.2s ease;
}
.comment-form textarea { height: 110px; resize: none; margin-bottom: 1rem; }
.comment-form input:focus, .comment-form textarea:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(178, 157, 255, 0.1); /* 포커스 효과 추가 */
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

/* Secret Checkbox Styling */
.secret-check {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.secret-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    margin: 0 10px 0 0; /* 마진 고정 */
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secret-check input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.secret-check input[type="checkbox"]:checked::after {
    content: "✔";
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.secret-check label {
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.secret-check:hover input[type="checkbox"] {
    border-color: var(--primary);
}

.comment-form .submit-btn, .comment-form button, .comment-form input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.comment-form .submit-btn:hover { background: #9a85ff; }
.comment-form .submit-btn:active { transform: scale(0.98); }

/* Tistory Dynamic Captcha (#tt_captChaBottom) - Compact & Professional Style */
#tt_captChaBottom {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    background: #fdfdfd !important;
    border: 1px solid #eee !important;
    border-radius: 12px !important;
    padding: 20px 15px !important;
    display: block !important;
    box-sizing: border-box !important;
}

#tt_captChaBottom .wrap_box_border,
#tt_captChaBottom .wrap_box_bg,
#tt_captChaBottom .wrap_btn_bg {
    display: none !important;
}

#innerBox {
    position: static !important;
    display: flex !important;
    flex-direction: row !important; /* 가로 정렬 */
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important; /* 왼쪽 정렬 */
    width: 100% !important;
    background: transparent !important;
    gap: 12px !important;
}

#imageCaptcha {
    display: block !important;
    margin: 0 !important;
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    height: 40px !important;
    width: auto !important;
}

.wrap_captcha_inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: auto !important;
    position: relative !important;
}

#inputCaptcha {
    order: 1 !important;
    display: block !important;
    width: 110px !important;
    height: 40px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    font-size: 1rem !important;
    text-align: center !important;
    margin: 0 !important;
    background: #fff !important;
}

#btnRefresh {
    order: 2 !important;
    width: 40px !important;
    height: 40px !important;
    background: #f5f5f7 !important;
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

#btnRefresh::after {
    content: "↻";
    font-size: 20px;
    color: #666;
}

#textRefresh {
    display: none !important;
}

.wrap_captcha_notice {
    order: 3 !important;
    width: 100% !important;
    margin-top: 10px !important; /* 간격 소폭 축소 */
    padding-top: 0 !important; /* 상단 패딩 제거 */
    border-top: none !important; /* 구분선 제거 */
    font-size: 0.75rem !important;
    color: #aaa !important;
    text-align: left !important; /* 왼쪽 정렬 */
}

#noticeCaptcha {
    display: block !important;
}

#noticeCaptcha {
    display: block !important;
}

/* Comment List */
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list > li { padding: 1.5rem 0; border-bottom: 1px solid var(--border-color); }
.comment-list > li:last-child { border-bottom: none; }

.comment-meta { 
    margin-bottom: 0.8rem; 
    font-weight: 700; 
    color: #333; 
    display: flex;
    align-items: center;
    gap: 10px;
}
.comment-meta span { 
    font-weight: 400; 
    color: var(--text-muted); 
}

.comment-content { 
    color: #555; 
    line-height: 1.7; 
    margin-bottom: 1rem; 
    word-break: break-all; 
}

.comment-control { display: flex; gap: 15px; margin-top: 0.5rem; }
.comment-control a { font-size: 0.78rem; color: #999; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.comment-control a:hover { color: var(--primary); }

/* Reply (Sub-comments) Styling */
.comment-reply-list { list-style: none; padding: 0; margin: 1.5rem 0 0 45px; }
.comment-reply-list li { 
    margin-top: 1.5rem; 
    padding-top: 1.5rem; 
    border-top: 1px dashed var(--border-color); 
    position: relative;
}

/* Indentation Arrow */
.comment-reply-list li::before {
    content: "↳";
    position: absolute;
    left: -22px;
    top: 1.5rem;
    color: #ccc;
    font-size: 1rem;
}

/* Mobile Adaptations */
@media (max-width: 767px) {
    .td-outer {
        padding-top: 50px; /* Matched with header */
    }

    .td-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 2.5rem 1rem;
        position: static;
        width: 100%;
        height: auto;
    }

    .td-content-wrapper {
        padding: 2.5rem 1rem 3.5rem !important;
        margin-left: 0;
    }

    .post-title {
        font-size: 2.1rem;
        letter-spacing: -1px;
    }

    /* Small Mobile (425px and below) */
    @media (max-width: 425px) {
        .post-title {
            font-size: 1.7rem;
        }
        .post-body {
            font-size: 1rem;
        }
        .td-content-wrapper {
            padding: 2rem 1rem 3rem !important;
        }
    }
}

/* Ad Areas */
.area-ad-list {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.area-ad-list.upper { margin-bottom: 3rem; }
.area-ad-list.lower { margin-top: 3rem; }

.area-ad-list:empty {
    display: none;
}

/* Tistory Profile Layer Disable */
.tistoryProfileLayerTrigger {
    display: none !important;
}

.tt_box_namecard {
    display: none !important;
}

