/* ==========================================================================
   support.css — NaturaeSoft Support Portal

   MUST be linked AFTER the Bootstrap 5.0.2 CDN link in views/template/_head.ejs.
   Bootstrap loads from the CDN after the local stylesheets, so a sheet linked
   before it loses on every shared selector (body, .card-header, blockquote,
   table, h1-h6, .accordion-button, .btn). Loading last lets this file win at
   equal specificity with no !important anywhere.

   Contents
     1  Tokens
     2  Base
     3  Headings
     4  Components (card, accordion, buttons)
     5  Article prose  .kb-content / .kb-answer / .ns-prose
     6  In-article cards (tables, callouts, figures)
     7  KB list
     8  Chrome (navbar offset, practice bar, footer)
     9  Utilities
   ========================================================================== */


/* 1  Tokens ================================================================= */

:root {
  /* brand */
  --ns-brand: #584A64;
  --ns-brand-600: #4a3e54;      /* hover  */
  --ns-brand-700: #3d3345;      /* active */
  --ns-brand-tint: #f4f1f6;     /* callout + table-head fill */

  /* ink */
  --ns-ink: #212529;
  --ns-ink-strong: #14171a;
  --ns-ink-muted: #6c757d;
  --ns-link: #4a3e54;
  --ns-link-hover: var(--ns-brand);

  /* surfaces */
  --ns-surface: #ffffff;
  --ns-surface-2: #f8f9fa;
  --ns-border: #dee2e6;
  --ns-radius: .375rem;
  --ns-shadow-sm: 0 1px 3px rgba(20, 23, 26, .08);

  /* type — no `cursive` fallbacks: a Google Fonts failure used to drop every
     heading and every <strong> on the site into the browser's script face. */
  --ns-font-body:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ns-font-display: "Palanquin Dark", "Trebuchet MS", var(--ns-font-body);
  --ns-font-accent:  "Architects Daughter", "Segoe UI", var(--ns-font-body);
  --ns-font-ui:      "Josefin Sans", "Century Gothic", var(--ns-font-body);

  /* reading */
  --ns-measure: 72ch;           /* prose line length */
  --ns-measure-wide: 56rem;     /* figures + tables may reach this */
  --ns-prose-size: 1rem;        /* the one dial for overall article text size */
  --ns-prose-lh: 1.65;

  /* spacing (4px base) */
  --ns-1: .25rem;  --ns-2: .5rem;   --ns-3: .75rem;  --ns-4: 1rem;
  --ns-5: 1.5rem;  --ns-6: 2rem;    --ns-7: 3rem;

  /* chrome */
  --ns-nav-h: 68px;
  --ns-footer-h: 60px;
  --ns-dash-icon: 110px;
}


/* 2  Base =================================================================== */

body {
  font-family: var(--ns-font-body);
  color: var(--ns-ink);
  /* clears the fixed footer so long articles don't end underneath it */
  padding-bottom: calc(var(--ns-footer-h) + var(--ns-5));
}

strong, b { font-weight: 700; }


/* 3  Headings =============================================================== */
/* Ladder: 2.25 / 1.75 / 1.375 / 1.125 / 1 / .8125 — strictly monotonic.
   Replaces the old h4(1.3rem) > h5(1.25rem) inversion. */

h1, .h1 {
  font-family: var(--ns-font-display);
  font-size: 2.25rem; line-height: 1.2; font-weight: 400;
  margin-bottom: .5rem; color: var(--ns-ink-strong);
}
h2, .h2 {
  font-family: var(--ns-font-accent);
  font-size: 1.75rem; line-height: 1.25; font-weight: 400;
  margin-bottom: .5rem; color: var(--ns-ink-strong);
}
h3, .h3 {
  font-family: var(--ns-font-accent);
  font-size: 1.375rem; line-height: 1.3; font-weight: 400;
  margin-bottom: .5rem; color: var(--ns-ink-strong);
}
h4, .h4 {
  font-family: var(--ns-font-ui);
  font-size: 1.125rem; line-height: 1.35; font-weight: 600;
  letter-spacing: .01em; margin-bottom: .5rem;
}
h5, .h5 {
  font-family: var(--ns-font-ui);
  font-size: 1rem; line-height: 1.4; font-weight: 600;
  letter-spacing: .015em; margin-bottom: .375rem;
}
h6, .h6 {
  font-family: var(--ns-font-ui);
  font-size: .8125rem; line-height: 1.4; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ns-ink-muted); margin-bottom: .375rem;
}


