/* ============================================================
   STOCKUP REPORTS: editorial template (shared by /reports pages)
   Based on the StockUp blog article template.
   Serif (Newsreader) for reading, Sans (Hanken Grotesk) for UI
============================================================ */
:root {
    --page-width: 1100px;

    --bg: #FAF8F4;
    --surface: #FFFFFF;
    --surface-2: #F3F0E8;
    --border: #E7E2D5;
    --border-strong: #D6CFBC;

    --text: #1C1B18;
    --body-text: #2E2C28;
    --text-secondary: #55524A;
    --text-tertiary: #767265;

    --accent: #8A6A22;
    --accent-soft: rgba(138, 106, 34, 0.09);
    --link: #1d4ed8;
    --cta: #2563eb;
    --cta-hover: #1d4ed8;
    --positive: #1f6b3a;
    --neutral: #55524A;

    --shadow: 0 1px 2px rgba(28, 27, 24, 0.04), 0 6px 20px rgba(28, 27, 24, 0.05);

    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    padding-bottom: 60px;
    overflow-wrap: break-word;
}
a { color: inherit; }
img { max-width: 100%; }

/* --- READING PROGRESS --- */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: var(--accent); z-index: 100; transition: width 0.1s linear;
}

/* --- NAVIGATION --- */
.nav-container { max-width: var(--page-width); margin: 0 auto; padding: 0 48px; }
.navbar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 22px 0; border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.logo { display: inline-flex; text-decoration: none; flex-shrink: 0; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.text-link {
    color: var(--text-secondary); text-decoration: none; font-weight: 600;
    font-size: 0.95rem; transition: color 0.2s;
}
.text-link:hover { color: var(--text); }
.return-btn {
    display: inline-block;
    background-color: var(--cta); color: #fff; text-decoration: none;
    padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 0.9rem;
    transition: background 0.2s;
}
.return-btn:hover { background-color: var(--cta-hover); }
.secondary-btn {
    display: inline-block;
    background: var(--surface); color: var(--text); text-decoration: none;
    padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 0.9rem;
    border: 1px solid var(--border-strong); transition: border-color 0.2s;
}
.secondary-btn:hover { border-color: var(--text-tertiary); }

/* --- BREADCRUMB --- */
.crumbs { font-size: 0.85rem; color: var(--text-tertiary); margin-bottom: 28px; text-align: center; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong); }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }

/* --- ARTICLE HEADER --- */
.article-container { max-width: var(--page-width); margin: 0 auto; padding: 0 48px; }
.category-tag {
    color: var(--accent); font-size: 0.8rem; text-transform: uppercase; font-weight: 700;
    letter-spacing: 0.08em; display: block; margin-bottom: 18px; text-align: center;
}
.article-title {
    font-family: var(--serif); font-weight: 600; font-size: 3rem;
    line-height: 1.18; text-align: center; letter-spacing: -0.01em;
    margin: 0 auto 24px; color: var(--text); max-width: 900px; text-wrap: balance;
}
.article-dek {
    font-family: var(--serif); font-size: 1.3rem; line-height: 1.55; color: var(--text-secondary);
    text-align: center; max-width: 760px; margin: 0 auto 28px;
}
.article-meta {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-bottom: 44px; color: var(--text-tertiary); font-size: 0.9rem;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; border: 1px solid var(--border-strong); flex-shrink: 0;
}
.meta-text strong { color: var(--text); display: block; font-weight: 600; font-size: 0.92rem; }
.meta-text span { color: var(--text-tertiary); }

/* --- QUICK SUMMARY --- */
.quick-summary {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 32px 36px; margin-bottom: 48px; box-shadow: var(--shadow);
}
.quick-summary-heading {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--accent); margin-bottom: 16px;
}
.quick-summary ul { list-style: none; }
.quick-summary li {
    position: relative; padding-left: 26px; margin-bottom: 12px;
    font-size: 1rem; line-height: 1.55; color: var(--text-secondary);
}
.quick-summary li:last-child { margin-bottom: 0; }
.quick-summary li::before {
    content: ""; position: absolute; left: 0; top: 0.5em;
    width: 8px; height: 8px; border-radius: 2px; background: var(--accent); opacity: 0.85;
}
.quick-summary li strong { color: var(--text); font-weight: 600; }

/* --- ARTICLE CONTENT --- */
.content { font-family: var(--serif); font-size: 1.22rem; line-height: 1.8; color: var(--body-text); }
.content h2 {
    font-family: var(--serif); font-weight: 600; color: var(--text);
    font-size: 1.8rem; line-height: 1.3; margin: 52px 0 18px; letter-spacing: -0.01em;
}
.content h3 { font-family: var(--serif); font-weight: 600; color: var(--text); font-size: 1.35rem; margin: 32px 0 12px; }
.content p { margin-bottom: 24px; }
.content strong { color: var(--text); font-weight: 600; }
.content ul, .content ol { margin: 0 0 26px; padding-left: 24px; }
.content li { margin-bottom: 10px; }
.content a { color: var(--link); text-underline-offset: 3px; }
.content a.return-btn { color: #fff; text-decoration: none; }

.content .callout {
    font-family: var(--sans); background: var(--surface-2);
    border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
    border-radius: 8px; padding: 18px 22px; margin: 8px 0 28px;
    font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary);
}
.content .callout p { margin-bottom: 8px; }
.content .callout p:last-child { margin-bottom: 0; }
.content .callout strong { color: var(--text); }

