@charset "UTF-8";

/* --- 1. Fonts & Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'NanumSquareNeo';
    src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-aLt.woff2) format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'NanumSquareNeo';
    src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-bRg.woff2) format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'NanumSquareNeo';
    src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-cBd.woff2) format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'NanumSquareNeo';
    src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-dEb.woff2) format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
  /* Color Palette */
  --bg-body: #f7f8fa;
  --bg-card: #ffffff;
  --text-main: #222222;
  --text-sub: #666666;
  --text-muted: #999999;
  --accent: #222; 
  --border: #eeeeee;
  --shadow: 0 10px 30px rgba(0,0,0,0.04);
  
  /* Fonts */
  --font-base: 'NanumSquareNeo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-en: 'Poppins', sans-serif;
}

*,*:before,*:after { box-sizing:border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
img { max-width: 100%; display: block; }
ul, ol, li { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }

/* --- 2. Layout & Header --- */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 120px; 
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: height 0.3s ease;
}
.header-visual {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 226, 159, 0.5) 0%, transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(255, 169, 159, 0.4) 0%, transparent 30%),
        radial-gradient(circle at 50% 80%, rgba(160, 236, 255, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 20% 90%, rgba(220, 200, 255, 0.3) 0%, transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    opacity: 1; 
    z-index: 0;
    pointer-events: none;
}

.gnb-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; z-index: 1;
}
.logo { font-family: var(--font-en); font-weight: 700; font-size: 26px; letter-spacing: -0.5px; transition: font-size 0.3s; }
.logo a { color: #000; }

.gnb-nav { display: flex; gap: 24px; }
.gnb-nav a {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-sub);
    text-transform: uppercase;
    font-family: var(--font-en);
}
.gnb-nav a:hover { color: var(--accent); }

/* Main Layout */
.layout {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto 80px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    position: relative;
    z-index: 10;
}

/* --- 3. Hero Section (Index) --- */
.hero-section {
    padding: 0 20px;
    max-width: 1200px;
    margin: 20px auto 0;
}
.hero-card {
    display: block;
    position: relative;
    height: 380px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    color: #fff;
    box-shadow: var(--shadow);
}
.hero-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
}
.hero-card__content {
    position: absolute;
    bottom: 0; left: 0;
    padding: 40px;
    width: 100%;
}
.hero-card__category {
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    display: inline-block;
}
.hero-card__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-card__summary {
    opacity: 0.8;
    font-size: 15px;
    max-width: 700px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* --- 4. Archive & Controls --- */
.archive-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.archive-title-wrap .eyebrow {
    display: block;
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
}
.archive-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.view-controls-card {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}
.view-controls { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.total-count { font-family: var(--font-en); font-size: 13px; color: var(--text-sub); }
.total-count strong { color: var(--text-main); }
.view-btns { display: flex; gap: 8px; }
.btn-view {
    border: none; background: #f0f0f0;
    width: 32px; height: 32px;
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-view.active, .btn-view:hover { background: var(--text-main); color: #fff; }

/* --- 5. Post List (Card Style) --- */
.post-list-wrapper { margin-bottom: 40px; }

.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid transparent;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(0,0,0,0.05);
}
.post-card a { display: block; color: inherit; }

/* 섬네일 - 기본 이미지 적용 */
.card-thumb {
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    background-image: url('https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FmSSXU%2FdJMcabRi4DA%2FAAAAAAAAAAAAAAAAAAAAADJffLwN3Bn5uHIS5wC14jD5LqddR72pL82KFqrDmTdx%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1777561199%26allow_ip%3D%26allow_referer%3D%26signature%3DD18qu4dsTp6aSXXEkKAUG79S9mw%253D');
    background-size: cover;
    background-position: center;
}
.thumb-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: transform 0.3s;
}
.post-card:hover .thumb-img { transform: scale(1.05); }

/* 텍스트 영역 */
.card-body { padding: 24px; }
.card-meta { margin-bottom: 12px; }
.card-category {
    font-size: 12px; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.card-title {
    font-size: 18px; font-weight: 700;
    margin-bottom: 10px; line-height: 1.4;
    word-break: keep-all;
    display: flex; align-items: center; gap: 6px;
}
.new-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background-color: #ff4b4b;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    line-height: 1;
}

.card-summary {
    font-size: 14px; color: var(--text-sub);
    line-height: 1.6; margin-bottom: 20px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
    border-top: 1px solid #f5f5f5;
    padding-top: 15px;
    font-size: 12px; color: var(--text-muted);
    font-family: var(--font-en);
}

/* = VIEW TYPE: GRID = */
.view-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.view-grid .card-thumb { padding-top: 60%; }

/* = VIEW TYPE: LIST = */
.view-list { display: flex; flex-direction: column; gap: 20px; }
.view-list .post-card a { display: flex; align-items: stretch; }
.view-list .card-thumb { width: 260px; padding-top: 0; flex-shrink: 0; }
.view-list .thumb-img { position: absolute; inset: 0; }
.view-list .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 768px) {
    .view-grid { grid-template-columns: 1fr; }
    .view-list .post-card a { flex-direction: column; }
    .view-list .card-thumb { width: 100%; padding-top: 60%; }
}

/* --- 6. Content Detail (상세 페이지) --- */
#hero-container { display: none; }

.post-hero {
    position: relative;
    width: 100%;
    height: 300px;
    background-size: cover; background-position: center;
    color: #fff;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    padding: 0 20px;
}
.post-hero.no-image { background: #333; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero-category a {
    color: rgba(255,255,255,0.8); font-weight: 700; font-size: 13px;
    text-transform: uppercase; display: block; margin-bottom: 10px;
}
.hero-content h1 {
    font-size: 36px; font-weight: 700; line-height: 1.3; margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3); word-break: keep-all;
}
.hero-meta {
    font-family: var(--font-en); font-size: 14px; opacity: 0.8;
}
.hero-meta .sep { margin: 0 6px; }