/* 4  Components ============================================================= */

/* A card header is a component, not a heading level. The portal uses four
   different tags for it (h4, strong, bare text, h5.card-title); neutralizing
   whatever is inside makes them all render identically with no markup edits. */
.card-header > h1,
.card-header > h2,
.card-header > h3,
.card-header > h4,
.card-header > h5,
.card-header > h6,
.card-header > strong,
.card-header > .card-title {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  margin: 0;
}

.card-header {
  font-family: var(--ns-font-ui);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ns-ink-strong);
  background: var(--ns-surface-2);
  border-bottom: 1px solid var(--ns-border);
  padding: .625rem 1rem;
}

.card {
  border-color: var(--ns-border);
  border-radius: var(--ns-radius);
}

/* .accordion-button sets no font-family, so every accordion label in the
   portal used to inherit the handwriting face from its h2.accordion-header. */
.accordion-header { margin: 0; }

.accordion-button {
  font-family: var(--ns-font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ns-ink-strong);
}
.accordion-button:not(.collapsed) {
  color: var(--ns-brand);
  background-color: var(--ns-brand-tint);
  box-shadow: none;
}
.accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(88, 74, 100, .25);
  border-color: var(--ns-border);
}
.accordion-item { border-color: var(--ns-border); }

.btn-brand {
  background-color: var(--ns-brand);
  border-color: var(--ns-brand);
  color: #fff;
}
.btn-brand:hover {
  background-color: var(--ns-brand-600);
  border-color: var(--ns-brand-600);
  color: #fff;
}
.btn-brand:active {
  background-color: var(--ns-brand-700);
  border-color: var(--ns-brand-700);
  color: #fff;
}
.btn-brand:focus,
.btn-brand:focus-visible {
  box-shadow: 0 0 0 .25rem rgba(88, 74, 100, .35);
  color: #fff;
}


/* 5  Article prose ========================================================== */
/* .kb-content — full article page (kb/article.ejs, kb/article_embed.ejs)
   .kb-answer  — article inside a modal (kb/kb.ejs, kb/faq.ejs, home.ejs)
   .ns-prose   — anywhere else CKEditor HTML is rendered (ticket comments) */

.kb-content,
.kb-answer,
.ns-prose {
  max-width: var(--ns-measure-wide);
  font-family: var(--ns-font-body);
  font-size: var(--ns-prose-size);
  line-height: var(--ns-prose-lh);
  color: var(--ns-ink);
  overflow-wrap: break-word;
}

/* The measure sits on the text-level blocks, not the container, so figures and
   tables keep the full width without negative-margin escapes. CKEditor emits a
   flat fragment with no wrapper, so `>` is reliable here. */
.kb-content > p,  .kb-content > ul,  .kb-content > ol,
.kb-content > blockquote, .kb-content > h2, .kb-content > h3, .kb-content > h4,
.kb-answer  > p,  .kb-answer  > ul,  .kb-answer  > ol,
.kb-answer  > blockquote, .kb-answer  > h2, .kb-answer  > h3, .kb-answer  > h4,
.ns-prose   > p,  .ns-prose   > ul,  .ns-prose   > ol,
.ns-prose   > blockquote, .ns-prose   > h2, .ns-prose   > h3, .ns-prose   > h4 {
  max-width: var(--ns-measure);
}

/* vertical rhythm */
.kb-content p, .kb-answer p, .ns-prose p { margin: 0 0 1.15em; }

