/* ============================================================================
   CCL KNOWLEDGEBASE - INK & AMBER, AUTHORITY SHEET
   Created 2026-09-23.

   This file is loaded last, after every other stylesheet, by the mu-plugin
   ccl-kb-ink-authority.php (wp_enqueue_scripts priority 99999) and every
   declaration carries !important. Nothing in the theme, a plugin, or a page
   builder can override it.

   It is deliberately a NEW filename. A browser or CDN still holding an old
   copy of ccl-kb2.css has nothing cached under this name, so this sheet is
   always fetched fresh.

   Scope: knowledgebase only. Every selector sits under .ccl-nofault--* or
   .ccl-kb2, so nothing here can reach the rest of the site.

   THE PALETTE
     ground       #F8F6F1   warm paper, the page
     card         #FFFFFF   anything raised off the page
     ink          #1D1B16   headings
     body         #302D24   body copy
     muted        #6B6558   meta, labels
     rule         #E7E1D5   hairlines
     accent       #9C6412   links, buttons, the current marker
     accent dark  #7A5210   accent on a soft fill, and hover
     soft         #F0E6D4   chips, info callouts
     deep         #2A2620   hero, rail card, table head, deadlines
     on deep      #E0A94A / #C6BCA8 / #9A917E

   Every colour was measured against its own background on rendered pages at
   1568px and 390px: all pass WCAG AA at the size and weight actually used.
   ========================================================================= */

body .ccl-nofault--wrapper,
body .ccl-kb2 {
	--kb2-navy: #2A2620 !important;
	--kb2-navy-lift: #3A342B !important;
	--kb2-signal: #E0A94A !important;
	--kb2-action: #9C6412 !important;
	--kb2-action-dark: #7A5210 !important;
	--kb2-paper: #F8F6F1 !important;
	--kb2-rule: #E7E1D5 !important;
	--kb2-ink: #1D1B16 !important;
	--kb2-body: #302D24 !important;
	--kb2-muted: #6B6558 !important;
	--kb2-on-navy: #C6BCA8 !important;
	--kbi-card: #FFFFFF !important;
	--kbi-soft: #F0E6D4 !important;
	--kbi-deep-line: #5E5647 !important;
	--kbi-deep-quiet: #9A917E !important;
}

/* --- article: page and cards ------------------------------------------- */

body .ccl-nofault--article {
	background: #F8F6F1 !important;
}

body .ccl-nofault--takeaways,
body .ccl-nofault--highlight,
body .ccl-nofault--toc,
body .ccl-nofault--related-card,
body .ccl-nofault--rating-container,
body .ccl-nofault--adjacent-link,
body .ccl-nofault--rating-btn {
	background: #FFFFFF !important;
}

body .ccl-nofault--takeaways,
body .ccl-nofault--toc,
body .ccl-nofault--related-card,
body .ccl-nofault--rating-container,
body .ccl-nofault--adjacent-link {
	border: 0 !important;
}

body .ccl-nofault--takeaways {
	border-radius: 22px !important;
}

body .ccl-nofault--highlight,
body .ccl-nofault--toc,
body .ccl-nofault--related-card,
body .ccl-nofault--rating-container,
body .ccl-nofault--adjacent-link {
	border-radius: 18px !important;
}

body .ccl-nofault--rating-btn {
	border-color: #E7E1D5 !important;
	color: #302D24 !important;
}

body .ccl-nofault--rating-btn:hover,
body .ccl-nofault--rating-btn:focus {
	border-color: #9C6412 !important;
	color: #7A5210 !important;
}

/* --- article: hero ----------------------------------------------------- */

body .ccl-nofault--hero {
	background: #2A2620 !important;
}

body .ccl-nofault--hero .ccl-nofault--hero-lede,
body .ccl-nofault--hero-meta-item,
body .ccl-nofault--hero-category {
	color: #C6BCA8 !important;
}

body .ccl-nofault--hero-category {
	border-color: #5E5647 !important;
}

body .ccl-nofault--breadcrumb-link {
	color: #E0A94A !important;
}

body .ccl-nofault--breadcrumb-current {
	color: #D8CFBC !important;
}

body .ccl-nofault--breadcrumbs,
body .ccl-nofault--breadcrumbs i,
body .ccl-nofault--breadcrumb-separator {
	color: #9A917E !important;
}

/* The type chip was signal yellow, which put a second masthead-coloured
   block at the top of every article. */
body .ccl-nofault--typechip {
	background: #F0E6D4 !important;
	color: #7A5210 !important;
}

