/*
Theme Name: Dasijapan Edit
Description: 다시일본 — 실측 데이터 기반 재방문 가이드. 미니멀 에디토리얼 전용 테마.
Version: 1.0
Author: 다시일본
Text Domain: dasijapan-edit
*/

:root {
  --bg: #faf9f6;
  --bg-sub: #f5f3ec;
  --ink: #141414;
  --body: #33302a;
  --sub: #4a463d;
  --mute: #8a857a;
  --hair: #e6e2d8;
  --hair2: #e3e0d8;
  --box-bd: #e0dcd2;
  --chip-bd: #d6d2c6;
  --accent: #bf3a2b;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--body); font-family: var(--sans); font-size: 16.5px; line-height: 1.8; -webkit-font-smoothing: antialiased; }
::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }

.wrap { max-width: 1440px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.mono-label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.accent { color: var(--accent); }

/* ── 고정 헤더 ─────────────────────────── */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(250,249,246,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.site-head__in { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 40px; max-width: 1440px; margin: 0 auto; }
.wordmark { display: flex; align-items: baseline; gap: 10px; }
.wordmark strong { font-size: 19px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; }
.wordmark span { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--mute); }
.site-nav { display: flex; gap: 28px; align-items: baseline; font-size: 14.5px; }
.site-nav a { white-space: nowrap; }
.site-nav .contact { color: var(--accent); border-bottom: 1px solid var(--accent); }
.wordmark { white-space: nowrap; }
.contact-short { display: none; }

/* ── 히어로 ────────────────────────────── */
.hero { padding: 108px 40px 72px; max-width: 1440px; margin: 0 auto; }
.hero h1 { font-size: clamp(52px, 8vw, 122px); font-weight: 750; line-height: 1.04; letter-spacing: -.045em; margin-top: 26px; }
.hero__lead { max-width: 540px; margin-left: auto; margin-top: 56px; font-size: 17px; line-height: 1.75; color: var(--sub); }

/* ── 통계 스트립 ───────────────────────── */
.stats { border-top: 1px solid var(--ink); display: grid; grid-template-columns: repeat(3, 1fr); }
.stats__cell { padding: 26px; border-right: 1px solid var(--hair); }
.stats__cell:last-child { border-right: 0; }
.stats__num { font-family: var(--mono); font-size: 27px; color: var(--ink); }
.stats__lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); margin-top: 6px; }

/* ── 아카이브 ─────────────────────────── */
.archive-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 96px; }
.archive-head h2 { font-size: clamp(38px, 4.5vw, 64px); font-weight: 750; letter-spacing: -.04em; }
.archive-head .count { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; margin-bottom: 40px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--chip-bd); color: var(--ink); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* 피처드 */
.featured { border-top: 1px solid var(--ink); padding-top: 36px; display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 72px; }
.featured__img { flex: 1.4; min-width: 380px; }
.featured__img img { aspect-ratio: 16/10; width: 100%; object-fit: cover; border-radius: 12px; background: var(--bg-sub); border: 1px solid var(--box-bd); }
.featured__info { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 20px; }
.featured__title { font-size: clamp(30px, 3.2vw, 50px); font-weight: 700; line-height: 1.16; letter-spacing: -.035em; }
.featured__more { color: var(--accent); border-bottom: 1px solid var(--accent); align-self: flex-start; }

/* 사진이 없을 때(=평소) 본문이 혼자 남는다. 줄 길이가 늘어지지 않게 잡는다 */
.featured__info:only-child { max-width: 860px; }

.badge { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 11px; }
.meta-line { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.databox { background: var(--bg-sub); border: 1px solid var(--box-bd); padding: 16px 20px; font-family: var(--mono); font-size: 12.5px; line-height: 2.0; color: var(--sub); }

/* 목록 행 */
.rows { border-top: 1px solid var(--ink); }
.row { display: flex; gap: 40px; padding: 36px 0; border-bottom: 1px solid var(--hair2); }
.row__thumb { width: 150px; }
.row__thumb img { width: 150px; height: 112px; object-fit: cover; border-radius: 12px; background: var(--bg-sub); border: 1px solid var(--box-bd); }
.row__meta { width: 108px; flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--mute); line-height: 2; }
.row__meta span { display: block; }
.row__main { flex: 1; }
.row__title { font-size: clamp(22px, 2.3vw, 33px); font-weight: 680; line-height: 1.25; letter-spacing: -.03em; margin-top: 12px; }
.row__excerpt { font-size: 15px; line-height: 1.7; color: var(--sub); margin-top: 12px; max-width: 640px; }
.row__stats { width: 220px; flex-shrink: 0; text-align: right; font-family: var(--mono); font-size: 12.5px; line-height: 2.1; color: var(--sub); }

