/* =========================================================
   TTN — design tokens
   ========================================================= */
:root {
  --bg: #0b0e11;
  --surface: #12161b;
  --surface-2: #181d24;
  --border: #232a33;
  --text: #e8eaed;
  --text-dim: #8b93a1;
  --text-faint: #5b6472;
  --up: #00c896;
  --down: #ff4757;
  --accent: #f0a500;
  --accent-dim: #6b4d00;
  --font-display: "IBM Plex Mono", "JetBrains Mono", monospace;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 6px;
  --header-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* =========================================================
   Top nav
   ========================================================= */
.topnav {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand .dot { color: var(--accent); }
.brand small {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-links { display: flex; gap: 24px; font-size: 14px; color: var(--text-dim); }
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  gap: 6px;
  min-width: 220px;
}
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 100%;
  font-family: var(--font-body);
}
.search-box svg { flex-shrink: 0; opacity: 0.6; width: 15px; height: 15px; }

/* =========================================================
   Ticker strip (TradingView Ticker Tape widget)
   ========================================================= */
.tv-ticker-tape-wrap {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ticker-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
.ticker-cell:last-child { border-right: none; }
.ticker-cell:hover { background: var(--surface-2); }
.ticker-cell.active { background: var(--surface-2); }
.ticker-cell.active::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

.ticker-label {
  font-size: 11.5px;
  color: #7dd3fc;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  justify-content: space-between;
}
.ticker-label span:first-child { color: #7dd3fc; }

.ticker-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
  transition: color 0.3s ease;
}

.ticker-change {
  font-family: var(--font-display);
  font-size: 12px;
  margin-top: 1px;
}
.ticker-change.up { color: var(--up); }
.ticker-change.down { color: var(--down); }

.badge-demo {
  font-size: 9px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 4px;
}

.flash-up { animation: flashUp 0.6s ease; }
.flash-down { animation: flashDown 0.6s ease; }
@keyframes flashUp { 0% { color: var(--up); } 100% { color: var(--text); } }
@keyframes flashDown { 0% { color: var(--down); } 100% { color: var(--text); } }

/* Chart panel that expands under the strip */
.chart-panel {
  max-height: 0;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  /* Stable geometry keeps chart navigation reliable on mobile. */
}
.chart-panel.open { max-height: 480px; }
.chart-panel-inner {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
}
.chart-panel-head button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.chart-panel-head button:hover { color: var(--accent); }
#tv-chart-container { width: 100%; height: 400px; }

/* =========================================================
   Market Snapshot
   ========================================================= */
.market-summary {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.market-summary-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.market-summary-stamp {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-display);
}
.market-summary p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 800px;
}

/* =========================================================
   Layout
   ========================================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Featured article */
.featured {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 36px;
}
.featured-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  background: var(--surface-2);
}
.featured-body { padding: 22px 24px 26px; }
.featured-body h1,
.featured-body h2 {
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 10px;
  font-weight: 700;
}
.featured-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.featured-body p.dek {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 14px;
}

/* Ticker tags under articles */
.article-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.article-ticker-tag {
  font-family: var(--font-display);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-ticker-tag:hover { border-color: var(--accent-dim); transform: translateY(-1px); }
.article-ticker-tag b { color: #7dd3fc; font-weight: 700; }
.article-ticker-tag .up { color: var(--up); font-weight: 600; }
.article-ticker-tag .down { color: var(--down); font-weight: 600; }

/* TTN Analysis (original articles) */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}
.analysis-card {
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  position: relative;
}
.view-all-analysis {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  color: var(--accent);
  font-size: 13px;
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
}
.view-all-analysis:hover { background: var(--surface); }
.analysis-list-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.analysis-list-item:last-child { border-bottom: none; }
.analysis-list-item img, .analysis-list-item .news-item-thumb-fallback {
  width: 96px;
  height: 72px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.analysis-list-item h3 { font-size: 15px; margin: 4px 0 6px; line-height: 1.35; }
.analysis-list-item h3 a:hover { color: var(--accent); }
.analysis-list-item p { font-size: 13px; color: var(--text-faint); margin: 0 0 6px; }
.analysis-card h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 8px 0 6px;
  font-weight: 700;
}
.analysis-card h3 a:hover { color: var(--accent); }
.analysis-card p { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }

@media (max-width: 700px) {
  .analysis-grid { grid-template-columns: 1fr; }
}

.ttn-original-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #14161a;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
}

@media (max-width: 700px) {
}

/* News feed list */
.news-feed { display: flex; flex-direction: column; gap: 16px; }

