/**
 * Cheat sheet block layout (web adaptation of the CIS print sheet).
 * 1 column on phones, 2 on desktop — not landscape PDF width.
 */

.cheat-sheet-body .cheat-sheet-layout,
.cheat-sheet-body .cs-sheet,
.cheat-sheet-layout,
.cs-sheet {
  --cs-border: #d7dee8;
  --cs-muted: #64748b;
  --cs-ink: #17212b;
  --cs-soft: #f1f5f9;
  --cs-green: #199b57;
  color: var(--cs-ink);
  font-size: 0.875rem;
  line-height: 1.35;
}

.cheat-sheet-body > .quiz-detail-section-title {
  margin-bottom: 0.75rem;
}

/* When using block layout, drop the article-y UGC spacing */
.cheat-sheet-body .cheat-sheet-layout .user-generated-content,
.cheat-sheet-body .cs-sheet .user-generated-content {
  /* no-op placeholder */
}

.cs-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 860px) {
  .cs-top {
    grid-template-columns: 1.45fr 0.9fr;
  }
}

.cs-hero,
.cs-hero-side,
.cs-card {
  border: 1px solid var(--cs-border);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  box-shadow: none;
  break-inside: avoid;
}

.cs-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e9fff4;
  color: #0d7a4c;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.cs-hero h1,
.cs-hero h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cs-hero .cs-sub {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #1d6d47;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cs-hero p,
.cs-hero-side p,
.cs-card p {
  margin: 0.35rem 0 0;
  color: #334155;
}

.cs-hero-side h3,
.cs-smallcaps {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #14532d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cs-hero-side ul,
.cs-card ul,
.cs-tight {
  margin: 0.25rem 0;
  padding-left: 1.1rem;
}

.cs-hero-side li,
.cs-card li,
.cs-tight li {
  margin: 0.15rem 0;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: start;
}

@media (min-width: 860px) {
  .cs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cs-span-2 {
  grid-column: 1 / -1;
}

.cs-section-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.cs-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  flex: 0 0 auto;
  background: #189b57;
}

.cs-n1 { background: #189b57; }
.cs-n2 { background: #2563eb; }
.cs-n3 { background: #7c3aed; }
.cs-n4 { background: #9333ea; }
.cs-n5 { background: #0f766e; }
.cs-n6 { background: #b45309; }
.cs-n7 { background: #dc2626; }
.cs-n8 { background: #0f766e; }
.cs-n9 { background: #1d4ed8; }
.cs-n10 { background: #059669; }
.cs-n11 { background: #c2410c; }
.cs-n12 { background: #111827; }

.cs-section-head h2,
.cs-section-head h3 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cs-domain {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}

.cs-mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0;
  font-size: 0.8rem;
}

.cs-mini-table th,
.cs-mini-table td {
  border: 1px solid #e2e8f0;
  padding: 0.28rem 0.4rem;
  vertical-align: top;
  text-align: left;
}

.cs-mini-table th {
  background: var(--cs-soft);
  font-weight: 700;
  font-size: 0.72rem;
}

.cs-callout,
.cs-callout-good,
.cs-callout-warn,
.cs-callout-alert {
  margin-top: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 5px;
  font-size: 0.8rem;
  line-height: 1.3;
}

.cs-callout,
.cs-callout-good {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.cs-callout-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.cs-callout-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.cs-chip {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  background: #f8fafc;
}

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

@media (min-width: 520px) {
  .cs-two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.cs-code {
  margin: 0.35rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 5px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-x: auto;
}

.cs-label {
  font-weight: 700;
}

.cs-footer-note {
  margin-top: 0.75rem;
  padding-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--cs-muted);
}

.cs-hr,
hr.cs-hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0.45rem 0;
  height: 1px;
}

/* Markdown fallback denser than quiz articles */
.cheat-sheet-markdown {
  font-size: 0.95rem;
}

.cheat-sheet-markdown h2 {
  font-size: 1.15rem;
  margin-top: 1.25rem;
}

.cheat-sheet-markdown table {
  font-size: 0.85rem;
}

@media print {
  .cs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cs-card,
  .cs-hero,
  .cs-hero-side {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
