/* =========================================================
   커스터마이징 변수
   ========================================================= */
:root {
  --bg-color:       #ffffff;
  --bg-image:       none;
  --overlay:        rgba(255,255,255,0.45);

  --paper:          #ffffff;
  --ink:            #1c1c1e;
  --ink-soft:       #8e8e93;
  --line:           #f0f0f0;
  --accent:         #c98b9e;
  --bubble-bg:      #0b93f6;

  --phone-w:        320px;
--phone-left: 120px;
--phone-bottom:  -40px;

/* 폰이 커진 만큼 메인 박스가 너무 밀리지 않게 겹침도 키움 */
--overlap:        110px;

/* 메인 안쪽 왼쪽 여백 */
--content-indent:  34px;

/* 메인 박스 위쪽 위치 */
--main-top:        64px;

/* 메인 박스가 너무 가로로 길어지지 않게 새 변수 추가 */
--main-max-w:    1180px;
--main-side-gap:  72px;

  --radius: 16px;
  --font: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* =========================================================
   리셋
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
img { max-width: 100%; display: block; }

body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.6;
  background:
    linear-gradient(var(--overlay), var(--overlay)),
    var(--bg-image),
    var(--bg-color);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =========================================================
   헤더 — 채팅 라벨
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  background: var(--bubble-bg);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.25px;
  padding: 8px 18px 8px 20px;
  border-radius: 18px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    0 4px 14px color-mix(in srgb, var(--bubble-bg) 28%, transparent),
    0 10px 28px color-mix(in srgb, var(--bubble-bg) 14%, transparent);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -5px;
  width: 14px;
  height: 14px;
  background: var(--bubble-bg);
  border-radius: 4px;
  transform: rotate(45deg);
  z-index: -1;
}

/* =========================================================
   폰 목업
   ========================================================= */
/* =========================================================
   폰 목업 — 제너릭 스마트폰 프레임
   ========================================================= */
.phone {
  position: fixed;
  left: var(--phone-left);
  bottom: var(--phone-bottom);
  z-index: 60;
  width: var(--phone-w);

  /* 너무 길쭉한 아이폰 비율 피하기 */
  height: 72vh;
  min-height: 500px;
  max-height: 680px;

  background: #19191c;
  border-radius: 34px;
  padding: 10px;

  box-shadow:
    0 26px 58px -22px rgba(0,0,0,0.42),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* 아이폰 느낌 강한 측면 버튼 제거 */
.phone::before,
.phone::after {
  display: none;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--paper);

  /* 프레임보다 덜 둥글게 */
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* 대신 일반 스마트폰 느낌의 작은 스피커 바 */
.screen::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: #d6d6dc;
  z-index: 5;
}

/* 작은 카메라 점 */
.screen::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 34px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7c7ce;
  z-index: 5;
}