/* ── 글 상세 ───────────────────────────── */
.post-head { padding: 64px 40px 0; max-width: 1440px; margin: 0 auto; }
.backlink { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.post-head__meta { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.post-head h1 { font-size: clamp(40px, 5.6vw, 86px); font-weight: 750; line-height: 1.06; letter-spacing: -.045em; margin-top: 24px; }
.post-head__lead { max-width: 520px; margin-left: auto; margin-top: 40px; font-size: 17px; line-height: 1.75; color: var(--sub); }

.summary { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 48px; }
.summary__cell { padding: 22px 26px; border-right: 1px solid var(--hair); }
.summary__cell:last-child { border-right: 0; }
.summary__num { font-family: var(--mono); font-size: 23px; color: var(--ink); }
.summary__lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); margin-top: 4px; }

.post-hero { margin-top: 56px; }
.post-hero img { aspect-ratio: 21/9; width: 100%; object-fit: cover; }

.post-body { max-width: 760px; margin: 72px auto 0; padding: 0 40px; }
.post-body h2 { border-top: 1px solid var(--ink); padding-top: 28px; margin-top: 72px; font-size: clamp(26px, 3vw, 36px); font-weight: 720; letter-spacing: -.03em; }
.post-body h3 { font-size: 20px; font-weight: 680; letter-spacing: -.02em; margin-top: 40px; }
.post-body p { margin-top: 18px; }
.post-body ul, .post-body ol { margin: 18px 0 0 22px; }
.post-body table { width: 100%; border: 1px solid var(--ink); border-collapse: collapse; margin-top: 24px; font-family: var(--mono); font-size: 13px; }
.post-body th { font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--ink); text-align: left; padding: 10px 14px; font-weight: 400; letter-spacing: .08em; }
.post-body td { padding: 10px 14px; border-bottom: 1px solid var(--hair); }
.post-body blockquote { background: var(--bg-sub); border: 1px solid var(--box-bd); padding: 16px 20px; margin-top: 24px; font-family: var(--mono); font-size: 13px; line-height: 2.0; color: var(--sub); }
.post-body a { color: var(--accent); border-bottom: 1px solid var(--accent); }
.post-body img { border-radius: 12px; margin-top: 24px; }
.post-body em:first-child { color: var(--mute); font-size: 14px; }

/* 이전/다음 */
.post-nav { border-top: 1px solid var(--ink); margin-top: 96px; padding: 36px 40px 0; max-width: 1440px; margin-left: auto; margin-right: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 40px; }
.post-nav__next { text-align: right; }
.post-nav__next .title { font-size: clamp(20px, 2.2vw, 30px); font-weight: 680; letter-spacing: -.02em; display: block; margin-top: 8px; }

/* ── 푸터 ─────────────────────────────── */
.site-foot { border-top: 1px solid var(--ink); margin-top: 120px; padding: 100px 40px 48px; max-width: 1440px; margin-left: auto; margin-right: auto; }
.site-foot h2 { font-size: clamp(44px, 7vw, 104px); font-weight: 750; letter-spacing: -.045em; line-height: 1.05; margin-top: 24px; }
.site-foot__mail { display: inline-block; font-size: clamp(18px, 2vw, 25px); border-bottom: 1px solid var(--ink); margin-top: 32px; }
.site-foot__links { display: flex; justify-content: space-between; align-items: baseline; margin-top: 72px; flex-wrap: wrap; gap: 20px; font-size: 14.5px; }
.site-foot__links nav { display: flex; gap: 24px; }
.credit { border-top: 1px solid var(--hair); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--mute); }

/* 페이지(소개 등) */
.page-body { max-width: 760px; margin: 64px auto 0; padding: 0 40px; }
.page-body h1 { font-size: clamp(36px, 5vw, 64px); font-weight: 750; letter-spacing: -.04em; }
.page-body .content { margin-top: 40px; }
.page-body .content h2 { border-top: 1px solid var(--ink); padding-top: 24px; margin-top: 56px; font-size: 26px; font-weight: 720; }
.page-body .content p { margin-top: 16px; }
.page-body .content ul { margin: 16px 0 0 22px; }

