@charset "utf-8";

/* ===== 포인트 컬러: 토큰은 style.css, 사용자 지정값은 skin.html의 --point ===== */
.entry-content a, .post-header h1 em, .comments h2 .count { color: var(--point); }
.comment-form .submit button:hover, .comment-form .submit button:focus { background-color: var(--point); }

/* ===== 다크모드 토글 버튼 ===== */
#header .util .theme-toggle {
  float: left; width: 32px; height: 32px; margin-left: 14px;
  border: 1px solid var(--line); border-radius: 50%; background: transparent;
  position: relative; font-size: 0;
}
#header .util .theme-toggle:before {
  content: "\e727"; font-family: 'icomoon'; font-size: 16px; line-height: 30px; color: var(--text-2);
  position: absolute; inset: 0; text-align: center;
}
[data-theme="dark"] #header .util .theme-toggle:before { content: "\e72a"; }

/* ===== 홈 소개 (서버 렌더링 텍스트) ===== */
.home-intro { display: none; margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
#tt-body-index .home-intro { display: block; }
.home-intro h2 { font-size: 1.5em; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.home-intro p { line-height: 1.7; color: var(--text-2); }

/* ===== 글 상세: 읽는 시간(커버 메타) / 목차 / 이전·다음 ===== */
.post-cover .meta .read-time[hidden] { display: none; }
.toc { margin: 0 0 32px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .9375em; }
.toc[hidden] { display: none; }
.toc strong { display: block; margin-bottom: 8px; color: var(--text-1); }
.toc ol { margin: 0; padding-left: 0; list-style: none; }
.toc li { padding: 3px 0; }
.toc li.lv3 { padding-left: 16px; font-size: .94em; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--point); text-decoration: underline; }

.post-notice { margin: 40px 0 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .875em; line-height: 1.7; color: var(--text-2); }
.post-notice strong { display: block; margin-bottom: 8px; font-size: .9375rem; color: var(--text-1); }
.post-notice ul { margin: 0; padding-left: 1.2em; list-style: disc; }
.post-notice li { margin: 2px 0; }
.post-notice-contact { margin: 10px 0 0; color: var(--text-3); }
.post-notice-contact a { color: var(--point); }

/* 본문 끝 "출처/참고" 구역 (extra.js가 해당 제목 뒤 목록에 클래스를 붙임) */
.entry-content .post-sources-title { margin-top: 2.2em; font-size: 1rem; }
.entry-content ul.post-sources, .entry-content ol.post-sources { font-size: .875em; line-height: 1.7; color: var(--text-3); }
.entry-content .post-sources a { word-break: break-all; }

.post-nav { display: flex; gap: 12px; margin: 40px 0; }
.post-nav a { flex: 1; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text-1); }
.post-nav a.next { text-align: right; }
.post-nav a:hover { border-color: var(--point); }
.post-nav em { display: block; margin-bottom: 4px; font-style: normal; font-size: .8125em; color: var(--text-3); }
.post-nav span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 광고 영역: 레이아웃 시프트 방지 ===== */
.adsbygoogle, ins.adsbygoogle { display: block; min-height: 90px; }
.entry-content .revenue_unit_wrap, .revenue_unit_wrap { margin: 28px 0; }

/* ===== 코드 하이라이트 (highlight.js 사용 시) ===== */

/* ===== 다크모드: 색은 style.css의 토큰으로 처리, 여기엔 예외만 ===== */
[data-theme="dark"] #header .util .theme-toggle:before { color: #fbbf24; }
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select { background-color: var(--surface); color: var(--text-1); }
[data-theme="dark"] .entry-content img { opacity: .92; }

/* ===== 본문 태그: 가운데 정렬, 밑줄 텍스트 ===== */
.tags { text-align: center; }
.tags a { margin: 0 8px 8px; padding: 0; border: 0; border-radius: 0; line-height: 1.8; text-decoration: underline; text-underline-offset: 3px; }
.tags a:hover, .tags a:focus { text-decoration: none; color: var(--text-1); }
#aside .tags { text-align: left; }

