@charset "utf-8";

/*
  PatchFairy Final Clean
  - 티스토리 자료실형 스킨
  - 검색 1개, 상단 카테고리, 조용한 소개 영역, 균일 간격
*/

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f4f9;
  --text: #151922;
  --muted: #667085;
  --line: #e3e8f1;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --green-soft: #ecfdf5;
  --danger: #ef4444;
  --shadow: 0 10px 26px rgba(15, 23, 42, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --wide: 1180px;
  --gap: 16px;
  --pad: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.72;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; vertical-align: middle; }
button, input, textarea { font: inherit; }

.site-shell { min-height: 100vh; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 12px 22px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto 280px;
  gap: 12px;
  align-items: center;
}
.site-title {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}
.site-title a { font-weight: 900; }

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.top-nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.header-search { min-width: 0; }
.mini-search {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mini-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  font-size: 14px;
}
.mini-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
  background: #fff;
}
.mini-search button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

/* Hero */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 16px 22px 0;
}
.hero-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: var(--gap);
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow);
}
.hero-title {
  text-align: center;
  padding: 6px 12px;
}
.hero-title h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.06em;
}
.hero-note {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.hero-note a {
  color: var(--accent);
  font-weight: 800;
}

/* Ads */
.ad-slot {
  max-width: var(--wide);
  margin: 16px auto;
  padding: 0 22px;
}
.ad-slot:empty { display: none; }
.manual-ad { margin: 18px 0; min-height: 0; }

/* Layout */
.layout {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 16px 22px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--gap);
  align-items: start;
}
.content {
  min-width: 0;
  display: grid;
  gap: var(--gap);
}
.sidebar {
  min-width: 0;
  display: grid;
  gap: var(--gap);
  position: sticky;
  top: 86px;
}

/* Common cards */
.article,
.list-head,
.post-card,
.empty-box,
.side-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* List head */
.list-head {
  padding: var(--pad);
}
.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
.list-head h2 {
  margin: 10px 0 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.05em;
}
.post-count {
  display: inline-flex;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

/* Posts */
.post-list { display: grid; gap: var(--gap); }
.post-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 180px;
}
.index-card { margin-bottom: 0; }

.thumb {
  position: relative;
  display: block;
  min-height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2ff, #ecfdf5);
}
.thumb img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}
.thumb-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(21, 25, 34, .36);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
}
.card-body {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}
.card-body h3 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.04em;
}
.card-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.read-more:hover { color: #fff; background: var(--accent); }

.empty-box {
  padding: 34px var(--pad);
  text-align: center;
}
.empty-box h3 { margin: 0 0 6px; }
.empty-box p { margin: 0; color: var(--muted); }

/* Article */
.article {
  padding: clamp(22px, 3.5vw, 38px);
}
.article-header {
  margin-bottom: 22px;
}
.article-header h2 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.055em;
}
.article-header time {
  color: var(--muted);
  font-size: 14px;
}
.article-body {
  color: var(--text);
  font-size: 16px;
}
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  line-height: 1.35;
  letter-spacing: -0.04em;
  margin: 2em 0 .7em;
}
.article-body h2 {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 28px;
}
.article-body p { margin: 1em 0; }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  padding: 12px 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-weight: 900;
}
.article-body ul,
.article-body ol { padding-left: 1.4em; }
.article-body li + li { margin-top: .35em; }
.article-body blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}
.article-body th { background: var(--surface-soft); }
.article-body pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #e5e7eb;
  line-height: 1.65;
}
.article-body code {
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--danger);
}
.article-body pre code {
  padding: 0;
  color: inherit;
  background: none;
}

.patch-info-box {
  margin: 18px 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.patch-info-box strong {
  display: block;
  margin-bottom: 8px;
}
.patch-info-box ul {
  margin: 0;
  padding-left: 1.25em;
  color: var(--muted);
  font-size: 14px;
}
.patch-info-box a {
  color: var(--accent);
  font-weight: 800;
}

/* Related / tags */
.tag-trail {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tag-trail a,
.tag-cloud a {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}
.related-posts {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.related-posts h3 {
  margin: 0 0 12px;
}
.related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.related-posts a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.related-posts time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.comments {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cloud1 { font-weight: 900; color: var(--accent) !important; }
.cloud2 { font-weight: 800; }
.cloud3 { font-weight: 700; }
.cloud4, .cloud5 { color: var(--muted) !important; }

/* Sidebar */
.side-box {
  padding: 18px;
  box-shadow: none;
}
.side-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.side-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}
.side-box li { min-width: 0; }
.side-box li a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-box li:last-child a { border-bottom: 0; }
.side-box li a:hover { color: var(--accent); }

.simple-links {
  display: grid;
  gap: 8px;
}
.simple-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 900;
  text-align: center;
}
.simple-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.counter-row {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.counter strong { color: var(--text); }

/* Paging / footer */
.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.page-link,
.page-num {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
}
.no-more-prev,
.no-more-next {
  opacity: .35;
  pointer-events: none;
}
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 22px 50px;
  text-align: center;
  font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text); }

/* 티스토리 기본 댓글 UI 보정 */
.tt-comment-cont { font-family: var(--font) !important; color: var(--text) !important; }
.tt-area-write, .tt-area-reply, .tt-box-total { border-color: var(--line) !important; }
.tt-btn_register { background: var(--accent) !important; border-color: var(--accent) !important; }

/* Responsive */
@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .header-search {
    max-width: 360px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
    word-break: normal;
  }
  .header-inner {
    padding: 12px 14px;
    gap: 10px;
  }
  .site-title { font-size: 22px; }
  .top-nav a {
    min-height: 28px;
    padding: 0 9px;
    font-size: 12px;
  }
  .header-search { max-width: none; }
  .mini-search input {
    padding: 9px 11px;
    font-size: 13px;
  }
  .mini-search button {
    padding: 9px 11px;
  }
  .hero {
    padding: 12px 14px 0;
  }
  .hero-card {
    grid-template-columns: 1fr;
    padding: 18px;
    text-align: center;
  }
  .hero-title {
    padding: 0;
  }
  .hero-title h2 {
    font-size: 28px;
  }
  .hero-note {
    padding: 14px;
    font-size: 13px;
  }
  .layout {
    padding: 14px 14px 26px;
  }
  .post-card {
    grid-template-columns: 1fr;
  }
  .thumb,
  .thumb img {
    min-height: 170px;
  }
  .article,
  .list-head,
  .card-body,
  .empty-box,
  .side-box {
    padding: 18px;
  }
  .article-body {
    font-size: 16px;
    line-height: 1.78;
  }
  .related-posts a {
    flex-direction: column;
    gap: 2px;
  }
  .page-numbers {
    display: none;
  }
}


/* Final v3 overrides */
.hero-card {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 8px 12px;
  text-align: center;
}

.hero-title h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.06em;
  color: var(--text);
}

.hero-note {
  text-align: left;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.footer-links a {
  color: var(--text);
  font-weight: 700;
}

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

.footer-links span {
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero-title h2 {
    font-size: 28px;
  }

  .hero-note {
    text-align: center;
  }

  .footer-links {
    gap: 6px;
  }
}
