/**
 * HR ZIP — Shared UI tokens & chrome
 * Keeps existing visual values; consolidates footer / search aliases / toast / loading.
 * Load after css/style.css. Do not redefine brand colors differently from :root in style.css.
 */

/* —— Header shell: reserve height to avoid layout shift —— */
html {
  background: var(--bg, #ffffff);
}

header.header {
  min-height: var(--header-h, 70px);
}

/* —— Unified site footer (replaces qna-footer / mp-footer / prec-footer duplicates) —— */
.footer {
  border-top: 1px solid var(--line, #e6ebf2);
  background: var(--bg, #fff);
  padding: 20px 0 28px;
}

.footer .footer__inner,
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--page-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer .footer__brand,
.footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer .footer__brand strong,
.footer__brand strong {
  color: #9aa3af;
  font-size: 18px;
  letter-spacing: -0.05em;
}

.footer .footer__brand nav,
.footer__brand nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer .footer__brand a,
.footer__brand a {
  font-size: 13px;
  color: #7b8491;
}

.footer .footer__brand a:hover,
.footer__brand a:hover {
  color: var(--blue);
}

.footer > .footer__inner > p,
.footer .footer__meta p {
  margin: 0;
  font-size: 12px;
  color: #9aa3af;
}

.footer__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__social {
  display: flex;
  gap: 8px;
}

.footer__social a {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e0e6ef;
  color: #8b93a0;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-decoration: none;
}

/* Legacy modifier classes → same look */
.qna-footer,
.mp-footer,
.prec-footer {
  border-top: 1px solid var(--line, #e6ebf2);
  background: var(--bg, #fff);
  padding: 20px 0 28px;
}

@media (max-width: 767px) {
  .footer .footer__inner,
  .qna-footer .footer__inner,
  .mp-footer .footer__inner,
  .prec-footer .footer__inner {
    padding: 0 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* —— Search aliases (visual = existing .search / .qna-search) —— */
.hrzip-search,
.hrzip-search-input,
.hrzip-search-button {
  /* structural hooks; styles inherit via grouped selectors below */
}

.search.hrzip-search,
.hrzip-search.search,
form.hrzip-search {
  position: relative;
  width: 100%;
  max-width: var(--search-max);
}

/* Map new class names onto existing pill search system in style.css */
.hrzip-search,
.hrzip-search.qna-search {
  position: relative;
}

.hrzip-search-input {
  width: 100%;
  height: var(--search-h);
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius);
  padding: 0 52px 0 18px;
  font-size: var(--search-ph-size);
  box-shadow: var(--search-shadow);
  outline: none;
  background: #fff;
}

.hrzip-search-input::placeholder {
  color: var(--search-ph);
  font-size: var(--search-ph-size);
}

.hrzip-search-input:focus {
  border-color: #c5d3ea;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.hrzip-search-button {
  position: absolute;
  right: var(--search-btn-inset);
  top: var(--search-btn-inset);
  width: var(--search-btn-size);
  height: var(--search-btn-size);
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.hrzip-search-button:hover {
  background: var(--blue-deep);
}

/* —— Loading —— */
.hrzip-loading {
  display: inline-grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hrzip-loading__spin {
  width: 22px;
  height: 22px;
  border: 2px solid #e6ebf2;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: hrzip-spin 0.7s linear infinite;
}

@keyframes hrzip-spin {
  to {
    transform: rotate(360deg);
  }
}

/* —— Toast —— */
.hrzip-toast-host {
  position: fixed;
  z-index: 4000;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

.hrzip-toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(28, 36, 48, 0.92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18);
}

.hrzip-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* —— Author + labor attorney badge —— */
.hz-author {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  vertical-align: middle;
}

.hz-author .js-member-profile {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.hz-author .js-member-profile:hover {
  color: var(--blue, #2f6fed);
  text-decoration: underline;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f5f8;
  color: #6b7480;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.02em;
  vertical-align: middle;
}

.member-badge--pro {
  background: #eaf1ff;
  color: var(--blue, #2f6fed);
}

.qna-attorney-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--blue, #2f6fed);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.answer-attorney-host.is-labor-attorney {
  border-left: 3px solid var(--blue, #2f6fed);
  padding-left: 12px;
}

/* —— Shared left category menu (Q&A / news / forms) —— */
.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 8px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #4b5563;
  cursor: pointer;
  text-align: left;
}

.cat-list button em {
  font-style: normal;
  color: #9aa3af;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cat-list button:hover {
  background: #f4f7fb;
}

.cat-list button.is-on {
  background: #eaf1ff;
  color: var(--blue, #2f6fed);
  font-weight: 700;
}

.cat-list button.is-on em {
  color: var(--blue, #2f6fed);
}

.list-count {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-deep, #0f1c2e);
  letter-spacing: -0.03em;
}

.list-count strong {
  color: var(--blue, #2f6fed);
}

.list-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.list-panel-head__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.page-size select,
.list-panel-head .page-size select {
  height: 34px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 0 28px 0 10px;
  font-size: 12.5px;
  color: #4b5563;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%238b93a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 767px) {
  .list-panel-head__tools {
    width: 100%;
    margin-left: 0;
  }

  .list-panel-head__tools .page-size,
  .list-panel-head__tools .page-size select,
  .list-panel-head__tools > a {
    width: 100%;
  }
}

/* —— Shared TOP 5 sidebar widget —— */
.hz-top5 .widget__head,
.side-box.hz-top5 .side-box__head,
.widget .widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.hz-top5 .widget__head h2,
.side-box.hz-top5 .side-box__head h2,
.widget .widget__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hz-top5 .widget__head a,
.side-box.hz-top5 .side-box__head a,
.widget .widget__head a {
  font-size: 12px;
  color: #8b93a0;
  white-space: nowrap;
}

.hz-top5 .widget__head a:hover,
.side-box.hz-top5 .side-box__head a:hover,
.widget .widget__head a:hover {
  color: var(--blue, #2f6fed);
}

.widget-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: #f3f5f8;
  border-radius: 999px;
  padding: 3px;
}

.widget-tabs button {
  flex: 1;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7b8491;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.widget-tabs button.is-on {
  background: #fff;
  color: var(--blue, #2f6fed);
  box-shadow: 0 1px 3px rgba(28, 55, 90, 0.08);
}

.popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pop;
}

.popular-list li {
  counter-increment: pop;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid #f1f4f8;
}

.popular-list li:first-child {
  border-top: 0;
}

.popular-list li.content-empty {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  padding: 10px 0;
  border-top: 0;
}

.popular-list li.content-empty::before {
  content: none;
  display: none;
}

.popular-list li::before {
  content: counter(pop);
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #eef2f8;
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.popular-list li:nth-child(-n + 3)::before {
  background: #e8f0ff;
  color: var(--blue, #2f6fed);
}

.popular-list li.content-empty:nth-child(-n + 3)::before {
  content: none;
  display: none;
}

.popular-list a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.4;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-list a:hover {
  color: var(--blue, #2f6fed);
}
