/* ============================================================
   NIGHTCITY RP — rules.css
   Styles for the rules page only
   ============================================================ */

/* ── RULES HERO ─────────────────────────────────────────── */
.rules-hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-bottom: 4rem;
}
.rules-hero-content {
  position: relative; z-index: 2;
  padding: 0 3rem;
  padding-top: 9rem;
}
.rules-hero-title {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 1rem;
  color: var(--text);
}
.rules-hero-sub {
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.rules-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.rules-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
.rules-meta-item svg { opacity: 0.6; flex-shrink: 0; }
.rules-meta-sep { color: var(--text-dim); }

/* ── LAYOUT: sidebar + main ─────────────────────────────── */
.rules-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  align-items: start;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.rules-sidebar {
  position: sticky;
  top: 100px;
  padding-right: 2.5rem;
}
.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: block;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.sidebar-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

/* ── RULE SECTIONS ──────────────────────────────────────── */
.rules-main {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  min-width: 0;
}

.rule-section {
  scroll-margin-top: 100px;
}

.rule-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.rule-num {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.rule-section-header h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--text);
  font-family: var(--font-head);
}
.rule-intro {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 640px;
}

/* ── RULE LIST ──────────────────────────────────────────── */
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rule-item {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  transition: background var(--transition);
}
.rule-item:last-child { border-bottom: none; }
.rule-item:hover { background: var(--surface); }

.rule-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.rule-id {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  min-width: 28px;
  flex-shrink: 0;
}
.rule-item-header h3 {
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  flex: 1;
}
.rule-item p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  padding-left: calc(28px + 0.75rem); /* align with title */
}

/* Severity badges */
.rule-severity {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sev-low    { background: rgba(34,197,94,0.1);   color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.sev-medium { background: rgba(251,191,36,0.1);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.sev-high   { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* Note item (no severity) */
.rule-item-note {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(var(--accent-rgb), 0.04) !important;
  border-left: 3px solid rgba(var(--accent-rgb), 0.4);
}
.rule-item-note .rule-note-icon {
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.1rem;
  width: 20px;
  text-align: center;
}
.rule-item-note p {
  padding-left: 0;
  color: var(--text-muted);
}

/* ── SEVERITY TABLE ─────────────────────────────────────── */
.severity-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sev-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.sev-row:last-child { border-bottom: none; }
.sev-row > span {
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.sev-row > span:not(:last-child) {
  border-right: 1px solid var(--border);
}
.sev-row-header {
  background: var(--surface);
}
.sev-row-header > span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sev-row:not(.sev-row-header) { background: var(--bg-2); }
.sev-row:not(.sev-row-header):hover { background: var(--surface); }

.sev-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}
/* Reuse severity colors */
.sev-badge.sev-low      { background: rgba(34,197,94,0.1);   color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.sev-badge.sev-medium   { background: rgba(251,191,36,0.1);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.sev-badge.sev-high-table { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.sev-badge.sev-perm     { background: rgba(192,57,43,0.15);  color: #ff6b6b; border: 1px solid rgba(192,57,43,0.3); }

/* ── FOOTER NOTE ────────────────────────────────────────── */
.rules-footer-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.rules-footer-note::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.4), transparent);
}
.rules-footer-note p {
  font-size: 0.93rem;
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .rules-layout {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem 5rem;
  }
  .rules-sidebar {
    position: static;
    padding-right: 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .sidebar-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
  }
  .rules-hero-content { padding: 0 1.5rem; padding-top: 8rem; }
  .rule-item p { padding-left: 0; }
  .sev-row { grid-template-columns: 110px 1fr; }
  .sev-row > span:last-child {
    display: none; /* hide examples on mobile */
  }
  .sev-row-header > span:last-child { display: none; }
}
@media (max-width: 480px) {
  .rule-item-header { flex-wrap: wrap; }
  .rules-hero-title { font-size: 2.25rem; }
}
