/*
Theme Name: Studio Branch
Theme URI: https://studio-branch.org
Author: Studio Branch
Description: 타이포그래피 중심의 미니멀 포트폴리오 테마. 첫 화면은 글자로만 구성된 카테고리 메뉴, 목록은 텍스트 링크 나열.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: studio-branch
*/

/* ---------- 삼화명조 ---------- */
/* 라틴·구두점: 첫 화면에서 즉시 필요한 최소 용량 */
@font-face {
  font-family: "Samhwa Myeongjo";
  src: url("fonts/samhwa-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2000-206F, U+2190-21FF, U+3000-303F, U+FF00-FFEF;
}
/* 한글 상용 2350자 */
@font-face {
  font-family: "Samhwa Myeongjo";
  src: url("fonts/samhwa-kr-common.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3130-318F, U+AC00-D7A3;
}
/* 한글 확장(상용 외 음절) */
@font-face {
  font-family: "Samhwa Myeongjo";
  src: url("fonts/samhwa-kr-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+AC00-D7A3;
}

/* ---------- 기본 ---------- */
:root {
  --bg: #f2f2f0;
  --ink: #141414;
  --ink-soft: #6b6b6b;
  /* 사이트 전체가 삼화명조 한 벌. 위계는 크기와 자간으로만 만든다. */
  --font-display: "Samhwa Myeongjo", "Apple SD Gothic Neo", serif;
  --font-mono: "Samhwa Myeongjo", "Apple SD Gothic Neo", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  font-family: var(--font-mono);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.45; }
img { max-width: 100%; height: auto; display: block; }

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mono { font-family: var(--font-mono); }
.small { font-size: 13px; color: var(--ink-soft); }

/* ---------- 상단(내부 페이지용 홈 링크) ---------- */
.site-top {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 10;
}
.site-top a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- 첫 화면(랜딩) ---------- */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12vh 24px;
  gap: 11vh;
}

.landing .site-name {
  font-size: clamp(28px, 4.2vw, 46px);
  letter-spacing: 0.28em;
}

.landing-desc { margin-top: 18px; }

.landing-nav {
  display: flex;
  flex-direction: column;
  gap: 7vh;
}

.landing-link {
  font-size: clamp(20px, 2.6vw, 30px);
  display: inline-block;
}

.landing-item p { margin-top: 10px; }

/* ---------- 목록(카테고리/아카이브) ---------- */
.archive-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20vh 24px 14vh;
  text-align: center;
}

.archive-title {
  font-size: clamp(24px, 3.2vw, 38px);
  margin-bottom: 3vh;
}

.archive-desc { margin-bottom: 9vh; }

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5.5vh;
}

.post-list .entry-title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(17px, 2vw, 22px);
}

.post-list .entry-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 본문(글 상세) ---------- */
.single-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 18vh 24px 12vh;
}

.single-header { text-align: center; margin-bottom: 9vh; }

.single-title {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.4;
}

.single-meta { margin-top: 14px; }

.entry-content { font-size: 16px; }
.entry-content > * + * { margin-top: 1.6em; }
.entry-content h2, .entry-content h3 {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 3em;
}
.entry-content h2 { font-size: 19px; }
.entry-content h3 { font-size: 16px; }
.entry-content img { margin-left: auto; margin-right: auto; }
.entry-content figcaption {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 8px;
}
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote {
  border-left: 1px solid var(--ink);
  padding-left: 1.4em;
  color: var(--ink-soft);
}

.wp-block-image.alignwide, .wp-block-image.alignfull { max-width: none; }

