/* Blog: category chips and pages, category tags on the cards and in the article header, and the share buttons. Prefix: bx-
   Loaded on /blog/, /blog/category/<slug>/ and the article pages only. Sized in rem (base.html forces a 22px body). */

/* ---- Breadcrumbs in the hero ---- */
.bx-crumbs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem; margin: 0 0 1rem; font-size: 0.875rem; color: #64748b; }
.bx-crumbs a { display: inline-flex; align-items: center; min-height: 36px; color: #1d4ed8; text-decoration: none; }
.bx-crumbs a:hover, .bx-crumbs a:focus-visible { text-decoration: underline; }
.bx-crumbs [aria-current] { color: #475569; }

/* ---- Category chips (links, like the chips on /services/) ---- */
.bx-chips-band { padding: 1.25rem 0 0.25rem; background: #ffffff; }
.bx-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0; padding: 0; }
.bx-chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0.4rem 1rem; border: 1.5px solid #cbd5e1; border-radius: 999px; background: #ffffff; color: #0f172a; font-size: 0.9rem; font-weight: 700; text-decoration: none; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.bx-chip span { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 0.78rem; font-weight: 800; }
.bx-chip[aria-current="page"] { background: #1d4ed8; border-color: #1d4ed8; color: #ffffff; }
.bx-chip[aria-current="page"] span { background: #ffffff; color: #1d4ed8; }
.bx-chip:focus-visible, .bx-cat:focus-visible, .bx-share-btn:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    .bx-chip:not([aria-current="page"]):hover { background: #eff6ff; border-color: #1d4ed8; transform: translateY(-2px); }
}
.bx-chip:active { transform: scale(0.96); }

/* ---- Category name on a card: a tiny plain-text label above the date, no box, so it never reads like a second title ---- */
.bx-cat-link { display: block; width: fit-content; margin: 0 0 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #475569; text-decoration: none; }
.bx-cat-link:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; border-radius: 2px; }
@media (hover: hover) and (pointer: fine) { .bx-cat-link:hover { color: #1d4ed8; text-decoration: underline; } }

/* ---- Category tag (article header) ---- */
.bx-cat { display: inline-flex; align-items: center; min-height: 28px; margin: 0 0 0.6rem; padding: 0.1rem 0.75rem; border: 1px solid #dbeafe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease; }
@media (hover: hover) and (pointer: fine) { .bx-cat:hover { background: #1d4ed8; color: #ffffff; } }
.bx-cat--hero { margin: 0; }

/* ---- Share buttons: round icons in one row; the network's name shows as a tooltip, and its colour fills the button on hover ---- */
.bx-share { max-width: 760px; margin: 1.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid #eef2f7; }
.bx-share-label { display: block; margin: 0 0 0.7rem; font-size: 0.9rem; font-weight: 600; color: #475569; }
.bx-share-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.bx-share-list [hidden] { display: none !important; }
.bx-share-list li:has(> [hidden]) { display: none; } /* the empty slot would otherwise leave a gap at the right edge */
.bx-share-btn { --brand: #1d4ed8; position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #cbd5e1; border-radius: 999px; background: #ffffff; color: #1e293b; font: inherit; line-height: 1; text-decoration: none; cursor: pointer; transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.bx-share-btn svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.bx-share-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bx-b-wa { --brand: #16a34a; } .bx-b-fb { --brand: #1877f2; } .bx-b-x { --brand: #000000; } .bx-b-in { --brand: #0a66c2; }
.bx-b-pin { --brand: #e60023; } .bx-b-tg { --brand: #1b8ac2; } .bx-b-rd { --brand: #ff4500; }
.bx-share-btn.is-done { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.bx-share-status { display: block; min-height: 1.2rem; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: #166534; }
@media (hover: hover) and (pointer: fine) {
    .bx-share-btn:hover, .bx-share-btn:focus-visible { background: var(--brand); border-color: var(--brand); color: #ffffff; transform: translateY(-2px); }
    .bx-share-btn::after { content: attr(aria-label); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5; padding: 0.3rem 0.6rem; border-radius: 6px; background: #0f172a; color: #ffffff; font-size: 0.78rem; font-weight: 600; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
    .bx-share-btn:hover::after, .bx-share-btn:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
}
.bx-share-btn:active { transform: scale(0.94); }

/* the bar after the article: the label on the left, the icons on the right edge of the text column (stacked and left-aligned on phones) */
.bx-share--full { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.bx-share--full .bx-share-label { margin: 0; }
.bx-share--full .bx-share-list { justify-content: flex-end; }
.bx-share--full .bx-share-status { flex-basis: 100%; margin-top: 0; text-align: right; }
@media (max-width: 600px) {
    .bx-share--full { display: block; }
    .bx-share--full .bx-share-label { margin: 0 0 0.7rem; }
    .bx-share--full .bx-share-list { justify-content: flex-start; }
    .bx-share--full .bx-share-status { margin-top: 0.5rem; text-align: left; }
}

/* the row under the article title: no label, left-aligned with the title */
.bx-share--compact { max-width: none; margin: 1.1rem 0 0; padding-top: 0; border-top: 0; }
.bx-share--compact .bx-share-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    .bx-chip, .bx-cat, .bx-share-btn, .bx-share-btn::after { transition: none; }
    .bx-chip:active, .bx-share-btn:active { transform: none; }
    .bx-chip:not([aria-current="page"]):hover, .bx-share-btn:hover { transform: none; }
}
@media (max-width: 600px) {
    .bx-chips { gap: 0.4rem; }
    .bx-chip { padding: 0.35rem 0.85rem; font-size: 0.85rem; }
}

/* The featured article card was wider than a phone screen: its picture has a minimum height AND a 2:1 shape, which forces a 440px width.
   On narrow screens the column may now shrink and the picture keeps only its shape. */
@media (max-width: 760px) {
    .blog-rd-spotlight .blog-rd-spotlight-card { grid-template-columns: minmax(0, 1fr); }
    .blog-rd-spotlight .blog-rd-spotlight-media { min-height: 0; }
    .blog-rd-spotlight .blog-rd-spotlight-body { min-width: 0; }
}