/* 본문 영역 */
.post-detail {
    background: #fff;
    padding: 60px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 60px;
}
.post-nav-top { margin-bottom: 40px; }
.btn-list-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 14px; color: var(--text-muted);
}
.btn-list-back:hover { color: var(--accent); }

/* 본문 스타일 */
.post-body { 
    font-family: inherit !important; 
    font-weight: 400; 
    font-size: 18px;
    line-height: 2.0; 
    color: #18181b; 
    word-break: break-word; 
    letter-spacing: normal; 
}
.post-body p { margin-bottom: 24px; }

.post-body img { 
    border-radius: 12px; 
    max-width: 100% !important; 
    height: auto !important; 
    vertical-align: middle;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.post-body figure.imagegridblock {
    max-width: 100%;
    margin: 32px 0;
    overflow: hidden;
}
.post-body figure.imagegridblock .image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
}
.post-body figure.imagegridblock .image-container > span,
.post-body figure.imagegridblock .image-container > a {
    flex: 1 1 250px;
    max-width: 100%;
    display: flex;
}
.post-body figure.imagegridblock .image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.post-body figure { margin: 32px 0; max-width: 100%; }
.post-body figure img { margin: 0 auto; display: block; }
.post-body .alignleft { float: left; margin: 0 20px 20px 0; }
.post-body .alignright { float: right; margin: 0 0 20px 20px; }
.post-body .aligncenter { display: block; margin: 20px auto; text-align: center; }

.post-body img[src*="emoticon"],
.post-body img[class*="emoticon"],
.post-body img[src*="sticker"] {
    width: auto !important;
    height: auto !important;
    margin: 2px 4px !important;
    border-radius: 0 !important;
    display: inline-block !important;
    vertical-align: middle;
    box-shadow: none;
}

