/**
 * Canonical Sentinel — page styles
 *
 * The scan UI was originally authored against the older w3c-functional token
 * set (square corners, hairline #2a4a6e borders, #f5f5f5 fills). The rest of
 * the site now runs nrlc-editorial-system, which only force-adopts generic
 * class names (.btn, .content-block) via !important. The tool's private class
 * names were never adopted, so the results view rendered in the old language
 * while the hero rendered in the new one. These rules move the tool's own
 * components onto the --nrlc-* tokens so both halves of the page agree.
 */

/*
 * The shared design system is already loaded by templates/head.php.
 * Importing it again here caused the primary navigation to reflow after the
 * page-specific stylesheet loaded.
 */

/* Match the homepage navigation proportions on this product page. */
.page-tool-canonical-sentinel .site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(70, 105, 140, 0.14);
  background: var(--nrlc-mesh-bg, #f7fbff);
}

.page-tool-canonical-sentinel .nav-primary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 32px, 1360px);
  max-width: 1360px;
  margin-inline: auto;
  padding: 20px 32px;
  gap: 24px;
  box-sizing: border-box;
  background: transparent;
}

.page-tool-canonical-sentinel .nav-primary__brand {
  justify-self: start;
  gap: 10px;
}

.page-tool-canonical-sentinel .nav-primary__brand::after {
  content: "NRLC / SEARCH LAB";
  color: rgba(15, 23, 42, 0.92);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.14em;
  line-height: 1;
  white-space: nowrap;
}

.page-tool-canonical-sentinel .nav-primary__menu {
  justify-self: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(12px, 1.5vw, 24px);
}

.page-tool-canonical-sentinel .nav-primary__link {
  min-height: 44px;
  padding: 12px 4px;
  color: rgba(71, 85, 105, 0.95);
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
}

.page-tool-canonical-sentinel .nav-primary__cta {
  justify-self: end;
  margin-left: 0;
}

