/* ============================================================
   DENSITY LABS - PROBLEMS CLUSTER
   Layout + menu for /problems/ hub and the /problems/<slug>/ pages.
   Consumes brand.css tokens (--ink, --paper, --line, --red, etc).
   ============================================================ */

/* ---------- Shared hero ---------- */
.prob-hero {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.prob-breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 22px;
}
.prob-breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.prob-breadcrumb a:hover { color: var(--red); }
.prob-breadcrumb span { color: var(--ink-faint); margin: 0 10px; }
.prob-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}
.prob-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 900px;
}
.prob-hero h1 em { font-style: italic; color: var(--red); font-weight: 800; }
.prob-hero .prob-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 720px;
  margin-top: 20px;
  font-weight: 300;
}

/* ---------- Page shell: nav | main | cta ---------- */
.prob-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 272px;
  grid-template-areas: "nav main cta";
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 72px;
  align-items: start;
}
.prob-nav  { grid-area: nav; }
.prob-main { grid-area: main; min-width: 0; }
.prob-cta  { grid-area: cta; }

/* ---------- Sidebar menu ---------- */
.prob-nav-inner {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
}
.prob-nav-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.prob-nav-toggle .chev { transition: transform 0.2s ease; }
.prob-nav-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.prob-nav-group {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.prob-nav-group:first-child { margin-top: 0; }
.prob-nav-list ul { list-style: none; margin: 0 0 4px; padding: 0; }
.prob-nav-list li { margin: 0; }
.prob-nav-list a {
  display: block;
  padding: 7px 10px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.prob-nav-list a:hover { color: var(--ink); background: var(--paper-soft); }
.prob-nav-list a[aria-current="page"] {
  color: var(--red);
  font-weight: 600;
  border-left-color: var(--red);
  background: var(--red-soft);
}

/* ---------- Main content (prose) ---------- */
.prob-main .prob-body { max-width: 720px; }
.prob-main .prob-body > p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.72;
  margin-bottom: 20px;
}
.prob-main .prob-body .prob-intro {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 300;
}
.prob-main .prob-body h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 40px 0 14px;
}
.prob-main .prob-body h2 .accent { color: var(--red); }
.prob-main .prob-body ul {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.prob-main .prob-body li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.6;
}
.prob-main .prob-body li:last-child { border-bottom: none; }
.prob-main .prob-body li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 17px;
  width: 8px;
  height: 1px;
  background: var(--red);
}
.prob-main .prob-body strong { color: var(--ink); font-weight: 600; }
.prob-main .prob-body a { color: var(--red); text-decoration-color: var(--line-strong); }
.prob-main .prob-body a:hover { text-decoration-color: var(--red); }

/* ---------- Prev / next ---------- */
.prob-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.prob-pager a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.prob-pager a:hover { border-color: var(--line-strong); background: var(--paper-soft); }
.prob-pager .pager-dir {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 6px;
}
.prob-pager .pager-title { color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.prob-pager .prob-next { text-align: right; }
.prob-pager .prob-next:only-child { grid-column: 2; }

/* ---------- Sticky CTA card ---------- */
.prob-cta-inner { position: sticky; top: 104px; }
.prob-cta-card {
  background: var(--black);
  color: var(--text-on-dark);
  border-radius: 12px;
  padding: 26px 24px;
}
.prob-cta-card .cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: 12px;
}
.prob-cta-card h2 {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.prob-cta-card p {
  color: var(--text-on-dark-soft);
  font-size: 13.5px;
  line-height: 1.6;
  margin-bottom: 20px;
  font-weight: 300;
}
.prob-cta-card .btn-primary {
  display: block;
  text-align: center;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 12px;
}
.prob-cta-card .btn-primary:hover { background: var(--white); color: var(--red); }
.prob-cta-card .cta-offer {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text-on-dark-soft);
  text-decoration: underline;
  text-decoration-color: var(--text-on-dark-muted);
  text-underline-offset: 3px;
}
.prob-cta-card .cta-offer:hover { color: var(--white); text-decoration-color: var(--white); }
.prob-cta-card .cta-fine {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-dark);
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

/* ---------- Hub (index) grid ---------- */
.prob-index { padding: 56px 0 80px; }
.prob-group { margin-bottom: 52px; }
.prob-group-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.prob-group-head .g-letter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  letter-spacing: 0.1em;
}
.prob-group-head h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.prob-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.prob-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  background: var(--white);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.prob-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(15, 23, 42, 0.25);
}
.prob-card .card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}
.prob-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.28;
  margin: 8px 0 8px;
}
.prob-card p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.prob-card .card-go {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .prob-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-areas: "nav main" "nav cta";
    gap: 40px;
  }
  .prob-cta-inner { position: static; margin-top: 8px; }
}

@media (max-width: 980px) {
  .prob-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "nav" "main" "cta";
    gap: 28px;
    padding-top: 32px;
  }
  .prob-nav-inner {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .prob-nav-toggle { display: flex; }
  .prob-nav-list {
    display: none;
    margin-top: 10px;
    padding: 4px 4px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .prob-nav-list.is-open { display: block; }
  .prob-cta-inner { margin-top: 0; }
  .prob-cards { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .prob-hero { padding: 48px 0 32px; }
  .prob-pager { grid-template-columns: 1fr; }
  .prob-pager .prob-next { text-align: left; }
  .prob-pager .prob-next:only-child { grid-column: 1; }
}
