/* sionth.xyz 공통 스타일 (메인, 프로젝트, 블로그, 관리자) */

:root {
  --ink: #121212;
  --title: #343434;
  --text: #565656;
  --muted: #999999;
  --off: #aaaaaa;
  --line: #e4e6eb;
  --paper: rgba(255, 255, 255, 0.95);
  --accent: #3d5a80;
  --danger: #c0392b;
  --font: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-logo: "Kdam Thmor Pro", var(--font);
  --radius: 14px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

/* 아래쪽 도시 실루엣 배경. 화면에 고정돼서 긴 글을 내려도 그대로 있다 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #fff url("/assets/img/bg_2.jpg") no-repeat center bottom / cover;
}

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

img {
  max-width: 100%;
}

.page {
  width: 80%;
  max-width: 1500px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

/* ── 상단 메뉴 ───────────────────────────── */

.menu-bar {
  display: flex;
  align-items: center;
  gap: 3%;
  padding-top: 30px;
  min-height: 100px;
}

.logo {
  font-family: var(--font-logo);
  font-size: 36px;
  line-height: 1;
  color: var(--title);
  white-space: nowrap;
}

.menu {
  flex: 1;
  display: flex;
  justify-content: space-around;
  gap: 12px;
  padding: 0 3%;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.menu a {
  color: var(--title);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.menu a:hover,
.menu a.current {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.off {
  color: var(--off);
  cursor: default;
}

.icons {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 700;
}

.lang {
  color: var(--off);
  cursor: default;
}

.lang.on {
  color: var(--title);
}

.sns img {
  display: block;
  width: 32px;
  height: 32px;
}

.sns.wide img {
  width: 38px;
}

/* ── 메인 ────────────────────────────────── */

.quick h2 {
  margin: 20px 0;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
}

.quick ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick li {
  margin: 5px 0;
  color: var(--text);
}

.quick li.off {
  color: var(--off);
}

.quick a:hover {
  color: var(--ink);
}

.chevron {
  vertical-align: -1px;
}

.hero {
  width: 60%;
  margin: 70px auto 60px;
}

.hero h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  color: var(--ink);
}

.description {
  margin: 10px 0 0 5px;
  font-size: 16px;
  color: var(--muted);
}

.recent {
  margin-top: 48px;
  max-width: 520px;
}

.recent h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.recent ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent li a {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--title);
}

.recent li a:hover .recent-title {
  color: var(--ink);
  text-decoration: underline;
}

.recent-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent time {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--muted);
}

.more {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text);
}

.more:hover {
  color: var(--ink);
}

/* ── 프로젝트 ────────────────────────────── */

.project {
  max-width: 40%;
  min-width: 300px;
}

.project h1 {
  margin: 0 0 12px;
  font-size: 40px;
  color: var(--ink);
}

.project p {
  margin: 0;
}

.initial {
  font-size: larger;
}

/* ── 아래 문구 ───────────────────────────── */

.site-footer {
  padding: 48px 0 40px;
  text-align: center;
  color: #444a52;
}

.site-footer p {
  margin: 4px 0;
}

.admin-links {
  font-size: 14px;
}

.admin-links a:hover {
  text-decoration: underline;
}

/* ── 블로그 ──────────────────────────────── */

.paper {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 40px 48px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.05), 0 10px 32px rgba(20, 30, 50, 0.07);
}

.paper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.paper h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.3;
  color: var(--ink);
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  border-bottom: 1px solid var(--line);
}

.post-list a {
  display: block;
  padding: 24px 0;
}

.post-list h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
}

.post-list a:hover h2 {
  text-decoration: underline;
}

.post-list p {
  margin: 0 0 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-list time,
.post-meta {
  font-size: 14px;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  font-size: 15px;
}

.pager a:hover {
  color: var(--ink);
}

.pager-now {
  color: var(--muted);
}

.notice {
  margin: 0 0 24px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff6e0;
  color: #8a6100;
  font-size: 14px;
}

.post-head {
  margin-bottom: 32px;
}

.post-meta {
  margin: 10px 0 0;
}

.post-meta a {
  color: var(--accent);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.post-nav a {
  display: block;
  color: var(--title);
}

.post-nav a:hover {
  color: var(--ink);
}

.post-nav span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.post-nav .older {
  grid-column: 2;
  text-align: right;
}

.back {
  margin: 32px 0 0;
  font-size: 15px;
}

.back a:hover {
  color: var(--ink);
}

.message {
  text-align: center;
}

.message p {
  margin: 16px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--title);
  border-radius: 999px;
  background: var(--title);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button.ghost {
  background: transparent;
  color: var(--title);
  border-color: #cfd3da;
}

.button.ghost:hover {
  border-color: var(--title);
}

.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: #e8c4bf;
}

.button.danger:hover {
  border-color: var(--danger);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── 글 본문 (블로그와 에디터가 같이 쓴다) ── */

.prose {
  font-size: 17px;
  line-height: 1.85;
  color: #2b2b2b;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  line-height: 1.4;
  margin: 1.8em 0 0.6em;
}

.prose h2 {
  font-size: 1.6em;
}

.prose h3 {
  font-size: 1.3em;
}

.prose h4 {
  font-size: 1.1em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose img {
  display: block;
  height: auto;
  margin: 1.4em auto;
  border-radius: 8px;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

.prose li > p {
  margin: 0.2em 0;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 4px solid #cfd6e0;
  color: #555;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: #f0f2f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "D2Coding", monospace;
  font-size: 0.88em;
}

.prose pre {
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: #1f2430;
  color: #e6e9ef;
  overflow-x: auto;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: 0.86em;
}

.prose hr {
  margin: 2.4em auto;
  width: 30%;
  border: 0;
  border-top: 1px solid #cfd3da;
}

.prose mark {
  padding: 0.05em 0.15em;
  border-radius: 3px;
  background: #fff3a3;
}

.prose table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.prose [data-youtube-video] {
  margin: 1.4em 0;
}

.prose iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
}

/* ── 휴대폰 ──────────────────────────────── */

@media (max-width: 768px) {
  .page {
    width: auto;
    padding: 0 16px;
  }

  .menu-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 16px;
    min-height: 0;
  }

  .logo {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--text);
    text-align: center;
  }

  .menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    padding: 14px 0 4px;
    font-size: 14px;
  }

  .icons {
    justify-content: space-between;
    margin-top: 12px;
  }

  .icons .lang + .sns {
    margin-left: auto;
  }

  .quick li {
    width: 80%;
  }

  .hero {
    width: 100%;
    margin: 48px 0 40px;
    text-align: center;
  }

  .hero h1 {
    font-size: 32px;
  }

  .description {
    margin-left: 0;
  }

  .recent {
    margin: 40px auto 0;
    text-align: left;
  }

  .project {
    max-width: none;
    min-width: 0;
  }

  .project h1 {
    font-size: 32px;
  }

  .paper {
    margin-top: 16px;
    padding: 24px 18px;
    border-radius: 10px;
  }

  .paper h1 {
    font-size: 26px;
  }

  .post-list h2 {
    font-size: 18px;
  }

  .prose {
    font-size: 16px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav .older {
    grid-column: 1;
    text-align: left;
  }
}