/* 이전/다음 글 */
.post-nav {
  margin-top: 12vh;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.post-nav a { color: var(--ink); }

/* ---------- Font 견본 페이지 ---------- */
.specimen {
  --rule: rgba(20, 20, 20, 0.32);
  --gap: clamp(20px, 3.2vw, 44px);
  border: 1px solid var(--rule);
  margin: clamp(14px, 1.8vw, 26px);
  padding: 0 var(--gap) var(--gap);
}

/* 작은 라벨 (Dinamo 견본의 모노 캡션 자리) */
.sp-label,
.sp-bar,
.sp-controls,
.sp-facts,
.sp-num {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
}

.sp-label {
  color: var(--ink-soft);
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

/* 상단 바 */
.sp-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.sp-bar-center { text-align: center; }
.sp-bar-right { text-align: right; color: var(--ink-soft); }
.sp-mark {
  background: #eaff00;
  padding: 2px 7px;
}
.sp-tag {
  margin-left: 12px;
  color: var(--ink-soft);
}
.sp-tag::before { content: "✓ "; }

/* 이름 */
.sp-hero {
  padding: clamp(50px, 10vh, 120px) 0 clamp(60px, 12vh, 140px);
  text-align: center;
}
.sp-word {
  font-size: clamp(64px, 15.5vw, 240px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: 0.01em;
  word-break: keep-all;
}

/* 비대칭 2단 */
.sp-columns {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: var(--gap);
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-bottom: clamp(60px, 11vh, 130px);
}
.sp-columns .sp-label { border-bottom: none; padding-bottom: 0; margin-bottom: 20px; }
.sp-col-narrow { border-left: 1px solid var(--rule); padding-left: var(--gap); }
.sp-col-narrow .sp-label:not(:first-child) { margin-top: 44px; }

.sp-body { font-size: clamp(19px, 2.1vw, 27px); line-height: 1.65; }
.sp-body > * + * { margin-top: 0.9em; }
.sp-lead {
  font-size: clamp(24px, 3.1vw, 42px);
  line-height: 1.45;
  margin-top: 1em;
  word-break: keep-all;
}
.sp-small { font-size: 14px; line-height: 1.85; }

.sp-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-bottom: 8px; }
.sp-facts dt { color: var(--ink-soft); }
.sp-facts dd { text-transform: none; letter-spacing: 0.02em; }

/* 공통 블록 */
.sp-block { margin-bottom: clamp(60px, 11vh, 130px); }
.sp-block-last { margin-bottom: 0; }

/* 크기 사다리 */
.sp-waterfall {
  line-height: 1.3;
  margin-bottom: 0.35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-num {
  display: inline-block;
  width: 46px;
  vertical-align: middle;
  color: var(--ink-soft);
}

/* 입력 견본 */
.sp-tester {
  font-size: 64px;
  line-height: 1.4;
  outline: none;
  padding: 0.15em 0 0.3em;
  min-height: 1.5em;
  word-break: keep-all;
  cursor: text;
}
.sp-tester:focus { box-shadow: 0 1px 0 var(--rule); }

.sp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 34px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}
.sp-controls label { display: flex; align-items: center; gap: 11px; }
.sp-ctl-name { min-width: 30px; }
.sp-ctl-val { min-width: 46px; color: var(--ink); }

.sp-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 132px;
  height: 1px;
  background: var(--ink);
  outline: none;
  cursor: pointer;
}
.sp-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}
.sp-controls input[type="range"]::-moz-range-thumb {
  width: 9px; height: 9px; border: 0; border-radius: 50%;
  background: var(--ink); cursor: pointer;
}
.sp-reset {
  font: inherit;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 5px 12px;
  cursor: pointer;
}
.sp-reset:hover { color: var(--ink); border-color: var(--ink); }

/* 글자 목록 */
.sp-charrow { display: flex; flex-wrap: wrap; margin-bottom: 20px; }
.sp-charrow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 26px;
  line-height: 1;
}

@media (max-width: 820px) {
  .sp-columns { grid-template-columns: 1fr; }
  .sp-col-narrow { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 22px; }
  .sp-tester { font-size: 40px; }
  .sp-charrow span { width: 44px; height: 44px; font-size: 21px; }
  .sp-bar { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .sp-bar-left, .sp-bar-right { text-align: center; }
}

/* ---------- 푸터 ---------- */
.site-footer {
  text-align: center;
  padding: 0 24px 6vh;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.landing + .site-footer { margin-top: -6vh; }

/* ---------- 모바일 ---------- */
@media (max-width: 600px) {
  .landing { gap: 9vh; }
  .site-top { position: absolute; }
}
