html body:has(.editorial-page) {
  height: auto;
  min-height: 100%;
}

.editorial-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--page-gutter) var(--space-12);
  color: var(--ink);
  background: var(--warm-50);
}

.editorial-shell {
  width: min(100%, var(--subpage-width-wide));
  margin: 0 auto;
}

.dictionary-search {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--line);
}

.dictionary-search__label,
.dictionary-search__count {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
}

.dictionary-search__field {
  position: relative;
}

.dictionary-search__field svg {
  position: absolute;
  top: 50%;
  left: var(--space-4);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.5;
  transform: translateY(-50%);
  pointer-events: none;
}

.dictionary-search input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4) 0 var(--space-9);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-md);
  background: var(--surface-solid);
  transition: border-color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}

.dictionary-search input::placeholder {
  color: rgb(119 119 115 / 68%);
}

.dictionary-search input:focus {
  border-color: rgb(111 100 97 / 38%);
  background: var(--gray-0);
}

.dictionary-search input::-webkit-search-cancel-button {
  opacity: 0.45;
}

.dictionary-list {
  border-bottom: 1px solid var(--hairline-strong);
}

.dictionary-term {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: var(--space-5);
  padding: var(--space-10) 0 var(--space-10);
  border-bottom: 1px solid var(--line);
}

.dictionary-term:last-child {
  border-bottom: 0;
}

.dictionary-term[hidden] {
  display: none;
}

.dictionary-term__index {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
}

.dictionary-term__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: var(--display-weight);
  letter-spacing: -0.045em;
  line-height: 1.28;
  word-break: keep-all;
}

.dictionary-term__definition {
  max-width: 720px;
  margin: var(--space-6) 0 0;
  color: var(--rose-600);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.9;
  word-break: keep-all;
}

.dictionary-related {
  margin-top: var(--space-7);
}

