/* ─────────────────────────────────────────────────────────────
   Brusite Guides — hub, category archives and article pages.

   Colours come from the style.css custom properties (--brand,
   --gray-*) rather than literals: those variables are redefined
   under [data-bs-theme="dark"], so the whole library follows the
   theme toggle without a second rule set here.
   ───────────────────────────────────────────────────────────── */

.guide-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: var(--radius-full, 9999px);
    background: rgba(var(--brand-rgb), .12);
    color: var(--brand-dark, #b8860b);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.6;
}
[data-bs-theme="dark"] .guide-badge {
    background: rgba(var(--brand-rgb), .18);
    color: var(--brand, #d4a017);
}

/* ---------- Cards (hub, archive, related reading) ---------- */

.guide-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: border-color var(--duration, .22s) var(--ease, ease),
                box-shadow var(--duration, .22s) var(--ease, ease),
                transform var(--duration, .22s) var(--ease, ease);
}
.guide-card:hover {
    border-color: rgba(var(--brand-rgb), .45);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
    .guide-card, .guide-card:hover { transition: none; transform: none; }
}

.guide-card-link {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    height: 100%;
    padding: 1.1rem 1.15rem;
    color: inherit;
    text-decoration: none;
}
.guide-card-link:focus-visible {
    outline: 2px solid var(--brand, #d4a017);
    outline-offset: 2px;
    border-radius: var(--radius);
}

.guide-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--gray-900);
    text-wrap: balance;
}
.guide-card-link:hover .guide-card-title { color: var(--brand-dark, #b8860b); }
[data-bs-theme="dark"] .guide-card-link:hover .guide-card-title { color: var(--brand, #d4a017); }

.guide-card-desc {
    margin: 0;
    font-size: .875rem;
    line-height: 1.55;
    color: var(--gray-600);
    flex-grow: 1;
}

.guide-card-meta {
    font-size: .78rem;
    color: var(--gray-500);
}

/* ---------- Article header ---------- */

.guide-title {
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
    text-wrap: balance;
}

.guide-byline {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.25rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: .82rem;
    color: var(--gray-500);
}
.guide-byline-item { white-space: nowrap; }

/* Draft front matter (Category / Target Audience) kept as a details strip
   rather than as body prose. */
.guide-details {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    padding: .75rem 1rem;
    margin-bottom: 1.75rem;
    background: var(--gray-50);
    border-left: 3px solid rgba(var(--brand-rgb), .55);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: .85rem;
    color: var(--gray-700);
}
.guide-details-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

/* ---------- Article body ---------- */

.guide-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--gray-800);
    overflow-wrap: break-word;
}
.guide-body > *:first-child { margin-top: 0; }
.guide-body > *:last-child { margin-bottom: 0; }

.guide-body p { margin: 0 0 1.15rem; }

.guide-body h2 {
    margin: 2.5rem 0 .85rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--gray-900);
    text-wrap: balance;
}
.guide-body h3 {
    margin: 1.85rem 0 .65rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--gray-900);
}
.guide-body strong { font-weight: 700; color: var(--gray-900); }
.guide-body em { font-style: italic; }

.guide-body a {
    color: var(--brand-dark, #b8860b);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.guide-body a:hover { color: var(--brand, #d4a017); }
[data-bs-theme="dark"] .guide-body a { color: var(--brand, #d4a017); }
[data-bs-theme="dark"] .guide-body a:hover { color: #e8b82f; }

.guide-list {
    margin: 0 0 1.25rem;
    padding-left: 1.35rem;
}
.guide-list li { margin-bottom: .5rem; }
.guide-list li:last-child { margin-bottom: 0; }
.guide-list ul, .guide-list ol { margin: .5rem 0 0; }

/* Tables: real markup, scrollable on narrow screens rather than squashed or
   reflowed into monospace text. */
.guide-table-wrap {
    margin: 0 0 1.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
}
.guide-table {
    margin-bottom: 0;
    font-size: .925rem;
    color: var(--gray-800);
    background: #fff;
}
.guide-table > :not(caption) > * > * {
    padding: .7rem .85rem;
    border-color: var(--gray-200);
    vertical-align: top;
}
.guide-table thead th {
    background: var(--gray-100);
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
}
.guide-table tbody tr:nth-child(even) > * { background: var(--gray-50); }
[data-bs-theme="dark"] .guide-table { background: var(--gray-50); }
[data-bs-theme="dark"] .guide-table thead th { background: var(--gray-200); }

/* The one flow diagram in the set: a data strip, not a code block. */
.guide-flow {
    margin: 0 0 1.5rem;
    padding: 1rem 1.15rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}
.guide-flow-line {
    font-size: .875rem;
    line-height: 1.9;
    color: var(--gray-700);
    white-space: nowrap;
}

/* ---------- Author box, hub note ---------- */

.guide-author-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 3rem;
    padding: 1.15rem 1.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.guide-author-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-full, 9999px);
    background: rgba(var(--brand-rgb), .14);
    color: var(--brand-dark, #b8860b);
    font-size: 1.05rem;
}
[data-bs-theme="dark"] .guide-author-icon { color: var(--brand, #d4a017); }

.guide-note {
    padding: 1.25rem 1.35rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--gray-700);
}

@media (max-width: 575.98px) {
    .guide-body { font-size: 1rem; }
    .guide-table { font-size: .85rem; }
}

/* The category badge is a link back to its archive (§4.2). */
a.guide-badge:hover,
a.guide-badge:focus-visible {
    background: rgba(var(--brand-rgb), .22);
    text-decoration: none;
}
a.guide-badge:focus-visible {
    outline: 2px solid var(--brand, #d4a017);
    outline-offset: 2px;
}
