/* Numbered citations + Sources panel in blog and tradeshow bodies
   (App\Services\CitationMarkup). Loaded by blog_detail and tradeshow_detail only.

   Colours come from the body tables (navy header #2d557a, row tint #e6edf3), so
   citations read as reference marks, not as content links. Contrast (WCAG AA):
   #2d557a on #e6edf3 6.6:1 · white on #2d557a 7.6:1 · chip in a table header:
   inherits the header's text colour on a 16% tint of it (white on navy ≥ 5:1). */

.cite-sources-box,
sup.cite {
    --cite-ink: #2d557a;
    --cite-tint: #e6edf3;
    --cite-line: #d5dee7;
}

/* ── [n] in the text → a small numbered chip, linked to its source ───────── */
sup.cite {
    display: inline-block;
    margin-left: 3px;
    padding: 0 0.42em;
    border-radius: 999px;
    background: var(--cite-tint);
    color: var(--cite-ink);
    font-size: 0.62em;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    vertical-align: 0.55em;   /* superscript position without stretching the line */
    white-space: nowrap;
}

sup.cite a,
sup.cite a:visited {
    color: inherit;
    text-decoration: none;
}

sup.cite a:hover,
sup.cite a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

sup.cite a:focus-visible {
    outline: 2px solid var(--cite-ink);
    outline-offset: 2px;
    border-radius: 2px;
}

sup.cite:has(a:hover) {
    background: var(--cite-ink);
    color: #fff;
}

/* in a table header the chip takes the header's own text colour, so it never
   ends up blue-on-blue */
th sup.cite {
    background: rgba(255, 255, 255, 0.16);
    background: color-mix(in srgb, currentColor 16%, transparent);
    color: inherit;
}

th sup.cite:has(a:hover) {      /* hover = underline only; a lighter chip would drop below 4.5:1 */
    background: rgba(255, 255, 255, 0.16);
    background: color-mix(in srgb, currentColor 16%, transparent);
    color: inherit;
}

th sup.cite a:focus-visible {
    outline-color: currentColor;
}

/* ── the Sources panel ─────────────────────────────────────────────────── */
.cite-sources-box {
    margin: 48px 0 24px;
    padding: 22px 26px 18px;
    background: #f5f8fb;
    border: 1px solid var(--cite-line);
    border-radius: 10px;
    counter-reset: cite-source;
}

/* a quiet label, not another content heading */
.cite-sources-box h2#sources,
.trad_sho_detl2 .Left_inner .cite-sources-box h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--cite-ink);
    scroll-margin-top: 90px;
}

.cite-sources-box h2#sources::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background: currentColor;
    /* open-book mark */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6a4 4 0 0 1 4 4v13a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 4h-6a4 4 0 0 0-4 4v13a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

section.cite-sources-box ol.cite-sources {   /* "section" outranks the page's own list indent rule */
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
    line-height: 1.55;
    color: #4b5563;
}

.cite-sources-box ol.cite-sources li {
    position: relative;
    display: block;
    margin: 0;
    padding: 9px 8px 9px 40px;
    font-size: 14.5px;          /* on the item: the page's own "li" size rule outranks the list */
    line-height: 1.55;
    border-top: 1px solid var(--cite-line);
    border-radius: 6px;
    text-align: left;           /* beats the page-wide justify rule */
    overflow-wrap: anywhere;    /* long titles / URLs never push the page sideways */
    scroll-margin-top: 90px;    /* clears the sticky header after a citation jump */
    counter-increment: cite-source;
}

.cite-sources-box ol.cite-sources li:first-child {
    border-top: 0;
}

/* the number: the same chip as the citation in the text */
.cite-sources-box ol.cite-sources li::before {
    content: counter(cite-source);
    position: absolute;
    left: 6px;
    top: 10px;
    min-width: 24px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--cite-tint);
    color: var(--cite-ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cite-sources-box ol.cite-sources a,
.cite-sources-box ol.cite-sources a:visited {
    color: var(--cite-ink);
    font-weight: 500;
    text-decoration: none;
}

.cite-sources-box ol.cite-sources a:hover,
.cite-sources-box ol.cite-sources a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cite-sources-box ol.cite-sources a:focus-visible {
    outline: 2px solid var(--cite-ink);
    outline-offset: 2px;
    border-radius: 2px;
}

/* opens in a new tab */
.cite-sources-box ol.cite-sources a[target="_blank"]::after {
    content: "\2197";
    content: "\2197" / "";      /* silent for screen readers where supported */
    display: inline-block;
    margin-left: 3px;
    font-size: 0.85em;
}

/* the source a reader just jumped to */
.cite-sources-box ol.cite-sources li:target {
    background: #fff4c2;
    border-top-color: transparent;
    transition: background-color 0.3s ease;
}

.cite-sources-box ol.cite-sources li:target::before {
    background: var(--cite-ink);
    color: #fff;
}

.cite-sources-box ol.cite-sources li:target + li {
    border-top-color: transparent;
}

@media (max-width: 575px) {
    .cite-sources-box {
        margin-top: 36px;
        padding: 18px 14px 12px;
    }

    .cite-sources-box ol.cite-sources li {
        padding-left: 36px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cite-sources-box ol.cite-sources li:target {
        transition: none;
    }
}
