/*
Theme Name: FinRisk News
Theme URI: https://news.softechtradinglimited.com
Author: FinRisk News
Description: Professional financial news theme with war risk tracking, FII/DII data, top movers and market snapshot.
Version: 2.0.0
Text Domain: finrisk-news
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&display=swap');

:root {
  --navy:   #0f1420;
  --navy2:  #1a2235;
  --gold:   #f0a500;
  --red:    #DC2626;
  --bg:     #f0ede8;
  --white:  #ffffff;
  --border: #e8e4dc;
  --text:   #0f1420;
  --muted:  #888880;
  --font:   'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid #f0ede8;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--navy);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: var(--gold);
  flex-shrink: 0;
}

.logo-text { font-size: 17px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.logo-text span { color: var(--red); }
.header-meta { font-size: 11px; color: var(--muted); }

.main-nav {
  display: flex;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  font-size: 12px; font-weight: 600; color: #555;
  padding: 9px 12px; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.main-nav a:hover,
.main-nav a.current { color: var(--red); border-bottom-color: var(--red); }

/* ══════════════════════════════════════
   WAR TICKER
══════════════════════════════════════ */
.war-ticker {
  background: var(--navy);
  padding: 6px 20px;
  display: flex; align-items: center; gap: 10px;
  overflow: hidden;
}
.ticker-badge {
  background: var(--red); color: #fff;
  font-size: 8px; font-weight: 800;
  padding: 2px 7px; border-radius: 2px;
  letter-spacing: 0.08em; flex-shrink: 0;
}
.ticker-text { font-size: 10px; color: rgba(255,255,255,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-text strong { color: var(--gold); }

/* ══════════════════════════════════════
   MARKET BAR
══════════════════════════════════════ */
.market-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 20px;
}
.market-bar::-webkit-scrollbar { display: none; }
.mkt-item { padding: 8px 14px; border-right: 1px solid #f0ede8; flex-shrink: 0; min-width: 95px; }
.mkt-item:first-child { padding-left: 0; }
.mkt-name { font-size: 8px; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 2px; }
.mkt-val  { font-size: 13px; font-weight: 700; color: var(--navy); }
.mkt-chg  { font-size: 9px; font-weight: 600; margin-top: 1px; }
.chg-up { color: #16a34a; }
.chg-dn { color: var(--red); }

/* ══════════════════════════════════════
   FII / DII BAR
══════════════════════════════════════ */
.fii-bar {
  background: #f7f5f0;
  border-bottom: 1px solid var(--border);
  padding: 7px 20px;
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none;
}
.fii-bar::-webkit-scrollbar { display: none; }
.fii-label {
  font-size: 9px; font-weight: 800; color: #555;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-right: 14px; flex-shrink: 0; white-space: nowrap;
}
.fii-item {
  display: flex; align-items: center; gap: 5px;
  padding: 0 12px; border-right: 1px solid #e0ddd8;
  flex-shrink: 0;
}
.fii-item:last-child { border-right: none; }
.fii-iname { font-size: 9px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.04em; }
.fii-ival  { font-size: 12px; font-weight: 800; }
.fii-itype { font-size: 8px; color: #aaa; margin-left: 2px; }

/* ══════════════════════════════════════
   PAGE LAYOUT — 3 COLUMNS
══════════════════════════════════════ */
.page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 270px;
  min-height: calc(100vh - 200px);
}

/* ══════════════════════════════════════
   SECTION LABELS
══════════════════════════════════════ */
.sec-label {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.sec-label::after { content: ''; flex: 1; height: 2px; background: var(--red); margin-left: 4px; }

.sec-label-w {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.sec-label-w::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1); margin-left: 4px; }

/* ══════════════════════════════════════
   LEFT COLUMN
══════════════════════════════════════ */
.col-left {
  padding: 14px 14px 14px 20px;
  border-right: 1px solid var(--border);
}

/* Hero card */
.hero-card {
  background: var(--navy);
  border-radius: 8px; padding: 14px; margin-bottom: 10px;
}
.hero-tag {
  background: var(--red); color: #fff;
  font-size: 8px; font-weight: 800;
  padding: 2px 7px; border-radius: 2px;
  letter-spacing: 0.08em; display: inline-block;
  margin-bottom: 7px; text-transform: uppercase;
}
.hero-title {
  font-size: 15px; font-weight: 800; color: #fff;
  line-height: 1.35; margin-bottom: 10px; letter-spacing: -0.01em;
}
.hero-footer {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 6px;
}
.hero-meta { font-size: 9px; color: rgba(255,255,255,0.3); }
.hero-btn {
  background: var(--gold); color: var(--navy);
  font-size: 9px; font-weight: 700;
  padding: 4px 10px; border-radius: 3px; text-decoration: none;
  white-space: nowrap;
}

/* Risk news cards */
.risk-card {
  background: var(--white);
  border-radius: 7px; padding: 11px; margin-bottom: 7px;
  border-left: 3px solid #ddd; cursor: pointer;
  display: block; text-decoration: none;
  transition: box-shadow 0.15s;
}
.risk-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.risk-card.rc-critical { border-left-color: var(--red); }
.risk-card.rc-high     { border-left-color: var(--gold); }
.risk-card.rc-medium   { border-left-color: #ca8a04; }
.risk-card.rc-low      { border-left-color: #16a34a; }
.risk-card.rc-positive { border-left-color: #16a34a; }

.rc-top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 4px; }
.rc-title { font-size: 12px; font-weight: 600; color: var(--navy); line-height: 1.4; flex: 1; }
.rc-meta  { font-size: 9px; color: var(--muted); display: flex; gap: 5px; }

/* Risk pills */
.rpill {
  font-size: 7px; font-weight: 800;
  padding: 2px 5px; border-radius: 2px;
  letter-spacing: 0.05em; white-space: nowrap;
  text-transform: uppercase; flex-shrink: 0;
  display: inline-block;
}
.rpill-critical { background: #FEE2E2; color: #991B1B; }
.rpill-high     { background: #FEF3C7; color: #92400E; }
.rpill-medium   { background: #FEF9C3; color: #854D0E; }
.rpill-low      { background: #F0FDF4; color: #166534; }
.rpill-positive { background: #F0FDF4; color: #166534; }

/* Top movers */
.movers-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  margin-top: 12px;
}
.mover-box {
  background: var(--white); border-radius: 7px; padding: 10px;
}
.mover-hdr {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 8px; display: flex; align-items: center; gap: 4px;
}
.mover-hdr.gainers { color: #16a34a; }
.mover-hdr.losers  { color: var(--red); }
.mover-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid #f5f3ef;
}
.mover-row:last-child { border-bottom: none; }
.mover-name { font-size: 11px; font-weight: 600; color: var(--navy); }
.mover-pct  { font-size: 11px; font-weight: 700; }
.mover-up   { color: #16a34a; }
.mover-dn   { color: var(--red); }

/* ══════════════════════════════════════
   MIDDLE COLUMN
══════════════════════════════════════ */
.col-mid {
  padding: 14px;
  border-right: 1px solid var(--border);
}

.news-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  margin-bottom: 10px;
}
.grid-card {
  background: var(--white); border-radius: 7px; padding: 10px;
  cursor: pointer; display: block; text-decoration: none;
  transition: box-shadow 0.15s;
}
.grid-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.grid-title {
  font-size: 11px; font-weight: 600; color: var(--navy);
  line-height: 1.4; margin: 5px 0;
}
.grid-meta { font-size: 9px; color: var(--muted); }

.load-more {
  display: block; text-align: center;
  padding: 10px; background: var(--white);
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 11px; font-weight: 600; color: var(--navy);
  text-decoration: none; transition: background 0.15s;
}
.load-more:hover { background: #f0ede8; }

/* ══════════════════════════════════════
   RIGHT COLUMN — DARK
══════════════════════════════════════ */
.col-right {
  background: var(--navy);
  padding: 14px;
}

/* War timeline */
.war-timeline { padding: 2px 0; }
.wt-item {
  display: flex; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wt-item:last-child { border-bottom: none; }
.wt-left {
  display: flex; flex-direction: column;
  align-items: center; width: 12px; flex-shrink: 0;
}
.wt-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); flex-shrink: 0; margin-top: 2px;
}
.wt-dot.gold { background: var(--gold); }
.wt-dot.grey { background: rgba(255,255,255,0.2); }
.wt-line { width: 1px; flex: 1; background: rgba(255,255,255,0.08); margin-top: 4px; min-height: 10px; }
.wt-tag {
  font-size: 7px; font-weight: 800; color: var(--red);
  background: rgba(220,38,38,0.15);
  padding: 1px 5px; border-radius: 2px;
  display: inline-block; margin-bottom: 2px; letter-spacing: 0.05em;
}
.wt-tag.gold { color: var(--gold); background: rgba(240,165,0,0.12); }
.wt-time  { font-size: 8px; color: rgba(255,255,255,0.25); margin-bottom: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.wt-title { font-size: 10px; font-weight: 600; color: #fff; line-height: 1.4; margin-bottom: 2px; }
.wt-src   { font-size: 8px; color: rgba(255,255,255,0.25); }

/* Risk meter */
.risk-meter {
  background: var(--navy2); border-radius: 7px;
  padding: 11px; margin-top: 10px;
}
.rm-header {
  font-size: 9px; font-weight: 800; color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 9px; display: flex; align-items: center; gap: 5px;
}
.rm-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.rm-row  { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.rm-name { font-size: 10px; color: rgba(255,255,255,0.5); width: 80px; flex-shrink: 0; }
.rm-bar  { flex: 1; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.rm-fill { height: 3px; border-radius: 2px; }
.rm-fill.red   { background: var(--red); }
.rm-fill.amber { background: var(--gold); }
.rm-fill.green { background: #16a34a; }
.rm-val  { font-size: 10px; font-weight: 700; width: 22px; text-align: right; flex-shrink: 0; }
.rm-val.red   { color: #f87171; }
.rm-val.amber { color: var(--gold); }
.rm-val.green { color: #4ade80; }

/* ══════════════════════════════════════
   SINGLE ARTICLE PAGE
══════════════════════════════════════ */
.single-page { background: var(--white); }
.single-wrap {
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  min-height: 100vh;
}
.single-main { padding: 28px 32px; border-right: 1px solid var(--border); }
.single-aside { padding: 28px 20px; background: #faf9f6; }

.single-tag {
  display: inline-block;
  font-size: 9px; font-weight: 800;
  padding: 3px 10px; border-radius: 2px;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 12px;
}
.single-title {
  font-size: 26px; font-weight: 800; color: var(--navy);
  line-height: 1.3; letter-spacing: -0.02em; margin-bottom: 12px;
}
.single-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.single-meta a { color: var(--red); }

.single-content { font-size: 15px; line-height: 1.78; color: #2a2a2a; }
.single-content h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 28px 0 12px; }
.single-content h3 { font-size: 17px; font-weight: 700; color: var(--navy); margin: 20px 0 8px; }
.single-content p  { margin-bottom: 16px; }
.single-content a  { color: var(--red); text-decoration: underline; }
.single-content div { margin-bottom: 14px; }

/* Single sidebar */
.single-aside-title {
  font-size: 10px; font-weight: 800; color: var(--navy);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 2px solid var(--red);
}
.related-card {
  display: block; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; transition: opacity 0.15s;
}
.related-card:hover { opacity: 0.75; }
.related-card:last-child { border-bottom: none; }
.related-title { font-size: 12px; font-weight: 600; color: var(--navy); line-height: 1.4; margin-bottom: 4px; }
.related-meta  { font-size: 10px; color: var(--muted); }

/* ══════════════════════════════════════
   ARCHIVE PAGE
══════════════════════════════════════ */
.archive-wrap { max-width: 960px; margin: 0 auto; padding: 20px 20px; }
.archive-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.archive-card {
  background: var(--white); border-radius: 8px; padding: 14px;
  border-left: 3px solid var(--border);
  display: block; text-decoration: none;
  transition: box-shadow 0.15s;
}
.archive-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.archive-card.rc-critical { border-left-color: var(--red); }
.archive-card.rc-high     { border-left-color: var(--gold); }
.archive-card.rc-medium   { border-left-color: #ca8a04; }
.archive-card.rc-low      { border-left-color: #16a34a; }
.archive-title { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.4; margin: 6px 0; }
.archive-meta  { font-size: 10px; color: var(--muted); }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  background: var(--navy); color: rgba(255,255,255,0.4);
  padding: 20px; text-align: center; font-size: 11px;
  margin-top: 0;
}
.site-footer a { color: var(--gold); }

/* ══════════════════════════════════════
   HIDE IMAGES
══════════════════════════════════════ */
.post-thumbnail,
.wp-post-image,
.attachment-post-thumbnail { display: none !important; }

/* ══════════════════════════════════════
   MOBILE — max 768px
   Sidebar goes FIRST (top) on mobile
══════════════════════════════════════ */
@media (max-width: 768px) {
  .header-top  { padding: 9px 14px; }
  .header-meta { display: none; }
  .main-nav    { padding: 0 14px; }
  .main-nav a  { padding: 8px 10px; font-size: 11px; }
  .war-ticker  { padding: 6px 14px; }
  .market-bar  { padding: 0 14px; }
  .fii-bar     { padding: 7px 14px; }

  .page-grid {
    grid-template-columns: 1fr;
  }

  /* War/Risk column goes FIRST on mobile */
  .col-right { order: -1; }
  .col-left  { padding: 12px 14px; border-right: none; border-bottom: 1px solid var(--border); }
  .col-mid   { padding: 12px 14px; border-right: none; }

  .news-grid        { grid-template-columns: 1fr 1fr; }
  .movers-grid      { grid-template-columns: 1fr 1fr; }

  /* Single article — full width on mobile */
  .single-wrap  { grid-template-columns: 1fr; }
  .single-aside { display: none; }
  .single-main  { padding: 16px; border-right: none; }
  .single-title { font-size: 21px; }
  .single-content { font-size: 14px; }

  /* Archive */
  .archive-wrap { padding: 14px; }
  .archive-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .news-grid    { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
  .movers-grid  { grid-template-columns: 1fr 1fr; }
}

/* TABLET */
@media (min-width: 769px) and (max-width: 1100px) {
  .page-grid { grid-template-columns: 1fr 1fr 240px; }
  .single-wrap { grid-template-columns: 1fr 260px; }
  .archive-grid { grid-template-columns: 1fr 1fr; }
}