.dictionary-related__empty,
.dictionary-empty {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

.dictionary-empty {
  padding: var(--space-11) 0;
  border-bottom: 1px solid var(--hairline-strong);
  text-align: center;
}

@media (max-width: 820px) {
  .editorial-page {
    padding: 0 var(--space-5) var(--space-11);
  }

  .dictionary-search {
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    padding: var(--space-4) 0;
  }

  .dictionary-search__label {
    grid-column: 1 / -1;
  }

  .dictionary-search__count {
    white-space: nowrap;
  }

  .dictionary-term {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-8) 0 var(--space-9);
  }

  .dictionary-term__index {
    margin-top: var(--space-2);
  }

  .dictionary-term__name {
    font-size: var(--text-2xl);
  }

  .dictionary-term__definition {
    margin-top: var(--space-4);
    font-size: var(--text-base);
    line-height: 1.85;
  }

  .dictionary-related {
    margin-top: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-page *,
  .editorial-page *::before,
  .editorial-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

html body:has(.editorial-page),
.editorial-page {
  background: var(--paper);
}

.editorial-shell {
  padding-inline: var(--space-6);
  border-right: 1px solid var(--editorial-frame);
  border-left: 1px solid var(--editorial-frame);
}

.editorial-page .subpage-header {
  border-top-color: var(--editorial-frame);
  border-bottom-color: var(--editorial-frame);
}

.editorial-page .subpage-header__top,
.editorial-page .dictionary-search,
.editorial-page .dictionary-term,
.editorial-page .dictionary-list,
.editorial-page .dict-index__grid,
.editorial-page .dict-index__grid li {
  border-color: var(--editorial-frame-soft);
}

.editorial-page :is(.dict-head__label, .subpage-header__eyebrow, .subpage-header__current) {
  color: var(--pink-strong);
}

.editorial-page .dict-place__media {
  border-radius: var(--radius-2);
}

@media (max-width: 820px) {
  .editorial-shell {
    padding-inline: var(--space-4);
  }
}
/* ═══════════════════════════════════════════════════════════════════
   DESIGN PILOT — /dictionary 전용 (hara + 발렌시아가 + Yvan Rodic 문법)
   이 파일은 /log 와 공유하므로 모든 규칙을 .editorial-page
   아래로 스코프했습니다. 롤백은 이 블록만 지우면 됩니다.
   ═══════════════════════════════════════════════════════════════════ */

.editorial-page {

  padding-bottom: 120px;
  color: var(--ink);
  background: var(--gray-0);
}

/* 순백은 페이지 밖(오버스크롤)까지 이어져야 톤이 끊기지 않습니다. */
html body:has(.editorial-page) {
  background: var(--gray-0);
}

.editorial-page :is(h1, h2, h3) {
  color: var(--ink);
}

/* 인덱스 항목으로 내려갈 때만 부드럽게. 추가 모션은 넣지 않습니다. */
html:has(.editorial-page) {
  scroll-behavior: smooth;
}

/* ── 공유 헤더 오버라이드 (파셜 구조는 그대로) ───────────────── */

.editorial-page .subpage-header,
.editorial-page .subpage-header__top {
  border-color: var(--hairline);
}

.editorial-page .subpage-header__eyebrow {
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: var(--weight-label);
  letter-spacing: 0.16em;
}

.editorial-page .subpage-header__lead {
  color: var(--muted);
  font-size: var(--text-md);
}

.editorial-page :is(.subpage-header__back, .subpage-header__nav a) {
  color: var(--muted);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
}

.editorial-page :is(.subpage-header__back, .subpage-header__nav a):hover {
  color: var(--ink);
}

.editorial-page .subpage-header__current {
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: var(--weight-label);
  letter-spacing: 0.12em;
}

/* ── 섹션 머리 = 소형 볼드 라벨 + 헤어라인 룰 + 우측 보조 ───────── */

.editorial-page .dict-head {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: auto minmax(24px, 1fr) auto;
  align-items: center;
}

.editorial-page .dict-head__label {
  margin: 0;
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: var(--weight-label);
  letter-spacing: 0.16em;
}

.editorial-page .dict-head__rule {
  display: block;
  height: 1px;
  background: var(--hairline);
}

.editorial-page .dict-head__aux {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  letter-spacing: var(--tracking-label);
}

.editorial-page .dict-head--minor .dict-head__label {
  color: var(--muted);
  font-size: var(--text-2xs);
}

/* ── 용어 인덱스 그리드 (Yvan Rodic 의 CITIES 문법) ─────────────── */

.editorial-page .dict-index {
  margin-bottom: var(--space-10);
}

/* 셀마다 좌우 여백을 주되, 그리드를 그만큼 왼쪽으로 당겨
   첫 열의 글자가 페이지 좌측 정렬선에 그대로 맞게 합니다. */
.editorial-page .dict-index__grid {
  display: grid;
  width: calc(100% + 16px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: var(--space-5) 0 0 -16px;
  padding: 0;
  border-top: 1px solid var(--hairline);
  list-style: none;
}

.editorial-page .dict-index__grid li {
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.editorial-page .dict-index__grid li:nth-child(5n) {
  border-right: 0;
}

.editorial-page .dict-index__item {
  display: flex;
  border-radius: var(--radius-sm);
  gap: var(--space-3);
  align-items: baseline;
  min-height: 62px;
  padding: var(--space-4);
  color: var(--ink);
  text-decoration: none;
  transition: color var(--duration-slow) var(--ease-out);
}

.editorial-page .dict-index__num {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
}

.editorial-page .dict-index__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-label);
  line-height: 1.4;
  word-break: keep-all;
}

.editorial-page .dict-index__item:hover {
  color: var(--rose-500);
}

/* 검색 중에는 인덱스를 접습니다. (JS 수정 없이 :has 로) */
.editorial-page:has(#dictionary-query:not(:placeholder-shown)) .dict-index {
  display: none;
}

/* ── 검색 ───────────────────────────────────────────────────── */

.editorial-page .dictionary-search {
  grid-template-columns: 96px minmax(0, 1fr) auto;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline);
}

.editorial-page :is(.dictionary-search__label, .dictionary-search__count) {
  color: var(--muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-label);
  letter-spacing: 0.16em;
}

.editorial-page .dictionary-search input {
  height: 42px;
  padding: 0 var(--space-4) 0 var(--space-8);
  border: 0;
  border-radius: 0;
  font-size: var(--text-md);
  background: transparent;
}

.editorial-page .dictionary-search input:focus {
  background: transparent;
}

.editorial-page .dictionary-search__field svg {
  left: var(--space-2);
  width: 16px;
  stroke: var(--muted);
  stroke-width: 1.4;
}

.editorial-page .dictionary-search input::placeholder {
  color: rgb(0 0 0 / 32%);
}

/* ── 용어 항목 ───────────────────────────────────────────────── */

.editorial-page .dictionary-list {
  border-bottom: 1px solid var(--hairline-strong);
}

.editorial-page .dictionary-term {
  grid-template-columns: 96px minmax(0, 1fr);
  padding: var(--space-10) 0 var(--space-10);
  border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 24px;
}

.editorial-page .dictionary-term__index {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
}

.editorial-page .dictionary-term__name {
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: var(--weight-display-strong);
  letter-spacing: -0.045em;
  line-height: 1.22;
}

.editorial-page .dictionary-term__definition {
  max-width: 60ch;
  margin-top: var(--space-5);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.95;
}

.editorial-page .dictionary-related {
  margin-top: var(--space-8);
}

/* ── 연관 장소 = 사진 우선 카드 (hara 문법) ───────────────────── */

.editorial-page .dict-places {
  display: grid;
  gap: var(--space-7) var(--space-6);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.editorial-page .dict-place {
  display: grid;
  color: var(--ink);
  text-decoration: none;
}

.editorial-page .dict-place__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--rose-50);
}

