/* ==========================================================
   심플 백업 스킨 - style.css
   흰 바탕, 단편 글 읽기에 최적화된 심플한 디자인
   ========================================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: #d6d6d6;
  background-image: radial-gradient(#ffffff 1px, transparent 1px);
  background-size: 16px 16px;
  color: #222222;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: #fbecee;
  color: #333333;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.wrap {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 20px 20px;
  background-color: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: wrap-in 0.5s ease both;
}

@keyframes wrap-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 스크롤바도 톤에 맞춰 은은한 핑크로 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f2f2f2;
}

::-webkit-scrollbar-thumb {
  background: #a7bd97;
  border-radius: 10px;
  border: 2px solid #f2f2f2;
}

html {
  scrollbar-color: #a7bd97 #f2f2f2;
}

/* 홈(카테고리) 화면 편지지에만 아주 은은한 종이 질감 */
body#tt-body-index .wrap {
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* ---------- 헤더 ---------- */

.site-header {
  position: relative;
  padding: 40px 0 24px;
  text-align: left;
  border-bottom: 1px solid #eeeeee;
  margin-bottom: 36px;
}

.site-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.site-title a {
  color: #111111;
  transition: color 0.15s ease;
}

.site-title a:hover {
  color: #ecc7ca;
}

.site-desc {
  margin: 0 0 16px;
  color: #888888;
  font-size: 13px;
  font-weight: 300;
}

.site-nav {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

.site-nav a {
  font-size: 12px;
  font-weight: 300;
  color: #999999;
  border: 1px solid #dddddd;
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.15s ease;
}

.site-nav a:hover {
  color: #111111;
  border-color: #bbbbbb;
}

/* 홈 화면에서는 기존 이름/설명 텍스트를 숨기고, 프로필 카드로 대체합니다 */
body#tt-body-index .site-title,
body#tt-body-index .site-desc {
  display: none;
}

body#tt-body-index .site-header {
  padding: 8px 0 22px;
}

/* ---------- 홈 화면 전용: 인사말 ---------- */

.home-intro {
  display: none;
}

body#tt-body-index .home-intro {
  display: block;
  padding-top: 4px;
}

.home-greeting {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #333333;
}

/* ---------- 프로필 사각형 (홈/카테고리/글 화면 모두에서 계속 떠 있음) ---------- */
/* .page-shell을 항상(모바일 포함) flex로 두어 aside가 편지(.wrap)
   옆에 나란히 붙게 합니다. aside(프로필 카드 + 세로 사진)는 자기
   자신의 폭과 고정 비율(aspect-ratio)만으로 높이가 정해지기 때문에,
   .wrap의 실제 내용(본문 길이, 카테고리 개수 등)과는 완전히 무관하게
   항상 똑같은 크기로 보입니다 — 홈/카테고리/본문 어디를 가도 동일. */

.page-shell {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  max-width: 794px;
  margin: 0 auto;
  padding: 0 10px;
}

.page-shell .wrap {
  flex: 1 1 auto;
  min-width: 0;
  margin: 24px 0;
}

@media (min-width: 1000px) {
  .page-shell {
    gap: 22px;
    padding: 0;
  }

  .page-shell .wrap {
    flex: 0 1 700px;
    margin: 40px 0;
  }
}

/* aside(프로필 카드 + 세로 사진들)가 옆의 편지(.wrap)와 정확히 같은
   높이를 갖도록: 위쪽 프로필 카드만 자기 크기를 유지하고, 아래
   두 장의 세로 사진이 flex:1로 남는 공간을 나눠 가지면서
   object-fit: cover로 알아서 잘려서 채웁니다. 그래서 페이지(홈/
   카테고리/본문)가 달라져 편지 높이가 바뀌어도 항상 딱 맞고,
   위아래로 남거나 튀어나가지 않습니다. */

.site-profile-float {
  display: none;
  flex-direction: column;
  position: sticky;
  top: 18px;
  align-self: stretch;
  flex: 0 0 52px;
  width: 52px;
  max-height: calc(100vh - 36px);
  gap: 6px;
  margin-top: 24px;
}

/* 기본은 숨김, 홈 화면(tt-body-index)에서만 사이드바(프로필 카드 등
   세 가지 디자인 요소)를 보여줍니다. 카테고리 글 목록/본문 페이지에서는
   메인 레이아웃만 보이도록 합니다. */
body#tt-body-index .site-profile-float {
  display: flex;
}

