﻿/* kc-v2 v1.5.7 -- navigation: site header, breadcrumbs, footer */
/* Full class contract and conventions: see README.md and kc-v2-base.css. */

/* ---------------------------------------------------------------------------
 * Navigation: site header, breadcrumbs, footer
 *
 * The logo is a SLOT, not an asset shipped by kc-v2 -- the logo is not
 * changing (see the KENT-55 design doc). These classes size a box for
 * whatever logo file the consuming app already has; they never reference a
 * specific image.
 *
 * The site header's search box reuses .kc-v2-search from kc-v2-forms.css --
 * load order between component files doesn't matter for correctness (see
 * kc-v2-base.css), but forms.css does need to be present.
 * ------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
 * List-item hardening
 *
 * Every list in this file sets `list-style: none; margin: 0; padding: 0` on the
 * <ul>/<ol>. That is not enough. A host that ships a bare
 *
 *     li { list-style-type: disc; margin-left: 20px; }
 *
 * (KentonCountyPublic's Community.css does, and it is loaded on every Community
 * page) applies that declaration DIRECTLY to the <li>, and a directly-applied
 * declaration always beats an inherited one -- specificity and load order never
 * enter into it. `margin-left` is not an inherited property at all, so the host
 * rule is simply unopposed.
 *
 * Measured, not theorised: the KENT-59 Phase 0 spike rendered kc-v2 chrome inside
 * the real Community cascade and got bullets plus a 20px indent in the site header
 * nav, the utility links, and the footer link columns.
 *
 * These selectors are (0,1,1) -- a scoped descendant, which README rule #2 allows;
 * what it forbids is an *unscoped* bare `li`.
 * ------------------------------------------------------------------------- */
.kc-v2-site-header__utility-links li,
.kc-v2-site-header__nav li,
.kc-v2-breadcrumbs li,
.kc-v2-footer__links li {
  list-style: none;
  margin: 0;
  padding: 0;
  text-indent: 0;
}

/* Bare `a { padding: 0 3px; }` in site.css was adding 3px either side of every link inside
   kc-v2 chrome. These are (0,1,1) and win once they declare it.

   :not(.kc-v2-btn) is load-bearing. Without it this rule ALSO out-specifies
   `.kc-v2-btn { padding: 0 var(--kc-v2-space-4) }` (0,1,0), so an anchor styled as a button
   anywhere in the chrome loses its horizontal padding and collapses to the width of its own
   text -- which is exactly what happened to the footer's "Report an Issue" button. This
   selector is for plain text links; a button in the chrome keeps the button component's
   padding. */
.kc-v2-site-header__utility a:not(.kc-v2-btn),
.kc-v2-site-header__nav a:not(.kc-v2-btn),
.kc-v2-breadcrumbs a:not(.kc-v2-btn),
.kc-v2-footer a:not(.kc-v2-btn) {
  padding: 0;
}

.kc-v2-site-header {
  background-color: var(--kc-v2-white);
}

.kc-v2-site-header__utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kc-v2-space-3);
  padding: var(--kc-v2-space-2) var(--kc-v2-space-4);
  background-color: var(--kc-v2-ink-900);
  color: #C9D6E2; /* a one-off utility-bar text tint, not reused elsewhere */
  font-family: var(--kc-v2-font-family);
  font-size: 12.5px;
}
.kc-v2-site-header__utility-links {
  display: flex;
  gap: var(--kc-v2-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.kc-v2-site-header__utility a {
  color: inherit;
  text-decoration: none;
}
.kc-v2-site-header__utility a:visited {
  color: inherit;
}
.kc-v2-site-header__utility a:hover,
.kc-v2-site-header__utility a:focus,
.kc-v2-site-header__utility a:active {
  text-decoration: underline;
}
.kc-v2-site-header__utility a:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 2px;
}

.kc-v2-site-header__main {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 28px;
  /* Wraps rather than crushing the identity lockup (KENT-44 1.2.0). The logo slot and the actions
     slot both set flex-shrink: 0, so on a narrow viewport __brand was the only item that could give
     -- at 375px "Kenton County" and "BUSINESS SERVICES" each wrapped to two lines, turning a
     two-line lockup into four beside the Log out button. With wrapping allowed, the actions slot
     drops to its own row instead (still right-aligned there, via its margin-left: auto) and the
     brand keeps the full width.

     No media query: the flex algorithm wraps exactly when the row stops fitting, so there is no
     breakpoint to guess at or to drift out of date as the actions slot gains items. row-gap keeps
     the wrapped row from touching the one above it. */
  flex-wrap: wrap;
  row-gap: var(--kc-v2-space-2);
  padding: var(--kc-v2-space-3) var(--kc-v2-space-4);
  /* Green rather than the ink-200 hairline this shipped with in 1.0.0: the Figma
     "external landing" frame (54:15) draws a brand-green rule under the header, and that
     frame is the design authority for the site chrome. Decorative divider, so the 2.61:1
     contrast of --kc-v2-green on white is not a WCAG 1.4.11 concern -- it carries no
     information and identifies no control. */
  border-bottom: 3px solid var(--kc-v2-green);
}

/* Height-constrained with an intrinsic width, so the slot shrink-wraps to whatever ratio the
   consuming app's logo has -- kc-v2 never ships the asset and must not assume its shape. Do
   not add a width: an earlier 40x40 square stretched the county's 232x192 mark 21%
   horizontally, and a 52x40 box then letterboxed it. object-fit rather than
   `width: auto; height: 100%` so host `img` sizing rules are neutralised without
   `!important`, which the contract forbids. Measures 62.8x52 in the Community cascade. */
.kc-v2-site-header__logo-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
}
.kc-v2-site-header__logo-slot img,
.kc-v2-site-header__logo-slot svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Right-hand action slot (KENT-44 1.2.0). Both Figma frames that show a signed-in workflow put
   controls at the header's trailing edge -- a "Log out" button on the Filing form (54:446), and
   that plus a "Normal Return" status pill on City fees (100:2).
 *
   `margin-left: auto` inside __main's flex row is what pushes it to the edge, so the slot needs no
   knowledge of how many items precede it (logo, brand, and optionally a nav).
 *
   This is where the annual flow's Log out lives. Previously each step rendered its own
   `btn btn-danger` inside the page body -- in _AnnualFilingInfo it sat in a col-xs-2 above the
   form -- which put a destructive control in the content flow, differently placed on every step. */
