/* ---------- Docs page ---------- */
.docs-hero {
  background: var(--inverse-deep);
  color: var(--ink-inverse);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.docs-hero .wrap {
  display: grid;
  gap: var(--s-3);
}
.docs-hero .display {
  color: var(--ink-inverse);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
}
.docs-hero .lead {
  max-width: 60ch;
}
.docs-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) 0;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-inverse-3);
  margin-top: var(--s-2);
}
.docs {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: var(--s-7);
  padding-block: var(--s-7) var(--s-8);
  align-items: start;
}

#docs-title {
  line-height: 1.1;
}

.docs > div {
  min-width: 0;
}
.doc {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 960px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }
}
/* ---------- Sidebar navigation ----------
   A grouped list, not a stack of cards: the titles do the work and only the
   active item carries colour. The active section's subheadings unfold under
   it. */
.dnav {
  min-width: 0;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: var(--s-2);
}
.dnav-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  padding: 0 var(--s-3);
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
}
.dnav-search:focus-within {
  border-color: var(--ink);
}
.dnav-search svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--ink-3);
}
/* 16px, or iOS zooms the whole page when this takes focus. The ring lives on
   .dnav-search:focus-within, so removing it here is intentional. */
.dnav-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--font-text);
  font-size: var(--t-5);
  color: var(--ink-deep);
}
.dnav-search kbd {
  flex: none;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--t-1);
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 var(--s-1);
  line-height: 1.4;
}

.dnav-group + .dnav-group {
  margin-top: var(--s-5);
}
.dnav-title {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-2);
  padding-left: var(--s-3);
}
.dnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.dnav a {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-1);
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--t-4);
  line-height: 1.35;
  border-left: 2px solid transparent;
}
.dnav-i {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}
.dnav a:hover {
  background: var(--panel-2);
  color: var(--ink);
}
.dnav a:hover .dnav-i {
  color: var(--ink);
}

.dnav a[aria-current="true"] {
  color: var(--link);
  font-weight: 600;
  background: var(--wash-red);
  border-left-color: var(--link);
}
.dnav a[aria-current="true"] .dnav-i {
  color: var(--link);
}

/* The active section's subheadings, hanging under the parent label. The
   selector has to out-specify `.dnav ul`, which sets margin:0;padding:0 at
   (0,1,1) against this rule's (0,1,0) and won on specificity whatever the
   order. */
.dnav ul.dnav-sub {
  list-style: none;
  margin: var(--s-1) 0 var(--s-2) var(--s-5);
  padding-left: var(--s-2);
  display: grid;
  gap: var(--s-1);
  border-left: 1px solid var(--rule-soft);
}
.dnav-sub a {
  padding: var(--s-1) var(--s-2);
  font-size: var(--t-3);
  color: var(--ink-3);
  border-left: 0;
}
.dnav-sub a:hover {
  background: var(--panel-2);
  color: var(--ink);
}
.dnav-sub a[aria-current="true"] {
  background: none;
  color: var(--link);
  font-weight: 600;
}

