/* Blog detail design layer.
 *
 * The presentation layer for Components/Pages/BlogPostPage.razor. Global CSS,
 * linked from App.razor — it was Blazor-scoped until the stylesheets were
 * consolidated under wwwroot/css, which leaves two rules governing this file,
 * the first shared with pages/blog-index.css:
 *
 * 1. Nothing confines these rules to this page any more, so every selector is
 *    qd- prefixed or a descendant of one. A bare element selector here would
 *    leak into the rest of the site the way the deleted css/site.css did.
 * 2. The doubled class in `.qd-prose.qd-prose h2` is deliberate, not a typo.
 *    Isolation used to rewrite these selectors as `.qd-prose[b-xxxxx] h2`, and
 *    the attribute was carrying real weight: the bundle's own .prose block is
 *    unlayered, and `.prose thead th` outspecifies a plain `.qd-prose th`.
 *    Repeating the class restores exactly the specificity the attribute gave.
 *
 * These rules are unlayered and Tailwind v4's utilities live inside @layer, so
 * they win regardless of specificity. Against the unlayered .prose block the
 * doubled class wins on specificity, and this sheet is linked after the bundle,
 * so both tie-breaks still fall the same way. .prose stays on the element as
 * the base — this file only adjusts it, it does not restate it.
 *
 * No @keyframes here, so there is nothing global to collide with the index's
 * qb- animations, home's qh- or pricing's qp- ones.
 *
 * The shape: a light page, the whole article in one white card, a rail of
 * widget cards beside it. Card chrome is deliberately quiet — a hairline plus a
 * low shadow — because the article body is the only thing on the page that is
 * meant to hold the eye.
 */

/* ── page ───────────────────────────────────────────────────────────── */
.qd-page {
    background: #f3f5fa;
    padding: 28px 0 64px;
}

.qd-card {
    background: #fff;
    border: 1px solid #ebeef5;
    border-radius: 14px;
    box-shadow: 0 2px 16px -6px rgba(16, 24, 40, .12);
}

.qd-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}

/* ── breadcrumb ─────────────────────────────────────────────────────── */
.qd-crumb { margin: 0 0 18px; }

.qd-crumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #98a1b3;
}

.qd-crumb a {
    color: #6b7488;
    transition: color .2s;
}