/* 프로필 카드: 탭하면 3D로 뒤집히면서 뒷면의 짧은 메시지가 보입니다 */
.site-profile-float .profile-card {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  perspective: 500px;
}

.profile-card-flip {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.45, 0.15, 0.2, 1);
}

.site-profile-float .profile-card.is-flipped .profile-card-flip {
  transform: rotateY(180deg);
}

.profile-card-face {
  position: relative;
  background: #ffffff;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.09);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.profile-card-front {
  position: relative;
}

.profile-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: #f0efea;
}

/* ---------- 카드 뒷면: 우표 디자인 ---------- */

/* 톱니(perforation) 가장자리: 네 방향에서 반원을 파내 우표 모양을 만듭니다 */
.stamp {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fdfdfb;
  --perf: 2.5px;
  --gap: 7px;
  -webkit-mask-image:
    radial-gradient(circle var(--perf) at 50% 0, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 50% 100%, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 0 50%, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 100% 50%, transparent 97%, #000 100%);
  -webkit-mask-size: var(--gap) 100%, var(--gap) 100%, 100% var(--gap), 100% var(--gap);
  -webkit-mask-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  -webkit-mask-position: 50% 0, 50% 100%, 0 50%, 100% 50%;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle var(--perf) at 50% 0, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 50% 100%, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 0 50%, transparent 97%, #000 100%),
    radial-gradient(circle var(--perf) at 100% 50%, transparent 97%, #000 100%);
  mask-size: var(--gap) 100%, var(--gap) 100%, 100% var(--gap), 100% var(--gap);
  mask-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  mask-position: 50% 0, 50% 100%, 0 50%, 100% 50%;
  mask-composite: intersect;
}

/* 우표 안쪽의 얇은 프레임 */
.stamp-inner {
  position: absolute;
  inset: 5px;
  border: 1px solid #d5d3cc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stamp-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35) contrast(0.95) brightness(1.06);
  opacity: 0.9;
}

/* 소인(동그란 도장) */
.stamp-postmark {
  position: absolute;
  top: 8%;
  right: 6%;
  width: 46%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(120, 125, 115, 0.75);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5px;
  color: rgba(110, 116, 106, 0.85);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1;
  text-align: center;
}

.stamp-postmark-top,
.stamp-postmark-bot {
  font-size: 3px;
  letter-spacing: 0.04em;
}

.stamp-postmark-mid {
  font-size: 3.4px;
  font-style: italic;
  border-top: 0.5px solid rgba(120, 125, 115, 0.6);
  border-bottom: 0.5px solid rgba(120, 125, 115, 0.6);
  padding: 0.8px 0;
  margin: 0.8px 0;
}

/* 액면가 */
.stamp-value {
  position: absolute;
  left: 7%;
  bottom: 6%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  color: #6f746a;
}

/* 상단 국가명 자리 */
.stamp-country {
  position: absolute;
  top: 5%;
  left: 7%;
  max-width: 44%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  color: #7c8177;
}

/* 손글씨 느낌의 문구 */
.stamp-note {
  position: absolute;
  right: 6%;
  bottom: 7%;
  max-width: 62%;
  font-style: italic;
  font-weight: 300;
  font-size: 4.6px;
  line-height: 1.45;
  text-align: right;
  color: #5f645c;
  word-break: keep-all;
}

.site-profile-float .profile-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f2f2;
}

.site-profile-float .profile-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-profile-float .profile-card-caption {
  padding: 6px 8px 8px;
  text-align: left;
  border-top: 1px solid #f0f0f0;
}

.site-profile-float .profile-card-title {
  margin: 0 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 9.5px;
  color: #222222;
  line-height: 1.25;
}

.site-profile-float .profile-card-desc {
  margin: 0;
  font-size: 8px;
  color: #aaaaaa;
}

/* 프로필 카드 아래에 오는 세로로 긴 사진들.
   기본(카테고리/본문 페이지)은 고정 비율이라 페이지가 바뀌어도,
   본문이 길어져도 절대 크기가 변하지 않습니다.
   홈 화면에서만 편지(.wrap) 높이에 맞춰 늘어나도록 별도로 처리합니다 */
.profile-float-extra {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 3 / 7;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.09);
}

.profile-float-extra img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 새로 추가한 두번째 세로 박스: 더 길게 + 각진 사각 모서리로 구분 */
.profile-float-extra2 {
  aspect-ratio: 3 / 11;
  border-radius: 0;
}

