/* HR Policy Handbook (/policies/). Builds on the tokens in styles.css. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.handbook-hero h1 .stamp { font-size: 0.85em; }
.doc-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
  text-wrap: balance;
}

.toc { max-width: 720px; margin: 32px auto; }
.toc ol { list-style: none; padding: 0; margin: 8px 0 12px; columns: 2 260px; column-gap: 24px; }
.toc li { break-inside: avoid; padding: 3px 0; }
.toc a { display: inline-flex; gap: 0.5em; }
.toc-num { flex: none; min-width: 1.6em; font-weight: 700; }
.toc .fineprint { margin: 0; }
.permalink-sample {
  display: inline-block;
  font-weight: 700;
  color: var(--link);
  border: 2px solid currentColor;
  border-radius: 6px;
  padding: 0 6px;
  line-height: 1.3;
}

.policy-section { max-width: 820px; margin: 28px auto; scroll-margin-top: 16px; }
.policy-section h2 { margin-bottom: 2px; }
.section-num {
  display: inline-block;
  background: var(--red);
  color: var(--on-red);
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px;
  margin-right: 4px;
}
.section-sub { color: var(--ink-soft); font-style: italic; margin: 0 0 14px; }

.policies { list-style: none; padding: 0; margin: 0; }
.policy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  border: 2px solid transparent;
  scroll-margin-top: 24px;
}
.policy + .policy { border-top: 1px dashed var(--shadow); }
.policy.depth-2 { margin-left: 1.25rem; }
.policy.depth-3 { margin-left: 2.5rem; }
.policy p { margin: 0; flex: 1; min-width: 0; text-wrap: pretty; }
.policy .num { white-space: nowrap; margin-right: 2px; }

.permalink {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  margin-top: -2px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: 0.75;
}
.permalink:visited { color: var(--link); }
.permalink:hover,
.permalink:focus-visible,
.policy:hover .permalink,
.policy:target .permalink { opacity: 1; }
.permalink.copied { background: var(--yellow); color: #2b2622; border-color: #2b2622; opacity: 1; }

/* The cited policy: highlighted like a memo someone went over with a marker. */
.policy:target {
  background: var(--yellow);
  color: #2b2622;
  border: 2px solid #2b2622;
  box-shadow: var(--shadow-soft);
}
.policy:target .permalink { color: #2b2622; }
.policy:target + .policy { border-top-color: transparent; }

.acknowledge { position: relative; max-width: 620px; margin: 40px auto; text-align: center; }
.acknowledge p { margin: 0 0 12px; text-wrap: pretty; }
.ack-stamp {
  display: inline-block;
  color: var(--red);
  border: 4px solid var(--red);
  border-radius: 8px;
  padding: 2px 14px;
  font-weight: 700;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-4deg);
}

.copy-status {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-soft);
  z-index: 10;
}
.copy-status:empty { display: none; }

@media (max-width: 600px) {
  .policy.depth-2 { margin-left: 0.5rem; }
  .policy.depth-3 { margin-left: 1rem; }
  .policy-section { padding: 18px 16px; }
}
