/* 심리학 용어사전 허브 — 지피디아 색(인디고 #4B3BC7 · 연보라 · 둥근 흰 카드)
   휴대폰 먼저: 검색 → 가나다 2줄 → 분야 한 줄(옆으로 밀기) → 목록(한 줄씩) → ‹ 이전 · 3 / 16 · 다음 › */
.psy-hub {
  --acc: #4B3BC7; --acc-d: #3A2FA0; --soft: #F2EEFC; --ink: #241F3D; --mut: #6F6890;
  --line: #ECE7F8; --line2: #DCD5F3; --off: #C9C3DD;
  margin: 6px 0 36px; color: var(--ink); font-size: 16px; line-height: 1.5;
}
.psy-hub *, .psy-hub *::before, .psy-hub *::after { box-sizing: border-box; }
.psy-hub [hidden] { display: none !important; }
.psy-hub a, .psy-hub a:hover, .psy-hub a:focus, .psy-hub a:visited { text-decoration: none !important; box-shadow: none; }
.psy-hub a:focus-visible, .psy-hub button:focus-visible, .psy-hub input:focus-visible { outline: 3px solid rgba(75, 59, 199, .35); outline-offset: 2px; }
.psy-hub p { margin: 0; }

/* 분야 목록 머리 */
.psy-hub-intro { margin: 0 0 18px; padding: 20px 20px 18px; border-radius: 18px;
  background: linear-gradient(125deg, #FBF1FA 0%, #F1ECFD 60%, #EAEAFE 100%); border: 1.5px solid #EAE2F8; }
.psy-hub-back { display: inline-block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--acc) !important; }
.psy-hub .psy-hub-intro h1 { margin: 0 0 6px; padding: 0; border: 0; font-size: 26px; line-height: 1.25; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.psy-hub .psy-hub-intro h1::before, .psy-hub .psy-hub-intro h1::after { display: none; }
.psy-hub-intro h1 span { font-size: 15px; font-weight: 700; color: var(--mut); }
.psy-hub-intro p { font-size: 15px; line-height: 1.65; color: #4A4366; }

/* 검색 */
.psy-hub-search { position: relative; margin: 0 0 14px; }
.psy-hub .psy-hub-search input[type="search"] {
  width: 100%; height: 52px; margin: 0; padding: 0 92px 0 20px; font-size: 16px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line2); border-radius: 999px; outline: none;
  -webkit-appearance: none; appearance: none; box-shadow: 0 6px 18px -14px rgba(75, 59, 199, .55);
}
.psy-hub .psy-hub-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.psy-hub .psy-hub-search input[type="search"]:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(75, 59, 199, .12); }
.psy-hub .psy-hub-search button {
  position: absolute; top: 6px; right: 6px; height: 40px; min-width: 72px; margin: 0; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--acc); color: #fff; font-size: 15px; font-weight: 800; line-height: 40px; cursor: pointer;
}
.psy-hub .psy-hub-search button:hover { background: var(--acc-d); }