.kb-content h2, .kb-answer h2, .ns-prose h2 {
  font-family: var(--ns-font-accent);
  font-size: 1.5rem; line-height: 1.25;
  margin: 2.25rem 0 .6rem;
  color: var(--ns-ink-strong);
}
.kb-content h3, .kb-answer h3, .ns-prose h3 {
  font-family: var(--ns-font-accent);
  font-size: 1.25rem; line-height: 1.3;
  margin: 1.75rem 0 .5rem;
  color: var(--ns-ink-strong);
}
.kb-content h4, .kb-answer h4, .ns-prose h4 {
  font-family: var(--ns-font-ui);
  font-size: 1.0625rem; font-weight: 600; letter-spacing: .01em;
  line-height: 1.35;
  margin: 1.5rem 0 .4rem;
  color: var(--ns-brand);
}

.kb-content > :first-child, .kb-answer > :first-child, .ns-prose > :first-child { margin-top: 0; }
.kb-content > :last-child,  .kb-answer > :last-child,  .ns-prose > :last-child  { margin-bottom: 0; }

/* lists */
.kb-content ul, .kb-content ol,
.kb-answer  ul, .kb-answer  ol,
.ns-prose   ul, .ns-prose   ol { margin: 0 0 1.15em; padding-left: 1.5em; }

.kb-content li, .kb-answer li, .ns-prose li { margin-bottom: .45em; }

.kb-content li > ul, .kb-content li > ol,
.kb-answer  li > ul, .kb-answer  li > ol,
.ns-prose   li > ul, .ns-prose   li > ol { margin: .45em 0 0; }

.kb-content li::marker, .kb-answer li::marker, .ns-prose li::marker { color: var(--ns-ink-muted); }

/* inline */
.kb-content strong, .kb-answer strong, .ns-prose strong {
  font-family: inherit;   /* explicitly undoes the old global strong rule */
  font-size: inherit;
  font-weight: 700;
  color: var(--ns-ink-strong);
}

.kb-content a, .kb-answer a, .ns-prose a {
  color: var(--ns-link);
  text-decoration: underline;
  text-decoration-thickness: .07em;
  text-underline-offset: .15em;
  text-decoration-color: rgba(88, 74, 100, .4);
}
.kb-content a:hover, .kb-answer a:hover, .ns-prose a:hover {
  color: var(--ns-link-hover);
  text-decoration-color: currentColor;
}

.kb-content code, .kb-answer code, .ns-prose code {
  font-size: .9em;
  background: var(--ns-surface-2);
  padding: .1em .35em;
  border-radius: .2rem;
  color: var(--ns-ink-strong);
}

.kb-content hr, .kb-answer hr, .ns-prose hr {
  margin: 2rem 0; border: 0;
  border-top: 1px solid var(--ns-border);
  opacity: 1;
}

/* padding — .kb-content had no rules at all before, so no vertical space and
   only the .container gutter horizontally */
.kb-content {
  padding: var(--ns-5) 0 var(--ns-7);
  border-top: 1px solid var(--ns-border);
  margin-top: var(--ns-4);
}

.kb-answer {
  padding: var(--ns-2) var(--ns-1) var(--ns-4);
  line-height: 1.6;              /* a touch tighter; the modal is height-capped */
}
.kb-answer h2 { font-size: 1.35rem; margin-top: 1.75rem; }
.kb-answer h3 { font-size: 1.15rem; margin-top: 1.4rem; }


/* 6  In-article cards ======================================================= */
/* All three key off structure CKEditor 5 already emits, so no existing article
   body needs re-authoring. Do not add class hooks: the admin editor has no
   General HTML Support configured and strips unknown classes on the next save. */

/* tables — CKEditor emits <figure class="table"><table> with no .table class,
   so these rendered borderless and unpadded */
.kb-content figure.table,
.kb-answer  figure.table,
.ns-prose   figure.table {
  margin: 1.75rem 0;
  max-width: var(--ns-measure-wide);
  overflow-x: auto;                        /* wide tables scroll in place */
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius);
  background: var(--ns-surface);
  box-shadow: var(--ns-shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.kb-content figure.table > table,
.kb-answer  figure.table > table,
.ns-prose   figure.table > table {
  width: 100%; margin: 0;
  border-collapse: collapse;
  font-size: .9375em; line-height: 1.5;
}

.kb-content figure.table th, .kb-content figure.table td,
.kb-answer  figure.table th, .kb-answer  figure.table td,
.ns-prose   figure.table th, .ns-prose   figure.table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--ns-border);
  border-right: 1px solid var(--ns-border);
  vertical-align: top;
  text-align: left;
}

