/* Copyright (c) 2026 Drew Gislason */
/* HEN specification page — reuses Hnefatafl colors, fonts, and buttons. */

body.hen-page {
  color: var(--chrome-text);
  background: var(--page-bg);
}

.hen-doc {
  width: 100%;
  max-width: 48rem;
  margin: 0.75rem auto 0;
  padding: 0.75rem 1rem 1.5rem;
  box-sizing: border-box;
}

.hen-doc__head {
  text-align: center;
  margin: 0 0 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--hen-border);
}

.hen-doc__eyebrow {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, "Cinzel", "Times New Roman", serif);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a96a8;
}

.hen-doc__head h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display, "Cinzel", "Times New Roman", serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--chrome-text);
}

.hen-doc__version {
  margin: 0 0 1rem;
  font-family: var(--font-display, "Cinzel", "Times New Roman", serif);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: var(--hen-text);
}

.hen-doc__download {
  margin: 0;
}

.hen-doc__download .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: min(100%, 22rem);
  padding: 0.65rem 1.1rem;
  text-decoration: none;
  white-space: normal;
}

.hen-doc__body {
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--status-text);
}

.hen-doc__body h2 {
  font-family: var(--font-display, "Cinzel", "Times New Roman", serif);
  font-weight: 600;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  letter-spacing: 0.06em;
  color: var(--chrome-text);
  margin: 1.75rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--hen-border);
}

.hen-doc__body h3 {
  font-family: var(--font-display, "Cinzel", "Times New Roman", serif);
  font-weight: 600;
  font-size: clamp(0.98rem, 2.6vw, 1.12rem);
  letter-spacing: 0.05em;
  color: var(--chrome-text);
  margin: 1.35rem 0 0.6rem;
}

.hen-doc__body p {
  margin: 0 0 0.85rem;
}

.hen-doc__body a {
  color: #e8d9a8;
  text-decoration: underline;
  text-decoration-color: var(--btn-border);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.hen-doc__body a:hover {
  color: #fff;
}

.hen-doc__body a:focus-visible {
  outline: 2px solid #c9b896;
  outline-offset: 2px;
}

.hen-doc__body ol,
.hen-doc__body ul {
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
}

.hen-doc__body li {
  margin: 0 0 0.3rem;
}

.hen-doc__body li ul {
  margin: 0.3rem 0 0.15rem;
}

.hen-doc__body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: none;
  color: #e8d9a8;
  border-radius: 0;
  padding: 0;
}

pre.hen-code {
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--hen-bg);
  color: var(--hen-text);
  border: 1px solid var(--hen-border);
  border-radius: var(--radius-btn);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 2.15vw, 0.82rem);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  tab-size: 0;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

pre.hen-code:focus {
  outline: 2px solid #3a4558;
  outline-offset: 1px;
}

pre.hen-code code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  white-space: inherit;
  display: block;
}

pre.hen-board {
  line-height: 1.32;
  /* pre-wrap lets long compact strings wrap at spaces; 11-wide board rows stay intact */
  white-space: pre-wrap;
}

.hen-doc .copyright {
  margin-top: 1.75rem;
}

body.hen-page .game-back {
  max-width: 48rem;
}

@media (min-width: 480px) {
  .hen-doc {
    padding: 1rem 1.25rem 2rem;
  }
}

@media print {
  body.hen-page {
    background: #f7f5ef;
    color: #1a2332;
  }
  body.hen-page .site-header,
  body.hen-page .menu-toggle,
  body.hen-page .skip-link,
  body.hen-page .hen-doc__download,
  body.hen-page .game-back {
    display: none !important;
  }
  .hen-doc__body,
  .hen-doc__head h1,
  .hen-doc__version,
  .hen-doc .copyright,
  .hen-doc__eyebrow {
    color: #1a2332;
  }
  .hen-doc__body a { color: #1a2332; }
  pre.hen-code,
  .hen-doc__body code {
    background: #eef2f6;
    color: #1a2332;
    border-color: #8aa0b8;
  }
}
