/* ═══════════════════════════════════════════════════════════════
   🎨 MONO ZINE BLOG SKIN
   Minimal + Trendy Magazine Style
   ═══════════════════════════════════════════════════════════════ */

/* 1. IMPORTS & VARIABLES */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Sophisticated Neutral + Bold Accent */
    --ink: #0d0d0d;
    --charcoal: #1a1a1a;
    --graphite: #2d2d2d;
    --slate: #6b6b6b;
    --silver: #a8a8a8;
    --cloud: #f5f5f5;
    --paper: #fafafa;
    --white: #ffffff;
    
    /* Accent Colors */
    --accent: #e63946;           /* Bold Red */
    --accent-soft: #ff6b6b;
    --accent-glow: rgba(230, 57, 70, 0.15);
    
    /* Alternative Accent (Switch for different mood) */
    /* --accent: #2563eb;        Deep Blue */
    /* --accent: #059669;        Emerald */
    /* --accent: #7c3aed;        Violet */
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 100px;
    
    /* Layout */
    --content-width: 1200px;
    --content-narrow: 720px;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.6s;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f5f5f5;
        --charcoal: #e8e8e8;
        --graphite: #d0d0d0;
        --slate: #9a9a9a;
        --silver: #6b6b6b;
        --cloud: #1a1a1a;
        --paper: #111111;
        --white: #0d0d0d;
        --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
        --shadow-lg: 0 20px 60px rgba(0,0,0,0.4);
    }
}


/* 2. RESET & BASE */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--charcoal);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: auto; /* Override for initial state */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}


/* 3. LAYOUT UTILITIES */
.content-width {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

#main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-2xl);
    padding: var(--space-2xl) 0;
}

#main.sidebarPosition.none {
    grid-template-columns: 1fr;
}

#content {
    min-width: 0;
}


/* 4. HEADER - Editorial Style */
#header_wrap {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all var(--duration-normal) var(--ease-out);
}

@media (prefers-color-scheme: dark) {
    #header_wrap {
        background: rgba(17, 17, 17, 0.85);
        border-bottom-color: rgba(255,255,255,0.05);
    }
}

#header_wrap.shrink {
    box-shadow: var(--shadow-sm);
}

#header_gnb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo / Title */
#header-title h1,
#header-title .h1-style {
    margin: 0;
}

#header-title a {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

#header-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-normal) var(--ease-out);
}

#header-title a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Search Bar */
#search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--cloud);
    border-radius: 100px;
    padding: var(--space-sm) var(--space-md);
    transition: all var(--duration-normal) var(--ease-out);
    border: 1px solid transparent;
}

#search-bar:focus-within {
    background: var(--white);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    color: var(--slate);
    display: flex;
    transition: color var(--duration-fast);
}

#search-bar:focus-within .search-icon {
    color: var(--accent);
}

#search-input {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--charcoal);
    width: 180px;
    outline: none;
}

#search-input::placeholder {
    color: var(--silver);
}


/* 5. PROGRESS BAR - Gradient Glow */
#progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: width 0.1s linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* 6. POST LIST - Magazine Cards */
.list_content {
    animation: fadeInUp 0.6s var(--ease-out) backwards;
}

.list_content:nth-child(1) { animation-delay: 0.1s; }
.list_content:nth-child(2) { animation-delay: 0.15s; }
.list_content:nth-child(3) { animation-delay: 0.2s; }
.list_content:nth-child(4) { animation-delay: 0.25s; }
.list_content:nth-child(5) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.index_wrap {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--cloud);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
}

.index_wrap::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 4px;
    height: 0;
    background: var(--accent);
    border-radius: 2px;
    transition: height var(--duration-normal) var(--ease-out);
    transform: translateY(-50%);
}

.index_wrap:hover::before {
    height: 60%;
}

.index_wrap:hover {
    padding-left: var(--space-md);
}

.post_link {
    display: flex;
    gap: var(--space-xl);
    width: 100%;
    align-items: flex-start;
}

.list_detail_wrap {
    flex: 1;
    min-width: 0;
}

/* Post Title */
.post_title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    transition: color var(--duration-fast);
    word-break: keep-all;
}

.index_wrap:hover .post_title {
    color: var(--accent);
}