.dnav-empty {
  font-size: var(--t-4);
  color: var(--ink-3);
  padding: var(--s-3);
}
.dnav-home {
  display: inline-block;
  margin-top: var(--s-5);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.dnav-home:hover {
  color: var(--link);
}

.dnav-toggle {
  display: none;
}

@media (max-width: 960px) {
  .dnav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 44px;
    padding: 0 var(--s-4);
    margin-bottom: var(--s-4);
    background: var(--panel);
    border: 2px solid var(--ink);
    border-radius: var(--r-1);
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: var(--t-6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
  }
  .dnav-toggle svg {
    width: 20px;
    height: 20px;
  }
  .dnav {
    position: static;
    max-height: none;
    overflow: visible;
    display: none;
    padding: var(--s-4);
    margin-bottom: var(--s-5);
    border: 1px solid var(--rule);
    border-radius: var(--r-2);
  }
  .dnav.is-open {
    display: block;
  }
}

.doc {
  display: grid;
  gap: var(--s-4);
  padding-bottom: var(--s-7);
  margin-bottom: var(--s-7);
  border-bottom: 1px solid var(--rule-soft);
  scroll-margin-top: 90px;
}
.doc:last-child {
  border-bottom: 0;
}
.doc > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 4.8vw, 3.4375rem);
  line-height: 1.1;
  color: var(--ink);
  padding-left: var(--s-4);
  border-left: 6px solid var(--tab, var(--ink));
}
.doc h3 {
  font-family: var(--font-text);
  font-weight: 700;
  font-size: var(--t-8);
  color: var(--ink);
  margin-top: var(--s-3);
}
.doc h4 {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-6);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-top: var(--s-2);
}
.doc p {
  color: var(--ink-2);
  max-width: 70ch;
}
.doc ul,
.doc ol {
  padding-left: 1.25rem;
  color: var(--ink-2);
  display: grid;
  gap: 0.35rem;
  max-width: 70ch;
}
.doc .note {
  background: var(--wash-gold);
  border-left: 4px solid var(--ca-gold-500);
  padding: var(--s-3) var(--s-4);
  border-radius: 0 var(--r-1) var(--r-1) 0;
  font-size: var(--t-4);
}
.doc .callout {
  background: var(--inverse);
  color: var(--ink-inverse);
  border-radius: var(--r-2);
  padding: var(--s-5);
  display: grid;
  gap: 0.5rem;
}
.doc .callout p {
  color: var(--ink-inverse-2);
  max-width: none;
}
.doc .callout a {
  color: var(--ink-inverse);
}
.doc .callout .eyebrow {
  color: var(--ca-gold-500);
}
.profiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-4);
}
.profile {
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--panel);
  padding: var(--s-4) var(--s-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  align-content: start;
}
.profile h3 {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 400;
  font-size: var(--t-7);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.profile dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.8rem;
  font-size: var(--t-4);
  margin: 0;
}
.profile dt {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-ink);
  padding-top: var(--s-1);
}
.profile dd {
  margin: 0;
  color: var(--ink-2);
}
.profile .overview {
  color: var(--ink-deep);
  font-size: var(--t-4);
}
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-4);
}
.link-card {
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: var(--s-4) var(--s-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  background: var(--panel);
}
.link-card b {
  color: var(--ink);
  font-size: var(--t-6);
}
.link-card p {
  font-size: var(--t-4);
}
.link-card ul {
  font-size: var(--t-3);
}
.link-card .btn-row {
  margin-top: var(--s-1);
}
.stars {
  font-family: var(--font-text);
  letter-spacing: 0.05em;
  color: var(--gold-ink);
  white-space: nowrap;
}
.punch {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--s-3);
}
.punch div {
  border: 2px dashed var(--ink-inverse-3);
  border-radius: var(--r-2);
  padding: var(--s-4);
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--panel);
}
.punch div span {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: var(--t-2);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}
.punch div a {
  color: var(--link-alt);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--ca-gold-700);
  text-underline-offset: 0.2em;
}
.punch div a:hover,
.punch div a:focus-visible {
  color: var(--ink);
  text-decoration-thickness: 3px;
}
.punch div i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--link);
  display: block;
}

/* The group name above the section title, the way GitBook labels a page. */
.doc-eyebrow {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: var(--t-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-ink);
  padding-left: var(--s-4);
  margin: 0 0 calc(var(--s-3) * -1);
}

/* The seal on the Quick Book cover. Two columns where there is room, with the
   badge leading the title; it drops above the copy on narrow screens
   rather than shrinking to an illegible token. */
.docs-hero .wrap {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--s-6);
}
.docs-seal {
  grid-row: 1 / span 4;
  grid-column: 1;
  width: clamp(112px, 13vw, 188px);
  height: auto;
  align-self: center;
  filter: drop-shadow(0 8px 22px rgba(1, 19, 47, 0.55));
}
@media (max-width: 760px) {
  .docs-hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-seal {
    grid-row: auto;
    grid-column: 1;
    width: 104px;
    margin-bottom: var(--s-2);
  }
}

/* A long list of plain names reads better in columns than as one tall stack.
   Used for the offices a Davidson County voter may see on a ballot. */
.doc ul.cols {
  columns: 2;
  column-gap: var(--s-6);
}
.doc ul.cols li {
  break-inside: avoid;
}
@media (max-width: 560px) {
  .doc ul.cols {
    columns: 1;
  }
}

/* Drawn on the separator rather than typed into the markup, so it never lands
   at the start of a wrapped row and is not read aloud. */
.docs-hero .meta span + span::before {
  content: "\2605";
  display: inline-block;
  /* Both sides: with the row's column gap at zero, the star owns the spacing. */
  margin-inline: var(--s-5);
  color: var(--ca-gold-500);
  font-size: 0.75em;
  vertical-align: 0.1em;
}

/* Groups the office profiles without a heading: the sidebar builds sub-items
   from h3s, so a real one would replace the fifteen office names with seven
   group names. */
.profiles .doc-group {
  grid-column: 1/-1;
  margin: var(--s-5) 0 0;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: var(--t-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.profiles .doc-group:first-child {
  margin-top: 0;
}
