/* ============================================================
   now-page.css
   ------------
   Shared styles for "The Now" article pages.

   Every Now article uses the same layout pattern:
     - intro with key-facts-grid
     - optional data-note framing paragraph
     - body sections
     - path-list blocks (paths from here / where serious analysts
       disagree / what this means for you)
     - mechanics-behind-this related tiles

   Historically each page included these rules in its own inline
   <style> block. They were bit-identical across pages, so they
   are extracted here. Anything page-specific (per-page comparison
   table widths, loading shimmers, etc.) remains inline on that
   specific page.
   ============================================================ */

/* Key facts grid (top of each Now article) ------------------ */
.key-facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.key-fact {
    text-align: center;
    padding: 28px 20px;
    background: var(--card-bg, #fff);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .key-fact {
    background: #141418;
    border-color: rgba(255, 255, 255, 0.06);
}

.key-fact-number {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffa726 0%, #ff6b35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 8px;
}

.key-fact-label {
    color: #86868b;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Framing-note callout (the "A note on framing" paragraph) -- */
.data-note {
    font-size: 0.95rem;
    color: #86868b;
    line-height: 1.65;
    max-width: 720px;
    margin: 24px auto 0;
    padding: 16px 20px;
    border-left: 3px solid rgba(255, 143, 31, 0.4);
    background: rgba(255, 143, 31, 0.04);
    border-radius: 4px;
}

[data-theme="dark"] .data-note {
    color: #a1a1a6;
    border-left-color: rgba(255, 143, 31, 0.5);
    background: rgba(255, 143, 31, 0.05);
}

.data-note strong {
    color: var(--apple-text, #1d1d1f);
}

[data-theme="dark"] .data-note strong {
    color: #f0f0f0;
}

/* Path-list (numbered scenario / disagreement / advice cards) */
.path-list {
    margin-top: 20px;
}

.path-card {
    display: flex;
    gap: 20px;
    padding: 24px 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .path-card {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.path-card:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .path-card:last-child {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* When a path-list is the very last block before the SequentialNav
   "NEXT" tile, its closing border would stack with the divider that
   NEXT adds on top of itself - creating two parallel horizontal lines
   a few px apart. Suppress the path-card border on lists marked
   .path-list-end so only the NEXT divider remains. */
.path-list-end .path-card:last-child {
    border-bottom: none;
}

.path-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffa726 0%, #ff6b35 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.path-content p {
    /* Match .story-text fluid sizing so path paragraphs read the same
       as the rest of the article. */
    font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.25rem);
    line-height: 1.8;
    margin: 10px 0;
    color: var(--apple-text, #1d1d1f);
}

.path-content p:first-of-type {
    margin-top: 8px;
}

.path-content .mud-typography {
    /* Path titles bumped to h5-ish size so they're clearly subsection-level. */
    font-size: 1.25rem !important;
    margin-bottom: 4px;
}

[data-theme="dark"] .path-content p {
    color: #e8e8ea;
}

/* Mobile breakpoint: stack path-card vertically ------------- */
@media (max-width: 640px) {
    .path-card {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================================
   RelatedConcepts component
   ------------------------
   Section-break chip-row used inside long-form articles to
   surface related deep-reads.

   Visual language:
     - filled, calm-orange chips with white text. Reads as a
       deliberate, finished UI element instead of an outlined
       component default.
     - subtle vertical gradient + inset highlight + soft warm-
       tinted shadow give the polished depth of a real Apple
       button rather than a flat coloured rectangle.
     - the prefix (arrow + "RELATED") sits a step quieter than
       the chips, so attention flows into the clickable targets.
   ============================================================ */
.related-concepts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 36px 0;
    padding: 0;
    font-family: inherit;
}

.related-concepts-arrow {
    color: rgba(184, 122, 30, 0.55);
    font-size: 15px;
    font-weight: 400;
    margin-right: 2px;
    line-height: 1;
}

[data-theme="dark"] .related-concepts-arrow {
    color: rgba(245, 185, 106, 0.55);
}

.related-concepts-label {
    color: rgba(184, 122, 30, 0.85);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-right: 6px;
}

[data-theme="dark"] .related-concepts-label {
    color: rgba(245, 185, 106, 0.8);
}

.related-concept {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: linear-gradient(180deg, #c47a35 0%, #a86214 100%);
    border: none;
    border-radius: 99px;
    color: #fff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    line-height: 1.3;
    box-shadow:
        0 2px 6px rgba(168, 98, 20, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.related-concept:hover {
    background: linear-gradient(180deg, #d48a3f 0%, #b87018 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        0 6px 14px rgba(168, 98, 20, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    text-decoration: none;
}

.related-concept:active {
    transform: translateY(0);
    box-shadow:
        0 1px 4px rgba(168, 98, 20, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Dark mode: same chip colour (the calm orange has its own
   brightness, independent of page bg). Drop-shadow drops the
   warm tint - black-on-dark reads better than warm-on-dark. */
[data-theme="dark"] .related-concept {
    background: linear-gradient(180deg, #c47a35 0%, #a86214 100%);
    color: #fff;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .related-concept:hover {
    background: linear-gradient(180deg, #d48a3f 0%, #b87018 100%);
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@media (max-width: 600px) {
    .related-concepts {
        gap: 8px;
        margin: 28px 0;
    }
    .related-concept {
        font-size: 0.82rem;
        padding: 6px 13px;
    }
}

/* ============================================================
   ArticleToc component
   --------------------
   Sticky right-rail table of contents for long-form articles.
   Built at runtime from the article's H4 headings. Designed to
   be quietly present, not demanding - reader can use it to jump
   between sections, or ignore it entirely.

   Hidden below 1280px viewport (where there is not enough side
   space for it without crowding the article body).
   ============================================================ */
.article-toc {
    position: fixed;
    top: 100px;
    right: 24px;
    width: 220px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    z-index: 50;
    pointer-events: auto;
    font-family: inherit;

    /* Subtle fade-in once JS has populated it */
    animation: articleTocIn 0.45s ease 0.2s both;
}

@keyframes articleTocIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Hide on narrower viewports - article needs the full width */
@media (max-width: 1280px) {
    .article-toc {
        display: none;
    }
}

.article-toc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(184, 122, 30, 0.85);
    margin-bottom: 12px;
    padding-left: 14px;
}

[data-theme="dark"] .article-toc-label {
    color: rgba(245, 185, 106, 0.8);
}

.article-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .article-toc-list {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.article-toc-list li {
    margin: 0;
}

.article-toc-link {
    display: block;
    padding: 7px 14px;
    color: rgba(29, 29, 31, 0.5);
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition:
        color 0.18s ease,
        border-color 0.18s ease;
}

[data-theme="dark"] .article-toc-link {
    color: rgba(255, 255, 255, 0.5);
}

.article-toc-link:hover {
    color: var(--apple-text, #1d1d1f);
    text-decoration: none;
}

[data-theme="dark"] .article-toc-link:hover {
    color: rgba(255, 255, 255, 0.94);
}

.article-toc-link.is-active {
    color: #b87a1e;
    border-left-color: #b87a1e;
    font-weight: 600;
}

[data-theme="dark"] .article-toc-link.is-active {
    color: #f5b96a;
    border-left-color: #f5b96a;
}

/* Scrollbar styling for the ToC if it overflows */
.article-toc::-webkit-scrollbar {
    width: 4px;
}
.article-toc::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 2px;
}
[data-theme="dark"] .article-toc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
}