/* --- TABLES (always inside .table-wrap for small screens) --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.95rem; line-height: 1.45; }
.data-table caption { caption-side: top; text-align: left; padding: 12px 16px 4px; font-weight: 700; color: var(--text); font-size: 0.9rem; }
.data-table th, .data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: none; }
.data-table thead th { background: var(--surface-2); font-weight: 700; color: var(--text); white-space: nowrap; }
.data-table tbody th { font-weight: 600; color: var(--text); }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-note { font-family: var(--sans); font-size: 0.82rem; color: var(--text-tertiary); margin: 0 0 28px; }
.content .table-note { margin-bottom: 28px; }

/* --- SNAPSHOT (report facts) --- */
.snapshot { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 48px; }
.snapshot div { padding: 16px 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.snapshot div:nth-child(4n) { border-right: none; }
.snapshot div:nth-last-child(-n+4) { border-bottom: none; }
.snapshot dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 4px; }
.snapshot dd { font-size: 0.98rem; font-weight: 600; color: var(--text); }
.view-label { display: inline-block; font-weight: 700; }
.view-positive { color: var(--positive); }
.view-neutral { color: var(--neutral); }

/* --- SOURCES LIST --- */
.content ol.sources { font-family: var(--sans); font-size: 0.92rem; line-height: 1.55; color: var(--text-secondary); padding-left: 22px; }
.content ol.sources li { margin-bottom: 10px; }
.content ol.sources a { word-break: break-all; }

/* --- REPORT PAGE IMAGES --- */
.page-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 8px 0 20px; }
.page-grid figure { margin: 0; }
.page-grid a { display: block; }
.page-grid img { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.page-grid figcaption { font-family: var(--sans); font-size: 0.82rem; color: var(--text-tertiary); margin-top: 8px; line-height: 1.45; }
.download-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 32px; font-family: var(--sans); }
.download-row .file-note { font-size: 0.88rem; color: var(--text-tertiary); }

/* --- GALLERY CARDS (index) --- */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-bottom: 56px; list-style: none; }
.report-card {
    display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 22px; box-shadow: var(--shadow); height: 100%;
}
.report-card img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; display: block; }
.report-card .card-type { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.report-card h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.25; margin-bottom: 8px; }
.report-card h3 a { text-decoration: none; }
.report-card h3 a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.report-card .card-headline { font-family: var(--serif); font-size: 1.02rem; color: var(--body-text); margin-bottom: 10px; line-height: 1.45; }
.report-card .card-meta { font-size: 0.85rem; color: var(--text-tertiary); margin-bottom: 14px; }
.report-card .card-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.9rem; font-weight: 600; }
.report-card .card-links a { color: var(--link); text-underline-offset: 3px; }

/* --- RELATED READING --- */
.related-reading {
    margin: 56px 0 8px; padding: 30px 36px; border: 1px solid var(--border);
    border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.related-reading h2 {
    margin: 0 0 16px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
    font-weight: 700; color: var(--text-tertiary);
}
.related-reading ul { margin: 0; padding: 0; list-style: none; }
.related-reading li + li { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.related-reading a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 1rem; transition: color 0.2s; }
.related-reading a:hover { color: var(--link); }
.related-reading span { display: block; color: var(--text-tertiary); font-size: 0.88rem; font-weight: 400; margin-top: 4px; }

/* --- FOOTER CTA --- */
.footer-cta {
    text-align: center; padding: 56px 24px; background: var(--surface); border-radius: 12px;
    border: 1px solid var(--border); margin-top: 64px; box-shadow: var(--shadow);
}
.footer-cta h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; margin-bottom: 10px; color: var(--text); }
.footer-cta p { color: var(--text-secondary); margin: 0 auto 22px; font-size: 1.02rem; max-width: 640px; }
.cta-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; }
.cta-actions .secondary-link { color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* --- MOBILE / TABLET --- */
@media (max-width: 1200px) {
    .nav-container, .article-container { padding: 0 32px; }
}
@media (max-width: 900px) {
    .report-grid { grid-template-columns: 1fr; }
    .snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .snapshot div:nth-child(4n) { border-right: 1px solid var(--border); }
    .snapshot div:nth-child(2n) { border-right: none; }
    .snapshot div:nth-last-child(-n+4) { border-bottom: 1px solid var(--border); }
    .snapshot div:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 768px) {
    .nav-container, .article-container { padding: 0 16px; }
    .navbar { padding: 16px 0; margin-bottom: 28px; }
    .nav-links { gap: 14px; }
    .nav-links .text-link.hide-sm { display: none; }
    .return-btn, .secondary-btn { padding: 9px 14px; }
    .article-title { font-size: 2rem; }
    .article-dek { font-size: 1.12rem; }
    .content { font-size: 1.08rem; }
    .content h2 { font-size: 1.5rem; margin-top: 40px; }
    .quick-summary { padding: 22px; }
    .related-reading { padding: 22px; }
    .page-grid { grid-template-columns: 1fr; gap: 24px; }
    .page-grid figure { max-width: 520px; }
    .data-table { font-size: 0.86rem; }
    .data-table th, .data-table td { padding: 10px 10px; }
}
@media (max-width: 480px) {
    .report-card { grid-template-columns: 1fr; }
    .report-card img { max-width: 220px; }
    .navbar .logo img { height: 22px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .progress-bar { transition: none; }
}
@media print {
    .progress-bar, .navbar, .footer-cta, .related-reading { display: none; }
}