.page-tool-canonical-sentinel .nav-primary__contact-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .page-tool-canonical-sentinel .nav-primary {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    padding-inline: 20px;
  }

  .page-tool-canonical-sentinel .nav-primary__brand::after {
    display: none;
  }

  .page-tool-canonical-sentinel .nav-primary__menu {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .page-tool-canonical-sentinel .nav-primary {
    display: flex;
    width: 100%;
    padding: 14px 18px;
  }

  .page-tool-canonical-sentinel .nav-primary__menu {
    position: absolute;
    top: calc(100% + 1px);
    left: 16px;
    right: 16px;
    display: none !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    overflow: visible;
    border: 1px solid rgba(70, 105, 140, 0.18);
    background: rgba(247, 251, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  }

  .page-tool-canonical-sentinel .nav-primary__menu[aria-hidden="false"] {
    display: flex !important;
  }

  .page-tool-canonical-sentinel .nav-primary__link {
    width: 100%;
    padding: 12px;
  }

  .page-tool-canonical-sentinel .nav-primary__toggle {
    display: flex !important;
    order: 3;
  }

  .page-tool-canonical-sentinel .nav-primary__cta {
    margin-left: auto;
  }

  .page-tool-canonical-sentinel .nav-primary__contact-btn {
    display: none;
  }
}

/* ==========================================================================
   Scan UI — mapped onto the editorial design system
   ========================================================================== */

/*
 * Risk colours. The old token set rendered every severity as black or navy,
 * so a critical finding and a healthy one were the same colour. These are
 * distinguishable hues tuned to sit on the soft blue surfaces.
 */
.page-tool-canonical-sentinel {
  --cs-critical: #c0283a;
  --cs-critical-soft: #fdf0f1;
  --cs-high: #a35a06;
  --cs-high-soft: #fdf5e9;
  --cs-low: #0c6f52;
  --cs-low-soft: #eaf8f2;
  --cs-panel-pad: clamp(24px, 3.5vw, 36px);
}

.page-tool-canonical-sentinel .section-hero {
  padding: var(--nrlc-section-md, 3rem) 0 var(--nrlc-section-sm, 2rem);
  border-bottom: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
  background: transparent;
  margin-bottom: var(--nrlc-section-sm, 2rem);
}

.page-tool-canonical-sentinel .section-hero .heading-1 {
  color: var(--nrlc-ink, #0b1220);
  margin-bottom: 1rem;
}

.page-tool-canonical-sentinel .section-hero .text-lg {
  font-size: 1.125rem;
  line-height: 1.7;
}

.page-tool-canonical-sentinel .text-muted {
  color: var(--nrlc-muted, #52647a);
}

/* ── Panels ──────────────────────────────────────────────── */

.page-tool-canonical-sentinel .scan-form,
.page-tool-canonical-sentinel .info-section,
.page-tool-canonical-sentinel .results-header,
.page-tool-canonical-sentinel .summary,
.page-tool-canonical-sentinel .filters,
.page-tool-canonical-sentinel .results-table {
  width: var(--nrlc-container, min(100% - 48px, 1120px));
  margin-inline: auto;
  margin-top: 0;
  margin-bottom: var(--nrlc-stack, 1.75rem);
  padding: var(--cs-panel-pad);
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76));
  border: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
  border-radius: var(--nrlc-radius-lg, 28px);
  box-shadow: var(--nrlc-shadow-card, 0 24px 80px rgba(34, 92, 130, 0.08));
}

.page-tool-canonical-sentinel .scan-form .heading-2,
.page-tool-canonical-sentinel .info-section .heading-2,
.page-tool-canonical-sentinel .results-header .heading-2 {
  color: var(--nrlc-ink, #0b1220);
  margin-bottom: 0.75rem;
}

.page-tool-canonical-sentinel .alert {
  padding: 1rem 1.25rem;
  border: 1px solid var(--cs-critical);
  border-left-width: 4px;
  border-radius: var(--nrlc-radius-sm, 14px);
  background: var(--cs-critical-soft);
  color: var(--cs-critical);
  margin-bottom: 1.5rem;
}

/* ── Forms ───────────────────────────────────────────────── */

.page-tool-canonical-sentinel .form-group {
  margin-bottom: 1rem;
}

.page-tool-canonical-sentinel .form-group label,
.page-tool-canonical-sentinel .filter-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--nrlc-ink, #0b1220);
}

.page-tool-canonical-sentinel .form-group input,
.page-tool-canonical-sentinel .form-group select,
.page-tool-canonical-sentinel .filter-group input,
.page-tool-canonical-sentinel .filter-group select {
  width: 100%;
  min-height: 46px;
  padding: 0.625rem 1rem;
  box-sizing: border-box;
  font-size: 0.9375rem;
  font-family: var(--nrlc-font-body, Inter, system-ui, sans-serif);
  color: var(--nrlc-ink, #0b1220);
  background: var(--nrlc-surface, #fff);
  border: 1px solid var(--nrlc-line-strong, rgba(70, 105, 140, 0.24));
  border-radius: 999px;
}

.page-tool-canonical-sentinel .form-group input:focus,
.page-tool-canonical-sentinel .form-group select:focus,
.page-tool-canonical-sentinel .filter-group input:focus,
.page-tool-canonical-sentinel .filter-group select:focus {
  outline: 2px solid var(--nrlc-sky, #129fe9);
  outline-offset: 2px;
  border-color: var(--nrlc-sky, #129fe9);
}

/*
 * Radius, fill and border for .btn are already forced site-wide by
 * nrlc-editorial-system. Only the touch-target sizing is set here.
 */
.page-tool-canonical-sentinel .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 26px;
  box-sizing: border-box;
  cursor: pointer;
  overflow-wrap: break-word;
}

.page-tool-canonical-sentinel form .btn {
  margin-top: 1rem;
}

.page-tool-canonical-sentinel .btn-link {
  padding: 0;
  min-height: auto;
  border: none;
  background: none;
  color: var(--nrlc-sky-strong, #078ddb);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.page-tool-canonical-sentinel .btn-link:hover {
  text-decoration-thickness: 2px;
}

.page-tool-canonical-sentinel .btn-group,
.page-tool-canonical-sentinel .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-tool-canonical-sentinel .actions {
  width: var(--nrlc-container, min(100% - 48px, 1120px));
  margin: var(--nrlc-section-sm, 2rem) auto;
  justify-content: center;
}

/* ── Results header ──────────────────────────────────────── */

.page-tool-canonical-sentinel .scan-meta {
  margin-top: 0.75rem;
}

.page-tool-canonical-sentinel .scan-meta p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--nrlc-muted, #52647a);
  overflow-wrap: anywhere;
}

.page-tool-canonical-sentinel .scan-meta strong {
  color: var(--nrlc-ink, #0b1220);
}

/* ── Summary cards ───────────────────────────────────────── */

.page-tool-canonical-sentinel .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
}

.page-tool-canonical-sentinel .summary-card {
  text-align: center;
  padding: 20px 14px;
  box-sizing: border-box;
  background: var(--nrlc-surface-soft, #f7fbff);
  border: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
  border-radius: var(--nrlc-radius-md, 20px);
}

.page-tool-canonical-sentinel .summary-value {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.375rem;
  color: var(--nrlc-ink, #0b1220);
}

.page-tool-canonical-sentinel .summary-value.critical {
  color: var(--cs-critical);
}

.page-tool-canonical-sentinel .summary-value.high {
  color: var(--cs-high);
}

.page-tool-canonical-sentinel .summary-value.low {
  color: var(--cs-low);
}

.page-tool-canonical-sentinel .summary-label {
  font-size: 0.8125rem;
  font-weight: 550;
  letter-spacing: 0.02em;
  color: var(--nrlc-muted, #52647a);
}

/* ── Filters ─────────────────────────────────────────────── */

.page-tool-canonical-sentinel .filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.page-tool-canonical-sentinel .filter-group {
  flex: 1;
  min-width: 150px;
}

.page-tool-canonical-sentinel .filters .btn {
  margin-top: 0;
}

/* ── Results table ───────────────────────────────────────── */

.page-tool-canonical-sentinel .results-table {
  padding: 0;
  overflow-x: auto;
}

.page-tool-canonical-sentinel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.page-tool-canonical-sentinel thead {
  background: var(--nrlc-surface-blue, #eef8ff);
}

.page-tool-canonical-sentinel th {
  padding: 14px 18px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nrlc-muted, #52647a);
  border-bottom: 1px solid var(--nrlc-line-strong, rgba(70, 105, 140, 0.24));
  white-space: nowrap;
}

.page-tool-canonical-sentinel td {
  padding: 14px 18px;
  color: var(--nrlc-ink, #0b1220);
  border-bottom: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
  vertical-align: top;
}

.page-tool-canonical-sentinel tbody tr:last-child td {
  border-bottom: none;
}

/* Severity is carried by a left edge so the row fill stays light. */
.page-tool-canonical-sentinel tr.risk-critical td:first-child {
  box-shadow: inset 3px 0 0 var(--cs-critical);
}

.page-tool-canonical-sentinel tr.risk-high td:first-child {
  box-shadow: inset 3px 0 0 var(--cs-high);
}

.page-tool-canonical-sentinel tr.risk-low td:first-child {
  box-shadow: inset 3px 0 0 var(--cs-low);
}

.page-tool-canonical-sentinel .url-cell,
.page-tool-canonical-sentinel .canonical-cell {
  max-width: 300px;
  overflow-wrap: anywhere;
}

.page-tool-canonical-sentinel .url-cell a {
  color: var(--nrlc-sky-strong, #078ddb);
  text-decoration: none;
}

.page-tool-canonical-sentinel .url-cell a:hover {
  text-decoration: underline;
}

.page-tool-canonical-sentinel .score-cell {
  font-weight: 700;
  white-space: nowrap;
}

.page-tool-canonical-sentinel .score-cell.score-critical {
  color: var(--cs-critical);
}

.page-tool-canonical-sentinel .score-cell.score-low {
  color: var(--cs-high);
}

.page-tool-canonical-sentinel .score-cell.score-good {
  color: var(--cs-low);
}

/* ── Badges ──────────────────────────────────────────────── */

.page-tool-canonical-sentinel .badge {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-sizing: border-box;
}

.page-tool-canonical-sentinel .badge-error,
.page-tool-canonical-sentinel .badge-critical {
  background: var(--cs-critical-soft);
  color: var(--cs-critical);
  border-color: rgba(192, 40, 58, 0.28);
}

.page-tool-canonical-sentinel .badge-high {
  background: var(--cs-high-soft);
  color: var(--cs-high);
  border-color: rgba(163, 90, 6, 0.28);
}

.page-tool-canonical-sentinel .badge-success,
.page-tool-canonical-sentinel .badge-low {
  background: var(--cs-low-soft);
  color: var(--cs-low);
  border-color: rgba(12, 111, 82, 0.28);
}

.page-tool-canonical-sentinel .badge-unknown {
  background: var(--nrlc-surface-soft, #f7fbff);
  color: var(--nrlc-muted, #52647a);
  border-color: var(--nrlc-line-strong, rgba(70, 105, 140, 0.24));
}

.page-tool-canonical-sentinel .text-center {
  text-align: center;
}

/* ── Expanded detail row ─────────────────────────────────── */

.page-tool-canonical-sentinel .details-row {
  background: var(--nrlc-surface-soft, #f7fbff);
}

.page-tool-canonical-sentinel .details-cell {
  padding: 24px 18px !important;
  box-sizing: border-box;
}

.page-tool-canonical-sentinel .details-content .heading-4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--nrlc-ink, #0b1220);
}

.page-tool-canonical-sentinel .details-content .heading-4:first-child {
  margin-top: 0;
}

.page-tool-canonical-sentinel .details-content p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.page-tool-canonical-sentinel .details-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.page-tool-canonical-sentinel .fix-directives {
  margin-top: 0.5rem;
  padding: 16px 18px;
  box-sizing: border-box;
  background: var(--nrlc-surface, #fff);
  border: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
  border-left: 3px solid var(--nrlc-sky, #129fe9);
  border-radius: var(--nrlc-radius-sm, 14px);
}

.page-tool-canonical-sentinel .fix-directives p {
  margin: 0.25rem 0;
  color: var(--nrlc-ink, #0b1220);
}

/* ── Author section ──────────────────────────────────────── */

.page-tool-canonical-sentinel .author-section {
  border-top: 1px solid var(--nrlc-line, rgba(70, 105, 140, 0.16));
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .page-tool-canonical-sentinel .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .page-tool-canonical-sentinel .filters form {
    flex-direction: column;
    align-items: stretch;
  }

  .page-tool-canonical-sentinel .filter-group {
    width: 100%;
  }

  .page-tool-canonical-sentinel th,
  .page-tool-canonical-sentinel td {
    padding: 10px 12px;
  }

  .page-tool-canonical-sentinel .btn-group .btn,
  .page-tool-canonical-sentinel .actions .btn {
    width: 100%;
  }
}
