/* =============================================================================
   Typography for CMS-generated article bodies (blog posts, help articles).

   The classes here are emitted by App\Kurio\Blocks::toHtml — a fixed, closed
   set. They are NOT Tailwind utilities because the markup is produced at
   runtime by PHP, which the Tailwind scanner cannot see; a stylesheet keeps
   the rendering independent of the build.

   Reading comfort is the whole brief: long line-height, restrained measure,
   generous spacing between blocks, and nothing that competes with the words.
   ============================================================================= */

.kb {
  color: #cfcbc4;
  font-size: 1.0625rem;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .kb { font-size: 1.125rem; line-height: 1.85; }
}

.kb > * + * { margin-top: 1.5rem; }

.kb p { text-wrap: pretty; }

.kb strong { color: #f5f3ef; font-weight: 650; }
.kb em { font-style: italic; }

.kb a {
  color: #ffc629;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
.kb a:hover { color: #e0a800; }

.kb code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: #1f1f1f;
  border: 1px solid #2b2b2b;
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: #f5f3ef;
}

/* --- headings ------------------------------------------------------------- */
.kb .kb-h2,
.kb .kb-h3 {
  color: #f5f3ef;
  letter-spacing: -0.02em;
  scroll-margin-top: 6rem;
  text-wrap: balance;
}
.kb .kb-h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 3rem;
}
@media (min-width: 768px) {
  .kb .kb-h2 { font-size: 1.75rem; }
}
.kb .kb-h3 {
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 2.25rem;
}

/* A hairline above every H2 gives the article a rhythm without a hard rule. */
.kb .kb-h2::before {
  content: '';
  display: block;
  width: 2.25rem;
  height: 3px;
  background: #ffc629;
  margin-bottom: 1rem;
}

/* --- lists ---------------------------------------------------------------- */
.kb .kb-list { padding-left: 0; list-style: none; }
.kb .kb-list li { position: relative; padding-left: 1.6rem; }
.kb .kb-list li + li { margin-top: 0.7rem; }

.kb ul.kb-list li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffc629;
}

.kb ol.kb-list { counter-reset: kb-counter; }
.kb ol.kb-list li { counter-increment: kb-counter; }
.kb ol.kb-list li::before {
  content: counter(kb-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffc629;
  font-variant-numeric: tabular-nums;
}

/* --- quote ---------------------------------------------------------------- */
.kb .kb-quote {
  border-left: 3px solid #ffc629;
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin-left: 0;
  margin-right: 0;
  color: #f5f3ef;
  font-size: 1.125rem;
  line-height: 1.7;
}
@media (min-width: 768px) {
  .kb .kb-quote { font-size: 1.25rem; }
}
.kb .kb-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  color: #868686;
}

/* --- callout -------------------------------------------------------------- */
.kb .kb-callout {
  border: 1px solid #2b2b2b;
  border-left-width: 3px;
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  background: #191919;
  font-size: 1rem;
  line-height: 1.7;
}
.kb .kb-callout p { margin: 0; }
.kb .kb-callout__title {
  font-weight: 700;
  color: #f5f3ef;
  margin-bottom: 0.35rem !important;
  font-size: 0.9375rem;
}
.kb .kb-callout--info { border-left-color: #4b9fe1; }
.kb .kb-callout--tip { border-left-color: #56d38a; }
.kb .kb-callout--warning { border-left-color: #ffb020; background: #1e1a12; }

/* --- figure --------------------------------------------------------------- */
.kb .kb-figure { margin: 2.25rem 0; }
.kb .kb-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #232323;
}
.kb .kb-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: #868686;
  text-align: center;
}

/* --- table ---------------------------------------------------------------- */
.kb .kb-tablewrap {
  overflow-x: auto;
  border: 1px solid #232323;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.kb .kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 30rem;
}
.kb .kb-table caption {
  caption-side: bottom;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #868686;
  text-align: left;
}
.kb .kb-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #868686;
  background: #191919;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #232323;
  white-space: nowrap;
}
.kb .kb-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #232323;
  vertical-align: top;
}
.kb .kb-table tr:last-child td { border-bottom: 0; }

/* --- divider -------------------------------------------------------------- */
.kb .kb-divider {
  border: 0;
  height: 1px;
  background: #232323;
  margin: 3rem 0;
}

/* =============================================================================
   Article furniture: reading progress and table of contents.
   ============================================================================= */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: #ffc629;
  z-index: 60;
  will-change: transform;
}

.toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.85rem;
  border-left: 2px solid #232323;
  color: #9a9a9a;
  font-size: 0.875rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: #f5f3ef; border-left-color: #2e2e2e; }
.toc a.is-current { color: #ffc629; border-left-color: #ffc629; }
.toc a[data-level='3'] { padding-left: 1.6rem; font-size: 0.8125rem; }

@media (prefers-reduced-motion: reduce) {
  .reading-progress { transition: none; }
}
