/*
Theme Name: Tistory Skin Replica Theme
Theme URI: https://example.com/
Author: WordPress Custom Theme Generator
Author URI: https://example.com/
Description: 티스토리 스킨 HTML/CSS 구조와 스타일(폰트, 헤더, 그림자, 모던 타이틀 스타일, 반응형)을 완벽하게 재현한 워드프레스 테마입니다.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: tistory-wp-theme
*/

/* ==========================================
   Base CSS & Variables (From Tistory Skin)
   ========================================== */
:root {
    --ts-custom-font: "Noto Sans DemiLight", AppleSDGothicNeo, "Malgun Gothic", "맑은 고딕", "돋움", dotum, sans-serif, 'Font_Awesome_5_Free';
    --ts-title-position: center;
    --ts-border-radius: 8px;
    --ts-html-font-size: 16px;
    --ts-line-height: 1.75;
    --ts-font-ratio: 1;
    --ts-mobile-font-ratio: 0.95;
    --ts-bg-color: #ffffff;
    --ts-sidebar-color: #f8f9fa;
    --ts-sidebar-text-color: #333333;
    --ts-etc-color: #3b82f6;
    --ts-border-size: 1px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: var(--ts-html-font-size) !important;
    font-family: var(--ts-custom-font) !important;
    background-color: var(--ts-bg-color);
    color: #333333;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--ts-bg-color);
    font-family: var(--ts-custom-font) !important;
}

/* Layout */
.site-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px 15px;
}

header.site-header {
    margin-bottom: 30px;
    text-align: var(--ts-title-position);
}

header.site-header p.site-title {
    margin: 0;
    padding: 10px 0;
}

header.site-header p.site-title a {
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    color: #222222;
    text-align: var(--ts-title-position);
}

header.site-header p.site-description {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #777;
}

#blog-menu ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

#blog-menu ul li a {
    text-decoration: none;
    color: #555555;
    font-weight: 600;
}

/* Main & Sidebar Layout */
.site-content {
    display: block;
    clear: both;
}

.content-area {
    float: left;
    width: 72%;
}

aside.sidebar {
    float: right;
    width: 25%;
}

.site-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Cards & Shadow Effects (Matching Skin) */
.content-wrapper, .content-title, .book-toc, .floating-toc-new, .post-item, .sidebar .widget {
    border-radius: var(--ts-border-radius);
    box-shadow: 0 0 16px -4px #ddd;
    background: #ffffff;
    margin-bottom: 25px;
    padding: 25px;
}

body.dark-mode .content-wrapper, 
body.dark-mode .content-title, 
body.dark-mode .post-item, 
body.dark-mode .sidebar .widget {
    box-shadow: 0 0 16px -4px #555 !important;
    background: #1e1e1e;
    color: #e0e0e0;
}

/* Typography & Content Styles */
.content-article p {
    line-height: var(--ts-line-height) !important;
    margin-bottom: 1.5em;
}

/* Headings (Modern Style as defined in skin) */
h1, h1[data-ke-size] { font-size: calc(1.4em * var(--ts-font-ratio)) !important; margin-top: 1.2em; margin-bottom: 0.6em; }

h2, h2[data-ke-size] {
    font-size: calc(1.3em * var(--ts-font-ratio)) !important;
    position: relative;
    padding: 5px 10px;
    border-bottom-left-radius: 12px;
    border-bottom: 2px solid var(--ts-etc-color) !important;
    margin-top: 1.4em;
    margin-bottom: 0.8em;
}

h3, h3[data-ke-size] {
    font-size: calc(1.24em * var(--ts-font-ratio)) !important;
    position: relative;
    padding: 5px 10px;
    border-bottom-left-radius: 12px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.5) !important;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

h4, h4[data-ke-size] {
    font-size: calc(1.17em * var(--ts-font-ratio)) !important;
    position: relative;
    padding: 5px 10px;
    border-bottom-left-radius: 12px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2) !important;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* OpenGraph Embed Blocks */
figure[data-ke-type='opengraph'], .og-card {
    border: var(--ts-border-size) solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 0 16px -4px #ddd;
}

figure[data-ke-type='opengraph'] div.og-text p.og-title {
    font-size: calc(1.22em * var(--ts-font-ratio)) !important;
    font-weight: bold;
    margin-bottom: 5px !important;
}

figure[data-ke-type='opengraph'] div.og-text p.og-desc {
    font-size: calc(0.83em * var(--ts-font-ratio)) !important;
    color: #666;
}

figure[data-ke-type='opengraph'] div.og-text p.og-host {
    font-size: calc(0.77em * var(--ts-font-ratio)) !important;
    color: #888;
}

/* Sidebar Styling */
.sidebar .widget {
    margin-bottom: 20px;
}

.sidebar .widget h2, .sidebar .widget h2.widget-title {
    font-size: 16px;
    padding: 10px 15px;
    background-color: var(--ts-sidebar-color);
    color: var(--ts-sidebar-text-color);
    border-radius: 4px;
    margin-top: 0;
    margin-bottom: 15px;
    border: none !important;
}

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

.sidebar .widget ul li {
    padding: 8px 0;
    border-bottom: 1px dotted #e0e0e0;
}

.sidebar .widget ul li a {
    text-decoration: none;
    color: #444444;
}

/* Post Cards */
.post-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.post-item .thum img {
    width: 200px;
    height: 135px;
    object-fit: cover;
    border-radius: 6px;
}

.post-item .post-info {
    flex: 1;
}

.post-item h2.entry-title {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    font-size: 20px !important;
}

.post-item h2.entry-title a {
    text-decoration: none;
    color: #222;
}

.post-item .meta {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 10px;
}

/* Comments */
.comments {
    margin-top: 30px;
}

.comments h2 {
    border-bottom: 2px solid var(--ts-etc-color) !important;
}

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

.comment-list li {
    padding: 15px 0;
    border-bottom: 1px dotted #ccc;
}

/* Responsive Rules from Skin */
@media (max-width: 767px) {
    .content-area, aside.sidebar {
        float: none;
        width: 100%;
    }
    h1, h1[data-ke-size] { font-size: calc(1.4em * var(--ts-mobile-font-ratio) * var(--ts-font-ratio)) !important; }
    h2, h2[data-ke-size] { font-size: calc(1.3em * var(--ts-mobile-font-ratio) * var(--ts-font-ratio)) !important; }
    h3, h3[data-ke-size] { font-size: calc(1.24em * var(--ts-mobile-font-ratio) * var(--ts-font-ratio)) !important; }
    h4, h4[data-ke-size] { font-size: calc(1.17em * var(--ts-mobile-font-ratio) * var(--ts-font-ratio)) !important; }
    
    .post-item {
        flex-direction: column;
    }
    .post-item .thum img {
        width: 100%;
        height: auto;
    }
}