/* Post Excerpt */
.post_text {
    font-size: 1rem;
    color: var(--slate);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

/* Post Meta */
.post_meta {
    font-size: 0.8rem;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Thumbnail */
s_article_rep_thumbnail {
    display: block;
    flex-shrink: 0;
}

.thumnail {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 10 / 7;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--cloud);
}

.thumnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.index_wrap:hover .thumnail img {
    transform: scale(1.08);
}

/* 썸네일 없는 경우 */
.index_wrap:not(:has(s_article_rep_thumbnail)) .list_detail_wrap {
    max-width: 100%;
}


/* 7. ARTICLE PAGE - Editorial Reading Experience */
.h-entry {
    animation: fadeIn 0.8s var(--ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Article Header */
.hd {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-xl);
    max-width: var(--content-narrow);
    margin: 0 auto;
}

.meta-cate {
    font-size: 0.85rem;
    color: var(--slate);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-lg);
}

.meta-cate a {
    color: var(--accent);
    font-weight: 600;
    transition: opacity var(--duration-fast);
}

.meta-cate a:hover {
    opacity: 0.7;
}

/* Article Title */
.hd-heading {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    letter-spacing: -0.03em;
    margin: 0;
    word-break: keep-all;
}

/* Admin Tools */
.admin-tools {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--cloud);
}

.dup-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--ink);
    color: var(--white);
    padding: var(--space-sm) var(--space-md);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all var(--duration-fast) var(--ease-out);
}

.dup-button:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.textLenIncludeSpaces {
    color: var(--slate);
    font-size: 0.85rem;
    margin-left: var(--space-sm);
}


/* 8. POST CONTENT - Typography Perfection */
.post-content,
.e-content {
    max-width: var(--content-narrow);
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--charcoal);
}

.post-content > * + * {
    margin-top: 1.5em;
}

.post-content p {
    word-break: keep-all;
    text-align: justify;
}

/* Headings */
.post-content h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
    color: var(--ink);
    margin: 2.5em 0 0.8em;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: var(--space-lg);
}

.post-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 4px;
    height: 1em;
    background: var(--accent);
    border-radius: 2px;
}

.post-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink);
    margin: 2em 0 0.6em;
}

.post-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--graphite);
    margin: 1.8em 0 0.5em;
}

/* Links */
.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color var(--duration-fast);
}

.post-content a:hover {
    text-decoration-color: var(--accent);
}

/* Blockquote */
.post-content blockquote {
    position: relative;
    margin: 2em 0;
    padding: var(--space-lg) var(--space-xl);
    background: var(--cloud);
    border-radius: 8px;
    font-style: italic;
    color: var(--graphite);
}

.post-content blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: var(--space-md);
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.3;
    line-height: 1;
}

/* Lists */
.post-content ul,
.post-content ol {
    padding-left: var(--space-lg);
}

.post-content li {
    margin: 0.5em 0;
}

.post-content li::marker {
    color: var(--accent);
}

/* Code */
.post-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    background: var(--cloud);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--graphite);
}

.post-content pre {
    background: var(--ink);
    color: var(--cloud);
    padding: var(--space-lg);
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Images */
.post-content img {
    border-radius: 12px;
    margin: 1.5em auto;
    box-shadow: var(--shadow-md);
}

.post-content figure {
    margin: 2em 0;
}

.post-content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--slate);
    margin-top: var(--space-sm);
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.post-content th,
.post-content td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--cloud);
}

.post-content th {
    font-weight: 600;
    color: var(--ink);
    background: var(--cloud);
}

.post-content tr:hover {
    background: rgba(0,0,0,0.02);
}

/* Horizontal Rule */
.post-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--silver), transparent);
    margin: 3em 0;
}


/* 9. SIDEBAR - Clean & Minimal */
#sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.module {
    margin-bottom: var(--space-xl);
}

.module-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--ink);
    display: inline-block;
}

/* Category List */
.module-category .module-content {
    font-size: 0.95rem;
}

.module-category a {
    display: block;
    padding: var(--space-xs) 0;
    color: var(--charcoal);
    transition: all var(--duration-fast);
}

.module-category a:hover {
    color: var(--accent);
    padding-left: var(--space-sm);
}

.module-category .c_cnt {
    color: var(--silver);
    font-size: 0.85em;
    margin-left: var(--space-xs);
}


/* 10. PAGINATION */
#paging {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-2xl) 0;
}

.pagination .num,
.pagination .prev,
.pagination .next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--slate);
    transition: all var(--duration-fast) var(--ease-out);
}

.pagination .num:hover,
.pagination .prev:hover,
.pagination .next:hover {
    background: var(--cloud);
    color: var(--ink);
}

.pagination .num.selected {
    background: var(--ink);
    color: var(--white);
    font-weight: 600;
}


/* 11. FOOTER - Minimal */
#footer {
    border-top: 1px solid var(--cloud);
    padding: var(--space-2xl) 0;
    margin-top: var(--space-3xl);
}

#footer .content-width {
    text-align: center;
}