body .ccl-nofault--progress {
	background: #E7E1D5 !important;
}

body .ccl-nofault--progress > * {
	background: #9C6412 !important;
}

/* --- article: body copy ------------------------------------------------ */

body .ccl-nofault--article-content h2,
body .ccl-nofault--article-content h3,
body .ccl-nofault--article-content h4,
body .ccl-nofault--article-content strong,
body .ccl-nofault--related-card-title,
body .ccl-nofault--adjacent-title {
	color: #1D1B16 !important;
}

body .ccl-nofault--article-content p,
body .ccl-nofault--article-content li,
body .ccl-nofault--table td {
	color: #302D24 !important;
}

body .ccl-nofault--article-content a,
body .ccl-nofault--article-content a.wpil_keyword_link,
body .ccl-nofault--related-card-icon,
body .ccl-nofault--related-card-arrow {
	color: #9C6412 !important;
}

body .ccl-nofault--article-content a:hover,
body .ccl-nofault--article-content a:focus,
body .ccl-nofault--article-content a.wpil_keyword_link:hover {
	color: #7A5210 !important;
}

body .ccl-nofault--toc-title,
body .ccl-nofault--toc-d > summary,
body .ccl-nofault--related-card-meta,
body .ccl-nofault--related-card-meta-item,
body .ccl-nofault--adjacent-label,
body .ccl-nofault--disclaimer,
body .ccl-nofault--disclaimer-note {
	color: #6B6558 !important;
}

body .ccl-nofault--wrapper .ccl-nofault--toc-list a {
	color: #302D24 !important;
}

body .ccl-nofault--wrapper .ccl-nofault--toc-list a:hover,
body .ccl-nofault--wrapper .ccl-nofault--toc-list a:focus,
body .ccl-nofault--wrapper .ccl-nofault--toc-list a.is-current {
	color: #7A5210 !important;
}

body .ccl-nofault--table th {
	background: #2A2620 !important;
	color: #FFFFFF !important;
}

body .ccl-nofault--table td,
body .ccl-nofault--disclaimer {
	border-color: #E7E1D5 !important;
}

/* --- article: rail ------------------------------------------------------
   Two card variants with opposite backgrounds, so each needs its own text
   colours. Getting this wrong produced 1.14:1 and 1.0:1 while building. */

body .ccl-nofault--railcard,
body .ccl-nofault--railcard--navy {
	background: #2A2620 !important;
	border-color: #2A2620 !important;
}

body .ccl-nofault--railcard h2,
body .ccl-nofault--railcard h3,
body .ccl-nofault--railcard--navy h2,
body .ccl-nofault--railcard--navy h3 {
	color: #FFFFFF !important;
}

body .ccl-nofault--railcard p,
body .ccl-nofault--railcard--navy p {
	color: #C6BCA8 !important;
}

body .ccl-nofault--railcard .ccl-nofault--raillink,
body .ccl-nofault--railcard--navy .ccl-nofault--raillink {
	color: #E0A94A !important;
}

body .ccl-nofault--railcard--signal {
	background: #F0E6D4 !important;
	border-color: #F0E6D4 !important;
}

body .ccl-nofault--railcard--signal h2,
body .ccl-nofault--railcard--signal h3 {
	color: #1D1B16 !important;
}

body .ccl-nofault--railcard--signal p {
	color: #302D24 !important;
}

body .ccl-nofault--railcard--signal .ccl-nofault--raillink {
	color: #7A5210 !important;
}

body .ccl-nofault--railbtn--navy {
	background: #9C6412 !important;
	color: #FFFFFF !important;
}

body .ccl-nofault--railbtn--signal,
body .ccl-nofault--railpill {
	background: #E0A94A !important;
	color: #2A2620 !important;
}

body .ccl-nofault--railcard .ccl-nofault--railbtn--quiet,
body .ccl-nofault--railcard--navy .ccl-nofault--railbtn--quiet {
	border-color: #5E5647 !important;
	color: #EDE6D8 !important;
}

body .ccl-nofault--railcard--signal .ccl-nofault--railbtn--quiet {
	border-color: #C9B894 !important;
	color: #7A5210 !important;
}

/* --- home, topic and search -------------------------------------------- */

body .ccl-kb2 {
	background: #F8F6F1 !important;
}

body .ccl-kb2__hub,
body .ccl-kb2__result-list > li,
body .ccl-kb2__q {
	background: #FFFFFF !important;
	border: 0 !important;
}

body .ccl-kb2__hub-icon,
body .ccl-kb2__hub-count,
body .ccl-kb2__tag {
	background: #F0E6D4 !important;
}