/* 프로필 카드 바로 아래 사진: 탭하면 사진 위로 흰 글씨(시)가 페이드인 */
.profile-float-poem {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.poem-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 9%;
  opacity: 0;
  transition: opacity 0.6s ease;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.profile-float-poem.is-revealed .poem-overlay {
  opacity: 1;
}

.poem-text {
  font-weight: 300;
  font-style: italic;
  font-size: 5px;
  line-height: 1.7;
  text-align: left;
  word-break: keep-all;
}

.poem-source {
  align-self: flex-end;
  margin-top: auto;
  padding-top: 8px;
  font-weight: 300;
  font-style: italic;
  font-size: 5px;
  text-align: right;
  white-space: nowrap;
}

/* 세번째 사진: 탭하면 글자를 눕혀 세로로 읽는 워드마크가 나타남.
   scale로 글자 자체를 세로로 늘리고 가로로 압축한 뒤 90도 돌려서
   이미지를 위아래로 꽉 채웁니다 */
.profile-float-word {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.word-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.85, 2.4);
  transform-origin: center;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.profile-float-word.is-revealed .word-overlay {
  opacity: 1;
}

/* 홈 화면 전용: 고정 비율 대신 남는 세로 공간을 나눠 가지며 채우기 */
body#tt-body-index .profile-float-extra {
  flex: 1 1 0;
  aspect-ratio: auto;
  min-height: 60px;
}

@media (min-width: 1000px) {
  .site-profile-float {
    top: 40px;
    flex: 0 0 72px;
    width: 72px;
    max-height: calc(100vh - 80px);
    gap: 10px;
    margin-top: 40px;
  }
}

/* 홈 화면에서는 sticky/화면높이 제한을 풀어, aside 높이가 화면이 아니라
   옆의 편지(.wrap) 높이에 정확히 맞춰지도록 합니다. 그래서 홈에서는
   위아래로 튀어나가지도, 공백이 남지도 않습니다. 카테고리/본문 페이지는
   기존 동작(스크롤 따라다니는 sticky)을 그대로 유지합니다. */
body#tt-body-index .site-profile-float {
  position: static;
  max-height: none;
  margin-top: 24px;
}

@media (min-width: 1000px) {
  body#tt-body-index .site-profile-float {
    margin-top: 40px;
  }
}

/* ---------- 홈 화면: 카테고리 ---------- */

/* 기본은 숨김, 홈 화면(tt-body-index)에서만 카테고리를 보여줍니다 */
.category-home {
  display: none;
}

body#tt-body-index .category-home {
  display: block;
}

/* 홈 화면에서는 글 목록과 페이징을 숨깁니다 */
body#tt-body-index .post-list,
body#tt-body-index .paging {
  display: none;
}

/* 글 목록 화면(카테고리/태그/검색 등)에서는 "전체 카테고리" 링크만 보여줍니다 */
.all-category-link {
  display: none;
  margin-bottom: 20px;
  font-size: 13px;
  color: #999999;
}

body:not(#tt-body-index) .all-category-link {
  display: inline-block;
}

.category-heading {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 300;
  color: #999999;
  letter-spacing: 0.04em;
}

.category-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: none;
  text-align: left;
}

.category-list li {
  margin: 0;
  border-bottom: none;
}

.category-list a {
  position: relative;
  display: block;
  padding: 10px 4px 14px;
  font-size: 13px;
  font-weight: 400;
  color: #333333;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}

.category-list a::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 6px;
  height: 1px;
  background: #dddddd;
}

.category-list a::before {
  content: "♡";
  display: inline-block;
  width: 0;
  margin-right: 0;
  color: #ecc7ca;
  font-size: 11px;
  opacity: 0;
  overflow: hidden;
  vertical-align: middle;
  transition: width 0.15s ease, margin-right 0.15s ease, opacity 0.15s ease;
}

.category-list a:hover {
  color: #000000;
}

.category-list a:hover::before {
  width: 12px;
  margin-right: 4px;
  opacity: 1;
}

.category-list a:hover::after {
  background: #ecc7ca;
}

/* 터치 기기에서는 hover 애니메이션 대신 하트를 항상 온전히 표시 (잘려 보이는 것 방지) */
@media (hover: none) {
  .category-list a::before {
    width: 12px;
    margin-right: 4px;
    opacity: 1;
  }
}

