/* ============================================
   CIRCUIT BLOG - 모던 테크 매거진 스타일시트
   디자인 컨셉: 그리드 기반의 강한 타이포그래피,
   시그널 옐로우 액센트, 깔끔한 검정 컨트라스트
   ============================================ */
 
/* Google Fonts @import 제거 → header.php <link rel="preload"> 비동기 로드로 이전 (FCP 개선) */

/* ===== CSS 변수 ===== */
:root {
    /* 컬러 팔레트 - 모노 베이스 + 시그널 액센트 */
    --color-bg: #FAFAF7;
    --color-surface: #FFFFFF;
    --color-ink: #0A0A0A;
    --color-ink-soft: #2A2A2A;
    --color-muted: #6B6B6B;
    --color-line: #E5E5E0;
    --color-line-strong: #1A1A1A;
 
    /* 시그널 컬러 */
    --color-accent: #FFD400;          /* 시그널 옐로우 */
    --color-accent-2: #FF3D00;        /* 레드 */
    --color-accent-3: #00E5FF;        /* 시안 */
    --color-accent-4: #7C4DFF;        /* 퍼플 */
    --color-success: #00C853;
 
    /* 타이포그래피 */
    --font-display: 'Archivo Black', 'Pretendard', system-ui, sans-serif;
    --font-sans: 'Archivo', 'Pretendard', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', 'D2Coding', ui-monospace, monospace;
    --font-kr: 'Pretendard', 'Apple SD Gothic Neo', system-ui, sans-serif;
 
    /* 간격 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
 
    /* 컨테이너 */
    --container-max: 1440px;
    --container-content: 720px;
    --header-height: 72px;
 
    /* 모션 */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 280ms;
}
 
/* 다크 모드 */
[data-theme="dark"] {
    --color-bg: #0A0A0A;
    --color-surface: #141414;
    --color-ink: #FAFAF7;
    --color-ink-soft: #D8D8D5;
    --color-muted: #8A8A8A;
    --color-line: #252525;
    --color-line-strong: #E5E5E0;
}
 
/* ===== 리셋 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-kr);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-ink);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; }
 
/* ===== 컨테이너/그리드 ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}
@media (max-width: 768px) { .container { padding: 0 var(--space-md); } }
 
.grid {
    display: grid;
    gap: var(--space-xl);
}
.grid-12 { grid-template-columns: repeat(12, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
 
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
 
/* ===== 타이포그래피 ===== */
.display-1 {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 128px);
    line-height: 0.92;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}
.display-2 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.headline {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
}
.kicker {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
 
/* ===== 헤더 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header__inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}
.logo {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.logo__dot {
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: 50%;
    display: inline-block;
}
.nav-main {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}
.nav-main a {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    padding: 4px 0;
    transition: color var(--duration) var(--ease);
}
.nav-main a:hover { color: var(--color-accent-2); }
.nav-main a.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 100%;
    height: 2px;
    background: var(--color-ink);
}
.header-actions { display: flex; align-items: center; gap: var(--space-md); }
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-line);
    transition: all var(--duration) var(--ease);
}
.icon-btn:hover { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
 
/* ===== 모바일 메뉴 ===== */
.mobile-toggle { display: none; }
@media (max-width: 1024px) {
    .nav-main { display: none; }
    .mobile-toggle { display: inline-flex; }
    .nav-main.is-open {
        display: flex;
        position: fixed;
        top: var(--header-height);
        left: 0; right: 0;
        flex-direction: column;
        background: var(--color-bg);
        padding: var(--space-xl);
        border-bottom: 1px solid var(--color-line);
        gap: var(--space-md);
        z-index: 99;
    }
    .nav-main.is-open a { font-size: 24px; padding: var(--space-sm) 0; }
}
 
/* ===== 히어로 ===== */
.hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
    border-bottom: 1px solid var(--color-line);
    position: relative;
    overflow: hidden;
}
.hero__grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: var(--space-2xl);
    align-items: end;
}
@media (max-width: 1024px) { .hero__grid { grid-template-columns: 1fr; } }
 
.hero__featured {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-line);
}
.hero__featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}
.hero__featured:hover img { transform: scale(1.04); }
.hero__featured-content {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-xl);
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
}
.hero__featured-content .headline { color: #fff; }
 
.hero__sidebar { display: flex; flex-direction: column; gap: var(--space-xl); }
.hero__article {
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-line);
}
.hero__article:last-child { border-bottom: none; }
.hero__article-num {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--color-muted);
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}
.hero__article-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
    margin-bottom: var(--space-sm);
    transition: color var(--duration) var(--ease);
}
.hero__article:hover .hero__article-title { color: var(--color-accent-2); }
.hero__article-meta {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
 
/* ===== 카테고리 배지 ===== */
.cat-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    background: var(--color-ink);
    color: var(--color-bg);
    transition: all var(--duration) var(--ease);
}
.cat-badge--accent { background: var(--color-accent); color: var(--color-ink); }
.cat-badge:hover { transform: translateY(-2px); }
 
/* ===== 섹션 헤더 ===== */
.section {
    padding: var(--space-3xl) 0;
    border-bottom: 1px solid var(--color-line);
}
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-line-strong);
}
.section-head__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 48px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.section-head__link {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.section-head__link::after { content: '→'; transition: transform var(--duration) var(--ease); }
.section-head__link:hover::after { transform: translateX(4px); }
 
/* ===== 카드 ===== */
.card {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transition: transform var(--duration) var(--ease);
}
.card__image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--color-line);
    position: relative;
}
.card__image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}
.card:hover .card__image img { transform: scale(1.06); }
.card__category {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
}
.card__title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    transition: color var(--duration) var(--ease);
}
.card:hover .card__title { color: var(--color-accent-2); }
.card__excerpt {
    color: var(--color-muted);
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card__meta {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: auto;
}
.card__author { display: inline-flex; align-items: center; gap: 6px; }
.avatar-sm { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
 
/* ===== 사이드 리스트 ===== */
.list-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-line);
}
.list-item:last-child { border-bottom: none; }
.list-item__num {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--color-accent-2);
    line-height: 1.2;
}
.list-item__title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 4px;
}
.list-item__meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
 
/* ===== 게시물 본문 ===== */
.post-hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
}
.post-hero__inner {
    max-width: var(--container-content);
    margin: 0 auto;
}
.post-hero__category { margin-bottom: var(--space-md); }
.post-hero__title {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}
.post-hero__subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--color-muted);
    line-height: 1.4;
    margin-bottom: var(--space-xl);
    font-weight: 400;
}
.post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.post-meta__author { display: inline-flex; align-items: center; gap: var(--space-sm); }
.post-meta__author img { width: 28px; height: 28px; border-radius: 50%; }
.post-meta__name { color: var(--color-ink); font-weight: 600; }
 
.post-cover {
    margin: var(--space-2xl) auto;
    max-width: 1200px;
}
.post-cover img { width: 100%; height: auto; }
 
 
/* ===== 포스트 디자인 테마 (AI 생성 포스트 전용) ===== */
/* 테마가 설정된 경우 .post-body의 CSS 변수를 오버라이드 */
 