.kb-content figure.table th:last-child, .kb-content figure.table td:last-child,
.kb-answer  figure.table th:last-child, .kb-answer  figure.table td:last-child,
.ns-prose   figure.table th:last-child, .ns-prose   figure.table td:last-child { border-right: 0; }

.kb-content figure.table tr:last-child td, .kb-content figure.table tr:last-child th,
.kb-answer  figure.table tr:last-child td, .kb-answer  figure.table tr:last-child th,
.ns-prose   figure.table tr:last-child td, .ns-prose   figure.table tr:last-child th { border-bottom: 0; }

/* header row — CKEditor emits <thead><th> when "header row" is on */
.kb-content figure.table thead th,
.kb-answer  figure.table thead th,
.ns-prose   figure.table thead th {
  background: var(--ns-brand-tint);
  font-family: var(--ns-font-ui);
  font-weight: 600;
  color: var(--ns-brand);
  border-bottom: 2px solid var(--ns-border);
  white-space: nowrap;
}

.kb-content figure.table tbody tr:nth-child(even),
.kb-answer  figure.table tbody tr:nth-child(even),
.ns-prose   figure.table tbody tr:nth-child(even) { background: var(--ns-surface-2); }

/* CKEditor wraps every cell's content in a <p>; without this each cell
   carries 1.15em of bottom margin */
.kb-content figure.table td > p:only-child,
.kb-answer  figure.table td > p:only-child,
.ns-prose   figure.table td > p:only-child { margin: 0; max-width: none; }

/* callouts — scoped to prose only, so the <blockquote> holding the practice
   address on views/account.ejs is untouched */
.kb-content blockquote,
.kb-answer  blockquote,
.ns-prose   blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--ns-border);
  border-left: 4px solid var(--ns-brand);
  border-radius: 0 var(--ns-radius) var(--ns-radius) 0;
  background: var(--ns-brand-tint);
  color: var(--ns-ink);
  font-size: .96em;
}
.kb-content blockquote > :first-child,
.kb-answer  blockquote > :first-child,
.ns-prose   blockquote > :first-child { margin-top: 0; }
.kb-content blockquote > :last-child,
.kb-answer  blockquote > :last-child,
.ns-prose   blockquote > :last-child { margin-bottom: 0; }
.kb-content blockquote p, .kb-answer blockquote p, .ns-prose blockquote p { max-width: none; }

/* figures */
.kb-content figure.image,
.kb-answer  figure.image,
.ns-prose   figure.image {
  margin: 1.75rem 0;
  max-width: var(--ns-measure-wide);
  text-align: center;
}
.kb-content figure.image img,
.kb-answer  figure.image img,
.ns-prose   figure.image img {
  max-width: 100%; height: auto;
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius);
  background: var(--ns-surface);
  box-shadow: var(--ns-shadow-sm);
}
.kb-content figure.image figcaption,
.kb-answer  figure.image figcaption,
.ns-prose   figure.image figcaption {
  margin-top: .5rem;
  font-family: var(--ns-font-ui);
  font-size: .8125rem;
  color: var(--ns-ink-muted);
  text-align: center;
}

.image {
  margin-left: auto; margin-right: auto;
  position: relative; max-width: 100%;
}
.image.image-style-side {
  float: right;
  margin: .25rem 0 1rem 1.25rem;
  max-width: 45%;
}
/* a right-floated figure at the end of an article used to escape .kb-content
   and overlap the "Back to Articles" button */
.kb-content::after, .kb-answer::after, .ns-prose::after {
  content: ""; display: block; clear: both;
}
@media (max-width: 575.98px) {
  .image.image-style-side { float: none; max-width: 100%; margin: 1.5rem 0; }
}

/* Screenshots must never be wider than the column/modal that holds them. */
.image img,
.kb-content img,
.kb-answer img,
.ns-prose img,
.modal-body img {
  max-width: 100%;
  height: auto;
}


/* 7  KB list =============================================================== */