/* 최상위(메인) 카테고리: 제일 윗줄에 살짝 더 굵게 */
.category-list > ul > li > a {
  padding-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.category-list > ul > li > a::before {
  content: none;
}

/* 하위 카테고리들: 왼쪽 정렬된 줄글처럼, 편지지 줄처럼 길게 통일 */
.category-list li ul {
  margin-top: 14px;
  padding-left: 0;
  border-top: none;
}

.category-list li ul a {
  padding: 10px 4px 14px;
  font-size: 13px;
  font-weight: 400;
  color: #333333;
}

/* ---------- 홈 화면: 카테고리 아래 작은 검색 ---------- */

.home-search {
  margin-top: 18px;
}

.home-search-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #b3b3b3;
  cursor: pointer;
}

.home-search-toggle:hover {
  color: #888888;
}

.home-search-box {
  display: none;
  margin-top: 8px;
}

.home-search-box.is-open {
  display: block;
}

.home-search-input {
  width: 100%;
  max-width: 220px;
  padding: 6px 2px;
  border: none;
  border-bottom: 1px solid #dddddd;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: #333333;
}

.home-search-input:focus {
  outline: none;
  border-bottom-color: #a7bd97;
}

.home-search-input::placeholder {
  color: #cccccc;
}

/* ---------- 글 목록 (카테고리 클릭 후) ---------- */

.post-item {
  border-bottom: none;
  padding: 22px 0;
}

.post-item:first-child {
  padding-top: 0;
}

.post-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  transition: transform 0.18s ease;
}

.post-link:hover {
  transform: translateX(3px);
}

.post-thumb,
.post-item-summary {
  display: none;
}

.post-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.post-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111111;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.post-link:hover .post-item-title {
  color: #ecc7ca;
}

.post-item-date {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #aaaaaa;
}

/* ---------- 글 본문 (개별 글) ---------- */

.post-full {
  padding: 8px 0 12px;
}

.post-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111111;
}

.post-meta {
  margin-bottom: 30px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e8e8e8;
}

.post-date {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #aaaaaa;
}

.post-content {
  font-size: 13.5px;
  line-height: 1.75;
  color: #2a2a2a;
  word-break: keep-all;
}

.post-content p {
  margin: 0 0 1.1em;
}

.post-content img {
  margin: 1.6em auto;
  border-radius: 6px;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: 1.6em 0 0.6em;
  line-height: 1.4;
}

.post-content blockquote {
  margin: 1.4em 0;
  padding: 4px 18px;
  border-left: 3px solid #f3d9db;
  color: #666666;
}

.post-content a {
  color: #d99aa0;
  text-underline-offset: 2px;
  text-decoration: underline;
  text-decoration-color: #ecc7ca;
  transition: color 0.15s ease;
}

.post-content a:hover {
  color: #c97a82;
}

/* 티스토리가 기본으로 넣는 가운데 정렬을 왼쪽으로 */
.post-content [data-ke-type="moreLess"] {
  text-align: left !important;
}

/* 티스토리 에디터가 자동으로 넣는 "더보기/닫기" 버튼을
   텍스트 대신 화살표 아이콘으로 표시합니다 */
.post-content [data-ke-type="moreLess"] .btn-toggle-moreless {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 28px 0 4px;
  padding: 0;
  overflow: hidden;
  background: #fdfdfb;
  border: 1px solid #ececec;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

/* 버튼 자신과 그 안의 모든 자식(글자를 담은 span 등)의 글자를
   전부 강제로 숨깁니다 */
.post-content [data-ke-type="moreLess"] .btn-toggle-moreless,
.post-content [data-ke-type="moreLess"] .btn-toggle-moreless * {
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
}

.post-content [data-ke-type="moreLess"] .btn-toggle-moreless::after {
  content: "⌄";
  display: block;
  font-size: 15px !important;
  line-height: 1 !important;
  color: #a7bd97 !important;
  transition: color 0.2s ease, transform 0.25s ease;
}

.post-content [data-ke-type="moreLess"] .btn-toggle-moreless:hover {
  border-color: #ecc7ca;
}

.post-content [data-ke-type="moreLess"] .btn-toggle-moreless:hover::after {
  color: #ecc7ca !important;
}

.post-content [data-ke-type="moreLess"] .btn-toggle-moreless.is-open::after {
  transform: rotate(180deg);
}

/* 글이 끝나는 지점에 놓는 작은 마무리 표시 */
.post-end {
  margin: 46px 0 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: #d5ddcc;
}

/* ---------- 글 아래 이전 편지 / 다음 편지 ---------- */

.post-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 34px 0 4px;
  background: #ededed;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
}