/* 반응형 */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .wrap, .hero, .post-head, .post-body, .page-body { padding-left: 20px; padding-right: 20px; }
  .site-head__in { padding: 13px 20px; gap: 12px; }
  .site-nav { gap: 14px; font-size: 13px; }
  .wordmark span { display: none; }           /* DASI JAPAN 서브 워드마크 숨김 */
  .contact-full { display: none; }            /* 긴 이메일 대신 Contact */
  .contact-short { display: inline; }
  .hero { padding-top: 52px; padding-bottom: 44px; }
  .hero h1 { font-size: clamp(38px, 11.5vw, 52px); margin-top: 18px; }
  .hero__lead { margin-top: 28px; font-size: 15.5px; max-width: none; }
  .stats, .summary { grid-template-columns: 1fr; }
  .stats__cell, .summary__cell { border-right: 0; border-bottom: 1px solid var(--hair); padding: 18px 20px; }
  .stats__cell:last-child, .summary__cell:last-child { border-bottom: 0; }
  .archive-head { margin-top: 52px; }
  .archive-head h2 { font-size: 34px; }
  .chips { margin-top: 20px; margin-bottom: 28px; }
  .featured { gap: 24px; margin-bottom: 44px; }
  .featured__img { min-width: 100%; }
  .featured__info { min-width: 100%; gap: 14px; }
  .featured__title { font-size: 26px; }
  .row { flex-direction: column; gap: 12px; padding: 26px 0; }
  .row__meta { width: auto; display: flex; gap: 10px; }   /* 날짜·도시 한 줄로 */
  .row__meta span { display: inline; }
  .row__thumb { width: 100%; }
  .row__thumb img { width: 100%; height: auto; aspect-ratio: 16/9; }
  .row__title { font-size: 21px; margin-top: 8px; }
  .row__excerpt { font-size: 14.5px; margin-top: 8px; }
  .row__stats { width: auto; text-align: left; font-size: 12px; line-height: 1.9; }
  .post-head { padding-top: 40px; }
  .post-head h1 { font-size: clamp(30px, 9vw, 44px); }
  .post-head__lead { margin-top: 24px; font-size: 15.5px; max-width: none; }
  .summary { margin-top: 32px; }
  .post-body { margin-top: 44px; }
  .post-body h2 { margin-top: 52px; font-size: 24px; }
  .post-body h3 { font-size: 18px; margin-top: 30px; }
  /* 표 스크롤은 .table-scroll 래퍼가 담당 — display:block은 셀 정렬을 깨뜨려 제거 */
  .site-foot { padding: 56px 20px 28px; margin-top: 72px; }
  .site-foot h2 { font-size: clamp(36px, 11vw, 56px); }
  .site-foot__links { margin-top: 44px; }
  .post-nav { padding: 24px 20px 0; margin-top: 56px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .post-nav__next { text-align: left; }
  .credit { flex-direction: column; }
}


/* ══ 모바일 최적화 (2026-08-17) ══════════════════════════════════
   자동 발행 글은 맨 <table>·긴 URL로 들어온다. 디자이너 마크업 클래스에
   의존하지 않고 본문 요소 자체를 안전하게 처리한다. */

/* 페이지 가로 스크롤 차단. clip을 쓰는 이유: hidden은 sticky 헤더를 깨뜨린다. */
body { overflow-x: hidden; overflow-x: clip; }

/* 긴 URL·영문이 본문 밖으로 밀려나 가로 스크롤을 만드는 것 방지 */
.post-body, .post-body li, .post-body p, .post-body td, .post-body th { overflow-wrap: anywhere; }
/* 한글은 단어 중간에서 끊지 않는다 (｢유튜브 직/접 결제｣ 같은 깨짐 방지) */
.post-body table, .post-body li, .post-body p { word-break: keep-all; }

/* 표: 좁은 화면에서 눌리지 않게 가로 스크롤 컨테이너로 */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; margin: 18px 0 0;
}
.table-scroll table { margin: 0; }
/* 디자이너 마크업(.compare-table)이 이미 스크롤 컨테이너면 중첩시키지 않는다 */
.compare-table .table-scroll { overflow: visible; }

@media (max-width: 640px) {
  /* 셀이 한 글자씩 접히지 않도록 최소 폭 확보 — 넘치는 만큼만 가로 스크롤 */
  .table-scroll table { min-width: 520px; }
  .post-body table { font-size: 14px; }
  .post-body th, .post-body td { padding: 10px 12px; }
  /* 표가 스크롤된다는 것을 알리는 오른쪽 페이드 */
  .table-scroll {
    background: linear-gradient(to left, rgba(0,0,0,.06), transparent 24px);
    border-radius: 8px;
  }
}


/* ── 카테고리 바 + 검색 (2026-08-24 통일) ────────────────── */
.catbar { border-bottom: 1px solid rgba(128,128,128,.22); }
.catbar__in { max-width: 1096px; margin: 0 auto; padding: 10px 20px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.catbar a.cat { padding: 7px 14px; border: 1.4px solid rgba(128,128,128,.32);
  border-radius: 3px; font-size: 14.5px; font-weight: 600; white-space: nowrap;
  text-decoration: none; }
.catbar a.cat:hover,
.catbar a.cat.is-active { border-color: currentColor; }
.catbar .catsearch { margin-left: auto; display: flex; }
.catbar .catsearch input { font: inherit; font-size: 14px; padding: 7px 12px;
  border: 1.4px solid rgba(128,128,128,.32); border-radius: 3px;
  background: transparent; color: inherit; width: 168px; }
.catbar .catsearch input::placeholder { color: rgba(128,128,128,.85); }
@media (max-width: 640px) {
  .catbar__in { gap: 6px; padding: 9px 14px; }
  .catbar a.cat { font-size: 13.5px; padding: 6px 11px; }
  .catbar .catsearch { margin-left: 0; width: 100%; }
  .catbar .catsearch input { width: 100%; }
}