/* 프로필 — 고정 */
.screen-profile {
  flex-shrink: 0;
  padding: 48px 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.screen-profile a { text-decoration: none; }

.profile-img {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  background: #eee;
}
.nickname {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.bio {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 5px;
}

/* 카테고리 — 스크롤 */
.screen-cats {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 34px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen-cats::-webkit-scrollbar { display: none; }

.cat-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

/* s_sidebar / s_sidebar_element 태그 자체는 display:contents 처리 */
.screen-cats s_sidebar,
.screen-cats s_sidebar_element {
  display: contents;
}

.screen-cats .category-list,
.screen-cats .category-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 전체보기 / 1depth */
.screen-cats .category-list > li {
  margin-bottom: 0;
}

.screen-cats .category-list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 3px 2px;
  border-radius: 6px;

  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;

  transition: color 0.15s, background 0.15s;
}

.screen-cats .category-list > li > a:hover {
  background: transparent;
  color: var(--accent);
}

/* 2depth 묶음 */
.screen-cats .category-list ul {
  margin: 3px 0 6px 9px;
  padding-left: 13px;
  border-left: 1px solid #eeeeee;
}

/* 2depth 아이템 */
.screen-cats .category-list ul li {
  margin-bottom: 0;
}

.screen-cats .category-list ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 4px 2px;
  border-radius: 5px;

  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;

  transition: color 0.15s, background 0.15s;
}

.screen-cats .category-list ul li a:hover {
  background: transparent;
  color: var(--accent);
}

/* 글 수 */
.screen-cats .category-list span {
  margin-left: 8px;
  font-size: 10.5px;
  color: var(--ink-soft);
  font-weight: 400;
}

/* 티스토리가 끼워 넣는 카테고리 아이콘 이미지 숨김 */
.screen-cats .category-list img {
  display: none;
}

/* =========================================================
   메인 콘텐츠 박스 — viewport 고정 크기 + 내부 스크롤
   ========================================================= */
.main {
  position: relative;
  z-index: 10;

  /* 메인 시작점: 폰과 자연스럽게 겹치게 */
  margin-left: calc(var(--phone-left) + var(--phone-w) - var(--overlap));
  margin-top: var(--main-top);
  margin-bottom: 40px;

  /* 너무 가로로 길게 늘어나지 않게 제한 */
  width: min(
    var(--main-max-w),
    calc(100vw - (var(--phone-left) + var(--phone-w) - var(--overlap)) - var(--main-side-gap))
  );

  padding: 44px 44px 52px calc(var(--overlap) + var(--content-indent));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px -24px rgba(0,0,0,0.18);

  height: calc(100vh - 64px - var(--main-top) - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 메인 박스 스크롤바 — 얇고 은은하게 */
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb {
  background: #d8d8d8;
  border-radius: 4px;
}
.main::-webkit-scrollbar-thumb:hover { background: #b8b8b8; }
.main { scrollbar-width: thin; scrollbar-color: #d8d8d8 transparent; }

/* =========================================================
   글 목록
   ========================================================= */
.main-head { margin-bottom: 36px; }
.main-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.post-list { display: flex; flex-direction: column; }

/* 카드: 위에서 아래로 헤드 -> 바디 -> 메타 */
.post {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.post:last-child { border-bottom: 0; }

/* 위: 카테고리 + 제목 */
.post-head { display: flex; flex-direction: column; gap: 6px; }
.post-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.post-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
}
.post-title a { text-decoration: none; color: var(--ink); }
.post-title a:hover { color: var(--accent); }

/* 아래: 썸네일 + 요약
   - 썸네일 있으면 좌(이미지) + 우(요약) 가로 배치
   - 썸네일 없으면 요약이 자동으로 한 칸 다 차지 */
.post-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.post-thumb-link {
  flex: 0 0 180px;
  display: block;
}
.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
}
.post-desc {
  flex: 1;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* 메타 */
.post-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background 0.15s;
}
.pagination a:hover { background: #f2f2f7; color: var(--ink); }
.pagination .on { background: var(--accent); color: #fff; font-weight: 700; }

/* =========================================================
   글 상세
   ========================================================= */
.article-head { margin-bottom: 32px; }

/* 카테고리 칩 (링크 버전) */
.article-head .post-cat {
  display: inline-block;
  margin-bottom: 8px;
}
.article-head .post-cat a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.article-head .post-cat a:hover { opacity: 0.7; }

.article-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 8px 0 10px;
  line-height: 1.35;
}
.article-meta { font-size: 12.5px; color: var(--ink-soft); }

/* 수정/삭제 어드민 버튼 */
.article-admin {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.article-admin a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 7px;
  background: #f2f2f7;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.article-admin a:hover {
  background: #e8e8ee;
  color: var(--ink);
}

/* 본문 액션(공감 등) */
.article-reaction { margin: 24px 0; }

/* 비밀글 폼 */
.protected-wrap {
  text-align: center;
  padding: 40px 20px;
  background: #fafafa;
  border-radius: 12px;
  margin: 24px 0;
}
.protected-wrap p { color: var(--ink-soft); margin-bottom: 16px; }
.protected-wrap form { display: inline-flex; gap: 6px; }
.protected-wrap input {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
}
.protected-wrap button {
  padding: 8px 16px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.article-body {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink);
  word-break: keep-all;
}
.article-body img { border-radius: 10px; margin: 24px 0; }
.article-body h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; }
.article-body h3 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; }
.article-body p  { margin-bottom: 16px; }
.article-body pre {
  background: #f7f7f8;
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  margin: 20px 0;
}
.article-body code {
  background: #f7f7f8;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13.5px;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  color: var(--ink-soft);
  margin: 20px 0;
}

/* 티스토리가 본문에 자동으로 끼워 넣는 블로거 프로필/관련글 위젯 숨김 */
.article-body .tt_profile_box,
.article-body .profile_box,
.article-body .profile-box,
.article-body .blogger-profile,
.article-body .blogger_profile,
.article-body .tt-profile,
.article-body .tistory_profile,
.article-body .author-card,
.article-body .profile-widget,
.article-body .related-articles,
.article-body .tt_more_articles,
.article-body .another_category,
.article-body .related_post,
.article-body .relatedlist,
.article-body .similarlist,
.article-body #profile,
.article-body #blogProfile,
.article-wrap > .profile,
.article-wrap > .tt_profile_box,
.article-wrap > .blogger-profile,
.article-reaction + .profile,
.article-reaction + .blogger-profile {
  display: none !important;
}

.article-foot { margin-top: 32px; }
.article-tags a {
  display: inline-block;
  margin-right: 8px;
  font-size: 13px;
  text-decoration: none;
  color: var(--accent);
}
.article-tags a:hover { text-decoration: underline; }

/* 이전/다음 */
.post-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 10px;
  background: #fafafa;
  transition: background 0.15s;
}
.post-nav-item:hover { background: #f2f2f7; }
.nav-label {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }

/* =========================================================
   댓글
   ========================================================= */
.comment-wrap {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--line);
}
.comment-title { font-size: 16px; font-weight: 700; margin-bottom: 24px; }
.comment-title span { color: var(--accent); }
.comment-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 32px; }

#cmt_form, .reply_form {
  background: #fafafa;
  border-radius: 12px;
  padding: 20px;
}

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }

  .phone {
    position: static;
    width: auto;
    max-width: 320px;
    height: auto;
    min-height: 0;
    margin: 20px auto 0;
    border-radius: 32px;
  }
  .screen { border-radius: 22px; }
  .screen-profile { padding: 48px 20px 18px; }
  .screen-cats { max-height: 220px; }

  .main {
    margin: 16px 12px 60px;
    padding: 28px 20px 36px;
    height: auto;
    overflow-y: visible;
  }
  .post-body { flex-direction: column; }
  .post-thumb-link { flex: 0 0 auto; width: 100%; }
  .article-title { font-size: 20px; }
}