.post-nav:empty {
  display: none;
}

.post-nav-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  transition: background 0.18s ease;
}

.post-nav-item:hover {
  background: #fbfbf9;
}

.post-nav-prev {
  justify-content: flex-start;
}

.post-nav-next {
  justify-content: flex-end;
  text-align: right;
}

.post-nav-arrow {
  flex: 0 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 16px;
  color: #a7bd97;
}

.post-nav-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #555555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s ease;
}

.post-nav-item:hover .post-nav-title {
  color: #111111;
}

/* ---------- 맨 위로 버튼 ---------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13px;
  color: #8a9a7c;
  background: #ffffff;
  border: 1px solid #e2e6dd;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease,
    background 0.18s ease, color 0.18s ease;
  z-index: 60;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: #f4f7f0;
  color: #6f8060;
}

@media (max-width: 480px) {
  .to-top {
    right: 12px;
    bottom: 16px;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .post-nav-item {
    flex-direction: column;
    gap: 4px;
  }
}

/* ---------- 홈 상단 아이콘 버튼 (프로필 / 공지) & 팝업 ---------- */

.header-icons {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  align-items: flex-start;
  gap: 14px;
}

body#tt-body-index .header-icons {
  display: flex;
  top: 8px;
}

.icon-with-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.icon-label {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #cccccc;
  line-height: 1;
}

.music-btn,
.profile-btn,
.notice-btn,
.dm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: #cccccc;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.profile-btn {
  font-size: 14px;
}

.music-btn:hover,
.profile-btn:hover,
.notice-btn:hover,
.dm-btn:hover {
  color: #ecc7ca;
  transform: scale(1.1);
}

.notice-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 100;
}

.notice-modal.is-open {
  display: flex;
}

.notice-modal-inner {
  position: relative;
  width: 100%;
  max-width: 320px;
  max-height: min(70vh, 560px);
  padding: 0 0 26px;
  background: #ffffff;
  border-radius: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.notice-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f3f3f3;
}

.notice-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.notice-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  color: #666666;
  cursor: pointer;
  z-index: 1;
}

.notice-close:hover {
  color: #111111;
}

.notice-title {
  margin: 20px 24px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbbbbb;
}

.notice-body {
  margin: 0 24px;
  padding-top: 12px;
  border-top: 1px dashed #eaeaea;
  font-size: 14px;
  line-height: 1.8;
  color: #444444;
  word-break: keep-all;
}

.profile-modal-inner {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(70vh, 560px);
  background: #ffffff;
  border-radius: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

/* 카드 모서리의 ㄴ자(직각 브라켓) 장식. 두껍고 끝이 둥근 선 두 개가
   직각으로 만나 코너 브라켓 모양을 만듭니다 */
.profile-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  z-index: 2;
  pointer-events: none;
}

.profile-corner::before,
.profile-corner::after {
  content: "";
  position: absolute;
  background: #c7c7c7;
  border-radius: 999px;
}

.profile-corner::before {
  height: 4px;
}

.profile-corner::after {
  width: 4px;
}

.profile-corner-tl {
  top: 8px;
  left: 8px;
}

.profile-corner-tl::before {
  top: 0;
  left: 0;
  width: 13px;
}

.profile-corner-tl::after {
  top: 0;
  left: 0;
  height: 13px;
}

.profile-corner-br {
  bottom: 8px;
  right: 8px;
}

.profile-corner-br::before {
  bottom: 0;
  right: 0;
  width: 13px;
}

.profile-corner-br::after {
  bottom: 0;
  right: 0;
  height: 13px;
}

.profile-modal-row {
  display: flex;
  align-items: stretch;
  gap: 4%;
  padding: 28px;
}

/* 정사각형에 가까운 사진. object-fit:cover라 원본 비율이 정확히
   1:1이 아니어도 항상 정사각형으로 잘려서 보입니다 */
.profile-photo-box {
  flex: 0 0 46%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #f2f2f2;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 텍스트 칸: 옆 사진 박스와 같은 높이(정사각형 높이)를 그대로 이어받고
   그 안에서 세로 중앙 정렬됩니다 → 사진 세로폭 = 글씨 영역 세로폭 */
.profile-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 11px;
  line-height: 1.8;
  color: #999999;
  word-break: keep-all;
}

.profile-body p {
  margin: 0 0 6px;
}

