/* =========================================================
   Penal Codes page (night theme). Shared bar/signal/close: night.css.
   Photo opener, sticky search + category strip, one table per
   category (cards under 900px), green close.
   ========================================================= */

/* ---------- Opener ---------- */
.lx-hero { position: relative; min-height: 52svh; display: grid; align-items: end; overflow: clip; background: var(--night); color: #fff; }
.lx-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 12% 55%; }
.lx-hero-scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 15, 20, 0.96) 0%, rgba(11, 15, 20, 0.65) 45%, rgba(11, 15, 20, 0.2) 85%); }
.lx-hero-copy { position: relative; z-index: 2; padding-block: clamp(96px, 16svh, 160px) clamp(36px, 6svh, 64px); }
.lx-title { margin: 0; font-size: clamp(3.2rem, 8.5vw, 7.4rem); line-height: 0.92; letter-spacing: -0.05em; color: #fff; }
.lx-title span { color: var(--sc-accent); }
.lx-lead { margin: 1.1rem 0 0; max-width: 46ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #dde3ea; }
.lx-meta { margin: 0.9rem 0 0; font-weight: 600; color: #f5a48f; }

/* ---------- Sticky search + categories ---------- */
.lx-bar { position: sticky; top: 68px; z-index: 40; background: var(--night); border-bottom: 1px solid rgba(255, 255, 255, 0.08); scroll-margin-top: 68px; }
.lx-bar-inner { display: flex; align-items: center; gap: 12px 20px; padding-block: 12px; }
.lx-search { position: relative; flex: 0 1 380px; min-width: 0; }
.lx-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--night-soft); pointer-events: none; }
.lx-search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px; border-radius: 999px; font: inherit; font-size: 1rem; color: #fff;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out);
}
.lx-search input::placeholder { color: #8f99a5; }
.lx-search input:focus { outline: none; border-color: var(--sc-accent); background: rgba(255, 255, 255, 0.1); }
.lx-cats { flex: 1; min-width: 0; }
.lx-cats ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0 24px 0 0; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.lx-cats li { flex: none; }
.lx-cats li[hidden] { display: none; }
.lx-cats a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 0.92rem; color: rgba(245, 247, 250, 0.72); transition: background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out); }
.lx-cats a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.lx-cats a[aria-current] { color: #fff; background: rgba(236, 109, 77, 0.18); box-shadow: inset 0 0 0 1px rgba(236, 109, 77, 0.55); }

/* ---------- Categories + tables ---------- */
.lx-list { background: var(--night); color: var(--night-ink); padding-bottom: clamp(48px, 8vw, 96px); }
.lx-status { margin-block: 0; padding-top: 20px; min-height: 1em; color: var(--night-soft); font-weight: 600; }
.lx-status:empty { padding-top: 0; }
.lx-cat { padding-top: clamp(40px, 6vw, 72px); scroll-margin-top: 150px; }
.lx-cat[hidden] { display: none; }
.lx-cat-head { margin-bottom: 1.2rem; }
.lx-cat-num { margin: 0; font-family: var(--sc-font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sc-accent); }
.lx-cat-name { margin: 0.35rem 0 0; font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -0.035em; color: #fff; }

.lx-table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.lx-table thead th { position: sticky; top: 136px; z-index: 1; background: #10151c; padding: 12px 14px; text-align: left; font-family: var(--sc-font-display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-soft); border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.lx-table td, .lx-table tbody th { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.07); vertical-align: middle; }
.lx-table tbody tr { transition: background-color 120ms var(--sc-ease-out); }
.lx-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.lx-table tr[hidden] { display: none; }
.lx-code { font-variant-numeric: tabular-nums; color: var(--night-soft); white-space: nowrap; font-size: 0.9rem; }
.lx-charge { font-weight: 600; color: #fff; }
.lx-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lx-type { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.lx-type--minor { background: rgba(255, 255, 255, 0.08); color: #dde3ea; }
.lx-type--misd { background: rgba(255, 176, 32, 0.14); color: #ffc861; }
.lx-type--felony { background: rgba(255, 77, 61, 0.16); color: #ff9a8e; }
.lx-yes { font-weight: 700; color: #f5a48f; }
.lx-no { color: #8f99a5; }

.lx-empty { padding-top: clamp(40px, 6vw, 72px); color: var(--night-soft); }
.lx-empty[hidden] { display: none; }
.lx-empty p { margin: 0; }
.lx-empty-title { font-family: var(--sc-font-display); font-weight: 800; font-size: 1.5rem; color: #fff; margin-bottom: 0.4rem !important; }

@media (max-width: 900px) { .lx-bar-inner { flex-direction: column; align-items: stretch; } .lx-search { flex-basis: auto; } }

/* Phones: each charge becomes a card. */
@media (max-width: 900px) {
  .lx-cat { scroll-margin-top: 190px; }
  .lx-table thead { display: none; }
  .lx-table, .lx-table tbody { display: block; }
  .lx-table tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 10px 12px; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .lx-table td, .lx-table tbody th { padding: 0; border: 0; }
  .lx-table .lx-code { grid-row: 1; grid-column: 1 / 3; }
  .lx-table .lx-type-cell { grid-row: 1; grid-column: 3 / -1; justify-self: end; }
  .lx-table .lx-charge { grid-row: 2; grid-column: 1 / -1; font-size: 1.05rem; line-height: 1.3; }
  .lx-table td:not(.lx-code, .lx-type-cell)::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8f99a5; }
  .lx-table tbody tr:hover { background: none; }
}
