/* Odyssey-inspired Tistory Skin: Tech Blog / Long-form / SEO-friendly */
:root{--bg:#f7f8fb;--surface:#fff;--text:#202124;--muted:#6b7280;--line:#e8ebf2;--primary:#2563eb;--primary-soft:#eef4ff;--code-bg:#f3f5f9;--shadow:0 10px 30px rgba(15,23,42,.06);--radius:18px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR","Apple SD Gothic Neo",sans-serif;color:var(--text);background:var(--bg);line-height:1.78;word-break:keep-all}
a{color:inherit;text-decoration:none}img{max-width:100%;height:auto;border-radius:14px}button,input{font:inherit}
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.88);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.header-inner{max-width:1180px;margin:0 auto;height:72px;padding:0 24px;display:flex;align-items:center;gap:28px}
.blog-title{margin:0;font-size:22px;letter-spacing:-.03em;font-weight:800}.blog-title a{color:#111827}
.top-nav{margin-left:auto;display:flex;align-items:center;gap:18px;font-size:14px;color:var(--muted)}.top-nav ul{margin:0;padding:0;list-style:none;display:flex;gap:18px}.top-nav li{list-style:none}.top-nav a:hover{color:var(--primary)}
.mobile-menu-btn{display:none;width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff}.mobile-menu-btn span{display:block;width:18px;height:2px;margin:4px auto;background:#111827}
.layout{max-width:1180px;margin:34px auto;padding:0 24px;display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:34px}.content{min-width:0}.sidebar{min-width:0}.sidebar-inner{position:sticky;top:96px}
.widget{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px;margin-bottom:18px;box-shadow:var(--shadow)}.widget h3{margin:0 0 14px;font-size:15px;font-weight:800;letter-spacing:-.02em}.widget p,.widget li,.widget a{font-size:14px;color:var(--muted)}.widget ul{margin:0;padding-left:18px}.widget li{margin:8px 0}.widget a:hover{color:var(--primary)}
.search-box{display:flex;gap:8px}.search-box input{width:100%;min-width:0;border:1px solid var(--line);border-radius:12px;padding:10px 12px;outline:none}.search-box input:focus{border-color:var(--primary)}.search-box button{border:0;background:var(--primary);color:#fff;border-radius:12px;padding:10px 12px;cursor:pointer}
.list-header{background:linear-gradient(135deg,#111827 0%,#1e3a8a 100%);color:#fff;border-radius:24px;padding:34px;margin-bottom:24px;box-shadow:var(--shadow)}.list-header h2{margin:0;font-size:30px;letter-spacing:-.04em}.list-count{margin:10px 0 0;color:rgba(255,255,255,.72)}
.post-list{display:grid;gap:20px}.post-card{background:var(--surface);border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease}.post-card:hover{transform:translateY(-3px);box-shadow:0 16px 40px rgba(15,23,42,.1)}.post-card-link{display:block;min-height:160px}.post-card-link:has(.thumb){display:grid;grid-template-columns:210px 1fr}.thumb{background-size:cover;background-position:center;min-height:160px;background-color:var(--primary-soft)}.post-card-body{padding:24px}.post-category,.article-category{display:inline-flex;align-items:center;color:var(--primary);background:var(--primary-soft);border-radius:999px;padding:4px 10px;font-size:12px;font-weight:700}.post-card h2{margin:12px 0 8px;font-size:22px;line-height:1.35;letter-spacing:-.04em}.post-card p{margin:0;color:var(--muted);font-size:15px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.post-card time{display:block;margin-top:16px;color:#9ca3af;font-size:13px}
.article{background:var(--surface);border:1px solid var(--line);border-radius:24px;padding:44px;box-shadow:var(--shadow)}.article-header{padding-bottom:28px;margin-bottom:34px;border-bottom:1px solid var(--line)}.article-header h1{margin:14px 0 12px;font-size:36px;line-height:1.25;letter-spacing:-.05em}.article-meta{color:#9ca3af;font-size:14px}
.article-body{font-size:17px;color:#262b33}.article-body h2{margin:54px 0 18px;font-size:26px;line-height:1.35;letter-spacing:-.04em;border-left:0;padding-left:0;padding-bottom:10px;border-bottom:1px solid var(--line)}.article-body h2:empty{display:none;margin:0;padding:0;border:0}.article-body h2:has(br:only-child){display:none;margin:0;padding:0;border:0}.article-body h3{margin:36px 0 14px;font-size:21px;letter-spacing:-.035em}.article-body p{margin:16px 0}.article-body strong{font-weight:800;color:#111827}.article-body ul,.article-body ol{padding-left:24px;margin:18px 0}.article-body li{margin:8px 0}.article-body blockquote{margin:24px 0;padding:18px 22px;background:var(--primary-soft);border-left:5px solid var(--primary);border-radius:0 14px 14px 0;color:#1f3b77}.article-body pre{margin:22px 0;padding:18px 20px;border-radius:16px;background:#111827;color:#e5e7eb;overflow-x:auto;font-size:14px;line-height:1.7}.article-body code{font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace}.article-body :not(pre)>code{background:var(--code-bg);color:#e11d48;padding:3px 6px;border-radius:6px;font-size:.92em}.article-body table{width:100%;border-collapse:collapse;margin:24px 0;font-size:15px;overflow:hidden;border-radius:14px}.article-body th{background:#111827;color:#fff;padding:12px 14px;text-align:left}.article-body td{border-bottom:1px solid var(--line);padding:12px 14px}.article-body tr:nth-child(even) td{background:#f8fafc}
.article-tags{margin-top:36px;padding-top:24px;border-top:1px solid var(--line)}.article-tags a{display:inline-flex;margin:4px;padding:6px 12px;border-radius:999px;background:var(--primary-soft);color:var(--primary);font-size:13px;font-weight:700}
.related-posts,.comments{margin-top:38px;padding-top:28px;border-top:1px solid var(--line)}.related-posts h2,.comments h2{margin:0 0 14px;font-size:20px}.related-posts ul{padding-left:20px}.related-posts li{margin:8px 0;color:var(--muted)}
.paging{display:flex;align-items:center;justify-content:center;gap:8px;margin:34px 0}.paging a{min-width:38px;height:38px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:14px}.paging a:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
.tag-page,.guestbook,.cover-section{background:#fff;border:1px solid var(--line);border-radius:24px;padding:34px;box-shadow:var(--shadow)}.tag-cloud a{display:inline-flex;margin:5px;padding:7px 13px;border-radius:999px;background:var(--primary-soft);color:var(--primary);font-size:14px;font-weight:700}
.site-footer{max-width:1180px;margin:0 auto;padding:24px;color:#9ca3af;font-size:13px;text-align:center}
@media(max-width:960px){.layout{grid-template-columns:1fr;margin-top:22px}.sidebar{display:none}.article{padding:28px 22px;border-radius:20px}.article-header h1{font-size:30px}.post-card-link:has(.thumb){grid-template-columns:1fr}.thumb{min-height:210px}.top-nav{display:none;position:absolute;top:72px;left:16px;right:16px;padding:18px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.top-nav.is-open{display:block}.top-nav ul{flex-direction:column;gap:12px}.mobile-menu-btn{display:block;margin-left:auto}}
@media(max-width:560px){.header-inner{height:64px;padding:0 16px}.layout{padding:0 14px}.list-header{padding:26px 22px;border-radius:20px}.list-header h2{font-size:25px}.article-body{font-size:16px}.article-body h2{font-size:23px}}


/* ===== Prism.js / Highlight.js Friendly Code Style ===== */
/* 기존 검은 코드 박스, 중복 테두리 제거 */
.article-body pre,
.article-body pre[class*="language-"],
.article-body code[class*="language-"],
.article-body pre code {
  background: #f6f8fa !important;
  color: #24292f !important;
  text-shadow: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* 코드 블록 전체 */
.article-body pre,
.article-body pre[class*="language-"] {
  border: 1px solid #d8dee4 !important;
  border-radius: 12px !important;
  padding: 18px 20px !important;
  margin: 22px 0 !important;
  overflow-x: auto !important;
  line-height: 1.7 !important;
  font-size: 14px !important;
}

/* 코드 내부 */
.article-body pre code,
.article-body code[class*="language-"] {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  padding: 0 !important;
  white-space: pre !important;
}

/* 인라인 코드 */
.article-body :not(pre) > code {
  background: #eef2f7 !important;
  color: #d6336c !important;
  padding: 3px 6px !important;
  border-radius: 6px !important;
  border: 1px solid #e1e4e8 !important;
  font-size: 0.92em !important;
}

/* 티스토리 기본 코드 블록 스타일 충돌 방지 */
.tt_article_useless_p_margin pre,
.tt_article_useless_p_margin code,
pre, code {
  border-left: none !important;
}

/* Prism 토큰 색상: 밝은 테마 */
.article-body .token.comment,
.article-body .token.prolog,
.article-body .token.doctype,
.article-body .token.cdata {
  color: #6a737d !important;
}

.article-body .token.punctuation {
  color: #24292f !important;
}

.article-body .token.property,
.article-body .token.tag,
.article-body .token.boolean,
.article-body .token.number,
.article-body .token.constant,
.article-body .token.symbol,
.article-body .token.deleted {
  color: #005cc5 !important;
}

.article-body .token.selector,
.article-body .token.attr-name,
.article-body .token.string,
.article-body .token.char,
.article-body .token.builtin,
.article-body .token.inserted {
  color: #22863a !important;
}

.article-body .token.operator,
.article-body .token.entity,
.article-body .token.url,
.article-body .language-css .token.string,
.article-body .style .token.string {
  color: #d73a49 !important;
}

.article-body .token.atrule,
.article-body .token.attr-value,
.article-body .token.keyword {
  color: #d73a49 !important;
}

.article-body .token.function,
.article-body .token.class-name {
  color: #6f42c1 !important;
}

.article-body .token.regex,
.article-body .token.important,
.article-body .token.variable {
  color: #e36209 !important;
}

/* Prism toolbar / copy button */
div.code-toolbar > .toolbar {
  top: 8px !important;
  right: 8px !important;
  opacity: 1 !important;
}

div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > span {
  background: #ffffff !important;
  color: #57606a !important;
  border: 1px solid #d8dee4 !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

/* Highlight.js를 나중에 적용해도 깨지지 않도록 호환 */
.article-body pre code.hljs,
.article-body .hljs {
  background: #f6f8fa !important;
  color: #24292f !important;
}


/* ===== 관련글(다른 글) 디자인 개선 ===== */
.related-posts {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
}

.related-posts h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #1f2937;
}

.related-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts li {
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.related-posts li:hover {
    background: #eef2ff;
}

.related-posts a {
    color: #374151;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.related-posts a::after {
    content: "→";
    color: #6366f1;
    font-weight: bold;
}


/* ===== 티스토리 기본 '카테고리의 다른 글' 박스 개선 ===== */
/* 티스토리에서 자동 삽입되는 관련글 박스: .another_category */
.article-body .another_category,
.another_category {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  margin: 34px 0 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
  color: #374151 !important;
  overflow: hidden !important;
}

/* 제목 영역 */
.article-body .another_category h4,
.another_category h4 {
  margin: 0 0 14px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #eef2f7 !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  background: transparent !important;
}

/* 제목 안 링크 */
.article-body .another_category h4 a,
.another_category h4 a {
  color: #2563eb !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

/* 리스트 초기화 */
.article-body .another_category table,
.another_category table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.article-body .another_category tbody,
.article-body .another_category tr,
.article-body .another_category td,
.another_category tbody,
.another_category tr,
.another_category td {
  background: transparent !important;
  border: 0 !important;
}

/* 행 디자인 */
.article-body .another_category tr,
.another_category tr {
  display: block !important;
  border-radius: 10px !important;
  transition: background 0.18s ease, transform 0.18s ease !important;
}

.article-body .another_category tr:hover,
.another_category tr:hover {
  background: #f0f4ff !important;
  transform: translateX(2px) !important;
}

/* 글 제목 */
.article-body .another_category td,
.another_category td {
  display: block !important;
  padding: 0 !important;
}

.article-body .another_category a,
.another_category a {
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

/* 글 제목 셀 */
.article-body .another_category th,
.article-body .another_category td.title,
.another_category th,
.another_category td.title {
  display: block !important;
  padding: 8px 8px !important;
  background: transparent !important;
  border: 0 !important;
  text-align: left !important;
  color: #374151 !important;
  font-weight: 500 !important;
}

/* 티스토리 자동 삽입 title 링크 앞에 작은 점 대신 카드 느낌 */
.article-body .another_category th a,
.article-body .another_category td.title a,
.another_category th a,
.another_category td.title a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #374151 !important;
  font-weight: 500 !important;
}

.article-body .another_category th a::before,
.article-body .another_category td.title a::before,
.another_category th a::before,
.another_category td.title a::before {
  content: "›" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  background: #eef4ff !important;
  color: #2563eb !important;
  font-weight: 800 !important;
  flex: 0 0 auto !important;
}

/* 날짜 */
.article-body .another_category td.date,
.another_category td.date {
  display: block !important;
  float: right !important;
  margin-top: -32px !important;
  padding: 8px 8px !important;
  color: #9ca3af !important;
  font-size: 12px !important;
  background: transparent !important;
  border: 0 !important;
  text-align: right !important;
}

/* 댓글 수 */
.article-body .another_category .count,
.another_category .count {
  color: #9ca3af !important;
  font-size: 12px !important;
}

/* 일부 스킨/티스토리 기본 CSS가 pre 스타일을 잘못 먹이는 경우 방지 */
.article-body .another_category pre,
.article-body .another_category code,
.another_category pre,
.another_category code {
  background: transparent !important;
  color: inherit !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* 모바일에서는 날짜를 아래로 */
@media (max-width: 560px) {
  .article-body .another_category td.date,
  .another_category td.date {
    float: none !important;
    margin-top: -4px !important;
    text-align: left !important;
    padding-left: 34px !important;
  }
}


/* ===== 관련 글 영역을 '카테고리의 다른 글'과 동일한 카드 스타일로 통일 ===== */
.related-posts {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  margin: 34px 0 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
  color: #374151 !important;
}

.related-posts h2 {
  margin: 0 0 14px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #eef2f7 !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  background: transparent !important;
}

.related-posts ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.related-posts li {
  margin: 0 !important;
  padding: 8px 8px !important;
  border-radius: 10px !important;
  color: #374151 !important;
  transition: background 0.18s ease, transform 0.18s ease !important;
}

.related-posts li:hover {
  background: #f0f4ff !important;
  transform: translateX(2px) !important;
}

.related-posts a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #374151 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.7 !important;
  text-decoration: none !important;
}

.related-posts a::before {
  content: "›" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  background: #eef4ff !important;
  color: #2563eb !important;
  font-weight: 800 !important;
  flex: 0 0 auto !important;
}

.related-posts a::after {
  content: none !important;
}


/* ===== 목록 썸네일 전체 보이기 수정 ===== */
/* 기존 background-size: cover 방식은 이미지를 잘라서 보여줍니다.
   contain 방식으로 바꾸면 이미지 전체가 보입니다. */
.post-card .thumb {
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-color: #f8fafc !important;
  border-right: 1px solid #eef2f7 !important;
}

/* 썸네일이 가로/세로 비율이 달라도 카드에서 안정적으로 보이도록 보정 */
.post-card-link:has(.thumb) .thumb {
  min-height: 180px !important;
}

/* 모바일에서는 썸네일 영역을 조금 더 확보 */
@media (max-width: 960px) {
  .post-card-link:has(.thumb) .thumb {
    min-height: 220px !important;
    border-right: 0 !important;
    border-bottom: 1px solid #eef2f7 !important;
  }
}


/* ===== 우측 사이드바 sticky 개선: 본문 스크롤과 함께 따라오는 광고형 사이드바 ===== */
/* 페이지와 사이드바가 따로 스크롤되지 않도록 내부 스크롤을 제거합니다.
   본문을 스크롤하면 사이드바는 화면 오른쪽에 sticky 상태로 유지되어 광고 노출이 이어집니다. */
@media (min-width: 961px) {
  .sidebar {
    align-self: start !important;
    min-width: 0 !important;
  }

  .sidebar-inner {
    position: sticky !important;
    top: 96px !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .sidebar .widget {
    overflow: visible !important;
  }

  .sidebar .adsbygoogle {
    display: block !important;
    width: 100% !important;
  }
}
