/**
 * TrendsBeacon design system. Presentation only — every value here is a
 * styling decision, never a business rule (status colors are paired with
 * text/icons everywhere they're used, never color alone).
 */

:root {
	--tb-bg: #F5F6F3;
	--tb-surface: #FFFFFF;
	--tb-surface-2: #ECEEE9;
	--tb-text: #161A1D;
	--tb-text-secondary: #525C57;
	--tb-text-muted: #7B857F;
	--tb-border: #D6DAD2;
	--tb-accent: #B9791F;
	--tb-accent-strong: #9C6516;
	--tb-accent-tint: #F5E9D3;
	--tb-rising: #1F7A5C;
	--tb-rising-tint: #E6F3EE;
	--tb-falling: #B5473F;
	--tb-falling-tint: #FBEAE8;
	--tb-stable: #75807A;
	--tb-shadow: 0 1px 2px rgba(20,20,15,.05), 0 6px 18px -10px rgba(20,20,15,.15);
	--tb-radius: 12px;
	--tb-font-display: Iowan Old Style, "Palatino Linotype", Palatino, Georgia, serif;
	--tb-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--tb-max-width: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--tb-bg);
	color: var(--tb-text);
	font-family: var(--tb-font-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tb-accent-strong); }
h1, h2, h3, h4 { font-family: var(--tb-font-display); color: var(--tb-text); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.tb-skip-link:focus {
	position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
	background: var(--tb-text); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 1000;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--tb-accent-strong); outline-offset: 2px; border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.tb-container { max-width: var(--tb-max-width); margin: 0 auto; padding: 0 20px; }

/* ---------------- Header ---------------- */
.tb-site-header { background: var(--tb-surface); border-bottom: 1px solid var(--tb-border); position: sticky; top: 0; z-index: 100; }
.tb-header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 20px; }
.tb-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tb-text); flex: none; }
.tb-beacon-mark { color: var(--tb-accent-strong); display: inline-flex; }
.tb-brand-word { font-family: var(--tb-font-display); font-weight: 700; font-size: 19px; }
.tb-primary-nav { flex: 1; }
.tb-nav-list { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.tb-nav-list a { color: var(--tb-text-secondary); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.tb-nav-list a:hover { color: var(--tb-text); }
.tb-header-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.tb-header-search { display: flex; align-items: center; background: var(--tb-surface-2); border: 1px solid var(--tb-border); border-radius: 99px; padding: 4px 6px 4px 14px; }
.tb-header-search input { border: none; background: none; font-size: 13.5px; width: 160px; outline: none; color: var(--tb-text); }
.tb-header-search button { border: none; background: none; color: var(--tb-text-secondary); padding: 6px; cursor: pointer; display: flex; }
.tb-mobile-menu-toggle { display: none; border: 1px solid var(--tb-border); background: var(--tb-surface); border-radius: 8px; padding: 6px 10px; font-size: 18px; cursor: pointer; }
.tb-mobile-nav { border-top: 1px solid var(--tb-border); padding: 12px 20px; }
.tb-mobile-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tb-mobile-nav-list a { color: var(--tb-text); text-decoration: none; font-weight: 500; }

/* ---------------- Buttons ---------------- */
.tb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.tb-btn-primary { background: var(--tb-accent-strong); color: #fff; }
.tb-btn-primary:hover { background: var(--tb-accent); }
.tb-btn-ghost { background: transparent; color: var(--tb-text); border-color: var(--tb-border); }
.tb-btn-ghost:hover { background: var(--tb-surface-2); }
.tb-header-cta { white-space: nowrap; }

/* ---------------- Hero ---------------- */
.tb-hero { background: linear-gradient(180deg, var(--tb-surface), var(--tb-bg)); border-bottom: 1px solid var(--tb-border); padding: 56px 0 44px; }
.tb-hero-inner { text-align: center; max-width: 680px; }
.tb-hero h1 { font-size: clamp(30px, 4.4vw, 44px); text-wrap: balance; }
.tb-hero-sub { color: var(--tb-text-secondary); font-size: 17px; max-width: 52ch; margin: 14px auto 26px; }
.tb-hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------------- Sections ---------------- */
.tb-section { padding: 48px 0; border-top: 1px solid var(--tb-border); }
.tb-section:first-of-type { border-top: none; }
.tb-section h2 { font-size: 24px; display: flex; align-items: center; gap: 8px; }
.tb-section-sub { color: var(--tb-text-muted); font-size: 14.5px; margin-top: 4px; margin-bottom: 22px; max-width: 60ch; }
.tb-section-emphasis { background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 32px; box-shadow: var(--tb-shadow); }
.tb-link-more { display: inline-block; margin-top: 16px; font-weight: 600; text-decoration: none; }

/* ---------------- Trend grid & cards ---------------- */
.tb-trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tb-trend-grid-compact { grid-template-columns: repeat(4, 1fr); }
.tb-trend-card {
	position: relative; background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--tb-radius);
	padding: 20px; box-shadow: var(--tb-shadow); display: flex; flex-direction: column; gap: 8px;
}
.tb-rank { position: absolute; top: 16px; right: 18px; font-family: var(--tb-font-display); font-weight: 700; color: var(--tb-text-muted); font-size: 14px; }
.tb-trend-card-title { font-size: 19px; margin: 0; padding-right: 30px; }
.tb-trend-card-title a { color: var(--tb-text); text-decoration: none; }
.tb-trend-card-title a:hover { text-decoration: underline; }
.tb-trend-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tb-text-muted); }
.tb-meta-sep { opacity: .6; }
.tb-trend-card-qa { font-size: 13.5px; color: var(--tb-text-secondary); margin: 0; }
.tb-trend-card-qa strong { color: var(--tb-text); }
.tb-trend-card-cta { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--tb-accent-strong); text-decoration: none; }