.editorial-page .dict-place__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 기존 페이지의 느긋한 fade 톤을 그대로 씁니다. */
  transition: opacity var(--duration-slow) var(--ease-out);
}

.editorial-page .dict-place:hover .dict-place__media img {
  opacity: 0.82;
}

.editorial-page .dict-place__blank {
  display: grid;
  height: 100%;
  color: var(--border-heavy-soft);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  place-items: center;
}

.editorial-page .dict-place__name {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.45;
  word-break: keep-all;
  transition: color var(--duration-slow) var(--ease-out);
}

.editorial-page .dict-place:hover .dict-place__name {
  color: var(--rose-500);
}

.editorial-page .dict-place__meta {
  display: -webkit-box;
  overflow: hidden;
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.editorial-page :is(.dictionary-related__empty, .dictionary-empty) {
  color: var(--muted);
  font-size: var(--text-sm);
}

.editorial-page .dictionary-empty {
  border-bottom: 1px solid var(--hairline-strong);
}

.editorial-page :is(.dictionary-search input, .dict-index__item, .dict-place):focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}


@media (max-width: 1080px) {
  .editorial-page .dict-index__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editorial-page .dict-index__grid li:nth-child(5n) {
    border-right: 1px solid var(--hairline);
  }

  .editorial-page .dict-index__grid li:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .editorial-page {
    padding-bottom: var(--space-12);
  }

  .editorial-page .dict-index {
    margin-bottom: var(--space-8);
  }

  .editorial-page .dict-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editorial-page .dict-index__grid li:nth-child(3n),
  .editorial-page .dict-index__grid li:nth-child(5n) {
    border-right: 1px solid var(--hairline);
  }

  .editorial-page .dict-index__grid li:nth-child(2n) {
    border-right: 0;
  }

  .editorial-page .dict-index__item {
    min-height: 56px;
    padding: var(--space-4) var(--space-4);
  }

  .editorial-page .dictionary-search {
    grid-template-columns: 1fr auto;
  }

  .editorial-page .dictionary-term {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: var(--space-9) 0 var(--space-9);
  }

  .editorial-page .dictionary-term__index {
    margin-top: var(--space-2);
  }

  .editorial-page .dictionary-term__definition {
    margin-top: var(--space-4);
    font-size: var(--text-md);
    line-height: 1.9;
  }

  .editorial-page .dict-places {
    gap: var(--space-6) var(--space-4);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 장소가 하나뿐이면 좁은 화면에서 반칸짜리 썸네일이 되므로 한 칸을 다 씁니다. */
  .editorial-page .dict-places:has(> li:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  .editorial-page .dict-place__name {
    margin-top: var(--space-3);
    font-size: var(--text-md);
  }
}

.editorial-shell {
  padding-inline: var(--space-6);
  border-right: 1px solid var(--editorial-frame);
  border-left: 1px solid var(--editorial-frame);
}

.editorial-page .subpage-header,
.editorial-page .subpage-header__top,
.editorial-page .dictionary-search,
.editorial-page .dictionary-term,
.editorial-page .dictionary-list,
.editorial-page .dict-index__grid,
.editorial-page .dict-index__grid li {
  border-color: var(--editorial-frame-soft);
}

.editorial-page :is(.dict-head__label, .subpage-header__eyebrow, .subpage-header__current) {
  color: var(--pink-strong);
}

.editorial-page .dict-place__media {
  border-radius: var(--radius-2);
}

@media (max-width: 820px) {
  .editorial-shell {
    padding-inline: var(--space-4);
  }
}
