/* Drake KB — article title block, in-content link color, breadcrumb dedupe.
 *
 * Owns three narrow fixes on the single-doc template. Everything here is
 * presentation only: no post title, content or plugin setting is modified.
 *
 * 1. TITLE BLOCK. BetterDocs' single-doc block template renders the title as
 *    `<h1 class="wp-block-post-title" style="font-size:clamp(...,36px);
 *    text-transform:uppercase; margin-bottom:30px;">`. Those are INLINE block
 *    styles baked into the DB template, so overriding them requires
 *    `!important` — there is no lower-specificity way to beat an inline style.
 *    The uppercase is the theme's, not the data's: the post_title is stored in
 *    proper mixed case ("Drake Tax Online - Drake SmartExtract TM (Beta)").
 *
 *    Target (real Drake KB): mixed case, Drake blue, bold, ~28px, with a solid
 *    Drake-blue vertical bar on the left edge and the text padded off it.
 *
 * 2. IN-CONTENT LINKS. The theme paints body links near-black; the live KB
 *    shows them Drake blue, darker + underlined on hover.
 *
 * 3. BREADCRUMB. BetterDocs emits both a "home" crumb and a "docs landing page"
 *    crumb; here the docs landing page is titled "Home" and resolves to the
 *    same URL, so the trail read "Home › Home › …".
 */

/* ---------------------------------------------------------------------------
 * 1. Article title
 * ------------------------------------------------------------------------- */
.wp-block-post-title,
h1.wp-block-post-title {
  /* Beat the inline `text-transform:uppercase` on the block itself. */
  text-transform: none !important;
  font-family: var(--drake-font);
  /* Source title is markedly smaller than the theme's 36px clamp. */
  font-size: 28px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: var(--drake-blue) !important;
  /* The signature element: a solid blue bar down the left edge. */
  border-left: 5px solid var(--drake-blue);
  padding-left: 14px;
  /* Sit tight above the Article #/Last Updated lines (was 30px inline). */
  margin-top: 6px !important;
  margin-bottom: 10px !important;
}

/* ---------------------------------------------------------------------------
 * 2. Article # / Last Updated meta lines
 *    Rendered by the content itself as a nested <div><div> wrapper:
 *      <p><strong>Article #: </strong>19010</p>
 *      <p><strong>Last Updated: </strong><span>…</span></p>
 *      <hr/>
 *    The theme's paragraph rhythm spaces these far apart; the source keeps them
 *    on consecutive tight lines with a thin rule before the body.
 *
 *    Matched STRUCTURALLY (a div whose last child is an <hr> and that holds
 *    <strong>-led paragraphs) rather than by position: a handful of articles
 *    (e.g. KB 14304) emit a product-year <select> ahead of this wrapper, so it
 *    is not always the first child of .drake-doc-main.
 * ------------------------------------------------------------------------- */
.drake-doc-main div:has(> hr:last-child):has(> p > strong) > p {
  margin: 0 0 2px !important;
  font-size: 15px;
  line-height: 1.45;
  color: var(--drake-gray);
}
.drake-doc-main div:has(> hr:last-child):has(> p > strong) > p strong {
  color: var(--drake-ink);
  font-weight: 700;
}
.drake-doc-main div:has(> hr:last-child):has(> p > strong) > hr {
  margin: 12px 0 18px;
  border: 0;
  border-top: 1px solid var(--drake-line);
  height: 0;
  background: none;
}

/* ---------------------------------------------------------------------------
 * 3. In-content links
 *    Scoped to `.drake-doc-main` (the article-body wrapper injected by
 *    right-rail.php) ON PURPOSE: the right rail, breadcrumb, header and footer
 *    live outside it and are owned by other stylesheets. `.drake-right-rail` is
 *    a SIBLING of `.drake-doc-main` inside `.drake-doc-layout`, so scoping this
 *    way cannot leak into the rail's CTA pills or section nav.
 * ------------------------------------------------------------------------- */
/* The darker brand blue, not --drake-blue: the article body sits on #f2f4f7,
 * where #1b75bc measures 4.41:1 — under WCAG AA's 4.5:1 for body text. This was
 * every link in every article, 61% of all pages in an axe-core sweep, and the
 * single highest-volume accessibility failure in the KB. #155e97 is 6.19:1. */
.drake-doc-main a {
  color: var(--drake-blue-dark, #155e97);
  text-decoration: none;
}
/* Hover/focus goes a step darker still (7.76:1), because the base link colour is
 * now --drake-blue-dark and the two would otherwise be identical — the underline
 * carries the affordance, but the colour shift should remain visible. */
.drake-doc-main a:hover,
.drake-doc-main a:focus {
  color: #124f80;
  text-decoration: underline;
}
/* Links that wrap an image (screenshots, lightboxes) shouldn't get an
 * underline artifact on hover. */
.drake-doc-main a:has(> img):hover {
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
 * 4. Breadcrumb: drop the duplicated crumb
 *    BetterDocs always emits crumb 1 = "home" (item-home) and crumb 2 = the
 *    docs landing page (item-custom-docs-page, or item-custom-post-type-docs
 *    when the built-in archive is used). This install's docs landing page is
 *    titled "Home" and points at the site root, so crumb 2 duplicates crumb 1.
 *
 *    We hide crumb 2 (not crumb 1) so a real "Home" link always survives, and
 *    remove the now-dangling delimiter that followed it. The source Drake KB
 *    trail has no intermediate docs-landing level either
 *    ("Home › Drake Tax › …"), so this matches the target regardless.
 * ------------------------------------------------------------------------- */
.betterdocs-breadcrumb .betterdocs-breadcrumb-item.item-custom-docs-page,
.betterdocs-breadcrumb
  .betterdocs-breadcrumb-item.item-custom-docs-page
  + .betterdocs-breadcrumb-item.breadcrumb-delimiter {
  display: none;
}

/* ---------------------------------------------------------------------------
 * 5. Breadcrumb: the CURRENT page crumb.
 *
 * BetterDocs colours it #528fff, which is 2.83:1 on the #f2f4f7 body wrapper —
 * well under WCAG AA's 4.5:1, and it was the last contrast failure in the KB
 * (35 nodes across 33 articles). We had never styled this selector, so their
 * default was showing through.
 *
 * The current crumb is not a link, so it reads as body text: --drake-gray gives
 * 8.28:1 and matches how the source Drake KB de-emphasises the page you are
 * already on, rather than colouring it like a destination you can click.
 * ------------------------------------------------------------------------- */
.betterdocs-breadcrumb .betterdocs-breadcrumb-item.item-current,
.betterdocs-breadcrumb .betterdocs-breadcrumb-item.item-current > span {
  color: var(--drake-gray, #48484a);
}
