/* Welphi Support – clean documentation layout with Welphi's brand colours.
   Each section has an accent colour (color in categories.yml), passed in as --accent. */
:root {
  --ink: #111417;
  --text: #2b3136;
  --muted: #6b7378;
  --faint: #9aa2a7;
  --line: #e6e8ea;
  --bg: #ffffff;
  --bg-soft: #f7f8f8;
  --link: #0e8797;   /* Welphi teal */
  --navy: #16235c;   /* Welphi navy */
  --teal: #1fadc0;   /* logo teal */
  --accent: var(--link);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
  --header-h: 64px;
  --sidebar-w: 280px;
  --max-w: 1240px;   /* whole layout is centred within this width */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font: 16px/1.7 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }

/* Buttons */
.btn { display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: 6px; transition: background .15s, border-color .15s, color .15s; background: #fff; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .93rem; line-height: 1.4; }
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: #0e8797; border-color: #0e8797; color: #fff; }
.btn-outline { box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.btn-block { display: block; text-align: center; }

/* Header */
.preview-bar { position: fixed; right: 16px; bottom: 16px; z-index: 60; max-width: 260px; background: #fff6d6; color: #6b5200; border: 1px solid #f0dc8f; border-radius: 6px; padding: 6px 10px; font-size: .78rem; font-weight: 500; line-height: 1.4; box-shadow: 0 4px 14px rgba(17, 20, 23, .08); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--teal), var(--navy) 45%, #6b4fd8 70%, #e0613d); }
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); padding: 0 24px; max-width: var(--max-w); margin: 0 auto; }
.logo { margin-right: auto; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { display: block; height: 30px; width: auto; }
.logo-sub { padding: 1px 8px; border-radius: 20px; background: color-mix(in srgb, var(--teal) 14%, #fff); color: var(--link); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 22px; font-size: .93rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--link); }
.nav-toggle { display: none; width: 36px; height: 36px; padding: 9px 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); }

/* Shell: sidebar + main */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); max-width: var(--max-w); margin: 0 auto; }
@media (min-width: 1241px) { .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 22px 20px 28px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 22px; font-size: .92rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 820px; padding: 22px 48px 56px; flex: 1; }

/* Search */
.search { position: relative; }
.search input { width: 100%; padding: 10px 36px 10px 12px; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: .92rem; color: var(--ink); background: #fff; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 20%, transparent); }
.search-icon { position: absolute; right: 12px; top: 12px; color: var(--muted); pointer-events: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search-results { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(17, 20, 23, .08); text-align: left; max-height: 420px; overflow: auto; }
.search-results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--bg-soft); }
.search-results small { display: block; color: var(--muted); font-size: .8rem; }
.search-results .empty { padding: 12px 14px; color: var(--muted); }

/* Sidebar navigation */
.side-nav { display: flex; flex-direction: column; gap: 14px; }
.side-group summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--ink); padding: 2px 0; }
.side-group summary::-webkit-details-marker { display: none; }
.side-label { display: inline-flex; align-items: flex-start; gap: 9px; }
.side-label .icon { flex: none; box-sizing: content-box; margin: -2px 0 0 -4px; padding: 4px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.side-group summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 1.1rem; }
.side-group[open] summary::after { content: "–"; }
.side-group ul { list-style: none; margin: 6px 0 0 4px; padding: 0 0 0 8px; }
/* Each item gets a bullet so wrapped titles read as separate links. */
.side-group li { position: relative; padding: 4px 0 4px 13px; line-height: 1.45; }
.side-group li::before { content: ""; position: absolute; left: 0; top: calc(4px + .725em - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 45%, #fff); }
.side-group li a { color: var(--muted); text-decoration: none; }
.side-group li a:hover { color: var(--accent); }
.side-group li.current::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.side-group li.current a { color: var(--accent); font-weight: 600; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #e0a800; vertical-align: middle; margin-left: 4px; }
.side-help { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.side-help p { margin: 0 0 12px; }
.side-help strong { color: var(--ink); font-weight: 600; }

/* Welcome notice for returning visitors */
.welcome { display: flex; gap: 16px; align-items: flex-start; max-width: 724px; margin: 22px 48px 0; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 6px; background: color-mix(in srgb, var(--teal) 7%, #fff); font-size: .92rem; }
.welcome[hidden] { display: none; }
.welcome strong { color: var(--ink); font-weight: 600; }
.welcome p { margin: 2px 0 0; color: var(--muted); line-height: 1.55; }
.welcome-close { margin-left: auto; flex: none; width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.welcome-close:hover { background: var(--line); color: var(--ink); }

/* Page headings */
.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { margin: 0 8px; color: var(--faint); }
.page > h1, .article h1 { font-size: 2.25rem; margin: 0 0 8px; letter-spacing: -0.025em; }
.meta { color: var(--muted); font-size: .86rem; margin: 0 0 28px; }

/* Home */
.intro { position: relative; overflow: hidden; padding: 36px 40px 38px; margin-bottom: 40px; border-radius: 16px; background: linear-gradient(135deg, #e6f6f9 0%, #eef0fb 55%, #f6effb 100%); }
.intro::before, .intro::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.intro::before { width: 220px; height: 220px; right: -60px; top: -70px; background: color-mix(in srgb, var(--teal) 22%, transparent); }
.intro::after { width: 120px; height: 120px; right: 110px; bottom: -60px; background: color-mix(in srgb, #6b4fd8 14%, transparent); }
.intro > * { position: relative; }
.intro h1 { font-size: 2.6rem; margin: 0 0 18px; letter-spacing: -0.03em; }
.intro .subtitle { display: block; color: var(--link); font-weight: 500; }
.lead { font-size: 1.15rem; color: var(--ink); max-width: 560px; margin: 0 0 24px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.topic { padding: 18px 20px 16px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; background: #fff; transition: box-shadow .15s, transform .15s; }
.topic:hover { box-shadow: 0 8px 24px rgba(22, 35, 92, .08); transform: translateY(-2px); }
.topic h2 { font-size: 1.02rem; margin: 0 0 10px; }
.topic h2 a { color: var(--ink); text-decoration: none; }
.topic-icon { flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 7px; margin-right: 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
h1.with-icon { display: flex; align-items: center; }
h1.with-icon .topic-icon { width: 24px; height: 24px; padding: 9px; margin-right: 14px; border-radius: 10px; }
.topic-desc { margin: -4px 0 10px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.page > .lead { margin: 0 0 28px; font-size: 1.05rem; color: var(--muted); }
.topic h2 a:hover { text-decoration: underline; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .75rem; line-height: 1.6; text-align: center; margin-left: 4px; vertical-align: 2px; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-list li { position: relative; padding: 4px 0 4px 15px; line-height: 1.45; }
.article-list li::before { content: ""; position: absolute; left: 0; top: calc(4px + .725em - 3px); width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 45%, #fff); }
.article-list a { color: var(--muted); text-decoration: none; }
.article-list a:hover { color: var(--accent); text-decoration: underline; }
.badge { display: inline-block; padding: 0 6px; border: 1px solid #f0dc8f; border-radius: 3px; background: #fff9e3; color: #6b5200; font-size: .7rem; font-weight: 500; vertical-align: middle; letter-spacing: 0; }

/* Article body */
.prose { color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-size: 1.45rem; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.1rem; margin: 1.8em 0 .5em; }
.prose h4, .prose h5 { font-size: 1rem; margin: 1.6em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose figure { margin: 28px 0; }
.prose figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 6px; }
.prose figcaption { color: var(--muted); font-size: .84rem; text-align: center; margin-top: 10px; }
.prose li img { vertical-align: middle; margin-right: 6px; max-height: 28px; }
.prose li figure img { max-height: none; margin: 0 auto; vertical-align: baseline; }
.prose table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: .93rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; }
.prose blockquote { margin: 20px 0; padding: 10px 16px; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--accent-soft); color: var(--text); }
.prose code { background: var(--bg-soft); border: 1px solid var(--line); padding: 0 5px; border-radius: 3px; font-size: .88em; }
.prose iframe { border: 1px solid var(--line) !important; border-radius: 6px; }
.callout-screenshot { display: flex; flex-direction: column; gap: 4px; margin: 20px 0; padding: 14px 16px; border: 1px dashed #e0a800; border-radius: 6px; background: #fffbeb; color: #5e4600; font-size: .9rem; }
.review { margin: 0 0 28px; padding: 10px 14px; border: 1px solid #f0dc8f; border-radius: 6px; background: #fffbeb; font-size: .9rem; }
.review summary { cursor: pointer; font-weight: 500; color: #6b5200; }
.review pre { white-space: pre-wrap; font: .8rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 10px 0 0; color: var(--text); }
.article-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

/* Category list */
.rows { border-top: 1px solid var(--line); }
.row { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.row h2 { font-size: 1.05rem; margin: 0 0 4px; }
.row p { margin: 0 0 4px; color: var(--muted); font-size: .93rem; }
.row .meta { margin: 0; font-size: .8rem; color: var(--faint); }
.row { transition: padding .15s, box-shadow .15s; }
.row:hover { padding-left: 12px; box-shadow: inset 3px 0 0 var(--accent); }
.row:hover h2 { color: var(--accent); }

/* FAQs */
.faqs { border-top: 1px solid var(--line); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 36px 16px 0; font-weight: 500; color: var(--ink); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 1.2rem; color: var(--link); }
.faq[open] summary::after { content: "–"; }
.faq .prose { padding: 0 0 8px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; }
.contact-info h3 { font-size: 1rem; }
.map { width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 6px; }

/* Footer */
.site-footer { padding: 22px 48px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }
.copyright { margin: 0; color: var(--faint); }

/* Small screens: sidebar becomes a drawer */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: flex; }
  .site-nav a:not(.btn) { display: none; }
  .sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; height: auto; width: min(320px, 88vw); z-index: 35; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(17, 20, 23, .12); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .main { opacity: .35; }
  body.nav-open .preview-bar { display: none; }
  .main { transition: opacity .2s ease; }
  .page { padding: 20px 20px 48px; }
  .welcome { margin: 16px 20px 0; }
  .site-footer { padding: 20px; }
  .header-inner { padding: 0 16px; }
  .topic-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { font-size: 2rem; }
  .intro { padding: 26px 22px 28px; }
  .page > h1, .article h1 { font-size: 1.8rem; }
}
@media (max-width: 480px) {
  .site-nav .btn { display: none; }
}