#footer p {
    font-size: 0.85rem;
    color: var(--slate);
    margin: var(--space-xs) 0;
}

#footer a {
    color: var(--charcoal);
    font-weight: 500;
    transition: color var(--duration-fast);
}

#footer a:hover {
    color: var(--accent);
}


/* 12. COMMENTS & REACTIONS */
.post-reply {
    max-width: var(--content-narrow);
    margin: var(--space-lg) auto 0;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--cloud);
}

/* 카테고리 다른 글 영역 간격 조정 */
.another_category {
    margin: var(--space-lg) 0 var(--space-md) !important;
}

/* 티스토리 프로필 카드 간격 조정 */
.post-reply .tt-box-profile,
.post-reply .tt_box_namecard {
    margin: var(--space-md) 0 !important;
    padding: var(--space-md) !important;
}

/* 댓글 목록 상단 간격 */
.post-reply .tt-box-total {
    margin-top: var(--space-sm) !important;
}

/* 티스토리 댓글 스타일 오버라이드 */
.post-reply .rp_wrap,
.post-reply #entry0Comment,
.post-reply .tt_box_total,
.post-reply .tt_cmt_input {
    color: var(--charcoal) !important;
    background: var(--white) !important;
}

.post-reply input,
.post-reply textarea {
    color: var(--charcoal) !important;
    background: var(--white) !important;
    border: 1px solid var(--cloud) !important;
    border-radius: 8px !important;
    padding: var(--space-sm) var(--space-md) !important;
}

.post-reply input::placeholder,
.post-reply textarea::placeholder {
    color: var(--silver) !important;
}

.post-reply button,
.post-reply .tt_btn_submit {
    background: var(--ink) !important;
    color: var(--white) !important;
    border-radius: 8px !important;
    padding: var(--space-sm) var(--space-md) !important;
    transition: background var(--duration-fast) !important;
}

.post-reply button:hover,
.post-reply .tt_btn_submit:hover {
    background: var(--accent) !important;
}

.post-reply .tt_txt_g,
.post-reply .tt_cmt_info,
.post-reply .tt_date {
    color: var(--slate) !important;
}

.post-reply a {
    color: var(--charcoal) !important;
}

.post-reply a:hover {
    color: var(--accent) !important;
}

.container_postbtn {
    max-width: var(--content-narrow);
    margin: var(--space-xl) auto;
    visibility: hidden;
}


/* 13. RESPONSIVE DESIGN */
@media screen and (max-width: 1024px) {
    #main {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    #sidebar {
        position: static;
        padding-top: var(--space-xl);
        border-top: 1px solid var(--cloud);
    }
}

@media screen and (max-width: 768px) {
    :root {
        --space-lg: 20px;
        --space-xl: 32px;
        --space-2xl: 48px;
    }
    
    #header_gnb {
        height: 60px;
    }
    
    #header-title a {
        font-size: 1.4rem;
    }
    
    #search-input {
        width: 120px;
    }
    
    .index_wrap {
        flex-direction: column-reverse;
        gap: var(--space-md);
    }
    
    .post_link {
        flex-direction: column-reverse;
    }
    
    s_article_rep_thumbnail {
        width: 100%;
    }
    
    .thumnail {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    
    .post_title {
        font-size: 1.4rem;
    }
    
    .hd-heading {
        font-size: 1.8rem;
    }
    
    .post-content,
    .e-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .content-width {
        padding: 0 var(--space-md);
    }
    
    .index_wrap::before {
        display: none;
    }
    
    .index_wrap:hover {
        padding-left: 0;
    }
    
    #search-bar {
        padding: var(--space-xs) var(--space-sm);
    }
    
    #search-input {
        width: 100px;
        font-size: 0.85rem;
    }
}


/* 14. ANIMATIONS & MICRO-INTERACTIONS */
/* Smooth entrance for content */
#content.show {
    animation: contentReveal 0.8s var(--ease-out);
}

@keyframes contentReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Selection styling */
::selection {
    background: var(--accent);
    color: var(--white);
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth scroll anchor offset */
:target {
    scroll-margin-top: 100px;
}


/* 15. UTILITY CLASSES */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--white);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 0 0 8px 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 9999;
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
    outline: none;
}

.text-accent { color: var(--accent); }
.text-muted { color: var(--slate); }
.font-display { font-family: var(--font-display); }


/* 16. PRINT STYLES */
@media print {
    #header_wrap,
    #sidebar,
    #footer,
    .admin-tools,
    #progress,
    .container_postbtn {
        display: none;
    }
    
    #main {
        display: block;
    }
    
    .post-content {
        max-width: none;
        font-size: 12pt;
    }
}