/* 모던 블루 */
[data-post-theme="modern_blue"] .post-body {
    --pt-h2-color: #1565C0;
    --pt-h2-border: 4px solid #1565C0;
    --pt-blockquote-border: #90CAF9;
    --pt-blockquote-bg: #E3F2FD;
    --pt-accent: #1565C0;
    font-family: 'Pretendard','Apple SD Gothic Neo',sans-serif;
}
[data-post-theme="modern_blue"] .post-body h2 { color: var(--pt-h2-color,inherit); border-left: var(--pt-h2-border,none); padding-left: 14px; border-bottom: none; }
[data-post-theme="modern_blue"] .post-body blockquote { border-left-color: #90CAF9; background: #E3F2FD; padding: 16px 20px; }
 
/* 따뜻한 감성 */
[data-post-theme="warm_emotion"] .post-body {
    font-family: 'Pretendard','Apple SD Gothic Neo',sans-serif;
    background: #fffdf8;
    line-height: 1.85;
}
[data-post-theme="warm_emotion"] .post-body h2 { color: #E65100; font-weight: 800; }
[data-post-theme="warm_emotion"] .post-body blockquote { border-left-color: #FFCC80; background: #FFF3E0; border-radius: 0 8px 8px 0; }
[data-post-theme="warm_emotion"] .post-body p { color: #3e2c1a; }
 
/* 미니멀 블랙 */
[data-post-theme="minimal_black"] .post-body { font-family: 'Pretendard',sans-serif; }
[data-post-theme="minimal_black"] .post-body h2 { font-weight: 900; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #000; padding-bottom: 8px; font-size: 26px; }
[data-post-theme="minimal_black"] .post-body blockquote { border-left: 3px solid #000; font-style: italic; background: none; padding-left: 20px; font-size: 20px; }
 
/* 비비드 팝 */
[data-post-theme="vivid_pop"] .post-body h2 { color: #D500F9; font-weight: 900; }
[data-post-theme="vivid_pop"] .post-body blockquote { border-left-color: #D500F9; background: #F3E5FF; border-radius: 0 8px 8px 0; }
[data-post-theme="vivid_pop"] .post-body li::marker { color: #D500F9; }
 
/* 럭셔리 골드 */
[data-post-theme="luxury_gold"] .post-body { background: #0f1628; color: #e8dcc8; }
[data-post-theme="luxury_gold"] .post-body h2 { color: #d4af37; border-left: 3px solid #d4af37; padding-left: 14px; }
[data-post-theme="luxury_gold"] .post-body h3 { color: #c8a82a; }
[data-post-theme="luxury_gold"] .post-body p { color: #c8bca8; }
[data-post-theme="luxury_gold"] .post-body blockquote { border-left-color: #d4af37; background: rgba(212,175,55,.08); font-style: italic; }
[data-post-theme="luxury_gold"] .post-body li::marker { color: #d4af37; }
[data-post-theme="luxury_gold"] .post-body a { color: #d4af37; background-image: none; text-decoration: underline; }
 
/* 사이버 테크 */
[data-post-theme="cyber_tech"] .post-body { font-family: 'IBM Plex Mono',monospace; background: #08192e; color: #c8f0ff; }
[data-post-theme="cyber_tech"] .post-body h2 { color: #00E5FF; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 22px; border-left: 3px solid #00E5FF; padding-left: 14px; }
[data-post-theme="cyber_tech"] .post-body h3 { color: #80D8FF; }
[data-post-theme="cyber_tech"] .post-body p { color: #a0c8e0; font-size: 16px; }
[data-post-theme="cyber_tech"] .post-body blockquote { border-left-color: #00E5FF; background: rgba(0,229,255,.06); }
[data-post-theme="cyber_tech"] .post-body li::marker { color: #00E5FF; }
[data-post-theme="cyber_tech"] .post-body code { background: rgba(0,229,255,.1); color: #00E5FF; }
 
/* 어스 네이처 */
[data-post-theme="earth_nature"] .post-body { font-family: 'Pretendard',sans-serif; background: #fafaf5; color: #2d3a1e; }
[data-post-theme="earth_nature"] .post-body h2 { color: #558B2F; border-left: 4px solid #8BC34A; padding-left: 14px; }
[data-post-theme="earth_nature"] .post-body h3 { color: #33691E; }
[data-post-theme="earth_nature"] .post-body blockquote { border-left-color: #8BC34A; background: #F1F8E9; border-radius: 0 4px 4px 0; }
[data-post-theme="earth_nature"] .post-body li::marker { color: #558B2F; }
 
/* 아카데믹 세리프 */
[data-post-theme="academic_serif"] .post-body { font-family: Georgia,'Times New Roman',serif; line-height: 1.9; }
[data-post-theme="academic_serif"] .post-body h2 { font-family: Georgia,serif; color: #4A148C; font-size: 26px; border-bottom: 2px solid #4A148C; padding-bottom: 8px; font-weight: 700; }
[data-post-theme="academic_serif"] .post-body h3 { font-family: Georgia,serif; color: #6A1B9A; }
[data-post-theme="academic_serif"] .post-body p { text-align: justify; }
[data-post-theme="academic_serif"] .post-body blockquote { border-left-color: #4A148C; font-style: italic; color: #555; background: none; }
 
/* 포스트 이미지 (Pixabay) 공통 스타일 */
.post-section-img {
    width: 100%;
    margin: 20px 0 28px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: var(--color-line);
}
.post-section-img img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    margin: 0;
}
.post-section-img figcaption {
    font-size: 11px;
    color: var(--color-muted);
    font-family: var(--font-mono);
    padding: 6px 10px;
    text-align: right;
    background: var(--color-bg);
}
 
.post-body {
    max-width: var(--container-content);
    margin: 0 auto;
    padding: 0 var(--space-md);
}
.post-body p,
.post-body ul, .post-body ol,
.post-body blockquote, .post-body figure,
.post-body pre, .post-body table {
    margin-bottom: var(--space-lg);
    font-size: 18px;
    line-height: 1.75;
}
.post-body h2 {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 32px;
    line-height: 1.2;
    margin: var(--space-2xl) 0 var(--space-md);
    letter-spacing: -0.01em;
}
.post-body h3 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 24px;
    margin: var(--space-xl) 0 var(--space-md);
}
.post-body a {
    color: var(--color-ink);
    background-image: linear-gradient(to top, var(--color-accent) 0%, var(--color-accent) 35%, transparent 35%);
    transition: background var(--duration) var(--ease);
}
.post-body a:hover { background-image: linear-gradient(to top, var(--color-accent) 0%, var(--color-accent) 100%); }
.post-body blockquote {
    border-left: 4px solid var(--color-accent-2);
    padding-left: var(--space-lg);
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1.3;
    color: var(--color-ink);
    text-transform: none;
    letter-spacing: -0.01em;
}
.post-body img { width: 100%; height: auto; margin: var(--space-xl) 0; }
.post-body code {
    font-family: var(--font-mono);
    font-size: 14px;
    background: var(--color-line);
    padding: 2px 6px;
    border-radius: 3px;
}
.post-body pre {
    background: var(--color-ink);
    color: var(--color-bg);
    padding: var(--space-lg);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    border-radius: 4px;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
 
/* ===== 액션 바 ===== */
.action-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl) 0;
    margin: var(--space-2xl) 0;
    border-top: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
    max-width: var(--container-content);
    margin-left: auto;
    margin-right: auto;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--color-line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all var(--duration) var(--ease);
}
.action-btn:hover { background: var(--color-ink); color: var(--color-bg); }
.action-btn.is-active { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-ink); }
.action-btn svg { width: 16px; height: 16px; }
 
/* ===== 태그 ===== */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--color-line);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all var(--duration) var(--ease);
}
.tag:hover { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
 
/* ===== 댓글 ===== */
.comments {
    max-width: var(--container-content);
    margin: var(--space-2xl) auto;
    padding: 0 var(--space-md);
}
.comments__head {
    font-family: var(--font-display);
    font-size: 24px;
    text-transform: uppercase;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-line-strong);
}
.comment {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--color-line);
}
.comment.is-reply {
    margin-left: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 2px solid var(--color-line);
}
.comment__head {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}
.comment__author { font-weight: 600; font-size: 14px; }
.comment__date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
}
.comment__body { font-size: 15px; line-height: 1.6; margin-bottom: var(--space-sm); }
.comment__actions {
    display: flex;
    gap: var(--space-md);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.comment__actions button:hover { color: var(--color-accent-2); }
 
/* ===== 폼 ===== */
.form-group { margin-bottom: var(--space-md); }
.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: var(--color-muted);
}
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-line);
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 15px;
    transition: border-color var(--duration) var(--ease);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-ink);
}
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
 
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--color-ink);
    color: var(--color-bg);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--color-ink);
    transition: all var(--duration) var(--ease);
}
.btn:hover { background: var(--color-accent); color: var(--color-ink); border-color: var(--color-accent); }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-line-strong); }
.btn--ghost:hover { background: var(--color-ink); color: var(--color-bg); }
.btn--accent { background: var(--color-accent); color: var(--color-ink); border-color: var(--color-accent); }
 
/* ===== 페이지네이션 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: var(--space-2xl) 0;
}
.pagination a, .pagination span {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    border: 1px solid var(--color-line);
    transition: all var(--duration) var(--ease);
}
.pagination a:hover { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.pagination .is-active { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-ink); font-weight: 700; }
 
/* ===== 뉴스레터 ===== */
.newsletter {
    background: var(--color-ink);
    color: var(--color-bg);
    padding: var(--space-3xl) 0;
}
.newsletter__inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 var(--space-md);
}
.newsletter__title {
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 64px);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: var(--space-md);
}
.newsletter__title span { color: var(--color-accent); }
.newsletter__desc {
    font-size: 16px;
    color: rgba(250, 250, 247, 0.7);
    margin-bottom: var(--space-xl);
}
.newsletter__form {
    display: flex;
    gap: 0;
    max-width: 480px;
    margin: 0 auto;
}
.newsletter__input {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: 1px solid rgba(250, 250, 247, 0.3);
    border-right: none;
    color: var(--color-bg);
    font-size: 15px;
}
.newsletter__input:focus { outline: none; border-color: var(--color-accent); }
.newsletter__input::placeholder { color: rgba(250, 250, 247, 0.5); }
.newsletter__btn {
    padding: 16px 24px;
    background: var(--color-accent);
    color: var(--color-ink);
    border: 1px solid var(--color-accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
}
 
/* ===== 푸터 ===== */
.site-footer {
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--color-bg);
    border-top: 2px solid var(--color-line-strong);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand .logo { margin-bottom: var(--space-md); }
.footer-brand p { color: var(--color-muted); font-size: 14px; max-width: 360px; }
.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-md);
    color: var(--color-muted);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 14px; transition: color var(--duration) var(--ease); }
.footer-col a:hover { color: var(--color-accent-2); }
.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
 
/* ===== 검색 모달 ===== */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.search-modal.is-open { display: flex; }
.search-modal__inner {
    width: 100%;
    max-width: 720px;
    padding: 0 var(--space-md);
}
.search-modal__form { position: relative; }
.search-modal__input {
    width: 100%;
    padding: 24px 60px 24px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(250, 250, 247, 0.3);
    color: #fff;
    font-family: var(--font-display);
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
.search-modal__input:focus { outline: none; border-bottom-color: var(--color-accent); }
.search-modal__input::placeholder { color: rgba(250, 250, 247, 0.4); }
.search-modal__close {
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 24px;
}
.search-modal__hint {
    margin-top: var(--space-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(250, 250, 247, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
 
/* ===== 알림 토스트 ===== */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    background: var(--color-ink);
    color: var(--color-bg);
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-mono);
    font-size: 13px;
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration) var(--ease-out);
    max-width: 320px;
}
.toast.is-show { transform: translateY(0); opacity: 1; }
.toast--success { background: var(--color-success); }
.toast--error { background: var(--color-accent-2); }
 
/* ===== 스크롤 리빌 애니메이션 ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.reveal {
    opacity: 0;
}
.reveal.is-visible {
    animation: fadeUp 0.7s var(--ease-out) forwards;
}
 
/* ===== 유틸리티 ===== */
.text-accent { color: var(--color-accent-2); }
.bg-accent { background: var(--color-accent); }
.divider {
    height: 1px;
    background: var(--color-line);
    margin: var(--space-xl) 0;
}
.empty-state {
    padding: var(--space-3xl) var(--space-md);
    text-align: center;
    color: var(--color-muted);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 32px;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    color: var(--color-ink);
}
.alert {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 14px;
    border-left: 3px solid var(--color-accent);
}
.alert--error { border-color: var(--color-accent-2); background: rgba(255, 61, 0, 0.06); }
.alert--success { border-color: var(--color-success); background: rgba(0, 200, 83, 0.06); }
 
/* ===== 그리드 헬퍼 ===== */
.row-span-2 { grid-row: span 2; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-8 { grid-column: span 8; }
@media (max-width: 1024px) {
    .col-span-4, .col-span-6, .col-span-8 { grid-column: span 12; }
}
 
/* ===== 포커스 가시성 ===== */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}
 
/* ===== 선택 색상 ===== */
::selection {
    background: var(--color-accent);
    color: var(--color-ink);
}
 
/* ===== 테마 적용: body[data-post-theme] 방식 (실제 게시물 페이지) ===== */
body[data-post-theme="modern_blue"] .post-body h2 { color:#1565C0; border-left:4px solid #1565C0; padding-left:14px; }
body[data-post-theme="modern_blue"] .post-body blockquote { border-left-color:#90CAF9; background:#E3F2FD; }
 
body[data-post-theme="warm_emotion"] .post-body h2 { color:#E65100; }
body[data-post-theme="warm_emotion"] .post-body h3 { color:#BF6C00; }
body[data-post-theme="warm_emotion"] .post-body blockquote { border-left-color:#FFCC80; background:#FFF3E0; border-radius:0 8px 8px 0; }
body[data-post-theme="warm_emotion"] .post-body p { color:#3e2c1a; }
 
body[data-post-theme="minimal_black"] .post-body h2 { font-weight:900; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid #000; padding-bottom:8px; border-left:none; font-size:26px; }
body[data-post-theme="minimal_black"] .post-body blockquote { border-left:3px solid #000; background:none; font-style:italic; font-size:20px; }
 
body[data-post-theme="vivid_pop"] .post-body h2 { color:#D500F9; font-weight:900; }
body[data-post-theme="vivid_pop"] .post-body h3 { color:#6200EA; }
body[data-post-theme="vivid_pop"] .post-body blockquote { border-left-color:#D500F9; background:#F3E5FF; border-radius:0 8px 8px 0; }
 
body[data-post-theme="luxury_gold"] { background:#0a0e1a; }
body[data-post-theme="luxury_gold"] .post-hero { background:#0a0e1a; }
body[data-post-theme="luxury_gold"] .post-hero__title { color:#d4af37; }
body[data-post-theme="luxury_gold"] .post-meta { color:#c8bca8; border-color:#d4af3744; }
body[data-post-theme="luxury_gold"] .post-body { color:#e8dcc8; background:#0f1628; border:1px solid #d4af3722; padding:32px 40px; }
body[data-post-theme="luxury_gold"] .post-body h2 { color:#d4af37; border-left:3px solid #d4af37; padding-left:14px; }
body[data-post-theme="luxury_gold"] .post-body h3 { color:#c8a82a; }
body[data-post-theme="luxury_gold"] .post-body p { color:#c8bca8; }
body[data-post-theme="luxury_gold"] .post-body blockquote { border-left-color:#d4af37; background:rgba(212,175,55,.06); font-style:italic; }
body[data-post-theme="luxury_gold"] .post-body a { color:#d4af37; background-image:none; text-decoration:underline; }
 
body[data-post-theme="cyber_tech"] { background:#050d1a; }
body[data-post-theme="cyber_tech"] .post-hero { background:#050d1a; }
body[data-post-theme="cyber_tech"] .post-hero__title { color:#00E5FF; font-family:'IBM Plex Mono',monospace; }
body[data-post-theme="cyber_tech"] .post-meta { color:#80d8ff; border-color:#00E5FF33; }
body[data-post-theme="cyber_tech"] .post-body { font-family:'IBM Plex Mono',monospace; background:#08192e; color:#c8f0ff; border:1px solid #00E5FF22; padding:32px 40px; }
body[data-post-theme="cyber_tech"] .post-body h2 { color:#00E5FF; text-transform:uppercase; letter-spacing:.06em; font-size:22px; border-left:3px solid #00E5FF; padding-left:14px; }
body[data-post-theme="cyber_tech"] .post-body h3 { color:#80D8FF; }
body[data-post-theme="cyber_tech"] .post-body p { color:#a0c8e0; font-size:16px; }
body[data-post-theme="cyber_tech"] .post-body blockquote { border-left-color:#00E5FF; background:rgba(0,229,255,.06); }
body[data-post-theme="cyber_tech"] .post-body code { background:rgba(0,229,255,.1); color:#00E5FF; }
 
body[data-post-theme="earth_nature"] .post-body h2 { color:#558B2F; border-left:4px solid #8BC34A; padding-left:14px; }
body[data-post-theme="earth_nature"] .post-body h3 { color:#33691E; }
body[data-post-theme="earth_nature"] .post-body p { color:#2d3a1e; }
body[data-post-theme="earth_nature"] .post-body blockquote { border-left-color:#8BC34A; background:#F1F8E9; border-radius:0 4px 4px 0; }
 
body[data-post-theme="academic_serif"] .post-body { font-family:Georgia,'Times New Roman',serif; line-height:1.9; }
body[data-post-theme="academic_serif"] .post-body h2 { font-family:Georgia,serif; color:#4A148C; font-size:26px; border-bottom:2px solid #4A148C; padding-bottom:8px; font-weight:700; border-left:none; }
body[data-post-theme="academic_serif"] .post-body h3 { font-family:Georgia,serif; color:#6A1B9A; }
body[data-post-theme="academic_serif"] .post-body p { text-align:justify; }
body[data-post-theme="academic_serif"] .post-body blockquote { border-left-color:#4A148C; font-style:italic; color:#555; background:none; }
/* ===================================================================
   사이트 디자인 테마 (body[data-site-theme] 기반)
   관리자 설정에서 선택한 테마가 body에 data-site-theme 속성으로 적용됨
   =================================================================== */

/* ── 뉴스포털 ── */
[data-site-theme="newsportal"] {
    --color-bg: #FFFFFF;
    --color-surface: #F5F5F5;
    --color-ink: #1a1a2e;
    --color-muted: #666;
    --color-line: #ddd;
    --color-accent: #e53935;
    --color-accent-2: #1a237e;
    --font-display: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
    --font-sans: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
}
[data-site-theme="newsportal"] .site-header {
    background: #1a237e; border-bottom: 3px solid #e53935;
}
[data-site-theme="newsportal"] .site-header a,
[data-site-theme="newsportal"] .site-header .logo,
[data-site-theme="newsportal"] .nav-main a,
[data-site-theme="newsportal"] .icon-btn { color: #fff; }
[data-site-theme="newsportal"] .logo__dot { background: #e53935; }
[data-site-theme="newsportal"] .nav-main a:hover,
[data-site-theme="newsportal"] .nav-main a.active { color: #FFD54F; }
[data-site-theme="newsportal"] .cat-badge { background: #e53935; color: #fff; }
[data-site-theme="newsportal"] .hero { background: #fff; border-bottom: 1px solid #ddd; }
[data-site-theme="newsportal"] .hero__featured { border: 1px solid #ddd; }
[data-site-theme="newsportal"] .card { border: 1px solid #ddd; border-radius: 0; }
[data-site-theme="newsportal"] .card:hover { border-color: #e53935; }
[data-site-theme="newsportal"] .section-head__title { color: #1a237e; border-left: 4px solid #e53935; padding-left: 12px; }

/* ── 커뮤니티 ── */
[data-site-theme="community"] {
    --color-bg: #f5f5f5;
    --color-surface: #FFFFFF;
    --color-ink: #212121;
    --color-muted: #757575;
    --color-line: #e0e0e0;
    --color-accent: #00897B;
    --font-display: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
    --font-sans: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
}
[data-site-theme="community"] .site-header {
    background: #fff; border-bottom: 2px solid #00897B; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
[data-site-theme="community"] .logo { color: #00897B; font-weight: 900; }
[data-site-theme="community"] .logo__dot { background: #00897B; }
[data-site-theme="community"] .nav-main a { color: #212121; }
[data-site-theme="community"] .nav-main a:hover,
[data-site-theme="community"] .nav-main a.active { color: #00897B; }
[data-site-theme="community"] .cat-badge { background: #00897B; color: #fff; border-radius: 12px; }
[data-site-theme="community"] .hero { background: #fff; padding: 16px 0; }
[data-site-theme="community"] .hero__featured { border-radius: 8px; }
[data-site-theme="community"] .card { border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border: none; }
[data-site-theme="community"] .card:hover { box-shadow: 0 4px 20px rgba(0,137,123,.2); }
[data-site-theme="community"] .section-head__title { color: #00897B; }

/* ── 단순 목록형 ── */
[data-site-theme="minimal"] {
    --color-bg: #FFFFFF;
    --color-surface: #FFFFFF;
    --color-ink: #111111;
    --color-muted: #888;
    --color-line: #eee;
    --color-accent: #111111;
    --font-display: Georgia,'Times New Roman',serif;
    --font-sans: Georgia,'Times New Roman',serif;
}
[data-site-theme="minimal"] .site-header {
    background: transparent; border-bottom: 1px solid #111; box-shadow: none;
}
[data-site-theme="minimal"] .logo__dot { background: #111; }
[data-site-theme="minimal"] .nav-main a { font-size: 13px; letter-spacing: .04em; }
[data-site-theme="minimal"] .cat-badge { background: none; color: #888; border: 1px solid #ddd; font-size: 10px; }
[data-site-theme="minimal"] .hero { background: #fff; padding-top: 40px; }
[data-site-theme="minimal"] .hero__featured { border: none; border-bottom: 1px solid #eee; }
[data-site-theme="minimal"] .card { border: none; border-bottom: 1px solid #eee; border-radius: 0; padding-bottom: 20px; }
[data-site-theme="minimal"] .card:hover { background: none; transform: none; box-shadow: none; }
[data-site-theme="minimal"] .card__image { display: none; }
[data-site-theme="minimal"] .section-head__title { font-family: Georgia,serif; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; }

/* ── 기업홈페이지 ── */
[data-site-theme="corporate"] {
    --color-bg: #F5F7FA;
    --color-surface: #FFFFFF;
    --color-ink: #0D1B2A;
    --color-muted: #607080;
    --color-line: #dde3ea;
    --color-accent: #1976D2;
    --font-display: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
    --font-sans: 'Pretendard','Apple SD Gothic Neo',system-ui,sans-serif;
}
[data-site-theme="corporate"] .site-header {
    background: #0D1B2A; border-bottom: none; box-shadow: 0 2px 12px rgba(13,27,42,.3);
}
[data-site-theme="corporate"] .site-header a,
[data-site-theme="corporate"] .site-header .logo,
[data-site-theme="corporate"] .nav-main a,
[data-site-theme="corporate"] .icon-btn { color: #fff; }
[data-site-theme="corporate"] .logo__dot { background: #1976D2; }
[data-site-theme="corporate"] .nav-main a:hover,
[data-site-theme="corporate"] .nav-main a.active { color: #64B5F6; }
[data-site-theme="corporate"] .cat-badge { background: #1976D2; color: #fff; border-radius: 4px; }
[data-site-theme="corporate"] .hero { background: linear-gradient(135deg,#0D1B2A 0%,#1a2f4a 100%); }
[data-site-theme="corporate"] .hero__featured-content h1 { color: #fff; }
[data-site-theme="corporate"] .card { border-radius: 8px; box-shadow: 0 2px 12px rgba(13,27,42,.08); border: none; }
[data-site-theme="corporate"] .card:hover { box-shadow: 0 8px 32px rgba(25,118,210,.15); transform: translateY(-3px); }
[data-site-theme="corporate"] .section-head__title { color: #0D1B2A; }
[data-site-theme="corporate"] .section-head__link,
[data-site-theme="corporate"] a.section-head__link { color: #1976D2; }

/* ── 포트폴리오 ── */
[data-site-theme="portfolio"] {
    --color-bg: #080808;
    --color-surface: #111;
    --color-ink: #F0F0F0;
    --color-ink-soft: #ccc;
    --color-muted: #888;
    --color-line: #222;
    --color-accent: #7C4DFF;
    --font-display: 'Archivo Black','Pretendard',system-ui,sans-serif;
    --font-sans: 'Archivo','Pretendard',system-ui,sans-serif;
}
[data-site-theme="portfolio"] body { background: #080808; color: #F0F0F0; }
[data-site-theme="portfolio"] .site-header {
    background: rgba(8,8,8,.9); border-bottom: 1px solid #222; backdrop-filter: blur(20px);
}
[data-site-theme="portfolio"] .site-header a,
[data-site-theme="portfolio"] .site-header .logo,
[data-site-theme="portfolio"] .nav-main a,
[data-site-theme="portfolio"] .icon-btn { color: #F0F0F0; }
[data-site-theme="portfolio"] .logo__dot { background: #7C4DFF; box-shadow: 0 0 12px #7C4DFF; }
[data-site-theme="portfolio"] .nav-main a:hover,
[data-site-theme="portfolio"] .nav-main a.active { color: #B39DDB; }
[data-site-theme="portfolio"] .cat-badge { background: linear-gradient(135deg,#7C4DFF,#E040FB); color: #fff; border: none; }
[data-site-theme="portfolio"] .hero { background: #080808; }
[data-site-theme="portfolio"] .hero__featured { border: 1px solid #222; }
[data-site-theme="portfolio"] .hero__featured:hover { border-color: #7C4DFF; box-shadow: 0 0 30px rgba(124,77,255,.2); }
[data-site-theme="portfolio"] .card { background: #111; border: 1px solid #222; border-radius: 8px; }
[data-site-theme="portfolio"] .card:hover { border-color: #7C4DFF; box-shadow: 0 0 20px rgba(124,77,255,.15); }
[data-site-theme="portfolio"] .section-head__title { background: linear-gradient(135deg,#7C4DFF,#E040FB); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-site-theme="portfolio"] .site-footer { background: #000; border-top: 1px solid #222; }

/* ===================================================================
   포스트 본문 표(table) 스타일
   비교, 스펙, 순위, 통계 등을 시각적으로 정리
   =================================================================== */

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.6;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.post-body table thead {
    background: var(--color-ink);
    color: #fff;
}
.post-body table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .02em;
    border: none;
}
.post-body table tbody tr {
    border-bottom: 1px solid var(--color-line);
    transition: background .15s;
}
.post-body table tbody tr:last-child { border-bottom: none; }
.post-body table tbody tr:nth-child(even) { background: var(--color-bg); }
.post-body table tbody tr:hover { background: rgba(255,212,0,.05); }
.post-body table tbody td {
    padding: 11px 16px;
    vertical-align: middle;
}
.post-body table tbody td:first-child {
    font-weight: 600;
    color: var(--color-ink);
}

/* 모바일: 가로 스크롤 */
@media (max-width: 600px) {
    .post-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .post-body table thead th,
    .post-body table tbody td {
        padding: 9px 12px;
        font-size: 13px;
    }
}

/* ── 포스트 디자인 테마별 표 색상 보정 ── */

/* 모던 블루 */
[data-post-theme="modern_blue"] .post-body table thead { background: #1565C0; }
[data-post-theme="modern_blue"] .post-body table tbody tr:hover { background: rgba(21,101,192,.06); }

/* 따뜻한 감성 */
[data-post-theme="warm_emotion"] .post-body table thead { background: #E65100; }
[data-post-theme="warm_emotion"] .post-body table tbody tr:nth-child(even) { background: #FFF8F0; }
[data-post-theme="warm_emotion"] .post-body table tbody tr:hover { background: #FFE0B2; }

/* 미니멀 블랙 */
[data-post-theme="minimal_black"] .post-body table { border: 2px solid #000; box-shadow: none; border-radius: 0; }
[data-post-theme="minimal_black"] .post-body table thead { background: #000; }
[data-post-theme="minimal_black"] .post-body table thead th { text-transform: uppercase; letter-spacing: .05em; }

/* 비비드 팝 */
[data-post-theme="vivid_pop"] .post-body table { border-radius: 8px; border: 2px solid #D500F9; }
[data-post-theme="vivid_pop"] .post-body table thead { background: linear-gradient(135deg,#D500F9,#6200EA); }
[data-post-theme="vivid_pop"] .post-body table tbody tr:hover { background: rgba(213,0,249,.06); }

/* 럭셔리 골드 */
[data-post-theme="luxury_gold"] .post-body table { background: #0f1628; border: 1px solid #d4af3744; }
[data-post-theme="luxury_gold"] .post-body table thead { background: #d4af37; color: #0a0e1a; }
[data-post-theme="luxury_gold"] .post-body table tbody tr { border-bottom-color: #d4af3722; }
[data-post-theme="luxury_gold"] .post-body table tbody tr:nth-child(even) { background: #131c33; }
[data-post-theme="luxury_gold"] .post-body table tbody tr:hover { background: rgba(212,175,55,.08); }
[data-post-theme="luxury_gold"] .post-body table tbody td:first-child { color: #d4af37; }

/* 사이버 테크 */
[data-post-theme="cyber_tech"] .post-body table { font-family: 'IBM Plex Mono',monospace; background: #08192e; border: 1px solid #00E5FF44; }
[data-post-theme="cyber_tech"] .post-body table thead { background: #00E5FF; color: #050d1a; }
[data-post-theme="cyber_tech"] .post-body table thead th { text-transform: uppercase; letter-spacing: .06em; }
[data-post-theme="cyber_tech"] .post-body table tbody tr { border-bottom-color: #00E5FF22; }
[data-post-theme="cyber_tech"] .post-body table tbody tr:nth-child(even) { background: #0a1f3a; }
[data-post-theme="cyber_tech"] .post-body table tbody tr:hover { background: rgba(0,229,255,.06); }
[data-post-theme="cyber_tech"] .post-body table tbody td:first-child { color: #00E5FF; }

/* 어스 네이처 */
[data-post-theme="earth_nature"] .post-body table thead { background: #558B2F; }
[data-post-theme="earth_nature"] .post-body table tbody tr:nth-child(even) { background: #F1F8E9; }
[data-post-theme="earth_nature"] .post-body table tbody tr:hover { background: #DCEDC8; }

/* 아카데믹 세리프 */
[data-post-theme="academic_serif"] .post-body table { font-family: Georgia,serif; border: 1px solid #4A148C44; }
[data-post-theme="academic_serif"] .post-body table thead { background: #4A148C; }
[data-post-theme="academic_serif"] .post-body table thead th { font-weight: 700; }
[data-post-theme="academic_serif"] .post-body table tbody tr:hover { background: rgba(74,20,140,.05); }

/* ===================================================================
   사이드바 위젯 스타일
   =================================================================== */

.sidebar-widgets { display: flex; flex-direction: column; gap: 20px; }
.widget {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 4px;
    padding: 16px 18px;
}
.widget__title {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-ink);
    letter-spacing: -0.01em;
}
.widget__list { list-style: none; padding: 0; margin: 0; }
.widget__item { padding: 8px 0; border-bottom: 1px solid var(--color-line); }
.widget__item:last-child { border-bottom: none; }
.widget__link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--color-ink); transition: color .15s; }
.widget__link:hover { color: var(--color-accent); }
.widget__rank {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-accent);
    min-width: 18px;
}
.widget__post-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}
.widget__post-meta { font-size: 10px; color: var(--color-muted); font-family: var(--font-mono); margin-top: 2px; display: block; }

/* 댓글 위젯 */
.widget__comment { display: block; }
.widget__comment-author { font-size: 12px; font-weight: 700; color: var(--color-accent); }
.widget__comment-text { font-size: 12px; color: var(--color-ink); line-height: 1.4; margin: 3px 0; }
.widget__comment-post { font-size: 11px; color: var(--color-muted); }

/* 카테고리 위젯 */
.widget__cat-link { display: flex; align-items: center; gap: 10px; }
.widget__cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.widget__cat-name { flex: 1; font-size: 13px; font-weight: 600; }
.widget__cat-count { font-size: 11px; color: var(--color-muted); font-family: var(--font-mono); background: var(--color-bg); padding: 1px 8px; border-radius: 8px; }

/* 방문자 통계 */
.widget__stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.widget__stat { background: var(--color-bg); padding: 10px; border-radius: 3px; text-align: center; }
.widget__stat--total { grid-column: span 2; background: var(--color-ink); color: #fff; }
.widget__stat-label { font-size: 10px; font-family: var(--font-mono); color: var(--color-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .08em; }
.widget__stat--total .widget__stat-label { color: rgba(255,255,255,.7); }
.widget__stat-value { font-size: 18px; font-weight: 800; }

/* 환율 위젯 */
.widget__exchange-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.widget__exchange-table tr { border-bottom: 1px solid var(--color-line); }
.widget__exchange-table tr:last-child { border-bottom: none; }
.widget__exchange-table td { padding: 6px 4px; }
.widget__ex-flag { font-size: 14px; width: 20px; }
.widget__ex-name { color: var(--color-muted); }
.widget__ex-value { text-align: right; font-family: var(--font-mono); font-weight: 700; color: var(--color-ink); }
.widget__ex-updated { font-size: 10px; color: var(--color-muted); margin-top: 6px; text-align: right; font-family: var(--font-mono); }

/* 태그 클라우드 */
.widget__tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.widget__tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--color-bg);
    color: var(--color-ink);
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid var(--color-line);
    transition: all .15s;
}
.widget__tag:hover { background: var(--color-accent); border-color: var(--color-accent); }

/* 트렌딩 위젯 */
.widget__trending-item { padding: 10px 0; }
.widget__trending-item .widget__link { gap: 10px; align-items: flex-start; }
.widget__trending-img { width: 60px; height: 50px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.widget__trending-img--placeholder { background: linear-gradient(135deg,#666,#222); }
.widget__trending-info { flex: 1; min-width: 0; }

/* 뉴스레터 */
.widget__nl-desc { font-size: 12px; color: var(--color-muted); margin-bottom: 10px; line-height: 1.5; }
.widget__nl-form { display: flex; gap: 4px; }
.widget__nl-input {
    flex: 1; padding: 8px 10px; font-size: 12px;
    border: 1px solid var(--color-line); border-radius: 3px;
    background: var(--color-bg); color: var(--color-ink);
}
.widget__nl-btn {
    padding: 8px 14px; font-size: 12px; font-weight: 700;
    background: var(--color-accent); color: var(--color-ink);
    border: none; cursor: pointer; border-radius: 3px;
}

/* 검색 위젯 */
.widget__search-form { display: flex; gap: 4px; }
.widget__search-input {
    flex: 1; padding: 8px 10px; font-size: 13px;
    border: 1px solid var(--color-line); border-radius: 3px;
    background: var(--color-bg); color: var(--color-ink);
}
.widget__search-btn {
    padding: 8px 14px; font-size: 14px; font-weight: 700;
    background: var(--color-ink); color: var(--color-bg);
    border: none; cursor: pointer; border-radius: 3px;
}

/* ── 푸터 위젯 (가로 배치) ── */
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 32px 0;
    margin-top: 40px;
    border-top: 1px solid var(--color-line);
    background: var(--color-bg);
}
@media (max-width: 900px) { .footer-widgets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .footer-widgets { grid-template-columns: 1fr; } }
.footer-widgets .widget { background: transparent; border: none; padding: 0; }

/* ── 메인 슬라이드 ── */
.hero-slider {
    position: relative;
    overflow: hidden;
    height: 480px;
    background: #0a0a0a;
}
@media (max-width: 768px) { .hero-slider { height: 360px; } }
.hero-slider__track { display: flex; height: 100%; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.hero-slider__slide { flex: 0 0 100%; position: relative; height: 100%; }
.hero-slider__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .55; }
.hero-slider__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,.95), rgba(10,10,10,.3) 60%, transparent); }
.hero-slider__content {
    position: absolute; bottom: 60px; left: 0; right: 0;
    padding: 0 var(--space-lg);
    max-width: var(--container-max-width); margin: 0 auto;
    color: #fff;
}
.hero-slider__cat { display: inline-block; padding: 4px 12px; background: var(--color-accent); color: #0a0a0a; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.hero-slider__title { font-size: clamp(24px, 4vw, 44px); font-weight: 900; line-height: 1.15; margin-bottom: 12px; max-width: 800px; color: #fff; }
.hero-slider__excerpt { font-size: 15px; color: rgba(255,255,255,.8); max-width: 600px; line-height: 1.6; margin-bottom: 20px; }
.hero-slider__link { display: inline-block; padding: 12px 28px; background: var(--color-accent); color: #0a0a0a; font-size: 13px; font-weight: 700; text-decoration: none; letter-spacing: .04em; }
.hero-slider__link:hover { background: #fff; }
.hero-slider__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    background: rgba(0,0,0,.4); color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%; cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.hero-slider__nav:hover { background: var(--color-accent); color: #0a0a0a; border-color: var(--color-accent); }
.hero-slider__nav--prev { left: 20px; }
.hero-slider__nav--next { right: 20px; }
.hero-slider__dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.hero-slider__dot { width: 30px; height: 3px; background: rgba(255,255,255,.4); border: none; cursor: pointer; transition: background .2s; padding: 0; }
.hero-slider__dot--active { background: var(--color-accent); }

/* 메인 콘텐츠 + 사이드바 레이아웃 */
.main-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    margin-top: 40px;
}
@media (max-width: 1100px) { .main-with-sidebar { grid-template-columns: 1fr; } }

/* 메인 카드 그리드 (12개) */
.main-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
@media (max-width: 900px) { .main-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .main-card-grid { grid-template-columns: 1fr; } }
.main-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-ink);
    transition: all .2s;
}
.main-card:hover { border-color: var(--color-accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.main-card__img { aspect-ratio: 16/10; overflow: hidden; background: var(--color-bg); }
.main-card__img img { width: 100%; height: 100%; object-fit: cover; }
.main-card__body { padding: 14px 16px; }
.main-card__cat { font-size: 10px; font-weight: 700; color: var(--color-accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.main-card__title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.main-card__meta { font-size: 11px; color: var(--color-muted); font-family: var(--font-mono); }

/* 메인 목록형 (20개) */
.main-list { display: flex; flex-direction: column; gap: 0; }
.main-list-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-line);
    text-decoration: none;
    color: var(--color-ink);
    transition: background .15s;
    align-items: flex-start;
}
.main-list-item:hover { background: var(--color-bg); }
.main-list-item__num {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-accent);
    width: 30px;
    text-align: right;
    padding-top: 2px;
}
.main-list-item__img { width: 100px; height: 70px; object-fit: cover; border-radius: 3px; flex-shrink: 0; background: var(--color-bg); }
.main-list-item__info { flex: 1; min-width: 0; }
.main-list-item__cat { font-size: 10px; font-weight: 700; color: var(--color-accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.main-list-item__title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.main-list-item__excerpt { font-size: 12px; color: var(--color-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.main-list-item__meta { font-size: 11px; color: var(--color-muted); font-family: var(--font-mono); }

/* 섹션 헤더 */
.main-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-ink);
}
.main-section-head__title { font-size: 18px; font-weight: 800; }
.main-section-head__more { font-size: 11px; color: var(--color-muted); text-decoration: none; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.main-section-head__more:hover { color: var(--color-accent); }

/* ── 카테고리/태그/검색 페이지 사이드바 통합 ── */
.main-with-sidebar > main > section:first-child > .container,
.main-with-sidebar > main > .container { padding: 0; max-width: 100%; }
.main-with-sidebar > main > section { padding-left: 0; padding-right: 0; }

/* ===================================================================
   반응형 그리드 클래스 (인라인 스타일 대체)
   CSS 클래스 기반이므로 미디어 쿼리 override 가능
   =================================================================== */

/* 4열 → 2열 → 1열 */
.rg-4col-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px)  { .rg-4col-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .rg-4col-grid { grid-template-columns: 1fr; } }

/* 3열 → 2열 → 1열 */
.rg-3col-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px)  { .rg-3col-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .rg-3col-grid { grid-template-columns: 1fr; } }

/* 2열 → 1열 */
.rg-2col-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 580px)  { .rg-2col-grid { grid-template-columns: 1fr; } }

/* 뉴스포털 히어로 (2fr 1fr → 1열) */
.rg-news-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
@media (max-width: 768px)  { .rg-news-hero { grid-template-columns: 1fr; } }

/* 커뮤니티 테이블 행 */
.rg-comm-header {
    display: grid;
    grid-template-columns: 40px 1fr 100px 80px 60px;
}
.rg-comm-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px 80px 60px;
}
/* 모바일: 번호+제목+날짜 3열로 축소 */
@media (max-width: 768px) {
    .rg-comm-header { display: none; } /* 헤더행 숨김 */
    .rg-comm-row {
        grid-template-columns: 30px 1fr auto;
    }
    /* 카테고리/조회 컬럼 숨김 */
    .rg-comm-row > span:nth-child(3),
    .rg-comm-row > span:nth-child(5) { display: none; }
}

/* ===================================================================
   모바일 최적화 반응형 CSS
   브레이크포인트: 1100px / 768px / 480px
   =================================================================== */

/* ── 공통 ── */
@media (max-width: 768px) {
    .container { padding: 0 14px; }
    button, a.btn { min-height: 44px; }
}

/* ── 헤더 ── */
@media (max-width: 768px) {
    .site-header { position: sticky; top: 0; z-index: 200; }
    .header-actions { gap: 4px; }
    /* 테마 토글 숨김 (검색+햄버거만 노출) */
    #themeToggle { display: none; }
    .icon-btn { width: 40px; height: 40px; }

    /* 모바일 메뉴 */
    .nav-main.is-open {
        top: var(--header-height);
        padding: 12px 16px;
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
    }
    .nav-main.is-open a {
        font-size: 17px;
        padding: 13px 0;
        border-bottom: 1px solid var(--color-line);
    }
    .nav-main.is-open a:last-child { border-bottom: none; }
}

/* ── 슬라이더 ── */
@media (max-width: 768px) {
    .hero-slider        { height: 280px; }
    .hero-slider__title { font-size: clamp(16px, 5vw, 26px); margin-bottom: 8px; }
    .hero-slider__excerpt { display: none; }
    .hero-slider__content { bottom: 44px; padding: 0 14px; }
    .hero-slider__cat   { font-size: 10px; padding: 3px 8px; margin-bottom: 8px; }
    .hero-slider__link  { padding: 9px 18px; font-size: 12px; }
    .hero-slider__nav   { display: none; } /* 화살표 숨김, 스와이프 사용 */
    .hero-slider__dots  { bottom: 14px; }
}
@media (max-width: 480px) {
    .hero-slider { height: 220px; }
    .hero-slider__content { bottom: 34px; }
    .hero-slider__title { font-size: 16px; }
}

/* ── 메인 섹션 헤더 ── */
@media (max-width: 768px) {
    .main-section-head { margin-bottom: 12px; }
    .main-section-head__title { font-size: 14px; }
    .main-with-sidebar { margin-top: 20px; }
}

/* ── 카드 그리드 ── */
@media (max-width: 768px) {
    .main-card-grid      { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
    .main-card__body     { padding: 10px 12px; }
    .main-card__title    { font-size: 13px; }
    .main-card__meta     { font-size: 10px; }
}
@media (max-width: 480px) {
    .main-card-grid      { grid-template-columns: 1fr; }
    .main-card__img      { aspect-ratio: 16/9; }
}

/* ── 목록형 ── */
@media (max-width: 768px) {
    .main-list-item         { gap: 10px; padding: 11px 0; }
    .main-list-item__num    { width: 22px; font-size: 10px; }
    .main-list-item__img    { width: 76px; height: 58px; }
    .main-list-item__title  { font-size: 13px; }
    .main-list-item__excerpt { display: none; }
    .main-list-item__meta   { font-size: 10px; }
}
@media (max-width: 480px) {
    .main-list-item__num { display: none; }
    .main-list-item__img { width: 64px; height: 52px; }
}

/* ── 사이드바 → 하단 2열 배치 ── */
@media (max-width: 1100px) {
    .main-with-sidebar              { grid-template-columns: 1fr; gap: 0; }
    .main-with-sidebar aside.sidebar-widgets {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 28px;
        padding-top: 24px;
        border-top: 2px solid var(--color-line);
    }
}
@media (max-width: 580px) {
    .main-with-sidebar aside.sidebar-widgets { grid-template-columns: 1fr; }
}

/* ── 위젯 ── */
@media (max-width: 768px) {
    .widget           { padding: 12px 14px; }
    .widget__title    { font-size: 12px; margin-bottom: 8px; padding-bottom: 6px; }
    .widget__stats-grid { grid-template-columns: repeat(3, 1fr); }
    .widget__stat--total { grid-column: span 3; }
    .widget__trending-img { width: 50px; height: 42px; }
}
@media (max-width: 480px) {
    .widget__nl-form      { flex-direction: column; }
    .widget__nl-btn       { width: 100%; text-align: center; }
    .widget__tag          { font-size: 11px !important; }
}

/* ── 푸터 위젯 ── */
@media (max-width: 768px) { .footer-widgets { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px 0; } }
@media (max-width: 480px) { .footer-widgets { grid-template-columns: 1fr; } }

/* ── 포스트 본문 ── */
@media (max-width: 768px) {
    .post-body { font-size: 15px; line-height: 1.75; }
    .post-body h2 { font-size: 1.2rem; }
    .post-body h3 { font-size: 1.05rem; }
    /* 테이블 가로 스크롤 (JS로 래퍼 삽입하지 않고 CSS로 처리) */
    .post-body table { display: block; overflow-x: auto; white-space: nowrap; }
    .post-body blockquote { padding: 10px 14px; }
}
@media (max-width: 480px) {
    .post-body { font-size: 14px; }
}

/* ── 페이지네이션 ── */
@media (max-width: 480px) {
    .pagination { gap: 3px; flex-wrap: wrap; justify-content: center; }
    .pagination a, .pagination span { min-width: 34px; height: 34px; font-size: 12px; }
}

/* ── 푸터 ── */
@media (max-width: 768px) {
    .site-footer { padding: 28px 0 16px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 480px) {
    .footer-grid   { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
}

/* ── 터치 디바이스 hover 고착 방지 ── */
.touch-device .main-card:hover,
.touch-device .widget__link:hover,
.touch-device .main-list-item:hover { transform: none; box-shadow: none; }

/* ═══════════════════════════════════════════
   P4 — AdSense 수익 최적화
   ① 사이드바 sticky 광고  ② 인피드 광고
═══════════════════════════════════════════ */

/* ① 사이드바 광고: 스크롤 시 viewport에 고정 → 노출 시간 극대화 */
@media (min-width: 1100px) {
    .widget--ad {
        position: sticky;
        top: calc(var(--header-height) + 20px);
        /* 사이드바 컨테이너를 넘지 않도록 */
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow: hidden;
    }
}

/* ② 인피드 광고: 카드 섹션↔목록 섹션 구분 위치 */
.ad-slot--infeed {
    width: 100%;
    text-align: center;
    /* 콘텐츠와 자연스럽게 구분되는 여백 */
    padding: 20px 0;
    border-top: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
    min-height: 100px;
}
@media (min-width: 769px) {
    .ad-slot--infeed { min-height: 90px; }
}

/* 관련 게시물 상단 광고 구분선 */
.ad-slot--before-related {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid var(--color-line);
}

/* ═══════════════════════════════════════════
   광고 슬롯 CLS(Cumulative Layout Shift) 방지
   광고 로드 전 공간을 미리 확보해 레이아웃 시프트 차단
   ─ Core Web Vitals CLS 점수 직접 영향
═══════════════════════════════════════════ */
.ad-slot {
    display: block;
    width: 100%;
    overflow: hidden;
    /* 광고 로드 전 최소 높이 예약 — 모바일 배너 기준 */
    min-height: 100px;
    /* 광고가 없을 때 빈 공간 collapse 방지 */
    background: transparent;
    /* 광고 영역이 주변 레이아웃에 영향을 최소화 */
    contain: layout;
}
/* 배너형 (제목 아래 — 728×90 or 320×50) */
.ad-slot--banner {
    min-height: 60px;
    text-align: center;
}
@media (min-width: 769px) {
    .ad-slot--banner { min-height: 90px; }
}
/* 사각형형 (본문 중간·하단 — 300×250 or 336×280) */
.ad-slot--rectangle {
    min-height: 250px;
    text-align: center;
}
@media (max-width: 768px) {
    .ad-slot--rectangle { min-height: 100px; }
}
/* 사이드바 광고 */
.ad-slot--sidebar {
    min-height: 250px;
    margin-bottom: var(--space-lg);
    text-align: center;
}
/* 광고 로드 전 플레이스홀더 시각 힌트 (선택) */
.ad-slot::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px; /* 높이는 min-height이 담당 */
}

/* ══════════════════════════════════════════════════════════
   P3 — 모바일 UX 최적화 (Mobile-First 개선)
   ① 헤더 높이  ② post-hero 패딩  ③ post-meta
   ④ 액션 바   ⑤ 공유 메뉴      ⑥ REPLY 터치타겟
   ⑦ 검색 iOS 자동줌 방지
══════════════════════════════════════════════════════════ */

/* ① 헤더: 모바일에서 72px → 56px 축소 */
@media (max-width: 768px) {
    :root { --header-height: 56px; }
    .icon-btn { width: 36px; height: 36px; }
}

/* ② 포스트 히어로 패딩: 96px → 28px (1/4 여백 낭비 제거) */
@media (max-width: 768px) {
    .post-hero { padding: 28px 0 18px; }
    .post-hero__title    { margin-bottom: 10px; }
    .post-hero__subtitle { margin-bottom: 16px; }
}
@media (max-width: 480px) {
    .post-hero { padding: 18px 0 12px; }
}

/* ③ 포스트 메타: flex-wrap으로 가로 오버플로우 방지 */
@media (max-width: 640px) {
    .post-meta {
        flex-wrap: wrap;
        gap: 8px 16px;
        font-size: 11px;
        padding: 10px 0;
    }
    .post-meta > * { white-space: nowrap; }
}

/* ④ 액션 바: 모바일 줄바꿈 + 44px 최소 터치 타겟 */
@media (max-width: 600px) {
    .action-bar { flex-wrap: wrap; gap: 6px; padding: 12px 0; }
    .action-btn { font-size: 11px; min-height: 44px; padding: 0 12px; letter-spacing: .04em; }
}

/* ⑤ 공유 메뉴:
     - 데스크톱: right:0 정렬로 화면 이탈 방지
     - 모바일: position:fixed 바텀 시트 (네이티브 UX)  */
#share-menu { right: 0; }

@media (max-width: 600px) {
    #share-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        border-radius: 16px 16px 0 0 !important;
        min-width: unset !important;
        width: 100% !important;
        /* iPhone 노치(Safe Area) 대응 */
        padding: 20px 16px max(20px, env(safe-area-inset-bottom, 20px)) !important;
        box-shadow: 0 -8px 40px rgba(0,0,0,.18) !important;
        z-index: 300 !important;
        animation: shareSlideUp .22s cubic-bezier(.16,1,.3,1);
    }
}
@keyframes shareSlideUp {
    from { transform: translateY(30px); opacity: .6; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ⑥ 댓글 REPLY 버튼: 최소 44×44px 터치 타겟 확보 (Google 권장) */
.comment__actions { margin-top: 8px; }
.comment__actions button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-muted);
    background: none;
    border: 1px solid var(--color-line);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.comment__actions button:hover { border-color: var(--color-ink); color: var(--color-ink); }
@media (max-width: 480px) {
    .comment__actions button { padding: 0 20px; font-size: 12px; }
}

/* ⑦ 검색 모달: iOS에서 font-size < 16px 시 자동 줌 발생 → 방지 */
@media (max-width: 640px) {
    .search-modal__input { font-size: 16px !important; }
}

/* ══════════════════════════════════════════════════
   에세이 블로그 테마  (data-site-theme="essay")
══════════════════════════════════════════════════ */
[data-site-theme="essay"] {
    --color-bg: #FAF8F4;
    --color-surface: #FFFFFF;
    --color-ink: #2C2C2C;
    --color-muted: #6B6B6B;
    --color-line: #E8E3DC;
    --color-accent: #6B8CAE;
}
[data-site-theme="essay"] .site-header {
    background: #FAF8F4;
    border-bottom: 1px solid #E8E3DC;
}
[data-site-theme="essay"] .logo {
    font-family: var(--font-kr);
    font-size: 18px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
[data-site-theme="essay"] .logo__dot { display: none; }
[data-site-theme="essay"] .nav-main a {
    font-family: var(--font-kr);
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #4A4A4A;
}
[data-site-theme="essay"] .nav-main a:hover { color: #6B8CAE; }
[data-site-theme="essay"] .nav-main a.active::after { background: #6B8CAE; }
[data-site-theme="essay"] .nav-main.is-open { background: #FAF8F4; border-color: #E8E3DC; }

/* 히어로 분할 레이아웃 */
.essay-hero {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 48px;
    align-items: center;
    padding: 40px 0 48px;
}
.essay-hero__text { min-width: 0; }
.essay-hero__cat {
    display: inline-block;
    font-size: 12px;
    color: #6B8CAE;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 12px;
}
.essay-hero__title-link { text-decoration: none; color: inherit; display: block; }
.essay-hero__title {
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    line-height: 1.3;
    color: #1E1E1E;
    margin-bottom: 16px;
    word-break: keep-all;
}
.essay-hero__title-link:hover .essay-hero__title { color: #6B8CAE; }
.essay-hero__excerpt {
    font-size: 15px;
    color: #6B6B6B;
    line-height: 1.75;
    margin-bottom: 16px;
    word-break: keep-all;
}
.essay-hero__meta { font-size: 13px; color: #ABABAB; }
.essay-hero__img {
    display: block;
    aspect-ratio: 4/3;
    border-radius: 4px;
    overflow: hidden;
    background: #E8E3DC;
}
.essay-hero__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.essay-hero__img:hover img { transform: scale(1.04); }

/* 섹션 공통 */
.essay-section { padding: 48px 0; }
.essay-section + .essay-section { padding-top: 0; }
.essay-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E8E3DC;
}
.essay-section__head h2 { font-size: 16px; font-weight: 700; color: #2C2C2C; }
.essay-section__head a { font-size: 13px; color: #ABABAB; text-decoration: none; transition: color .15s; }
.essay-section__head a:hover { color: #6B8CAE; }

/* 카드 그리드 */
.essay-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.essay-card { display: block; text-decoration: none; color: inherit; }
.essay-card__img {
    aspect-ratio: 3/2;
    border-radius: 10px;
    overflow: hidden;
    background: #E8E3DC;
    margin-bottom: 14px;
}
.essay-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.essay-card:hover .essay-card__img img { transform: scale(1.04); }
.essay-card__cat { font-size: 11px; color: #6B8CAE; font-weight: 600; letter-spacing: .04em; margin-bottom: 5px; }
.essay-card__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: #2C2C2C;
    margin-bottom: 6px;
    word-break: keep-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.essay-card:hover .essay-card__title { color: #6B8CAE; }
.essay-card__date { font-size: 12px; color: #ABABAB; }

/* 목록형 */
.essay-list { display: flex; flex-direction: column; }
.essay-list-item {
    display: flex;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #E8E3DC;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
}
.essay-list-item:first-child { border-top: 1px solid #E8E3DC; }
.essay-list-item__img {
    width: 110px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #E8E3DC;
    display: block;
}
.essay-list-item__info { flex: 1; min-width: 0; }
.essay-list-item__cat { font-size: 11px; color: #6B8CAE; font-weight: 600; letter-spacing: .04em; margin-bottom: 4px; }
.essay-list-item__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    color: #2C2C2C;
    margin-bottom: 4px;
    word-break: keep-all;
    transition: color .15s;
}
.essay-list-item:hover .essay-list-item__title { color: #6B8CAE; }
.essay-list-item__excerpt {
    font-size: 13px;
    color: #9B9B9B;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.essay-list-item__meta { font-size: 11px; color: #CBCBCB; }

/* 에세이 반응형 */
@media (max-width: 900px) {
    .essay-hero { grid-template-columns: 1fr; gap: 24px; padding: 28px 0 36px; }
    .essay-hero__img { aspect-ratio: 16/9; order: -1; }
    .essay-card-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 600px) {
    .essay-card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .essay-card__title { font-size: 14px; }
    .essay-list-item__img { width: 80px; height: 58px; }
    .essay-list-item__excerpt { display: none; }
    .essay-list-item__title { font-size: 14px; }
}
@media (max-width: 440px) {
    .essay-card-grid { grid-template-columns: 1fr; }
}