.profile-divider {
  display: block;
  width: 100%;
  height: 3px;
  margin: 0 0 10px;
  background: #d6d6d6;
  border-radius: 3px;
}

.profile-name {
  font-size: 13px;
  color: #777777;
  margin-bottom: 6px;
}

.profile-account {
  margin-bottom: 0 !important;
}

.profile-note {
  margin-top: 2px;
  font-size: 8px;
  line-height: 1.6;
  color: #b3b3b3;
}

.profile-sub {
  font-size: 8.5px;
  color: #bbbbbb;
}

.profile-account-label {
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: #bbbbbb;
}

.profile-body a {
  color: #cccccc;
  text-decoration: none;
  transition: color 0.15s ease;
}

.profile-body a:hover {
  color: #ecc7ca;
}

/* ---------- 메시지(DM) 팝업: 라이트 메시지앱 느낌, 말풍선이 하나씩 순서대로 등장 ---------- */

.dm-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 110;
  overflow-y: auto;
}

.dm-modal.is-open {
  display: flex;
}

.dm-modal-inner {
  width: 100%;
  max-width: 320px;
  max-height: min(60vh, 440px);
  max-height: min(60dvh, 440px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3);
  animation: dmFadeIn 0.25s ease both;
}

@keyframes dmFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 상단 헤더: 뒤로가기 / 아바타 / 이름 */
.dm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex: 0 0 auto;
}

.dm-back {
  font-size: 20px;
  color: #cfcfcf;
  line-height: 1;
}

.dm-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a1a1a;
  flex: 0 0 auto;
}

.dm-name {
  font-size: 14px;
  font-weight: 600;
  color: #222222;
}

.dm-header-chevron {
  font-size: 13px;
  color: #cccccc;
}

/* 말풍선 영역: 헤더/입력바를 뺀 나머지 공간만 차지하고, 넘치면 이 안에서만 스크롤됩니다 */
.dm-messages {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dm-bubble {
  max-width: 76%;
  margin: 0;
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #222222;
  word-break: keep-all;
  opacity: 0;
  transform: translateY(8px);
  animation: dmBubbleIn 0.4s ease forwards;
}

@keyframes dmBubbleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dm-messages .dm-bubble:nth-child(1) { animation-delay: 0.1s; }
.dm-messages .dm-bubble:nth-child(2) { animation-delay: 0.32s; }
.dm-messages .dm-bubble:nth-child(3) { animation-delay: 0.54s; }
.dm-messages .dm-bubble:nth-child(4) { animation-delay: 0.76s; }
.dm-messages .dm-bubble:nth-child(5) { animation-delay: 0.98s; }
.dm-messages .dm-bubble:nth-child(6) { animation-delay: 1.2s; }
.dm-messages .dm-bubble:nth-child(7) { animation-delay: 1.42s; }
.dm-messages .dm-bubble:nth-child(8) { animation-delay: 1.64s; }
.dm-messages .dm-bubble:nth-child(n+9) { animation-delay: 1.86s; }

.dm-bubble-them {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  border-bottom-left-radius: 6px;
}

.dm-bubble-me {
  align-self: flex-end;
  background: #dbe8d2;
  border-bottom-right-radius: 6px;
}

/* 하단 입력창(장식용) */
.dm-input-bar {
  flex: 0 0 auto;
  padding: 12px 16px 16px;
  border-top: 1px solid #f0f0f0;
}

.dm-input-placeholder {
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #b8b8b8;
  font-size: 12.5px;
}

/* ---------- 홈 진입 시 닫힌 편지지(봉투) 연출 ---------- */

.letter-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
  background-color: #d6d6d6;
  background-image: radial-gradient(#ffffff 1px, transparent 1px);
  background-size: 16px 16px;
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body#tt-body-index .letter-gate {
  display: flex;
}

.letter-gate.is-open {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.letter-gate.no-anim {
  transition: none;
}

.letter-gate-inner {
  text-align: center;
}

.envelope {
  position: relative;
  width: 96px;
  height: 66px;
  margin: 0 auto 16px;
  background: #ffffff;
  border: 1px solid #bbbbbb;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.letter-gate:hover .envelope {
  transform: translateY(-3px) rotate(-1deg);
}

.envelope::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 34px;
  background: #f2f2f2;
  border: 1px solid #bbbbbb;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* ---------- 비밀번호가 걸린 보호 글 ---------- */

.protected-box {
  padding: 22px 0 6px;
  border-top: 1px dashed #e6e6e6;
  margin-top: 18px;
}

.protected-desc {
  margin: 0 0 18px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: #999999;
}

.protected-desc::before {
  content: "✦ ";
  color: #a7bd97;
  font-style: normal;
}

.protected-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 0;
  max-width: 280px;
}

.protected-form input[type="password"] {
  flex: 1;
  min-width: 0;
  padding: 6px 2px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: #333333;
  background: transparent;
  border: none;
  border-bottom: 1px solid #dddddd;
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s ease;
}

.protected-form input[type="password"]:focus {
  border-bottom-color: #a7bd97;
}

.protected-form input[type="password"]::placeholder {
  letter-spacing: 0;
  color: #cccccc;
}

.protected-submit {
  flex: 0 0 auto;
  padding: 0 0 6px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #999999;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.protected-submit:hover {
  color: #ecc7ca;
  border-bottom-color: #ecc7ca;
}

/* ---------- 목록으로 돌아가기 ---------- */

.back-to-list {
  display: inline-block;
  margin: 24px 0 8px;
  font-size: 12px;
  color: #999999;
  transition: color 0.15s ease, transform 0.15s ease;
}

.back-to-list:hover {
  color: #d99aa0;
  transform: translateX(-2px);
}

/* 티스토리에서 자동으로 넣는 공감/좋아요/공유/구독/방명록 등 부가 위젯 숨김 */
.link_sympathy,
.area_sns,
.area_sns_btn,
.btn_sympathy,
.btn_sympathy_wrap,
.tt_sympathy_wrap,
.item_sympathy,
.container_postbtn,
.area_guestbook,
#guestbook,
.guestbook,
[class*="sympathy" i],
[class*="recommend" i],
[class*="_share" i],
[class*="share_" i],
[class*="shareBtn" i],
[class*="sns_" i],
[class*="_sns" i],
[class*="subscribe" i],
[class*="tistorySubscribe" i],
[class="#subscribe"],
[id*="sympathy" i],
[id*="share" i],
[id*="subscribe" i],
[id*="guestbook" i],
.area_related,
.tit_related,
.list_related,
[class*="related" i] {
  display: none !important;
}

/* ---------- 페이징 ---------- */

.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 40px 0;
  font-size: 12px;
  color: #999999;
}