.qd-crumb a:hover { color: #4f46e5; }

.qd-crumb__sep { color: #c9cfdb; }

/* The title is the one thing here that can be arbitrarily long, so the trail
   truncates rather than wrapping to three lines. */
.qd-crumb__now {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #a6aebe;
    font-weight: 550;
}

/* ── article card ───────────────────────────────────────────────────── */
.qd-post {
    min-width: 0;
    padding: 32px 34px 28px;
}

.qd-kind {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 16px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(100deg, #7c3aed, #a22dea);
}

.qd-title {
    font-size: clamp(25px, 2.9vw, 34px);
    line-height: 1.26;
    letter-spacing: -.025em;
    font-weight: 800;
    color: #16192c;
    margin: 0 0 16px;
    text-wrap: balance;
}

/* ── meta row ───────────────────────────────────────────────────────── */
.qd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef0f6;
    font-size: 12.5px;
    color: #8a93a6;
}

.qd-meta__by,
.qd-meta__i {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.qd-meta__by b {
    font-weight: 700;
    color: #3b4256;
}

.qd-meta__i svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: #a6aebe;
}

.qd-av {
    width: 24px;
    height: 24px;
    border-radius: 99px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    margin-right: 2px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(135deg, #a22dea, #5b5de2);
}

/* ── cover ──────────────────────────────────────────────────────────── */
.qd-cover {
    overflow: hidden;
    margin: 24px 0 0;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    background: #f1eefb;
}

.qd-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── short answer callout ───────────────────────────────────────────── */
.qd-short {
    padding: 18px 22px;
    margin: 26px 0 0;
    border-radius: 10px;
    border-left: 3px solid #7c3aed;
    background: #f7f5ff;
}

.qd-short__lbl {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #6d28d9;
    margin: 0 0 7px;
}

.qd-short__body {
    font-size: 15px;
    line-height: 1.75;
    color: #3b4256;
}

/* ── article body (doubled class — see note 2 at the top) ──────────── */
.qd-prose {
    margin-top: 26px;
    font-size: 15.5px;
    color: #6b7488;
}

.qd-prose.qd-prose p {
    margin: 0 0 1.35em;
    line-height: 1.9;
    color: #6b7488;
}

/* The bundle's .prose gives every heading the same weight and a 2–2.5em top
   margin; these restore a real hierarchy and tighten the rhythm. */
.qd-prose.qd-prose h2 {
    font-size: 1.32em;
    line-height: 1.35;
    letter-spacing: -.02em;
    font-weight: 800;
    color: #16192c;
    margin: 1.9em 0 .7em;
}

.qd-prose.qd-prose h3 {
    font-size: 1.14em;
    line-height: 1.4;
    letter-spacing: -.015em;
    font-weight: 750;
    color: #16192c;
    margin: 1.6em 0 .55em;
}

.qd-prose.qd-prose h4 {
    font-size: 1.02em;
    font-weight: 700;
    color: #262c40;
    margin: 1.45em 0 .5em;
}

/* .prose h1 in the bundle is 2.25em with a rule under it — inside a page that
   already has an H1 on the card, a second one has to sit below the H2s. */
.qd-prose.qd-prose h1 {
    font-size: 1.5em;
    line-height: 1.3;
    letter-spacing: -.025em;
    font-weight: 800;
    color: #16192c;
    border-bottom: 0;
    padding-bottom: 0;
    margin: 1.9em 0 .7em;
}

.qd-prose.qd-prose a {
    color: #5b21b6;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, .35);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: color .2s, text-decoration-color .2s;
}

.qd-prose.qd-prose a:hover {
    color: #4f46e5;
    text-decoration-color: #4f46e5;
}

.qd-prose.qd-prose strong { color: #262c40; font-weight: 700; }

.qd-prose.qd-prose ul,
.qd-prose.qd-prose ol {
    margin: 0 0 1.35em;
    padding-left: 1.3em;
}

.qd-prose.qd-prose li {
    margin: .45em 0;
    line-height: 1.8;
    padding-left: .2em;
}

.qd-prose.qd-prose li::marker {
    color: #7c3aed;
    font-weight: 700;
}

/* Grey pull-quote plate with the mark set into its bottom-right corner, rather
   than the bundle's italic left-border treatment. */
.qd-prose.qd-prose blockquote {
    position: relative;
    overflow: hidden;
    margin: 1.9em 0;
    padding: 26px 60px 26px 30px;
    border: 0;
    border-radius: 10px;
    background: #f2f4f8;
    font-style: italic;
    font-weight: 650;
    color: #3b4256;
}

.qd-prose.qd-prose blockquote::after {
    content: "”";
    position: absolute;
    right: 14px;
    bottom: -34px;
    font-size: 120px;
    font-style: normal;
    line-height: 1;
    color: #dfe3ec;
    pointer-events: none;
}

.qd-prose.qd-prose blockquote p:last-child { margin-bottom: 0; }

.qd-prose.qd-prose img {
    border-radius: 10px;
    margin: 1.8em 0;
    box-shadow: none;
}

.qd-prose.qd-prose hr {
    margin: 2.4em 0;
    border: 0;
    height: 1px;
    background: #eef0f6;
}

.qd-prose.qd-prose code {
    color: #6d28d9;
    background: #f4f0ff;
    border: 1px solid rgba(124, 58, 237, .16);
    font-size: .87em;
}

.qd-prose.qd-prose pre { border-radius: 10px; }

.qd-prose.qd-prose pre code {
    background: transparent;
    border: 0;
    color: inherit;
}

/* CMS tables are authored at full width and a stored table can easily be wider
   than the card, so the table scrolls rather than the page. */
.qd-prose.qd-prose table {
    display: block;
    overflow-x: auto;
    width: 100%;
    margin: 1.8em 0;
    border-radius: 10px;
    border: 1px solid #eef0f6;
    font-size: .9em;
}

.qd-prose.qd-prose thead {
    background: #f7f8fc;
    border-bottom: 1px solid #eef0f6;
}

.qd-prose.qd-prose th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #4c1d95;
    white-space: nowrap;
}

.qd-prose.qd-prose td {
    padding: 12px 16px;
    color: #6b7488;
    border-bottom: 1px solid #f3f5fa;
}

.qd-prose.qd-prose tbody tr:last-child td { border-bottom: 0; }

/* ── sources + reviewer ─────────────────────────────────────────────── */
.qd-block {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid #eef0f6;
}

.qd-block__h {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #16192c;
    margin: 0 0 14px;
}

.qd-sources {
    margin: 0;
    padding-left: 1.2em;
    display: grid;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.7;
    color: #6b7488;
}

.qd-sources li {
    word-break: break-word;
}

.qd-sources li::marker {
    color: #a6aebe;
    font-weight: 700;
}

.qd-review {
    margin: 22px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: #8a93a6;
}

.qd-review b { font-weight: 700; color: #3b4256; }

/* ── card footer ────────────────────────────────────────────────────── */
.qd-foot {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid #eef0f6;
}

.qd-back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #4f46e5;
    background: #f5f3ff;
    transition: color .2s, background .2s;
}

.qd-back:hover {
    color: #fff;
    background: linear-gradient(100deg, #7c3aed, #a22dea);
}

.qd-back svg {
    width: 15px;
    height: 15px;
    transition: transform .25s;
}

.qd-back:hover svg { transform: translateX(-3px); }

/* ── sidebar ────────────────────────────────────────────────────────── */
.qd-side {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 22px;
    min-width: 0;
}

.qd-widget { padding: 22px 22px 18px; }

.qd-widget__h {
    position: relative;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.015em;
    color: #16192c;
    margin: 0 0 18px;
    padding-bottom: 14px;
}

/* Hairline across the card with the brand ramp burning through its first
   40px — a full-width gradient rule would read as decoration, this reads as
   the heading's own underline. */
.qd-widget__h::before,
.qd-widget__h::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    border-radius: 99px;
}

.qd-widget__h::before {
    right: 0;
    height: 1px;
    background: #eef0f6;
}

.qd-widget__h::after {
    width: 38px;
    background: linear-gradient(90deg, #a22dea, #5b5de2);
}

/* ── rail: lead card ────────────────────────────────────────────────── */
.qd-lead {
    display: block;
    margin-bottom: 4px;
}

.qd-lead__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #f1eefb;
}

.qd-lead__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

.qd-lead:hover .qd-lead__media img { transform: scale(1.05); }

/* Sits on the image, so it carries its own backdrop — a flat tint would vanish
   on a light photograph. */
.qd-lead__pill {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(17, 12, 46, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .18);
}

.qd-lead__txt {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 13px 0 15px;
}

.qd-lead__txt b {
    font-size: 14.5px;
    font-weight: 780;
    line-height: 1.4;
    letter-spacing: -.015em;
    color: #16192c;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qd-lead:hover .qd-lead__txt b { color: #4f46e5; }

/* ── rail: compact rows ─────────────────────────────────────────────── */
.qd-rel {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #f1f3f8;
}

.qd-rel li + li { border-top: 1px solid #f1f3f8; }

/* Negative gutter so the hover tint bleeds to the card's padding edge while the
   dividers still stop short of it. */
.qd-rel a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 10px;
    margin: 0 -10px;
    border-radius: 10px;
    transition: background .2s;
}

.qd-rel a:hover { background: #f7f6fd; }

.qd-rel__thumb {
    position: relative;
    overflow: hidden;
    width: 68px;
    height: 60px;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #f1eefb;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06);
}

.qd-rel__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}

.qd-rel a:hover .qd-rel__thumb img { transform: scale(1.07); }

.qd-rel__txt {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.qd-rel__txt b {
    font-size: 13px;
    font-weight: 750;
    line-height: 1.42;
    color: #16192c;
    transition: color .2s;
    /* Rail titles are full post titles — two lines is the ceiling before five of
       them stop fitting beside the article. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qd-rel a:hover .qd-rel__txt b { color: #4f46e5; }

.qd-rel__date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #a6aebe;
}

.qd-rel__date svg {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

/* Stands in for a missing image, so an imageless row still reads as an entry
   rather than an empty plate. */
.qd-ph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .03em;
    color: rgba(255, 255, 255, .95);
    background: linear-gradient(135deg, #7b5ee5, #a22dea 52%, #5b5de2);
}

.qd-ph--lg { font-size: 40px; }

/* ── rail: footer link ──────────────────────────────────────────────── */
.qd-widget__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 16px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 700;
    color: #4f46e5;
    background: #f5f3ff;
    transition: color .2s, background .2s;
}

.qd-widget__more:hover {
    color: #fff;
    background: linear-gradient(100deg, #7c3aed, #a22dea);
}

.qd-widget__more svg {
    width: 15px;
    height: 15px;
    transition: transform .25s;
}

.qd-widget__more:hover svg { transform: translateX(3px); }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1120px) {
    .qd-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
}

@media (max-width: 980px) {
    /* Below this the rail is too narrow to hold a post title, so it drops under
       the article and stops being sticky. */
    .qd-grid { grid-template-columns: minmax(0, 1fr); }

    .qd-side { position: static; }
}

@media (max-width: 640px) {
    .qd-page { padding: 20px 0 44px; }

    .qd-crumb__now { display: none; }
    /* Its separator is the 4th item and has to go with it. */
    .qd-crumb ol li:nth-child(4) { display: none; }

    .qd-post { padding: 24px 20px 22px; }
    .qd-meta { gap: 8px 16px; }

    .qd-prose { font-size: 15px; }
    .qd-prose.qd-prose blockquote { padding: 22px 44px 22px 22px; }
    .qd-prose.qd-prose blockquote::after { font-size: 92px; bottom: -26px; }

    .qd-widget { padding: 20px 18px 16px; }
    .qd-back { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .qd-back svg,
    .qd-rel__thumb img,
    .qd-lead__media img,
    .qd-widget__more svg {
        transition: none;
    }

    .qd-back:hover svg,
    .qd-rel a:hover .qd-rel__thumb img,
    .qd-lead:hover .qd-lead__media img,
    .qd-widget__more:hover svg {
        transform: none;
    }
}
