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

body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.inner,
.main {
  max-width: 1020px;
  margin: 0 auto;
}

/* header */
.header { border-bottom: 1px solid #efefef; }

.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 30px 0;
}

.top-right { display: flex; align-items: center; gap: 32px; }

.blog-menu ul { display: flex; gap: 20px; }
.blog-menu a { font-size: 13px; color: #777; }
.blog-menu a:hover { color: #333; }

.search {
  display: flex;
  align-items: center;
  width: 260px;
  border-bottom: 2px solid #333;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
  background: none;
}

.search-button { padding: 4px; border: 0; background: none; color: #999; }

.slogan { display: inline-block; padding: 33px 0 36px; }
.slogan strong { display: block; margin-bottom: 9px; font-family: Arial, sans-serif; font-size: 36px; }
.slogan p { margin: 0; font-size: 13px; color: #999; }

/* category tabs */
.tabs-top,
.tabs-sub {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.tabs-top { gap: 40px; }
.tabs-top a {
  display: block;
  padding-bottom: 16px;
  margin-bottom: -1px;
  font-size: 16px;
  color: #999;
  border-bottom: 2px solid transparent;
}
.tabs-top a:hover,
.tabs-top a.on { color: #333; border-bottom-color: #333; }

.tabs-sub {
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid #efefef;
}
.tabs-sub a { font-size: 13px; color: #999; }
.tabs-sub a:hover,
.tabs-sub a.on { color: #333; font-weight: 600; }
.tabs-sub .count { margin-left: 3px; font-size: 11px; font-weight: 400; color: #bbb; }

/* 탭은 홈과 카테고리 목록에서만 쓴다 */
body:not(#tt-body-index):not(#tt-body-category) .category-tabs { display: none; }

/* layout */
#container { margin-top: 24px; }

.main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.content { width: 100%; max-width: 640px; }
.aside { width: 300px; flex-shrink: 0; }

/* list */
.list-title {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e8e8;
  font-size: 16px;
  font-weight: 600;
}
.list-title span { color: #f54; font-weight: 400; }
/* 홈·카테고리에서는 위 탭이 현재 위치를 보여주므로 목록 제목이 중복. 검색·태그·보관함 목록에서만 쓴다 */
#tt-body-index .list-title,
#tt-body-category .list-title { display: none; }

.post-item { display: flex; gap: 40px; padding-top: 32px; }
.post-text { flex: 1; min-width: 0; }

.post-title {
  display: block;
  margin: 14px 0 10px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
}
.post-link:hover .post-title { text-decoration: underline; }

.post-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #777;
}

.post-thumbnail { flex-shrink: 0; margin-top: 14px; }
.post-thumbnail img { display: block; width: 188px; height: 126px; object-fit: cover; }

.post-meta { margin-top: 10px; font-size: 11px; }
.post-category { color: #333; }
.post-date { margin-left: 10px; color: #999; }
.post-date::before { content: '·'; margin-right: 10px; }

.list-empty { padding: 60px 0; text-align: center; color: #999; }

/* paging */
.paging {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 80px 0 40px;
  font-size: 13px;
}
.paging a { min-width: 28px; line-height: 28px; text-align: center; }
.paging-arrow { font-size: 20px; }
.paging-arrow.no-more-prev,
.paging-arrow.no-more-next { visibility: hidden; }
/* 현재 페이지 번호는 티스토리가 span.selected 로 감싸 준다 */
.paging .selected { display: block; border-radius: 50%; color: #fff; background: #000; }

#tt-body-page .paging { display: none; }

/* article */
.article-header { padding-bottom: 32px; border-bottom: 1px solid #e8e8e8; }
.article-category { font-size: 13px; color: #777; }
.article-title { margin: 12px 0 16px; font-size: 32px; font-weight: 600; line-height: 1.35; word-break: keep-all; }
.article-date { font-size: 13px; color: #999; }

.article-view {
  padding: 40px 0;
  font-size: 16px;
  line-height: 1.8;
  word-break: break-word;
}
.article-view h2 { margin: 48px 0 16px; font-size: 26px; }
.article-view h3 { margin: 40px 0 12px; font-size: 21px; }
.article-view h4 { margin: 32px 0 8px; font-size: 18px; }
.article-view p { margin: 0 0 16px; }
.article-view a { color: #06c; text-decoration: underline; }
.article-view img { height: auto; }
.article-view blockquote { margin: 24px 0; padding: 4px 20px; border-left: 3px solid #ddd; color: #666; }
.article-view code { padding: 2px 5px; font-size: 14px; background: #f5f5f5; border-radius: 3px; }
.article-view pre { padding: 16px; overflow-x: auto; background: #f7f7f7; border-radius: 4px; }
.article-view pre code { padding: 0; background: none; }
.article-view table { width: 100%; border-collapse: collapse; }
.article-view th,
.article-view td { padding: 8px 10px; border: 1px solid #e0e0e0; }

.article-tags { padding-bottom: 32px; font-size: 13px; color: #777; }
.article-tags a { margin-right: 4px; }

.article-nav { display: flex; flex-direction: column; border-top: 1px solid #e8e8e8; }
.article-nav a { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid #efefef; font-size: 14px; }
.article-nav span { flex-shrink: 0; color: #999; }
.article-nav strong { font-weight: 400; }
.article-nav a:hover strong { text-decoration: underline; }

.article-related { padding: 40px 0 0; }
.article-related h3 { margin: 0 0 12px; font-size: 16px; }
.article-related li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14px; }
.article-related li span { flex-shrink: 0; color: #999; font-size: 12px; }

.article-comment { padding: 40px 0; }

.protected { padding: 60px 0; text-align: center; color: #777; }
.protected-form { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.protected-form input { padding: 8px 12px; border: 1px solid #ddd; }
.protected-form button { padding: 8px 16px; border: 0; color: #fff; background: #000; }

/* tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 32px 0; font-size: 14px; color: #777; }
.tag-cloud .cloud1 { font-size: 20px; color: #333; }
.tag-cloud .cloud2 { font-size: 17px; color: #333; }
.tag-cloud a:hover { text-decoration: underline; }

/* sidebar */
.aside > div { margin-bottom: 48px; }
.sidebar-title { margin: 0 0 10px; font-size: 14px; font-weight: 500; }

.box-profile {
  margin-bottom: 48px;
  padding: 40px 20px;
  border: 1px solid #e8e8e8;
  text-align: center;
}
.profile-image { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; }
.profile-name { margin: 16px 0 0; font-size: 14px; font-weight: 600; }

.box-profile .btn_tool { margin-top: 28px; }
.box-profile .btn_subscription {
  width: 100%;
  height: 46px;
  border: 1px solid #000;
  border-radius: 50px;
  font-size: 13px;
  color: #fff;
  background: #000;
}
.box-profile .btn_subscription.following { color: #333; background: #fff; border-color: #ddd; }

.profile-buttons { display: flex; gap: 10px; margin-top: 16px; }
.profile-buttons:not(.member) { display: none; }

.button {
  flex: 1;
  height: 46px;
  line-height: 44px;
  border: 1px solid #ddd;
  border-radius: 50px;
  font-size: 13px;
}
.button-primary { color: #fff; background: #000; border-color: #000; }

.link-portfolio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 14px;
  color: #777;
}
.link-portfolio:hover { color: #333; }

.box-category { font-size: 14px; color: #777; }
.box-category .link_tit { display: block; margin-bottom: 18px; }
.box-category .link_item { display: block; margin: 0 0 6px; color: #777; }
.box-category .category_list > li { margin-bottom: 14px; }
.box-category .sub_category_list { margin-left: 10px; }
.box-category .link_sub_item { display: block; padding: 2px 0; font-size: 13px; color: #999; }
.box-category .link_sub_item::before { content: '–'; margin-right: 8px; }
.box-category a:hover,
.box-category .selected { color: #333; }
.box-category .c_cnt { font-size: 12px; }

.tag-list { font-size: 13px; line-height: 2; color: #777; }
.tag-list a:not(:last-child)::after { content: ','; margin-right: 6px; }
.tag-list a:hover { color: #333; }

.recent-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.recent-tabs button { padding: 0; border: 0; background: none; font-size: 14px; color: #bbb; }
.recent-tabs button + button::before { content: '|'; margin-right: 8px; color: #ddd; }
.recent-tabs button.on { color: #333; }

.recent-list li { margin-bottom: 14px; }
.recent-list a { display: flex; gap: 12px; }
.recent-list img { width: 48px; height: 48px; flex-shrink: 0; object-fit: cover; }
.recent-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 400; line-height: 1.5; }
.recent-text span { font-size: 12px; color: #999; }
.recent-list a:hover strong { text-decoration: underline; }

.visit-total { margin: 0 0 8px; font-size: 26px; font-weight: 600; }
.visit-day { margin: 0; font-size: 12px; line-height: 1.8; color: #999; }

/* footer */
.footer { margin-top: 80px; padding: 40px 0; border-top: 1px solid #efefef; font-size: 12px; color: #999; }

/* mobile */
@media (max-width: 1060px) {
  .inner { padding: 0 20px; }
  .main { flex-direction: column; padding: 0 20px; }
  .content { max-width: none; }
  .aside { width: 100%; margin-top: 60px; }
  .blog-menu { display: none; }
  .search { width: 160px; }
}

@media (max-width: 600px) {
  .post-item { gap: 16px; }
  .post-thumbnail img { width: 96px; height: 96px; }
  .tabs-top { gap: 24px; }
  .article-title { font-size: 24px; }
}
