/* ==========================================================================
   Article page styles — shared by every file under /articles/
   Requires assets/reader.css for variables, reset and the sidebar shell
   ========================================================================== */

body {
    line-height: 1.9;
    color: var(--text-dim);
}

/* ---------- article shell ---------- */
article {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2.4rem 2.6rem;
    background: var(--panel);
    color: #2b333c;
    border: 1px solid #e3e7ee;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(27, 36, 48, 0.06);
}
article > h1 {
    font-size: 1.65rem;
    line-height: 1.45;
    color: #0b0f14;
    margin-bottom: 0.8rem;
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    font-size: 0.82rem;
    color: #7a838f;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #b9c0ca; }
.breadcrumb .current { color: #7a838f; }
h2 {
    color: #0b0f14;
    margin: 2rem 0 1rem;
    font-size: 1.4rem;
    border-left: 3px solid #c8860b;
    padding-left: 0.75rem;
}
h3 {
    color: #1f2731;
    margin: 1.5rem 0 0.8rem;
    font-size: 1.2rem;
}
p {
    margin-bottom: 1.2rem;
    text-align: justify;
}
ul, ol {
    margin: 1rem 0;
    padding-left: 2rem;
}
li {
    margin-bottom: 0.5rem;
}

/* ---------- callouts ---------- */
.highlight {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}
.quote {
    background: #f8f9fa;
    border-left: 4px solid #9b59b6;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}
.quote-author {
    text-align: right;
    font-weight: bold;
    margin-top: 0.5rem;
    color: #666;
}
.example {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}
.example-title {
    font-weight: bold;
    color: #856404;
    margin-bottom: 0.5rem;
}
.key-point {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}
.key-point-title {
    font-weight: bold;
    color: #155724;
    margin-bottom: 0.5rem;
}
.warning {
    background: #f8d7da;
    border: 1px solid #dc3545;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}
.warning-title {
    font-weight: bold;
    color: #721c24;
    margin-bottom: 0.5rem;
}

/* ---------- book / calculation blocks ---------- */
.book {
    background: #e7f3ff;
    border: 1px solid #0066cc;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
}
.book-title {
    font-weight: bold;
    color: #004085;
    margin-bottom: 0.3rem;
}
.book-author {
    font-size: 0.9rem;
    color: #666;
}
.book-desc {
    font-size: 0.95rem;
    color: #555;
}
.book-focus {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #004085;
    background: #d6eaff;
    border-radius: 4px;
    padding: 0.1rem 0.6rem;
}
.book-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}
.book-row .book {
    margin: 0;
    display: flex;
    flex-direction: column;
}
.book-row .book .book-desc {
    flex: 1;
}
.book-why {
    margin-top: 0.7rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #9ec9f0;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.14em;
    color: #0066cc;
}
.calc {
    background: #e7f3ff;
    border: 1px solid #0066cc;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}
.calc-title {
    font-weight: bold;
    color: #004085;
    margin-bottom: 0.5rem;
}

/* ---------- code blocks ---------- */
.code-block {
    margin: 1.5rem 0;
    border: 1px solid #d7dde6;
    border-radius: 6px;
    overflow: hidden;
    background: #0f1720;
}
.code-block-title {
    padding: 0.55rem 1.2rem;
    background: #1b2633;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
    border-bottom: 1px solid #2b3a4a;
}
.code-block pre {
    margin: 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    color: #e6edf3;
    font-size: 0.84rem;
    line-height: 1.7;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    tab-size: 4;
}
.code-block code {
    font-family: inherit;
}
p code, li code, td code {
    background: #f1f3f6;
    border: 1px solid #e1e6ed;
    border-radius: 4px;
    padding: 0.05em 0.35em;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

/* ---------- data tables ---------- */
.table-wrap {
    margin: 1.5rem 0;
    overflow-x: auto;
}
.table-wrap table { margin: 0; min-width: 560px; }
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    line-height: 1.65;
}
th, td {
    border: 1px solid var(--line);
    padding: 0.55rem 0.7rem;
    text-align: left;
    vertical-align: top;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
    min-width: 4.2em;
}
th {
    background: var(--panel-2);
    color: #1f2731;
    font-weight: 700;
}
tbody tr:nth-child(even) { background: #fafbfd; }

/* ---------- inline links & next steps ---------- */
.text-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed rgba(179, 116, 10, 0.45);
}
.text-link:hover { border-bottom-style: solid; }
.next-steps {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: var(--panel-2);
    border: 1px dashed var(--line);
    border-radius: 6px;
}
.next-steps-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.45rem;
}
.next-steps p { margin-bottom: 0.45rem; }
.next-steps p:last-child { margin-bottom: 0; }
.next-steps a {
    color: var(--accent);
    text-decoration: none;
}
.next-steps a:hover { text-decoration: underline; }

/* ---------- share prompt ---------- */
.share-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 1.2rem 0 0;
    padding: 0.85rem 1.1rem;
    background: #fdf6ea;
    border: 1px solid #efd9b4;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #6b5330;
    text-align: left;
}
.share-prompt p {
    flex: 1 1 14rem;
    margin: 0;
    text-align: left;
}
.share-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.86rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.share-cta-btn:hover {
    background: #8a5a05;
    border-color: #8a5a05;
}
.share-cta-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
@media (max-width: 640px) {
    .share-prompt {
        align-items: flex-start;
    }
    .share-cta-btn {
        width: 100%;
    }
}

/* ---------- back link ---------- */
.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
}
.back-link:hover {
    color: #8a5a05;
    text-decoration: underline;
}
@media (max-width: 640px) {
    article {
        margin: 1rem;
        padding: 1.5rem 1.1rem;
    }
    article > h1 {
        font-size: 1.35rem;
    }
}