/* ---------------- Badges / pills / chips ---------------- */
.tb-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--tb-border); background: var(--tb-surface-2); color: var(--tb-text-secondary); }
.tb-badge-exploding { background: var(--tb-falling-tint); border-color: transparent; color: var(--tb-accent-strong); }
.tb-badge-rising { background: var(--tb-rising-tint); border-color: transparent; color: var(--tb-rising); }
.tb-badge-stable { background: var(--tb-surface-2); color: var(--tb-stable); }
.tb-badge-falling { background: var(--tb-falling-tint); border-color: transparent; color: var(--tb-falling); }
.tb-pct { font-weight: 700; font-size: 12.5px; }
.tb-pct-up { color: var(--tb-rising); }
.tb-pct-down { color: var(--tb-falling); }

.tb-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip { display: inline-block; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--tb-border); background: var(--tb-surface); color: var(--tb-text-secondary); text-decoration: none; font-size: 13.5px; }
.tb-chip:hover { border-color: var(--tb-accent-strong); color: var(--tb-accent-strong); }
.tb-chip-small { padding: 3px 10px; font-size: 12px; }

.tb-demo-notice { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tb-accent-strong); background: var(--tb-accent-tint); border-radius: 8px; padding: 6px 10px; margin-top: 8px; }

/* ---------------- Trend list (Rising Fast rows) ---------------- */
.tb-trend-list { display: flex; flex-direction: column; border: 1px solid var(--tb-border); border-radius: var(--tb-radius); overflow: hidden; background: var(--tb-surface); }
.tb-trend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; text-decoration: none; color: var(--tb-text); border-bottom: 1px solid var(--tb-border); flex-wrap: wrap; }
.tb-trend-row:last-child { border-bottom: none; }
.tb-trend-row:hover { background: var(--tb-surface-2); }
.tb-trend-row-main { display: flex; align-items: center; gap: 10px; }
.tb-trend-row-title { font-weight: 600; }
.tb-trend-row-meta { font-size: 12.5px; color: var(--tb-text-muted); display: flex; gap: 6px; }