.kc-v2-site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--kc-v2-space-3);
  margin-left: auto;
  flex-shrink: 0;
}

/* The identity lockup. __title and the optional __subtitle sit in a __brand column so the
   two lines stack -- the Figma landing frame draws "Kenton County" over a green
   "BUSINESS SERVICES". __brand is optional: a single-line header can still use __title on
   its own, as the styleguide's Navigation section does. */
.kc-v2-site-header__brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Do not shrink: the two lines are the site's identity and must stay on one line each. Pressure
     is relieved by __main wrapping instead (see the note there). min-width: 0 still lets the text
     ellipsis-free-shrink in the pathological case where even a full row is too narrow, rather than
     overflowing the header. */
  flex-shrink: 0;
  min-width: 0;
}

.kc-v2-site-header__title {
  margin: 0;
  color: var(--kc-v2-ink-900);
  font-family: var(--kc-v2-font-family);
  font-size: 16px;
  font-weight: 800;
  line-height: 20px;
}

/* Brand green, matching the Figma landing frame (54:15) exactly, at the product owner's
   explicit direction.

   RECORDED ACCESSIBILITY TRADE-OFF -- do not "fix" this back without asking. 1.1.0 first
   shipped this line in --kc-v2-success-text as a documented deviation, because measured
   against the white header:
     --kc-v2-green        #2BB673 -> 2.61:1  (below even the 3:1 non-text floor)
     --kc-v2-green-2      #289A48 -> 3.62:1  (below 4.5:1 for text at this size)
     --kc-v2-success-text #155E35 -> 7.82:1  (passes)
   This is small, uppercase, letter-spaced *text*, so WCAG 1.4.3 asks 4.5:1 and the brand
   green does not reach it. It was reinstated as a deliberate brand-fidelity decision. The
   mitigation is that this line is decorative rather than functional: it duplicates the
   __title lockup above it and the <title>/nav already name the site, so nothing here is
   the only route to any information or control. If the audit ever needs to clear 4.5:1,
   --kc-v2-success-text is the drop-in swap. */
.kc-v2-site-header__subtitle {
  margin: 0;
  color: var(--kc-v2-green);
  font-family: var(--kc-v2-font-family);
  font-size: var(--kc-v2-overline-size);
  font-weight: var(--kc-v2-overline-weight);
  line-height: var(--kc-v2-overline-line-height);
  letter-spacing: var(--kc-v2-overline-letter-spacing);
  text-transform: uppercase;
}

.kc-v2-site-header__nav {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.kc-v2-site-header__nav a {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  color: var(--kc-v2-ink-600);
  text-decoration: none;
  font-family: var(--kc-v2-font-family);
  font-size: 14.5px;
  font-weight: 600;
}
.kc-v2-site-header__nav a:visited {
  color: var(--kc-v2-ink-600);
}
.kc-v2-site-header__nav a:hover,
.kc-v2-site-header__nav a:focus,
.kc-v2-site-header__nav a:active {
  text-decoration: none;
  color: var(--kc-v2-blue);
}
.kc-v2-site-header__nav a:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 2px;
}
.kc-v2-site-header__nav a[aria-current="page"] {
  color: var(--kc-v2-blue);
  border-bottom-color: var(--kc-v2-green);
}
.kc-v2-site-header__nav a[aria-current="page"]:visited {
  color: var(--kc-v2-blue);
}

.kc-v2-site-header__search {
  margin-left: auto;
  max-width: 280px;
}