/* 가나다 색인 */
.psy-hub-idx { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.psy-hub-idx a, .psy-hub-idx span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 40px; padding: 0 10px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink) !important;
  font-size: 15px; font-weight: 800; line-height: 1; white-space: nowrap;
}
.psy-hub-idx a:hover { border-color: #B9AEEF; background: #FAF8FF; }
.psy-hub-idx a.on { background: var(--acc); border-color: var(--acc); color: #fff !important; }
.psy-hub-idx span.off { color: var(--off) !important; background: #FBFAFE; }

/* 분야 */
.psy-hub-fld { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; }
.psy-hub-fld-l { flex: none; padding-top: 8px; font-size: 13px; font-weight: 800; color: var(--mut); }
.psy-hub-fld-sc { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.psy-hub-fld-sc a {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--soft); color: var(--acc-d) !important; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.psy-hub-fld-sc a i { font-style: normal; font-size: 12px; font-weight: 600; color: #8A80B8; }
.psy-hub-fld-sc a:hover { background: #E6E0FA; }
.psy-hub-fld-sc a.on { background: var(--acc); color: #fff !important; }
.psy-hub-fld-sc a.on i { color: #D9D3FF; }

/* 목록 머리 */
.psy-hub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.psy-hub-head .t { font-size: 18px; font-weight: 800; color: var(--ink); }
.psy-hub-head .t b { font-size: 14px; font-weight: 700; color: var(--mut); margin-left: 2px; }
.psy-hub-head .n { flex: none; font-size: 13.5px; font-weight: 700; color: var(--mut); }
.psy-hub-clear { flex: none; font-size: 14px; font-weight: 700; color: var(--acc) !important; }

/* 목록 */
.psy-hub .psy-hub-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.psy-hub .psy-hub-list li { margin: 0; padding: 0; }
.psy-hub-item {
  display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--ink) !important;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.psy-hub-item:hover { border-color: #B9AEEF; box-shadow: 0 10px 22px -16px rgba(75, 59, 199, .6); transform: translateY(-2px); }
.psy-hub-item .k { font-size: 16.5px; font-weight: 800; line-height: 1.35; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.psy-hub-item .e { font-size: 13px; line-height: 1.45; color: var(--mut); overflow-wrap: anywhere; }
.psy-hub-item .c { align-self: flex-start; margin-top: auto; padding: 3px 9px 2px; border-radius: 999px; background: var(--soft); color: #5A4BC9; font-size: 12px; font-weight: 700; line-height: 1.5; }
.psy-hub-item .e + .c, .psy-hub-item .k + .c { margin-top: 8px; }
.psy-hub-empty { padding: 28px 16px; border-radius: 14px; background: #FAF8FF; color: var(--mut); text-align: center; font-size: 15px; }
.psy-hub-empty a { color: var(--acc) !important; font-weight: 700; }
.psy-hub-more { display: block; margin-top: 12px; padding: 13px 16px; border-radius: 14px; background: var(--soft); color: var(--acc-d) !important; text-align: center; font-weight: 800; font-size: 15px; }

/* 쪽 이동 */
.psy-hub-pg { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 24px 0 0; }
.psy-hub-pg a, .psy-hub-pg span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink) !important;
  font-size: 15px; font-weight: 700; line-height: 1; white-space: nowrap;
}
.psy-hub-pg a:hover { border-color: #B9AEEF; background: #FAF8FF; }
.psy-hub-pg .on { background: var(--acc); border-color: var(--acc); color: #fff !important; }
.psy-hub-pg .gap { min-width: 18px; padding: 0; border: 0; background: none; color: var(--mut) !important; }
.psy-hub-pg .off { color: var(--off) !important; background: #FBFAFE; }
.psy-hub-pg .now { display: none; }

@media (max-width: 900px) {
  .psy-hub .psy-hub-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 휴대폰 */
@media (max-width: 640px) {
  .psy-hub-intro { padding: 16px 16px 14px; border-radius: 16px; }
  .psy-hub .psy-hub-intro h1 { font-size: 23px; }

  .psy-hub-idx { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
  .psy-hub-idx a, .psy-hub-idx span { min-width: 0; padding: 0; height: 40px; font-size: 15px; }

  .psy-hub-fld { display: block; }
  .psy-hub-fld-l { display: none; }
  .psy-hub-fld-sc {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 2px 24px 4px 0; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent);
  }
  .psy-hub-fld-sc::-webkit-scrollbar { display: none; }
  .psy-hub-fld-sc a { scroll-snap-align: start; height: 36px; }

  .psy-hub-head { margin-top: 18px; }
  .psy-hub-head .t { font-size: 17px; }

  .psy-hub .psy-hub-list { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
  .psy-hub .psy-hub-list li + li { border-top: 1px solid var(--line); }
  .psy-hub-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 1px; align-items: center;
    padding: 12px 14px 12px 16px; border: 0; border-radius: 0; min-height: 56px;
  }
  .psy-hub-item:hover { transform: none; box-shadow: none; }
  .psy-hub-item:active { background: #F7F5FE; }
  .psy-hub-item .k { grid-column: 1; font-size: 16px; }
  .psy-hub-item .e { grid-column: 1; font-size: 12.5px; }
  .psy-hub-item .c, .psy-hub-item .e + .c, .psy-hub-item .k + .c { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; }

  .psy-hub-pg { flex-wrap: nowrap; gap: 8px; }
  .psy-hub-pg .num, .psy-hub-pg .gap { display: none; }
  .psy-hub-pg .now { display: inline-flex; min-width: 76px; padding: 0 4px; border: 0; background: none; color: var(--mut) !important; font-weight: 800; }
  .psy-hub-pg .prev, .psy-hub-pg .next { flex: 1; height: 48px; font-weight: 800; }
}

/* 페이지 제목이 "(개념정\n리)" 처럼 글자 중간에서 끊기지 않게 (이 CSS 는 용어사전 화면에서만 불린다) */
.entry-header .entry-title { word-break: keep-all; }

/* 분야 목록 화면(테마 보관함 템플릿 대신 쓰는 화면) 여백 */
.psy-hub-page .entry-content { margin-top: 0; }
.tax-psy_field #primary { margin-top: 20px; }   /* 테마가 보관함에 주는 위 여백 68px → 20px */
@media (min-width: 922px) {
  .tax-psy_field #primary { margin-top: 48px; margin-bottom: 48px; }
}