/* ---------------- Explanation blocks ---------------- */
.tb-explain-block { margin-bottom: 26px; }
.tb-explain-block h2 { font-size: 21px; }
.tb-explain-block h3 { font-size: 15px; color: var(--tb-text-secondary); text-transform: uppercase; letter-spacing: .03em; margin-top: 18px; }
.tb-fact-tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; margin-right: 8px; background: var(--tb-surface-2); color: var(--tb-text-secondary); vertical-align: middle; }
.tb-fact-tag-fact { background: var(--tb-rising-tint); color: var(--tb-rising); }
.tb-fact-tag-interpretation { background: var(--tb-accent-tint); color: var(--tb-accent-strong); }
.tb-ai-tag { font-size: 11px; color: var(--tb-text-muted); font-style: italic; margin-left: 8px; }

/* ---------------- Chart ---------------- */
.tb-trend-history { margin-bottom: 26px; }
.tb-chart-toolbar { display: inline-flex; gap: 4px; background: var(--tb-surface-2); border-radius: 8px; padding: 4px; margin-bottom: 10px; }
.tb-chart-window-btn { border: none; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--tb-text-secondary); cursor: pointer; }
.tb-chart-window-btn.is-active { background: var(--tb-surface); color: var(--tb-text); box-shadow: var(--tb-shadow); }
.tb-chart-wrap { background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 16px; overflow-x: auto; }
.tb-chart-canvas { width: 100%; height: 200px; display: block; }
.tb-chart-fallback { margin-top: 8px; font-size: 12px; }

/* ---------------- Sources / related ---------------- */
.tb-sources { margin-bottom: 26px; }
.tb-source-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-source-list li { font-size: 13.5px; border: 1px solid var(--tb-border); border-radius: 8px; padding: 8px 12px; background: var(--tb-surface); }
.tb-source-list a { font-weight: 600; text-decoration: none; }
.tb-source-meta { display: block; font-size: 11.5px; color: var(--tb-text-muted); margin-top: 2px; }
.tb-related-trends { margin-bottom: 26px; }
.tb-related-searches { margin-bottom: 26px; }

/* ---------------- Trend single ---------------- */
.tb-trend-single-inner { max-width: 760px; padding-top: 26px; padding-bottom: 60px; }
.tb-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; font-size: 12.5px; color: var(--tb-text-muted); }
.tb-breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; }
.tb-breadcrumbs a { color: var(--tb-text-muted); text-decoration: none; }
.tb-trend-header { margin-bottom: 26px; }
.tb-trend-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tb-text-muted); margin-bottom: 10px; }
.tb-trend-header h1 { font-size: clamp(26px, 4vw, 36px); }
.tb-updated { margin-left: auto; }

