/* ===========================================================================
   RoxTribe resources theme — FULL DARK, RoxTribe palette.
   Single source of truth for article visual styling so every engine-authored
   fragment stays consistent WITHOUT per-fragment color hardcoding. Fragments are
   authored as semantic HTML (h2/h3/p/ul/table/blockquote) plus the .rox-*
   component classes below. Everything is namespaced under .rox-prose / .rox-* so
   it can never leak into the dark global theme.

   Palette: gold #FFD700 · silver #C0C0C0 · black #000 · near-black #0a0a0a
   See specs/content-engine/references/color-conventions.md for the contract.
   =========================================================================== */

:root {
    --rox-gold: #FFD700;
    --rox-gold-dim: #d4af00;
    --rox-silver: #C0C0C0;
    --rox-bg: #0a0a0a;
    --rox-surface: #111111;
    --rox-border: #2a2a2a;
    --rox-text: #d1d5db;
    --rox-text-strong: #f3f4f6;
    --rox-text-muted: #9ca3af;
}

/* --------------------------------------------------------------------------- */
/* Prose: semantic-HTML article body                                           */
/* --------------------------------------------------------------------------- */
.rox-prose {
    color: var(--rox-text);
    font-size: 1.0625rem;
    line-height: 1.75;
    max-width: 46rem;
}

.rox-prose > * + * { margin-top: 1.25rem; }

.rox-prose h2 {
    color: var(--rox-gold);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 5rem;
}

.rox-prose h3 {
    color: var(--rox-gold);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 5rem;
}

.rox-prose h4 {
    color: var(--rox-text-strong);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.rox-prose p { color: var(--rox-text); }

.rox-prose a {
    color: var(--rox-gold);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
.rox-prose a:hover { color: #ffe650; }

.rox-prose strong { color: var(--rox-text-strong); font-weight: 600; }
.rox-prose em { color: var(--rox-text-strong); }

.rox-prose ul,
.rox-prose ol { padding-left: 1.5rem; }
.rox-prose ul { list-style: disc; }
.rox-prose ol { list-style: decimal; }
.rox-prose li { margin-top: 0.5rem; }
.rox-prose li::marker { color: var(--rox-gold-dim); }

.rox-prose blockquote {
    border-left: 3px solid var(--rox-gold);
    padding: 0.25rem 0 0.25rem 1.25rem;
    color: var(--rox-text-muted);
    font-style: italic;
}

.rox-prose code {
    background: #1a1a1a;
    color: var(--rox-silver);
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.9em;
    border: 1px solid var(--rox-border);
}

.rox-prose pre {
    background: #1a1a1a;
    border: 1px solid var(--rox-border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
}
.rox-prose pre code { background: none; border: none; padding: 0; }

.rox-prose hr { border: none; border-top: 1px solid var(--rox-border); margin: 2.5rem 0; }

.rox-prose img {
    max-width: 100%;
    height: auto;            /* override any hardcoded height attr so images keep their true aspect ratio (no squash) */
    display: block;
    margin: 1.5rem auto;
    border-radius: 0.5rem;
    border: 1px solid var(--rox-border);
}

/* Portrait / tall assets. Most article images are landscape and sit fine at full
   column width, but a tall portrait (e.g. a low-angle shot looking up at the
   wall-ball rig) runs thousands of pixels deep and dominates the page. Add this
   class to constrain it. Lives here rather than as a per-fragment inline style so
   the value stays tunable from one place. */
.rox-prose img.rox-img-narrow {
    max-width: 420px;
}

/* Tables — silver borders. Raw <table> in a fragment is themed automatically;
   add class="rox-table" for the emphasized header style. */
.rox-prose table,
.rox-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.rox-prose th,
.rox-prose td,
.rox-table th,
.rox-table td {
    border: 1px solid var(--rox-silver);
    padding: 0.625rem 0.875rem;
    text-align: left;
}
.rox-prose th,
.rox-table th {
    background: #1a1a1a;
    color: var(--rox-gold);
    font-weight: 600;
}
.rox-prose tbody tr:nth-child(even),
.rox-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

/* --------------------------------------------------------------------------- */
/* Component classes (usable inside fragments and the article chrome)          */
/* --------------------------------------------------------------------------- */

/* Callout / note box */
.rox-callout {
    border: 1px solid var(--rox-border);
    border-left: 4px solid var(--rox-gold);
    background: var(--rox-surface);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    color: var(--rox-text);
}
.rox-callout strong { color: var(--rox-gold); }

/* Key takeaways box */
.rox-key-takeaways {
    border: 1px solid var(--rox-gold-dim);
    background: rgba(255, 215, 0, 0.05);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}
.rox-key-takeaways > .rox-key-takeaways-title {
    color: var(--rox-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}
.rox-key-takeaways ul { list-style: none; padding-left: 0; }
.rox-key-takeaways li { padding-left: 1.5rem; position: relative; }
.rox-key-takeaways li::before {
    content: "→";
    color: var(--rox-gold);
    position: absolute;
    left: 0;
}

/* CTA block */
.rox-cta {
    border: 1px solid var(--rox-gold);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(192, 192, 192, 0.04));
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}
.rox-cta a {
    display: inline-block;
    margin-top: 0.75rem;
    background: var(--rox-gold);
    color: #000;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.15s ease;
}
.rox-cta a:hover { background: #ffe650; }

/* --------------------------------------------------------------------------- */
/* Article chrome (TOC, FAQ, reading progress)                                 */
/* --------------------------------------------------------------------------- */
.rox-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--rox-gold);
    z-index: 60;
    transition: width 0.1s linear;
}

.rox-toc-link {
    display: block;
    color: var(--rox-text-muted);
    font-size: 0.9375rem;
    line-height: 1.4;
    padding: 0.125rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.rox-toc-link:hover { color: var(--rox-gold); }
.rox-toc-link.active {
    color: var(--rox-gold);
    border-left-color: var(--rox-gold);
    font-weight: 500;
}

.rox-faq {
    border: 1px solid var(--rox-border);
    border-radius: 0.5rem;
    background: var(--rox-surface);
    overflow: hidden;
}
.rox-faq summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--rox-text-strong);
    list-style: none;
}
.rox-faq summary::-webkit-details-marker { display: none; }
.rox-faq summary::after { content: "+"; float: right; color: var(--rox-gold); font-weight: 700; }
.rox-faq[open] summary::after { content: "−"; }
.rox-faq[open] summary { color: var(--rox-gold); }
.rox-faq-answer { padding: 0 1.25rem 1rem; color: var(--rox-text); line-height: 1.7; }

/* Tailwind `not-prose` escape hatch — keep the FAQ list from inheriting prose rules. */
.rox-prose .not-prose > * + * { margin-top: 0; }