.paging-nums {
  display: flex;
  gap: 10px;
}

.paging-num {
  color: #999999;
}

.paging-num:hover {
  color: #111111;
}

.paging-arrow.on {
  color: #cccccc;
  pointer-events: none;
}

/* ---------- 푸터 ---------- */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  padding: 40px 0 30px;
  color: #cccccc;
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.from-mark {
  align-self: flex-end;
  font-size: 13px;
  font-style: italic;
  color: #b5b5b5;
  letter-spacing: 0.02em;
}

.site-mark {
  text-align: center;
  color: #999999;
  font-size: 11px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.site-mark:hover {
  color: #666666;
}

/* 특수기호를 누르면 나타나는 P.S. 한 줄. 평소엔 접혀 있다가
   부드럽게 펼쳐지며 나타납니다 */
.ps-note {
  max-height: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  text-align: center;
  font-weight: 300;
  font-size: 11px;
  line-height: 1.6;
  color: #aaaaaa;
  word-break: keep-all;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.ps-note.is-open {
  max-height: 60px;
  margin-top: 10px;
  opacity: 1;
}

.ps-label {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  margin-right: 4px;
  color: #bbbbbb;
}

/* ---------- 홈 화면 글씨 크기만 축소 ---------- */

body#tt-body-index .site-title {
  font-size: 17px;
}

body#tt-body-index .site-desc {
  font-size: 11px;
}

body#tt-body-index .site-nav a {
  font-size: 11px;
  padding: 4px 12px;
}

body#tt-body-index .category-heading {
  font-size: 12px;
}

body#tt-body-index .category-list a {
  font-size: 12px;
}

body#tt-body-index .site-footer {
  font-size: 11px;
}

/* ---------- 아이패드 등 태블릿 대응 (모바일도 데스크탑도 아닌 구간) ---------- */
/* 아이패드는 가로 모드에서 1000px을 넘어 데스크탑 구간에 들어가기 때문에,
   화면 높이가 낮은 기기까지 확실히 커버하도록 범위를 넓게 잡습니다.
   DM 팝업이 세로로 길어져 위/아래가 잘리는 것을 막습니다 */