.kc-v2-breadcrumbs {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 20px 22px;
  border: 1px solid var(--kc-v2-ink-200);
  border-radius: 14px; /* off-scale, matching Figma's info-panel-style radius */
  background-color: var(--kc-v2-white);
  list-style: none;
  margin: 0;
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
}
.kc-v2-breadcrumbs li {
  display: flex;
  align-items: center;
}
/* The "/" separator is a ::before, not a separate <li> -- a dedicated
   separator list item (even aria-hidden) still inflates the list's item
   count for a screen reader announcing "list, N items"; this way the list
   contains only the meaningful crumbs. */
.kc-v2-breadcrumbs li + li::before {
  content: "/";
  margin-right: 9px;
  color: var(--kc-v2-ink-400);
}
.kc-v2-breadcrumbs a {
  color: var(--kc-v2-blue);
  text-decoration: none;
  font-weight: 600;
}
.kc-v2-breadcrumbs a:visited {
  color: var(--kc-v2-blue);
}
.kc-v2-breadcrumbs a:hover,
.kc-v2-breadcrumbs a:focus,
.kc-v2-breadcrumbs a:active {
  text-decoration: underline;
}
.kc-v2-breadcrumbs a:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 2px;
}
.kc-v2-breadcrumbs [aria-current="page"] {
  color: var(--kc-v2-ink-500);
  font-weight: 400;
}

/* Unboxed variant (1.5.0, KENT-56).
 *
 * The base component is a bordered white panel, which is what its own Figma frame shows. The
 * Business License Application frame (node 100:545) shows the same crumbs as plain text sitting
 * directly on the page ground, with no panel -- so this drops the chrome and keeps the layout,
 * separator and link treatment.
 *
 * Element-qualified DEFENSIVELY, not out of necessity. Measured both ways: an unqualified
 * `.kc-v2-breadcrumbs--plain` also wins today, because it sits later in this file than the base rule
 * and equal specificity goes to source order. Qualifying takes it to (0,1,1) so it keeps winning if
 * the base rule is ever moved below it, or if a host sheet lands an (0,1,1) selector on breadcrumb
 * padding -- which is precisely what site.css did to `a` inside this component. Cheap insurance;
 * the honest note is that nothing requires it right now. */
ol.kc-v2-breadcrumbs--plain,
nav.kc-v2-breadcrumbs--plain {
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
}

.kc-v2-footer {
  box-sizing: border-box;
  padding: 44px 40px;
  background-color: var(--kc-v2-ink-900);
  color: #8BA0B5; /* a one-off footer-body tint, not reused elsewhere */
  font-family: var(--kc-v2-font-family);
  /* site.css styles the bare `footer` element (font-size: 10px, text-align: center,
     height: 50px). That is (0,0,1) and loses to this class -- but only for properties
     this class actually declares. Without them the whole footer rendered at 10px and
     centred (KENT-59 Phase 0 spike).

     `height: auto` is the important one and the least obvious. Combined with the
     `box-sizing: border-box` above, an inherited `height: 50px` does not merely make the
     footer short -- it clamps the border box to 50px, so once padding exceeds that the
     height collapses to the padding alone and every child overflows the box. On the
     Community page that put the "Report an Issue" button underneath the fixed
     "Report a vulnerability" tab. Any host with a bare `footer { height: … }` does this. */
  height: auto;
  min-height: 0;
  font-size: 14px;
  text-align: start;
}
.kc-v2-footer * {
  box-sizing: border-box;
}
.kc-v2-footer__logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--kc-v2-space-3);
  border-radius: var(--kc-v2-radius-md);
  background-color: var(--kc-v2-white);
}
.kc-v2-footer__logo-slot img,
.kc-v2-footer__logo-slot svg {
  display: block;
  max-width: 70%;
  max-height: 70%;
}
.kc-v2-footer__tagline {
  display: block;
  /* Full margin, not just margin-top: this is a <p>, so the bottom edge was
     coming from the UA's `margin-block: 1em` (12px at this font-size) and was
     replaced by bootstrap's bare `p { margin: 0 0 10px; }` on a host page.
     12px is the previous effective value, pinned so it stops depending on
     whichever sheet wins. */
  margin: var(--kc-v2-space-3) 0 12px;
  color: var(--kc-v2-mint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kc-v2-footer__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--kc-v2-space-4);
}
/* font-family and line-height are declared here rather than inherited from
   .kc-v2-footer: this is an <h4>, and site.css styles `h1, h2, h3, h4, h5, h6`
   directly. A directly-applied declaration beats an inherited one, so the footer
   headings were rendering in Helvetica Neue while the rest of the footer was
   correctly Montserrat (KENT-59 Phase 0 spike). */
.kc-v2-footer__heading {
  margin: 0 0 var(--kc-v2-space-2);
  color: var(--kc-v2-white);
  font-family: var(--kc-v2-font-family);
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
}
.kc-v2-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--kc-v2-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.kc-v2-footer a {
  color: #8BA0B5;
  text-decoration: none;
}
.kc-v2-footer a:visited {
  color: #8BA0B5;
}
.kc-v2-footer a:hover,
.kc-v2-footer a:focus,
.kc-v2-footer a:active {
  text-decoration: underline;
}
.kc-v2-footer a:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 2px;
}

@media print {
  .kc-v2-site-header,
  .kc-v2-footer {
    display: none;
  }
}