/* 티스토리 하단 네임카드 숨김 */
html body [data-tistory-react-app="Namecard"] {
  display: none !important;
}

/* =========================================================
   자유 스티커
   ========================================================= */
:root {
  --sticker-1-x: 120px;
  --sticker-1-y: 110px;
  --sticker-1-size: 120px;
  --sticker-1-rotate: -8deg;

  --sticker-2-x: 82vw;
  --sticker-2-y: 120px;
  --sticker-2-size: 140px;
  --sticker-2-rotate: 8deg;

  --sticker-3-x: 86vw;
  --sticker-3-y: 44vh;
  --sticker-3-size: 150px;
  --sticker-3-rotate: -5deg;

  --sticker-4-x: 84vw;
  --sticker-4-y: 76vh;
  --sticker-4-size: 130px;
  --sticker-4-rotate: 6deg;

  --sticker-5-x: 360px;
  --sticker-5-y: 78vh;
  --sticker-5-size: 110px;
  --sticker-5-rotate: -6deg;
}

.sticker-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
}

.sticker {
  position: absolute;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  opacity: 0.96;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.15));
}

.sticker-1 {
  left: var(--sticker-1-x);
  top: var(--sticker-1-y);
  width: var(--sticker-1-size);
  transform: rotate(var(--sticker-1-rotate));
}

.sticker-2 {
  left: var(--sticker-2-x);
  top: var(--sticker-2-y);
  width: var(--sticker-2-size);
  transform: rotate(var(--sticker-2-rotate));
}

.sticker-3 {
  left: var(--sticker-3-x);
  top: var(--sticker-3-y);
  width: var(--sticker-3-size);
  transform: rotate(var(--sticker-3-rotate));
}

.sticker-4 {
  left: var(--sticker-4-x);
  top: var(--sticker-4-y);
  width: var(--sticker-4-size);
  transform: rotate(var(--sticker-4-rotate));
}

.sticker-5 {
  left: var(--sticker-5-x);
  top: var(--sticker-5-y);
  width: var(--sticker-5-size);
  transform: rotate(var(--sticker-5-rotate));
}

.sticker[src=""],
.sticker:not([src]) {
  display: none;
}

@media (max-width: 900px) {
  .sticker-layer {
    display: none;
  }
}

/* 카테고리/검색/태그/아카이브에서는 홈용 article_rep 목록 숨김 */
body#tt-body-category .home-post-item,
body#tt-body-search .home-post-item,
body#tt-body-tag .home-post-item,
body#tt-body-archive .home-post-item {
  display: none !important;
}

/* 글 상세에서는 카테고리/검색 목록 숨김 */
body#tt-body-page .main-head,
body#tt-body-page .post-list {
  display: none !important;
}

/* 목록 페이지에서 혹시 비밀글 폼이 새면 강제 숨김 */
body#tt-body-index .protected-wrap,
body#tt-body-category .protected-wrap,
body#tt-body-search .protected-wrap,
body#tt-body-tag .protected-wrap,
body#tt-body-archive .protected-wrap {
  display: none !important;
}

/* 글 상세 페이지에서는 목록 숨김 */
body#tt-body-page .list-output-guard,
body#tt-body-page .main-head,
body#tt-body-page .post-list {
  display: none !important;
}

/* 목록 페이지에서는 상세 글 숨김 */
body:not(#tt-body-page) .article-wrap {
  display: none !important;
}