/* ============================================================
   THE HIDEOUT — rules.html
   Page-specific styles. Loaded AFTER styles.css.
   ============================================================ */

.rules-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

/* ---------- table of contents ---------- */
.rules-toc { position: sticky; top: calc(var(--nav-h) + 20px); }
.rules-toc h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 14px;
  font-weight: 400;
}
.rules-toc a {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  font-size: 14px;
  color: var(--fg-muted);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.rules-toc a:hover { color: var(--fg); border-color: var(--line-strong); }
.rules-toc a.active {
  color: var(--aqua);
  border-color: var(--aqua);
  background: var(--aqua-ghost);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- search ---------- */
.rules-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 11px 18px;
  margin-bottom: 32px;
}
.rules-search svg { width: 17px; height: 17px; color: var(--fg-dim); flex: none; }
.rules-search input {
  background: none; border: none; outline: none;
  color: var(--fg); font: inherit; font-size: 14.5px; width: 100%;
  min-height: 24px;
}
.rules-search input::placeholder { color: var(--fg-dim); }
.rules-search:focus-within { border-color: var(--aqua-line); }

.rules-empty { padding: 20px 0; color: var(--fg-dim); font-size: 14.5px; font-family: var(--mono); }

/* ---------- rule groups ---------- */
.rule-group { margin-bottom: clamp(40px, 6vw, 60px); scroll-margin-top: calc(var(--nav-h) + 24px); }
.rule-group > h2 {
  font-size: clamp(24px, 3.4vw, 32px);
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.rule-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.rule-item:hover { border-color: var(--line-strong); }
.rule-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.rule-item p {
  margin: 0;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--fg-muted);
}
.rule-item p + p { margin-top: 10px; }
.rule-item p strong, .rule-item li strong { color: var(--fg); font-weight: 700; }

.rule-item ul { margin: 12px 0 0; padding-left: 20px; }
.rule-item li {
  font-family: var(--body);
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}
.rule-item li::marker { color: var(--aqua); }

/* class marker badge ( A / B / C / D ) */
.rule-item .code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--aqua);
  background: var(--aqua-ghost);
  border: 1px solid var(--aqua-line);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.rule-item p .code, .rule-item li .code { margin-right: 4px; vertical-align: 1px; }

@media (max-width: 860px) {
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
  }
  .rules-toc h4 { flex-basis: 100%; margin-bottom: 6px; }
  .rules-toc a { border-left: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 13px; }
  .rules-toc a.active { border-radius: 999px; }
}