.post-body blockquote {
  margin:24px 0;
  padding-left:18px;
  border-left:4px solid var(--accent);
  color:#4d4d51;
  font-style:italic;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 0 8px 8px 0;
}
.post-tags { margin-top:28px; display:flex; flex-wrap:wrap; gap:10px; font-size:13px; color:#5f5f66; }
.post-related { margin-top:36px; padding-top: 20px; border-top: 1px solid #eee; }
.post-related h2 { font-size: 18px; margin-bottom: 15px; font-weight: 700; }
.post-related ul { list-style:none; padding:0; margin:0; }
.post-related li { margin-bottom:8px; }
.post-comments { margin-top:40px; }

/* 좌우 고정 내비게이션 버튼 */
.side-navigation {
    position: fixed;
    top: 60%; 
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    z-index: 1000;
    pointer-events: none;
    padding: 0 40px;
    display: none;
    justify-content: space-between;
}
.side-nav-btn {
    pointer-events: auto;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-sub);
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}
.side-nav-btn:hover {
    background: var(--text-main);
    color: #fff;
    transform: scale(1.1);
}
.side-nav-btn.prev { float: left; }
.side-nav-btn.next { float: right; }

@media (max-width: 1300px) {
    .side-navigation { display: none !important; }
}

.post-page-nav {
    margin-top: 40px;
    display: flex;
    gap: 20px;
}
.page-nav-item {
    flex: 1;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    display: flex; flex-direction: column;
    text-decoration: none;
    transition: all 0.2s;
}
.page-nav-item:hover { background: #f0f0f0; transform: translateY(-2px); }
.nav-label {
    font-family: var(--font-en); font-weight: 700; font-size: 12px; color: var(--text-muted);
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.page-nav-item.next { text-align: right; }
.page-nav-item.next .nav-label { justify-content: flex-end; }
.nav-title {
    font-size: 15px; color: var(--text-main);
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Sidebar */
.side-box { display:flex; flex-direction:column; gap:10px; }
.side-categories ul { list-style:none; padding-left:0; margin:0; }
.side-categories li { margin-bottom:8px; font-size:14px; }
.side-list { list-style:none; padding:0; margin:0; }
.side-list li { margin-bottom:6px; }
.side-list a { color:#333; font-size:14px; }
.side-tags { display:flex; flex-wrap:wrap; gap:8px; }
.side-tags a { font-size:12px; color:#707077; background: #f1f1f3; padding: 4px 10px; border-radius: 4px; }
.side-search input {
    width: 100%; border: 1px solid #ddd; background: #fcfcfc;
    padding: 10px 14px; border-radius: 8px;
}

/* 방문자 수 위젯 스타일 */
.visitor-container {
    display: flex;
    justify-content: space-around;
    background: #fcfcfc;
    border-radius: 12px;
    padding: 15px 0;
    border: 1px solid var(--border);
}
.visitor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    position: relative;
}
.visitor-item:first-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #eee;
}
.visitor-item .label {
    font-family: var(--font-en);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}
.visitor-item .count {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}
.visitor-item .count.today {
    color: var(--accent);
}

/* Pagination */
.pagination {
    margin-top: 60px;
    display: flex !important; 
    flex-direction: row !important; 
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.paging-numbers {
    display: flex !important; 
    flex-direction: row !important;
    gap: 8px;
}
.pagination .num, .pagination .page-btn {
    display: flex; justify-content: center; align-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--text-sub);
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid transparent;
    text-decoration: none;
}
.pagination .num:hover, .pagination .page-btn:hover {
    color: var(--text-main);
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}
.pagination .num.selected {
    background: var(--text-main);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}
.pagination .prev, .pagination .next { color: var(--text-muted); }

.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--text-muted);
}

/* Top Button */
.btn-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--text-main);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
    z-index: 2000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.btn-top.show { opacity: 1; visibility: visible; bottom: 40px; }
.btn-top:hover { transform: translateY(-5px); background: #000; }

@media (max-width: 768px) {
    .layout { grid-template-columns: 1fr; gap: 0; padding: 0 16px; }
    .post-detail { padding: 30px 20px; }
    .hero-content h1 { font-size: 26px; }
    .post-page-nav { flex-direction: column; gap: 10px; }
}

/* --- 8. Page Detail Mode (JS Triggered) --- */

body.page-detail .site-header {
    height: 60px;
}
body.page-detail .logo {
    font-size: 20px; 
}

body.page-detail #hero-container {
    position: sticky; top: 60px;
    z-index: 0;
}

body.page-detail .layout {
    display: block;
    max-width: 1100px;
    position: relative; z-index: 10;
    margin-top: -30px; 
}
body.page-detail .side-column { display: none; }
body.page-detail .post-card { display: none; }

body.page-detail .header-visual {
    display: none;
}