/* ===== 테이블: 둥근 외곽 / 헤더 진한 배경 / 짝수 줄 연한 배경 / 가로 스크롤 ===== */
:root { --table-head: #eceff3; --table-odd: #f7f8fa; }
[data-theme="dark"] { --table-head: #263247; --table-odd: #1a2332; }
.table-scroll { max-width: 100%; margin: 0 0 1.5em; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
#article-view .table-scroll table { width: 100%; min-width: 100%; margin: 0; border: 0; border-collapse: separate; border-spacing: 0; background: transparent; }
#article-view table:not(.hljs-ln) td, #article-view table:not(.hljs-ln) th { min-width: 96px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); line-height: 1.6; vertical-align: middle; background: transparent; }
#article-view table:not(.hljs-ln) tr:last-child td, #article-view table:not(.hljs-ln) tr:last-child th { border-bottom: 0; }
/* 본문 기준 짝수 줄(2,4…) = 전체 3,5… 번째 줄에 배경 (헤더는 아래 규칙이 덮어씀) */
#article-view table:not(.hljs-ln) tr:nth-child(odd) td { background: var(--table-odd); }
#article-view table:not(.hljs-ln) tr:first-child td, #article-view table:not(.hljs-ln) th { background: var(--table-head); font-weight: 700; color: var(--text-1); }

/* ===== 글 카드: 썸네일 크롭을 object-fit으로 (세로 이미지도 자연스럽게) ===== */
.post-item .thum img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transform: none; }

/* ===== 홈 히어로: 최신 글 1개를 크게 ===== */
.hero-badge { display: inline-block; justify-self: start; margin-bottom: 10px; padding: 3px 10px; border-radius: 999px; background: var(--point); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.post-item.hero { float: none; clear: both; width: 100%; margin: 0 0 44px; }
.post-item.hero > a { display: grid; grid-template-columns: 1fr; }
.post-item.hero .thum { padding-bottom: 58%; margin-bottom: 18px; border-radius: var(--radius-lg); }
.post-item.hero .title { max-width: none; padding-top: 0; margin-bottom: 10px; white-space: normal; font-size: 1.5em; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.post-item.hero .excerpt { max-width: none; -webkit-line-clamp: 3; font-size: .9375em; line-height: 1.7; margin-bottom: 12px; }
@media screen and (min-width: 768px) {
  .post-item.hero > a { grid-template-columns: 1.3fr 1fr; column-gap: 32px; align-content: center; }
  .post-item.hero .thum { grid-column: 1; grid-row: 1 / span 4; margin-bottom: 0; padding-bottom: 66%; }
  .post-item.hero .hero-badge, .post-item.hero .title, .post-item.hero .excerpt, .post-item.hero .meta { grid-column: 2; }
  .post-item.hero .hero-badge { align-self: end; }
  .post-item.hero .title { font-size: 1.75em; }
  .post-item.hero .meta { align-self: start; }
}
/* 히어로(1번) 다음 카드부터 3열이 새 줄에서 시작되도록 (데스크톱만) */
@media screen and (min-width: 768px) {
  .has-hero .post-item:nth-child(3n+1) { clear: none; margin-left: 3.378378378378378%; }
  .has-hero .post-item:nth-child(3n+2) { clear: both; margin-left: 0; }
}

/* ===== 티스토리 네임카드(글 하단 블로그 프로필): 세로 축소 ===== */
body .tt_box_namecard { align-items: center; min-height: 0; margin: 28px 0; padding: 14px 20px; background: var(--surface); border-radius: var(--radius); }
body .tt_box_namecard .tt_cont { padding: 0; }
body .tt_box_namecard .tt_tit_cont { font-size: 16px; line-height: 22px; font-weight: 700; color: var(--text-1); }
body .tt_box_namecard .tt_desc { padding-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-3); }
body .tt_box_namecard .tt_link { height: auto; margin: 4px 0 0; }
body .tt_box_namecard .tt_link .tt_tit_g { color: var(--text-2); }
body .tt_box_namecard .tt_wrap_thumb { width: 44px; height: 44px; margin: 0 0 0 16px; border-radius: 50%; }
body .tt_box_namecard .tt_btn_subscribe { height: 30px; margin: 8px 0 0; padding: 0 14px; border-color: var(--text-3); }
body .tt_box_namecard .tt_btn_subscribe .tt_txt_g { color: var(--text-1); }

/* ===== 소제목 표식 (keep4n 형식): h2 = 동그라미 로마숫자, h3 = # . 클릭하면 해당 위치로 이동. 출처 구역은 제외 ===== */
html { scroll-behavior: smooth; }
#article-view { counter-reset: h2c; }
#article-view h2, #article-view h3 { position: relative; scroll-margin-top: 84px; }
#article-view h2:not(.post-sources-title) { counter-increment: h2c; }
#article-view .hd-mark { text-decoration: none; }
#article-view h2 > .hd-mark {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 2.2rem; height: 2.2rem; padding: 0 .55rem; margin-right: .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .875rem; font-weight: 400; line-height: 1; color: var(--text-1);
  vertical-align: .1em; transition: border-color .15s, color .15s;
}
#article-view h2 > .hd-mark:before { content: counter(h2c, upper-roman); }
#article-view h3 > .hd-mark { display: inline-block; margin-right: .45rem; font-weight: 400; color: var(--text-3); transition: color .15s; }
#article-view h3 > .hd-mark:before { content: "#"; }
#article-view h2 > .hd-mark:hover, #article-view h2 > .hd-mark:focus-visible { border-color: var(--point); color: var(--point); }
#article-view h3 > .hd-mark:hover, #article-view h3 > .hd-mark:focus-visible { color: var(--point); }
/* 1340px 미만(좁은 화면·모바일)에서는 표식 숨김 */
@media screen and (max-width: 1339px) {
  #article-view .hd-mark { display: none !important; }
}
/* 넓은 화면: 본문 왼쪽 여백에 걸어 두기 (keep4n처럼) */
@media screen and (min-width: 1340px) {
  #article-view h2 > .hd-mark { position: absolute; left: -3.6rem; top: 50%; margin: -1.1rem 0 0; vertical-align: baseline; }
  #article-view h3 > .hd-mark { position: absolute; left: -2.1rem; margin: 0; }
}
/* 목차의 번호·#는 1340px 이상에서만 표시 (그 미만에서는 모든 표식 숨김) */
@media screen and (min-width: 1340px) {
  .toc ol { counter-reset: tocc; }
  .toc li.lv2:not(.nonum) { counter-increment: tocc; }
  .toc li.lv2:not(.nonum) a:before { content: counter(tocc, upper-roman) "."; margin-right: .5em; color: var(--text-3); }
  .toc li.lv3 a:before { content: "#"; margin-right: .4em; color: var(--text-3); }
}

/* ===== "다른 글" 박스(another_category): 일반 표 스타일 제외, 목록 배경 투명 ===== */
#article-view .another_category table { border: 0; border-radius: 0; overflow: visible; background: transparent; }
#article-view .another_category table tr, #article-view .another_category table td, #article-view .another_category table th { min-width: 0; border: 0 !important; background: transparent !important; line-height: inherit; color: inherit; }
#article-view .another_category table tr:first-child td, #article-view .another_category table th { font-weight: inherit; }
#article-view .another_category table td { color: var(--text-3); }
#article-view .another_category table th a { color: var(--text-1); }

/* ===== 티스토리 공감/공유 버튼 그룹: 알약 → 안내 박스와 같은 라운드 ===== */
body .container_postbtn .postbtn_like, body .container_postbtn .btn_menu_toolbar { border-radius: var(--radius); }

/* ===== 글 목록: 제목 / 요약 / 날짜 구분 (색·굵기 차등) ===== */
.post-item .title { color: var(--text-1); font-weight: 700; letter-spacing: -.01em; }
.post-item .excerpt { color: var(--text-3); }
.post-item .meta, .post-item .meta .date { color: var(--text-3); font-size: .8125em; }
.post-item a:hover .title, .post-item a:focus .title { color: var(--point); text-decoration: none; }
.post-item.hero .title { font-weight: 800; }

/* ===== 라운딩 ===== */
/* 썸네일 / 이미지 */
.post-item .thum, .cover-thumbnail-1 ul li figure, .cover-thumbnail-2 ul li figure,
.cover-thumbnail-3 ul li figure, .cover-thumbnail-4 ul li figure,
.related-articles ul li figure, .cover-event ul li a { overflow: hidden; border-radius: var(--radius); }
.post-item .thum img, .related-articles ul li figure img,
.sidebar .post-list ul li img { border-radius: var(--radius); }
.sidebar .post-list ul li img { border-radius: var(--radius-sm); }
/* 글 본문 */
.entry-content img, .entry-content figure, .entry-content .iframe-wrap,
.entry-content iframe, .entry-content video { border-radius: var(--radius); }
.entry-content figure.imageblock, .entry-content .imageblock img { border-radius: var(--radius); }
.entry-content table, .entry-content figure.fileblock,
.entry-content figure[data-ke-type="opengraph"], .entry-content .protected_form { border-radius: var(--radius); }
.entry-content blockquote { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
/* 글 상세 커버 / 공지 */
.post-cover { border-radius: var(--radius-lg); overflow: hidden; }
#tt-body-index .post-cover.notice { border-radius: 0; }
/* 카드·박스·버튼·입력 */
.toc, .post-nav a, .home-intro { border-radius: var(--radius); }
.btn, a.btn, .tags a, .pagination a, .pagination .view-more { border-radius: var(--radius-sm); }
.comment-form textarea, .comment-form .field input,
.entry-content .protected_form input { border-radius: var(--radius-sm); }
.comment-form .submit button { border-radius: var(--radius-sm); }
.sidebar .social-list, .sidebar .recent-comment ul li a, .sidebar .tags a { border-radius: var(--radius-sm); }
#header .util .search { border-radius: 32px; }

/* ===== 카테고리 드롭다운 (헤더 2행 맨 앞, 눈에 띄는 버튼) ===== */
.gnb-row { display: flex; align-items: center; }
.gnb-row #gnb { flex: 1 1 auto; min-width: 0; }
.cat-menu { position: relative; flex: 0 0 auto; margin-right: 10px; }
.cat-menu[hidden] { display: none; }
.cat-toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 14px; border: 0; border-radius: var(--radius); background: var(--point); color: #fff; font-size: .9375em; font-weight: 700; }
.cat-toggle:hover { filter: brightness(.94); }
.cat-toggle [class^="icon-"] { font-size: 16px; }
.cat-panel { display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 200; width: 300px; max-height: 70vh; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.cat-menu.open .cat-panel { display: block; }
.cat-panel ul { margin: 0; padding: 0; list-style: none; }
.cat-panel li { position: relative; }
.cat-panel a { display: block; padding: 8px 40px 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-1); font-size: .9375em; }
.cat-panel a:hover { background: var(--surface); color: var(--point); }
.cat-panel .link_tit { display: none; }
.cat-panel .c_cnt { margin-left: 4px; font-size: .8125em; color: var(--text-3); }
.cat-panel li > ul { display: none; margin: 0 0 4px 12px; padding-left: 8px; border-left: 2px solid var(--line); }
.cat-panel li.open > ul { display: block; }
.cat-panel li > ul a { font-size: .875em; color: var(--text-2); }
.cat-panel li > ul li > ul a { font-size: .8125em; color: var(--text-3); }
.cat-panel .cat-sub-toggle { position: absolute; top: 2px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); }
.cat-panel .cat-sub-toggle:hover { background: var(--surface); color: var(--text-1); }
.cat-panel .cat-sub-toggle:before { content: "\e75e"; font-family: 'icomoon'; display: block; font-size: 14px; line-height: 32px; transition: transform .15s; }
.cat-panel li.open > .cat-sub-toggle:before { transform: rotate(180deg); }
.cat-panel li.current > a { color: var(--point); font-weight: 700; }

/* ===== 레이아웃 현대화 (데스크톱/태블릿 768px~, 모바일은 기존 유지) ===== */
@media screen and (min-width: 768px) {
  /* 헤더: 스크롤 시 따라오는 반투명 바, 구분선 대신 옅은 그림자 */
  #header {
    position: sticky; top: 0; z-index: 100;
    border-bottom: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    box-shadow: 0 1px 0 var(--line);
  }
  #header h1 { padding: 18px 0; font-size: 1.5em; }
  #header .util { top: 18px; }

  /* GNB: 밑줄 → 알약형 탭 */
  #gnb { display: flex; align-items: center; height: 52px; }
  .gnb-row { min-height: 52px; }
  #gnb ul { flex: none; margin-left: -8px; padding-top: 0; }
  #gnb ul li { padding: 0 4px; }
  #gnb ul li a { padding: 8px 14px; line-height: 20px; border-radius: 999px; font-size: .9375em; font-weight: 500; color: var(--text-3); transition: background-color .15s, color .15s; }
  #gnb ul li a:hover, #gnb ul li.current a { background-color: var(--surface); color: var(--text-1); }
  #gnb ul li.current a { font-weight: 700; }
  #gnb ul li.current a:after, #gnb ul li a:hover:after, #gnb ul li a:focus:after { content: none; }

  /* 전체 폭 1200px, 사이드바 최대 320px (flex) */
  #header .inner, #footer .inner, #container .content-wrap { max-width: 1200px; }
  #container .content-wrap:before, .layout-aside-left #container .content-wrap:before { content: none; }
  #container .content-wrap { display: flex; align-items: flex-start; gap: 48px; }
  #container .content-wrap:after { display: none; }
  .layout-aside-left #container .content-wrap { flex-direction: row-reverse; }
  #content, .layout-aside-left #content { float: none; flex: 1 1 0; min-width: 0; width: auto; padding-top: 48px; }
  #aside, .layout-aside-left #aside { float: none; flex: 0 0 auto; width: clamp(240px, 28%, 320px); margin: 0; padding: 48px 0 32px; }
  /* 카테고리는 헤더 드롭다운으로 이동 */
  .has-cat-menu #aside .category { display: none; }

  /* 사이드바: 카드형 블록 */
  .sidebar .sidebar-2 { margin-top: 0; padding-top: 0; border-top: 0; }
  #aside .category,
  #aside .notice,
  #aside .post-list,
  #aside .recent-comment,
  #aside h2 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-2);
  }
  #aside .tab-ui > h2 { text-transform: none; letter-spacing: 0; }
  #aside .count h2:before { content: none; }
  #aside .category ul li a { display: block; padding: 2px 0; }
  #aside .category .tt_category > li > .link_tit { display: none; }
  #aside .category .tt_category > li > ul.category_list { display: block; padding-top: 0; }
  #aside .recent-comment ul li a { padding: 0; line-height: 1.5; }
  #aside .recent-comment ul li { margin: 0; padding: 0; }
  #aside .count .total { margin-bottom: 8px; color: var(--point); }

  /* 푸터 */
  #footer { margin-top: 24px; border-top: 0; background: var(--surface); }
}

@media screen and (max-width: 767px) {
  .cat-menu { display: none !important; }
  .post-nav { flex-direction: column; }
}

/* 푸터: 아이콘 출처 표기 (Streamline CC BY 4.0) — 개인용 아이콘 폰트를 쓰는 동안 유지 */
#footer .credit { margin: 6px 0 0; font-size: .75rem; color: var(--text-3); }
#footer .credit a { color: inherit; text-decoration: underline; }