@media (min-width: 481px) and (max-width: 1366px) {
  .dm-modal-inner {
    max-height: min(56vh, 420px);
    max-height: min(56dvh, 420px);
  }

  .dm-messages {
    padding: 14px 16px;
    gap: 7px;
  }
}

/* 화면 높이 자체가 낮은 기기(가로 모드 등)에서는 한 번 더 줄입니다 */
@media (max-height: 820px) {
  .dm-modal-inner {
    max-height: min(58vh, 380px);
    max-height: min(58dvh, 380px);
  }
}

/* ---------- 모바일 대응 ---------- */

@media (max-width: 480px) {
  .wrap {
    padding: 0 14px;
  }

  .site-profile-float {
    flex: 0 0 60px;
    width: 60px;
  }

  /* 모바일에서는 왼쪽 사진들이 짧아 보여서, 최소 높이를 키워 더 길게 */
  .profile-float-extra {
    min-height: 130px;
  }

  /* 두번째 사진의 시 본문 줄간격(세로폭)만 줄임 (출처 문구는 그대로) */
  .poem-text {
    line-height: 1.05;
  }

  .notice-title {
    margin: 16px 18px 10px;
    font-size: 11px;
  }

  .notice-body {
    margin: 0 18px;
    font-size: 12px;
    line-height: 1.7;
  }

  .dm-modal {
    padding: 16px 12px;
  }

  .dm-modal-inner {
    max-height: min(62vh, 440px);
    max-height: min(62dvh, 440px);
    border-radius: 20px;
  }

  .dm-header {
    padding: 11px 14px;
  }

  .dm-messages {
    padding: 14px 14px;
    gap: 7px;
  }

  .dm-bubble {
    font-size: 12.5px;
    padding: 9px 13px;
  }

  .dm-input-bar {
    padding: 9px 14px 12px;
  }

  .site-header {
    padding: 40px 0 24px;
  }

  .post-thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
  }

  .post-title {
    font-size: 17px;
  }

  .post-content {
    font-size: 12.5px;
    line-height: 1.7;
  }

  .post-item-title {
    font-size: 14px;
  }

  .post-item-date {
    font-size: 12px;
  }

  .post-date {
    font-size: 11px;
  }

  .site-title {
    font-size: 18px;
  }

  .site-desc {
    font-size: 12px;
  }

  body#tt-body-index .site-title {
    font-size: 15px;
  }

  body#tt-body-index .site-desc {
    font-size: 11px;
  }

  .home-greeting {
    font-size: 12px;
  }

  .category-heading {
    font-size: 11px;
  }

  .category-list a {
    font-size: 12px;
  }

  body#tt-body-index .category-list a {
    font-size: 11px;
  }

  .category-list > ul > li > a {
    font-size: 13px;
  }

  .category-list li ul a {
    font-size: 12px;
  }

  .site-profile-float .profile-card-title {
    font-size: 8.5px;
  }

  .site-profile-float .profile-card-desc {
    font-size: 7px;
  }

  /* 모바일에서는 카드가 작아 톱니도 조금 촘촘하게 */
  .stamp {
    --perf: 2px;
    --gap: 5.5px;
  }

  .stamp-inner {
    inset: 4px;
  }

  .profile-modal-row {
    padding: 20px;
    gap: 3%;
  }

  .profile-corner {
    width: 16px;
    height: 16px;
  }

  .profile-corner-tl {
    top: 6px;
    left: 6px;
  }

  .profile-corner-br {
    bottom: 6px;
    right: 6px;
  }

  .profile-corner-tl::before,
  .profile-corner-br::before {
    width: 9px;
  }

  .profile-corner-tl::after,
  .profile-corner-br::after {
    height: 9px;
  }

  .profile-body {
    font-size: 9px;
  }

  .profile-name {
    font-size: 11px;
  }

  .profile-note {
    font-size: 7px;
  }

  .paging,
  .back-to-list,
  .all-category-link {
    font-size: 11px;
  }

  .site-footer {
    font-size: 10px;
  }

  .from-mark {
    font-size: 12px;
  }

  .site-mark {
    font-size: 10px;
  }

  .ps-note {
    font-size: 10px;
  }
}

/* 아주 좁은 화면에서는 사이드 폭을 살짝 더 줄여 편지가 읽기 편한 폭을 확보합니다 */
@media (max-width: 360px) {
  .page-shell {
    gap: 10px;
    padding: 0 8px;
  }

  .site-profile-float {
    flex-basis: 50px;
    width: 50px;
    gap: 5px;
  }
}
