/*
 * Shared styles for kField guide pages under /docs/.
 * Each guide includes <link rel="stylesheet" href="/docs/_assets/guide.css">.
 *
 * Page-specific tweaks (custom widths, table colours) go in inline <style>
 * blocks on the individual page; this file holds the brand chrome plus the
 * common building blocks (Subheading, NumberedList, Code, CodeBlock, Tip).
 */
:root {
  --kf-orange: #C64617;
  --kf-orange-dark: #9b330a;
  --kf-navy: #0E2A47;
  --kf-charcoal: #1F2937;
  --kf-gray: #4B5563;
  --kf-light: #F4EFEA;
  --hairline: #E5E7EB;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--kf-charcoal);
  background: #ffffff;
  line-height: 1.55;
}

/* ---- Branded guide header ---------------------------------------------- */
header.guide-header {
  background: #ffffff;
  border-bottom: 1px solid var(--hairline);
  padding: 14px 24px;
}
header.guide-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.guide-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--kf-charcoal);
}
header.guide-header .brand-logo { display: block; line-height: 0; }
header.guide-header img.logo { height: 32px; width: auto; display: block; }
header.guide-header .brand-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--kf-navy);
  letter-spacing: 0.01em;
}
header.guide-header .brand-text .sep { color: var(--kf-gray); font-weight: 400; padding: 0 6px; }
header.guide-header .brand-text .label { color: var(--kf-orange); font-weight: 700; text-decoration: none; }
header.guide-header .brand-text a { text-decoration: none; }
header.guide-header .brand-text a:hover .label { text-decoration: underline; }
header.guide-header nav.crumbs { font-size: 13px; color: var(--kf-gray); }
header.guide-header nav.crumbs a { color: var(--kf-orange); text-decoration: none; }
header.guide-header nav.crumbs a:hover { text-decoration: underline; }

/* ---- In-header search -------------------------------------------------- */
header.guide-header .kf-search-wrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 380px;
  margin: 0 16px;
}
header.guide-header input#kf-search {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--kf-charcoal);
  background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234B5563' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3 3'/%3E%3C/svg%3E") no-repeat 9px center;
  background-size: 16px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
header.guide-header input#kf-search:focus {
  border-color: var(--kf-orange);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(198, 70, 23, 0.12);
}
header.guide-header input#kf-search::placeholder { color: #9aa3af; }

#kf-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(14, 42, 71, 0.14);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 100;
}
.kf-search-hit {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
}
.kf-search-hit:last-child { border-bottom: none; }
.kf-search-hit:hover { background: var(--kf-light); }
.kf-search-meta {
  font-size: 11px;
  color: var(--kf-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 3px;
}
.kf-search-title {
  font-size: 15px;
  color: var(--kf-navy);
  font-weight: 600;
  margin-bottom: 3px;
}
.kf-search-desc {
  font-size: 13px;
  color: var(--kf-gray);
  line-height: 1.4;
}
.kf-search-empty {
  padding: 14px;
  font-size: 14px;
  color: var(--kf-gray);
  text-align: center;
}
#kf-search-results mark {
  background: rgba(198, 70, 23, 0.18);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  header.guide-header .inner { flex-wrap: wrap; row-gap: 10px; }
  header.guide-header .kf-search-wrap {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }
}

/* ---- Page layout ------------------------------------------------------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
h1.page-title { font-size: 28px; margin: 0 0 8px; color: var(--kf-navy); }
p.subtitle { color: var(--kf-gray); margin: 0 0 28px; font-size: 15px; max-width: 760px; }

/* ---- Building blocks for prose-style guides ---------------------------- */
.guide-prose h2 {
  margin: 32px 0 8px;
  color: var(--kf-navy);
  font-size: 22px;
  font-weight: 700;
}
.guide-prose h3 {
  margin: 28px 0 6px;
  color: var(--kf-charcoal);
  font-size: 17px;
  font-weight: 600;
}
.guide-prose p { margin: 8px 0; color: var(--kf-charcoal); font-size: 15px; }
.guide-prose ol, .guide-prose ul { margin: 10px 0 10px 0; padding-left: 22px; color: var(--kf-charcoal); font-size: 15px; }
.guide-prose ol li, .guide-prose ul li { margin: 6px 0; }
.guide-prose ol { list-style: decimal; }
.guide-prose ol li::marker { color: var(--kf-orange); font-weight: 700; }
.guide-prose strong { font-weight: 600; color: var(--kf-charcoal); }
.guide-prose a { color: var(--kf-orange); text-decoration: none; }
.guide-prose a:hover { text-decoration: underline; }

.guide-prose code {
  background: var(--kf-light);
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: var(--kf-charcoal);
}
.guide-prose pre {
  background: #0e2a47;
  color: #f4f4f5;
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}
.guide-prose pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }

.guide-prose .tip {
  margin: 14px 0;
  border-left: 4px solid var(--kf-orange);
  background: #fdf3ec;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 4px;
}
.guide-prose .tip strong:first-child { color: var(--kf-orange); margin-right: 6px; }

/* ---- Footer ------------------------------------------------------------ */
footer.guide-footer {
  margin-top: 56px;
  color: var(--kf-gray);
  font-size: 12px;
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
}
footer.guide-footer a { color: var(--kf-orange); text-decoration: none; }

/* ---- "Other guides" section at end of a page --------------------------- */
.related-guides {
  margin-top: 44px;
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
}
.related-guides h2 {
  font-size: 13px;
  color: var(--kf-orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0 0 12px;
}
.related-guides ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.related-guides li {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.related-guides li:hover { border-color: var(--kf-orange); }
.related-guides a { text-decoration: none; color: inherit; display: block; }
.related-guides .meta { font-size: 11px; color: var(--kf-gray); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.related-guides h3 { margin: 0; font-size: 14px; color: var(--kf-navy); font-weight: 600; }