.news-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  transition: border-color 0.15s ease;
  display: flex;
  gap: 14px;
}
.news-item:hover { border-color: #3a4451; }

.news-item-thumb {
  flex-shrink: 0;
  width: 110px;
  height: 90px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-2);
}
.news-item-thumb-fallback {
  flex-shrink: 0;
  width: 110px;
  height: 90px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.news-item-body { flex: 1; min-width: 0; }

.news-item h3 {
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 6px;
  font-weight: 600;
}
.news-item h3 a:hover { color: var(--accent); }

.news-item p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.news-meta {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.news-meta .source { color: var(--accent); }

.thumb-crypto { background: linear-gradient(135deg, #7c3aed, #f0a500); }
.thumb-stocks { background: linear-gradient(135deg, #1d4ed8, #38bdf8); }
.thumb-forex { background: linear-gradient(135deg, #059669, #34d399); }
.thumb-gold { background: linear-gradient(135deg, #b45309, #fbbf24); }
.thumb-general { background: linear-gradient(135deg, #334155, #64748b); }

@media (max-width: 480px) {
  .news-item-thumb, .news-item-thumb-fallback { width: 84px; height: 84px; }
}

/* Sidebar */
.sidebar-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  margin-bottom: 20px;
}
.sidebar-list { display: flex; flex-direction: column; gap: 10px; }
.sidebar-list a {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-dim);
  display: block;
}
.sidebar-list a:hover { color: var(--accent); }
.sidebar-list li + li { border-top: 1px solid var(--border); padding-top: 10px; }
.sidebar-list li:first-child { padding-top: 0; }
.sidebar-list { list-style: none; }

/* Ad slot placeholders — hidden from visitors until real AdSense code
   replaces the text inside. Change to `display: flex` once you paste
   in your actual <ins class="adsbygoogle"> snippet from AdSense. */
.ad-slot {
  display: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-bottom: 20px;
}

/* Loading skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #202730 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-line { height: 12px; margin-bottom: 8px; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 26px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}
footer a { color: var(--text-dim); margin: 0 8px; }
footer a:hover { color: var(--accent); }

/* Static pages */
.static-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.static-page h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 18px;
  color: var(--accent);
}
.static-page h2 {
  font-size: 18px;
  margin: 26px 0 10px;
}
.static-page p, .static-page li {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 12px;
}
.static-page ul { padding-left: 20px; }

/* =========================================================
   Calculators page
   ========================================================= */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.calc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
}
.calc-card h2 {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
}
.calc-card .calc-desc {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.calc-field { margin-bottom: 12px; }
.calc-field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.calc-field input, .calc-field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  outline: none;
}
.calc-field input:focus, .calc-field select:focus { border-color: var(--accent-dim); }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-result {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.calc-result .big {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--up);
}
.calc-result .label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.calc-result .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.calc-swap-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  margin: 0 auto 12px;
  display: block;
}

@media (max-width: 700px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Brokers page
   ========================================================= */
.disclosure-note {
  font-size: 12.5px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 18px 0 30px;
  line-height: 1.5;
}
.broker-list { display: flex; flex-direction: column; gap: 14px; }
.broker-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.broker-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.broker-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-display);
}
.broker-info p { font-size: 13px; color: var(--text-dim); max-width: 480px; }
.broker-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 6px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.broker-cta {
  background: var(--accent);
  color: #14161a;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}
.broker-cta:hover { filter: brightness(1.08); }
.broker-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 28px 0 12px;
}
/* =========================================================
   News article modal (in-site, no external redirect)
   ========================================================= */
body.modal-open { overflow: hidden; }

.news-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
}
.news-modal.open { display: block; }

.news-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, 0.72);
}

.news-modal-panel {
  position: relative;
  max-width: 640px;
  margin: 6vh auto;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0 22px;
}

.news-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.news-modal-panel .featured-img,
.news-modal-panel .news-item-thumb-fallback {
  width: 100%;
  height: 260px;
  border-radius: 0;
}

#news-modal-body { padding: 20px 24px 0; }

.news-modal-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin: 14px 0 8px;
}
.news-modal-meta .source { color: var(--accent); }

.news-modal-panel h2 {
  font-size: 21px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.news-modal-panel p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 14px;
}

.news-modal-source-link {
  display: inline-block;
  margin-top: 6px;
  background: var(--accent);
  color: #14161a;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius);
}
.news-modal-source-link:hover { filter: brightness(1.08); }

.news-modal-note {
  font-size: 11.5px !important;
  color: var(--text-dim) !important;
  margin-top: 16px !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 700px) {
  .news-modal-panel { margin: 0; max-height: 100vh; height: 100vh; border-radius: 0; }
}

/* =========================================================
   Cookie consent banner
   ========================================================= */
#cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
#cookie-consent p {
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 0;
  max-width: 640px;
}
#cookie-consent a { color: var(--accent); }
.cookie-consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-consent-actions button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
}
#cookie-accept { background: var(--accent); color: #14161a; border-color: var(--accent); }
#cookie-decline { background: transparent; color: var(--text-dim); }

@media (max-width: 900px) {
  .container { grid-template-columns: 1fr; }
  .ticker-strip { grid-template-columns: repeat(3, 1fr); }
  .ticker-cell:nth-child(3) { border-right: none; }
  .featured-img { height: 220px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 60;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .search-box { min-width: 0; flex: 1 1 100%; order: 3; }
  .brand small { display: none; }
}


/* TTN Original article hero: preserve the full photograph on every screen */
.article-hero-image {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--radius);
  margin: 16px 0;
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .article-hero-image {
    width: 100%;
    height: auto !important;
    max-height: none;
    object-fit: contain;
  }
}