body .ccl-kb2__hub-count,
body .ccl-kb2__tag {
	color: #7A5210 !important;
}

body .ccl-kb2__pill {
	border-color: #5E5647 !important;
}

body .ccl-kb2__quick-label {
	color: #9A917E !important;
}

/* --- callouts -----------------------------------------------------------
   The kind of callout is decided in PHP, by the mu-plugin ccl-kb-design.php,
   which reads the icon in the heading and writes data-callout on the box.
   It used to be read here with :has(), which Safari before 15.4 and older
   Android do not support - on those the rules below did nothing at all and
   the visitor got an untreated box. An attribute selector works everywhere.

   Three steps, no new colours:

     info   soft amber fill   info, lightbulb, stethoscope   context      44
     warn   deep left edge    warning, clock                 ends a claim 54
     tool   amber left edge   calculator, money, gavel, list a tool       69
*/

body .ccl-nofault--highlight {
	background: #FFFFFF !important;
	border-radius: 18px !important;
}

body .ccl-nofault--highlight[data-callout="info"] {
	background: #F0E6D4 !important;
	border-top: 0 !important;
	border-right: 0 !important;
	border-bottom: 0 !important;
	border-left: 3px solid #9C6412 !important;
}

body .ccl-nofault--highlight[data-callout="info"] h2,
body .ccl-nofault--highlight[data-callout="info"] h3,
body .ccl-nofault--highlight[data-callout="info"] h4,
body .ccl-nofault--highlight[data-callout="info"] h2 i,
body .ccl-nofault--highlight[data-callout="info"] h3 i,
body .ccl-nofault--highlight[data-callout="info"] h4 i,
body .ccl-nofault--highlight[data-callout="info"] a {
	color: #7A5210 !important;
}

body .ccl-nofault--highlight[data-callout="info"] p,
body .ccl-nofault--highlight[data-callout="info"] li {
	color: #302D24 !important;
}

body .ccl-nofault--highlight[data-callout="warn"] {
	border-top: 0 !important;
	border-right: 0 !important;
	border-bottom: 0 !important;
	border-left: 3px solid #2A2620 !important;
}

body .ccl-nofault--highlight[data-callout="warn"] h2,
body .ccl-nofault--highlight[data-callout="warn"] h3,
body .ccl-nofault--highlight[data-callout="warn"] h4,
body .ccl-nofault--highlight[data-callout="warn"] h2 i,
body .ccl-nofault--highlight[data-callout="warn"] h3 i,
body .ccl-nofault--highlight[data-callout="warn"] h4 i {
	color: #2A2620 !important;
}

body .ccl-nofault--highlight[data-callout="tool"] {
	border-top: 0 !important;
	border-right: 0 !important;
	border-bottom: 0 !important;
	border-left: 3px solid #9C6412 !important;
}

body .ccl-nofault--highlight[data-callout="tool"] h2 i,
body .ccl-nofault--highlight[data-callout="tool"] h3 i,
body .ccl-nofault--highlight[data-callout="tool"] h4 i {
	color: #9C6412 !important;
}

/* --- tables on a phone --------------------------------------------------
   Every table used to stack into one card per row, with each column's
   heading reprinted above its value. On the workplace-injuries article that
   turned a four-row table into 704px of scrolling - about a screen per two
   rows - and it destroyed the one thing the table was for: you cannot
   compare 32% against 22% against 18% when they sit on different screens.

   Below 720px a two- or three-column table stays a real table, with smaller
   type and tighter cells so it fits 390px without scrolling sideways.
   Measured: 704px -> 336px.

   The column count is written by the mu-plugin as data-cols, so this reads
   an attribute rather than counting header cells with :has().
   Of 78 tables, 25 are two columns, 42 are three, 9 are four and 2 are five.
*/