/* ---------------- Trust strip / newsletter ---------------- */
.tb-trust-strip { text-align: center; max-width: 640px; margin: 0 auto; }
.tb-newsletter { background: var(--tb-text); color: #fff; border-radius: var(--tb-radius); padding: 40px; margin: 40px 0; }
.tb-newsletter-inner { max-width: 480px; margin: 0 auto; text-align: center; }
.tb-newsletter h2, .tb-newsletter p { color: #fff; }
.tb-newsletter-form { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.tb-newsletter-form input { padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; min-width: 220px; }
.tb-newsletter-form input::placeholder { color: rgba(255,255,255,.6); }
.tb-newsletter-note { font-size: 12px; opacity: .7; margin-top: 10px; }

/* ---------------- Page content / forms / states ---------------- */
.tb-page-content { padding: 44px 0 70px; max-width: 760px; }
.tb-prose, .tb-page-content .tb-prose p { color: var(--tb-text-secondary); }
.tb-steps { list-style: none; margin: 24px 0; padding: 0; counter-reset: tb-step; display: flex; flex-direction: column; gap: 18px; }
.tb-steps li { position: relative; padding-left: 44px; }
.tb-steps li::before { counter-increment: tb-step; content: counter(tb-step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--tb-accent-tint); color: var(--tb-accent-strong); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tb-steps h2 { font-size: 17px; margin-bottom: 4px; }
.tb-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.tb-notice-success { background: var(--tb-rising-tint); color: var(--tb-rising); }
.tb-notice-error { background: var(--tb-falling-tint); color: var(--tb-falling); }
.tb-empty-state, .tb-error-state { color: var(--tb-text-muted); padding: 40px 0; text-align: center; }
.tb-search-page-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.tb-search-page-form input, .tb-search-page-form select { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--tb-border); font-size: 14px; }
.tb-pagination { margin-top: 30px; display: flex; justify-content: center; gap: 6px; }
.tb-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--tb-border); text-decoration: none; color: var(--tb-text-secondary); }
.tb-pagination .page-numbers.current { background: var(--tb-text); color: #fff; border-color: var(--tb-text); }

/* ---------------- Footer ---------------- */
.tb-site-footer { background: var(--tb-surface); border-top: 1px solid var(--tb-border); margin-top: 50px; padding: 40px 0 0; }
.tb-footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 30px; padding-bottom: 30px; }
.tb-footer-brand p { color: var(--tb-text-muted); font-size: 13.5px; margin-top: 8px; }
.tb-footer-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-footer-nav-list a { color: var(--tb-text-secondary); text-decoration: none; font-size: 14px; }
.tb-footer-trust p { font-size: 13px; color: var(--tb-text-muted); }
.tb-footer-legal { border-top: 1px solid var(--tb-border); padding: 16px 20px; font-size: 12.5px; color: var(--tb-text-muted); }

/* ---------------- Editorial content model ---------------- */
.tb-correction-notice { background: var(--tb-accent-tint); color: var(--tb-accent-strong); border-radius: 8px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 22px; }
.tb-trend-featured-image { margin: 0 0 26px; }
.tb-trend-featured-image img { width: 100%; border-radius: var(--tb-radius); }
.tb-trend-featured-image figcaption { font-size: 11.5px; color: var(--tb-text-muted); margin-top: 6px; }
.tb-key-facts { margin-bottom: 26px; }
.tb-key-facts ul { margin: 0; padding-left: 20px; color: var(--tb-text-secondary); font-size: 14.5px; }
.tb-key-facts li + li { margin-top: 6px; }
.tb-context { margin-bottom: 26px; }
.tb-timeline { margin-bottom: 26px; }
.tb-timeline-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--tb-border); }
.tb-timeline-list li { padding: 0 0 18px 20px; position: relative; }
.tb-timeline-list li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--tb-accent-strong); }
.tb-timeline-date { display: block; font-size: 11.5px; color: var(--tb-text-muted); text-transform: uppercase; letter-spacing: .03em; }
.tb-timeline-heading { display: block; margin-top: 2px; }
.tb-timeline-list p { margin: 4px 0 0; font-size: 13.5px; color: var(--tb-text-secondary); }
.tb-author-box { display: flex; gap: 12px; align-items: flex-start; background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--tb-radius); padding: 16px; margin-bottom: 26px; }
.tb-author-box img { border-radius: 50%; flex: none; }
.tb-author-name { margin: 0; font-size: 13.5px; }
.tb-author-bio { margin: 4px 0 0; font-size: 13px; color: var(--tb-text-secondary); }
.tb-author-trust { margin: 8px 0 0; font-size: 11.5px; color: var(--tb-text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------- Ad slots ---------------- */
.tb-ad-slot { display: flex; align-items: center; justify-content: center; min-height: 60px; background: var(--tb-surface-2); border: 1px dashed var(--tb-border); border-radius: 8px; color: var(--tb-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.tb-ad-slot::before { content: "Ad space"; }
.tb-ad-slot-top { margin: 0 auto; max-width: var(--tb-max-width); }
.tb-ad-slot-article_mid, .tb-ad-slot-article_bottom { margin: 26px 0; }
.tb-ad-slot-footer { max-width: var(--tb-max-width); margin: 0 auto 30px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
	.tb-trend-grid { grid-template-columns: repeat(2, 1fr); }
	.tb-trend-grid-compact { grid-template-columns: repeat(2, 1fr); }
	.tb-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
	.tb-primary-nav, .tb-header-search { display: none; }
	.tb-mobile-menu-toggle { display: inline-flex; }
	.tb-header-cta { display: none; }
}
@media (max-width: 640px) {
	.tb-trend-grid, .tb-trend-grid-compact { grid-template-columns: 1fr; }
	.tb-footer-grid { grid-template-columns: 1fr; }
	.tb-hero { padding: 40px 0 32px; }
	.tb-trend-row { flex-direction: column; align-items: flex-start; }
	.tb-updated { margin-left: 0; }
}
