/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* KB article prose — mirrors the Starlight content area (SC-13009). Scoped to .kb-prose. */

.kb-prose {
  max-width: 52rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #1e293b;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Headings */

.kb-prose h1,
.kb-prose h2,
.kb-prose h3,
.kb-prose h4,
.kb-prose h5,
.kb-prose h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  color: #0f172a;
}

.kb-prose h1:first-child,
.kb-prose h2:first-child,
.kb-prose h3:first-child,
.kb-prose h4:first-child,
.kb-prose h5:first-child,
.kb-prose h6:first-child {
  margin-top: 0;
}

.kb-prose h1 { font-size: 2em; }
.kb-prose h2 { font-size: 1.5em; }
.kb-prose h3 { font-size: 1.25em; }
.kb-prose h4 { font-size: 1.1em; }
.kb-prose h5 { font-size: 1em; font-weight: 600; }
.kb-prose h6 { font-size: 0.9em; font-weight: 600; }

/* Paragraphs */

.kb-prose p {
  margin-top: 0;
  margin-bottom: 1.1em;
}

.kb-prose p:last-child {
  margin-bottom: 0;
}

/* Lists — restore what Tailwind preflight strips */

.kb-prose ul,
.kb-prose ol {
  margin-top: 0;
  margin-bottom: 1.1em;
  padding-left: 1.75em;
}

.kb-prose ul {
  list-style: disc;
}

.kb-prose ol {
  list-style: decimal;
}

.kb-prose li {
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

.kb-prose li > ul,
.kb-prose li > ol {
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

/* Links */

.kb-prose a {
  color: var(--color-blue-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kb-prose a:hover {
  color: var(--color-blue-700);
}

/* Strong / em */

.kb-prose strong { font-weight: 700; }
.kb-prose em     { font-style: italic; }
.kb-prose del    { text-decoration: line-through; }

/* Horizontal rule */

.kb-prose hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 2em 0;
}

/* Blockquote */

.kb-prose blockquote {
  border-left: 4px solid #94a3b8;
  margin: 1.25em 0;
  padding: 0.5em 1em;
  color: #475569;
  background-color: #f8fafc;
  border-radius: 0 0.25rem 0.25rem 0;
}

.kb-prose blockquote p:last-child {
  margin-bottom: 0;
}

/* Inline code */

.kb-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
}

/* Block code — pre > code resets the inline treatment */

.kb-prose pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background-color: #1e293b;
  color: #e2e8f0;
  border-radius: 0.375rem;
  padding: 1em 1.25em;
  overflow-x: auto;
  margin: 1.25em 0;
  line-height: 1.6;
}

.kb-prose pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  border: 0;
  font-size: 1em;
}

/* Tables */

.kb-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: 0.9375em;
}

.kb-prose thead {
  background-color: #f1f5f9;
}

.kb-prose th {
  font-weight: 700;
  text-align: left;
  padding: 0.6em 0.85em;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.kb-prose td {
  padding: 0.6em 0.85em;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.kb-prose tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Images */

.kb-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  display: block;
  margin: 1.25em 0;
}

/* Admonitions */

.kb-admonition {
  border-left: 4px solid;
  border-radius: 0.375rem;
  padding: 0.85em 1em;
  margin: 1.25em 0;
}

.kb-admonition-title {
  font-weight: 700;
  font-size: 0.9em;
  margin: 0 0 0.5em 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kb-admonition-content > *:first-child { margin-top: 0; }
.kb-admonition-content > *:last-child  { margin-bottom: 0; }

/* note — blue */
.kb-admonition-note {
  background-color: var(--color-blue-100);
  border-color: var(--color-blue-700);
}
.kb-admonition-note .kb-admonition-title {
  color: var(--color-blue-700);
}

/* tip — green */
.kb-admonition-tip {
  background-color: var(--color-green-100);
  border-color: var(--color-green-700);
}
.kb-admonition-tip .kb-admonition-title {
  color: var(--color-green-700);
}

/* caution — amber */
.kb-admonition-caution {
  background-color: var(--color-orange-100);
  border-color: var(--color-orange-700);
}
.kb-admonition-caution .kb-admonition-title {
  color: var(--color-orange-700);
}

/* danger — red */
.kb-admonition-danger {
  background-color: var(--color-red-100);
  border-color: var(--color-red-700);
}
.kb-admonition-danger .kb-admonition-title {
  color: var(--color-red-700);
}

/* Roomier horizontal gutter for the article preview inside the slide-over
   drawer (SC-13009 #3). The DS drawer body's default padding (~14px) is tight
   for a 600px reading column; this widens it toward the Starlight content
   column. Scoped to .kb-prose within the drawer, so the inline draft-show
   surfaces — which already sit in padded cards — are unaffected. */
.tw-drawer-body .kb-prose {
  padding-inline: 0.75rem;
}

/* Draft diff — side-by-side rendered markdown columns (SC-13011). Scoped to .kb-diff-col / .kb-diff-scroll. */

.kb-diff-col {
  display: flex;
  flex-direction: column;
  min-width: 0; /* prevent grid blowout on wide content */
}

.kb-diff-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 32rem; /* ~512px — tall enough to read, short enough to see both cols */
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 1rem;
  background-color: #fff;
}

/* Video embeds — responsive 16:9 */

.kb-embed {
  position: relative;
  padding-top: 56.25%;
  width: 100%;
  border-radius: 0.375rem;
  overflow: hidden;
  margin: 1.25em 0;
}

.kb-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