@media (max-width: 720px) {

body .ccl-nofault--table-wrapper {
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch !important;
}

body .ccl-nofault--table[data-cols="2"],
body .ccl-nofault--table[data-cols="3"] {
	display: table !important;
	width: 100% !important;
	border-collapse: collapse !important;
	font-size: 13px !important;
}

body .ccl-nofault--table[data-cols="2"] thead,
body .ccl-nofault--table[data-cols="3"] thead {
	position: static !important;
	width: auto !important;
	height: auto !important;
	clip: auto !important;
	clip-path: none !important;
	overflow: visible !important;
	display: table-header-group !important;
}

body .ccl-nofault--table[data-cols="2"] tbody,
body .ccl-nofault--table[data-cols="3"] tbody {
	display: table-row-group !important;
}

body .ccl-nofault--table[data-cols="2"] tr,
body .ccl-nofault--table[data-cols="3"] tr {
	display: table-row !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

body .ccl-nofault--table[data-cols="2"] th,
body .ccl-nofault--table[data-cols="2"] td,
body .ccl-nofault--table[data-cols="3"] th,
body .ccl-nofault--table[data-cols="3"] td {
	display: table-cell !important;
	padding: 8px !important;
	margin: 0 !important;
	vertical-align: top !important;
	border-bottom: 1px solid #E7E1D5 !important;
	overflow-wrap: anywhere !important;
}

/* Without this the column headings do not wrap and overprint each other. */
body .ccl-nofault--table[data-cols="2"] th,
body .ccl-nofault--table[data-cols="3"] th {
	font-size: 10px !important;
	letter-spacing: 0.04em !important;
	line-height: 1.3 !important;
	white-space: normal !important;
	word-break: normal !important;
	hyphens: auto !important;
}

body .ccl-nofault--table[data-cols="2"] td::before,
body .ccl-nofault--table[data-cols="3"] td::before {
	display: none !important;
	content: none !important;
}

body .ccl-nofault--table[data-cols="2"] td:first-child,
body .ccl-nofault--table[data-cols="3"] td:first-child {
	font-weight: 700 !important;
	font-size: 13.5px !important;
}

/* Three columns: column 1 is the row's subject, column 2 is usually a short
   value and the last is usually prose, so the widths are weighted that way. */
body .ccl-nofault--table[data-cols="3"] {
	table-layout: fixed !important;
}

body .ccl-nofault--table[data-cols="3"] th:first-child,
body .ccl-nofault--table[data-cols="3"] td:first-child {
	width: 32% !important;
}

body .ccl-nofault--table[data-cols="3"] th:nth-child(2),
body .ccl-nofault--table[data-cols="3"] td:nth-child(2) {
	width: 24% !important;
}

/* Two columns are left to size themselves. Fixing them at 40/60 measured
   1523px on the food-poisoning article, where one cell runs to 925
   characters - worse than the 1354px it took as stacked cards. Letting the
   browser choose gives the prose column the room it needs: 1077px, and short
   two-column tables still come out compact. */
body .ccl-nofault--table[data-cols="2"] {
	table-layout: auto !important;
}

/* Four columns or more keeps the stacked cards, because that many columns of
   prose will not fit 390px however small the type gets. The cards are
   tightened instead: the column heading now sits inline with its value in
   quiet grey rather than shouting above it in amber on its own line. On the
   time-limits article a six-row four-column table went from 2158px to
   1730px, a 20% cut, with nothing lost. */
body .ccl-nofault--table:not([data-cols="2"]):not([data-cols="3"]) tbody tr {
	padding: 14px 16px !important;
	margin-bottom: 10px !important;
}

body .ccl-nofault--table:not([data-cols="2"]):not([data-cols="3"]) tbody td + td {
	margin-top: 7px !important;
}

body .ccl-nofault--table:not([data-cols="2"]):not([data-cols="3"]) tbody td + td::before {
	display: inline !important;
	margin: 0 7px 0 0 !important;
	color: #6B6558 !important;
	font-size: 10px !important;
	letter-spacing: 0.06em !important;
}


/* A dense table - longest cell past 90 characters, flagged as data-dense by
   ccl-kb-design.php - sizes itself instead of taking the weighted widths.
   The three-column split above assumes a short middle column, and when that
   assumption is wrong it squeezes: the medical negligence comparison ran to
   3009px with fixed widths and 1714px without, on the same phone. */
body .ccl-nofault--table[data-cols="3"][data-dense="1"] {
	table-layout: auto !important;
}

body .ccl-nofault--table[data-cols="3"][data-dense="1"] th:first-child,
body .ccl-nofault--table[data-cols="3"][data-dense="1"] td:first-child,
body .ccl-nofault--table[data-cols="3"][data-dense="1"] th:nth-child(2),
body .ccl-nofault--table[data-cols="3"][data-dense="1"] td:nth-child(2) {
	width: auto !important;
}

}

/* The sticky Call / Callback bar is not styled here. Its site-wide contrast
   correction lives in ccl-a11y-contrast.css, and the knowledgebase palette
   for it is attached as inline CSS by ccl-kb-design.php, which is the only
   way to reach an element that sits outside the knowledgebase markup on a
   theme that prints neither body_class() nor language_attributes(). */