.kb-item h4 { margin-bottom: .25rem; }

.kb-question { font-weight: 600; text-decoration: none; }
.kb-question:hover { text-decoration: underline; }


/* 8  Chrome ================================================================ */

.ns-navbar-fixed {
  position: fixed; top: 0; left: 0;
  width: 100%;
  /* Bootstrap's own $zindex-fixed. The old 1111 sat above $zindex-modal-backdrop
     (1040), so the navbar punched through the dim when a KB modal was open. */
  z-index: 1030;
}
.ns-navbar-fixed .navbar { background-color: var(--ns-brand) !important; }

/* The fixed navbar takes no space in the flow; this puts it back. It lives in
   _header.ejs rather than on body because kb/article_embed.ejs renders without
   the header and must not get the offset. */
.ns-nav-offset { height: var(--ns-nav-h); margin-bottom: var(--ns-5); }

/* When the practice bar is present it supplies its own separation. */
.ns-nav-offset + .ns-practice-bar { margin-top: calc(var(--ns-5) * -1); }

.ns-practice-bar {
  background: var(--ns-surface-2);
  border-bottom: 1px solid var(--ns-border);
  padding: .5rem 0;
  font-size: .9375rem;
  color: var(--ns-ink);
  margin-bottom: var(--ns-4);
}
.ns-practice-label {
  font-family: var(--ns-font-ui);
  font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ns-ink-muted);
  margin-right: .35rem;
}

.ns-footer {
  position: fixed; bottom: 0; left: 0;
  width: 100%;
  height: var(--ns-footer-h);
  padding: 10px 0;
  background: var(--ns-brand);
  color: #fff;
  font-size: .875rem;
  z-index: 1020;
}
.ns-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: .15em;
}
.ns-footer a:hover { color: #fff; text-decoration-color: rgba(255, 255, 255, .6); }


/* 9  Utilities ============================================================= */

.ns-eyebrow {
  font-family: var(--ns-font-ui);
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ns-ink-muted);
  margin: 0 0 .25rem;
}

/* a heading tag that must not look like one (a card's own title) */
.ns-card-heading { font: inherit; color: inherit; margin: 0; }

.ns-scroll    { max-height: 220px; overflow-y: auto; }
.ns-scroll-lg { max-height: 260px; overflow-y: auto; overflow-x: hidden; }

/* label/value spec tables — replaces three hardcoded label widths (130/140/160px) */
.ns-spec { width: 100%; margin-bottom: 0; }
.ns-spec th {
  width: 10rem;
  padding: .45rem .75rem .45rem 0;
  font-family: var(--ns-font-ui);
  font-weight: 600; font-size: .875rem; letter-spacing: .01em;
  color: var(--ns-ink-muted);
  vertical-align: top;
}
.ns-spec td { padding: .45rem 0; vertical-align: top; }
.ns-spec tr + tr th,
.ns-spec tr + tr td { border-top: 1px solid var(--ns-border); }
@media (max-width: 575.98px) { .ns-spec th { width: 7rem; } }

.ns-bg-brand   { background-color: var(--ns-brand) !important; color: #fff; }
.ns-text-brand { color: var(--ns-brand) !important; }
.ns-fill-brand { fill: var(--ns-brand); }

.DashIcon {
  font-size: var(--ns-dash-icon);
  color: var(--ns-brand);
  margin: .5rem;
  line-height: 1;
  display: inline-block;
}

/* ticket comment bubbles — replaces EJS interpolated inside a style attribute */
.ns-comment      { position: relative; clear: both; }
.ns-comment--out { margin-left: 25%; }    /* NaturaeSoft Support */
.ns-comment--in  { margin-right: 25%; }   /* client */
@media (max-width: 767.98px) {
  .ns-comment--in, .ns-comment--out { margin-left: 0; margin-right: 0; }
}

.ticket-comment__body { font-size: 1rem; }
.ticket-comment__body > :last-child { margin-bottom: 0; }

/* CKEditor instances: tickets/Add.ejs styled this locally, tickets/ticket.ejs
   did not, so the two editors had different heights */
.ck-editor__editable_inline { min-height: 120px; }
