/* ============================================================
   FinansSite — MarketWatch-inspired professional theme
   ============================================================ */

:root {
  --red:       #d6001c;
  --red-dark:  #a8001a;
  --red-light: #fff0f0;
  --bg:        #ffffff;
  --surface:   #f8f8f8;
  --surface2:  #f0f0f0;
  --border:    #e0e0e0;
  --border2:   #cccccc;
  --text:      #1a1a1a;
  --text2:     #333333;
  --muted:     #666666;
  --muted2:    #999999;
  --up:        #007a33;
  --up-bg:     #e6f4ec;
  --down:      #d6001c;
  --down-bg:   #fff0f0;
  --neutral:   #555555;
  --header-bg: #1a1a1a;
  --accent:    #0066cc;
  --radius:    4px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:'Georgia', 'Times New Roman', serif;
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }

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

/* ============================================================
   UTILITY BAR (top strip)
   ============================================================ */
.util-bar {
  background: var(--header-bg);
  border-bottom: 1px solid #333;
  padding: 5px 0;
  font-size: 11px;
  color: #aaa;
}
.util-bar .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.util-bar a { color: #ccc; }
.util-bar a:hover { color: #fff; }
.util-date { letter-spacing: 0.3px; }

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}
.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--red); }

.main-nav {
  display: flex;
  gap: 0;
  flex: 1;
}
.main-nav a {
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 14px;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: all 0.15s;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  border-bottom-color: var(--red);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-search input {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 20px;
  color: #fff;
  padding: 6px 14px;
  font-size: 12px;
  width: 180px;
  outline: none;
}
.header-search input::placeholder { color: #888; }
.header-search input:focus { border-color: var(--red); }

/* ============================================================
   TICKER TAPE
   ============================================================ */
.ticker-wrap {
  background: #111;
  border-bottom: 1px solid #2a2a2a;
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
}
.ticker-label {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 1;
}
.ticker-scroll {
  display: flex;
  animation: ticker-move 40s linear infinite;
  will-change: transform;
}
.ticker-scroll:hover { animation-play-state: paused; }
@keyframes ticker-move {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  border-right: 1px solid #2a2a2a;
  white-space: nowrap;
  color: #fff;
  font-size: 12px;
}
.ticker-sym { font-weight: 700; color: #fff; }
.ticker-price { color: #ccc; }
.ticker-chg { font-size: 11px; font-weight: 600; }
.up   { color: #00c853; }
.down { color: #ff3d3d; }
.neutral { color: #999; }

/* ============================================================
   BREAKING NEWS BAR
   ============================================================ */
.breaking-bar {
  background: var(--red);
  color: #fff;
  padding: 7px 0;
  font-size: 12px;
  display: none;
}
.breaking-bar.visible { display: block; }
.breaking-bar .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.breaking-label {
  background: #fff;
  color: var(--red);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.breaking-bar a { color: #fff; font-weight: 500; }
.breaking-bar a:hover { text-decoration: underline; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   MARKET SUMMARY STRIP
   ============================================================ */
.market-strip {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 0;
}
.market-strip-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.market-strip-inner::-webkit-scrollbar { display: none; }
.mkt-item {
  flex: 0 0 auto;
  padding: 6px 20px 6px 0;
  margin-right: 20px;
  border-right: 1px solid var(--border);
}
.mkt-item:last-child { border-right: none; }
.mkt-name { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.mkt-val  { font-size: 15px; font-weight: 700; color: var(--text); }
.mkt-chg  { font-size: 11px; font-weight: 600; margin-top: 1px; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
main { padding: 20px 0 60px; }

.page-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.page-grid > section,
.page-grid > aside {
  min-width: 0;
  overflow: hidden;
}
@media (max-width: 960px) {
  .page-grid { grid-template-columns: 1fr; }
  .main-nav a { padding: 0 10px; font-size: 11px; }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.sec-head h2 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sec-head a {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sec-head a:hover { text-decoration: underline; }

/* ============================================================
   HERO STORY
   ============================================================ */
.hero-section { margin-bottom: 28px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  border: 1px solid var(--border);
}
@media (max-width: 680px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-main {
  grid-row: 1 / 3;
  position: relative;
  border-right: 1px solid var(--border);
}
.hero-main img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.hero-main-body { padding: 16px; }
.hero-category {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 8px;
}
.hero-main h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-main h2 a:hover { color: var(--red); }
.hero-main p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}
.hero-meta { font-size: 11px; color: var(--muted2); }
.hero-meta span + span::before { content: ' · '; }

.hero-secondary {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.hero-secondary:last-child { border-bottom: none; }
.hero-secondary h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}
.hero-secondary h3 a:hover { color: var(--red); }
.hero-secondary p { font-size: 12px; color: var(--muted); }
.hero-secondary .s-meta { font-size: 11px; color: var(--muted2); margin-top: 6px; }

/* ============================================================
   CATEGORY TABS
   ============================================================ */
.cat-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 9px 16px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}
.cat-tabs a:hover { color: var(--text); }
.cat-tabs a.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* ============================================================
   NEWS LIST
   ============================================================ */
.news-list { margin-top: 0; }

.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  min-width: 0;
}
.ni-body {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover .ni-title { color: var(--red); }

.ni-source {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--red);
  margin-bottom: 4px;
}
.ni-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
  transition: color 0.15s;
  overflow-wrap: break-word;
  word-break: break-word;
}
.ni-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}
.ni-meta { font-size: 11px; color: var(--muted2); }
.ni-meta span + span::before { content: ' · '; }
.ni-thumb {
  width: 90px;
  height: 65px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.ni-thumb-wrap { width: 90px; flex-shrink: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { position: sticky; top: 72px; }

.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-head {
  background: var(--surface);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.widget-head a { font-weight: 500; color: var(--red); font-size: 10px; }

/* Stock table */
.stock-table { width: 100%; border-collapse: collapse; }
.stock-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 7px 12px;
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stock-table th:last-child,
.stock-table th:nth-child(2) { text-align: right; }
.stock-table td {
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.stock-table tr:last-child td { border-bottom: none; }
.stock-table tr:hover td { background: var(--surface); }
.stock-sym { font-weight: 800; font-size: 13px; color: var(--text); display: block; }
.stock-name { font-size: 10px; color: var(--muted); margin-top: 1px; display: block; }
.stock-price { text-align: right; font-weight: 700; font-size: 13px; }
.stock-chg { text-align: right; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 2px; display: inline-block; }
.chg-up   { background: var(--up-bg);   color: var(--up); }
.chg-down { background: var(--down-bg); color: var(--down); }
.chg-neutral { background: var(--surface2); color: var(--neutral); }

/* Most read */
.most-read { padding: 0; }
.mr-item {
  display: flex;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.mr-item:last-child { border-bottom: none; }
.mr-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--border2);
  flex-shrink: 0;
  line-height: 1;
  width: 20px;
}
.mr-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text2);
}
.mr-title:hover { color: var(--red); }

/* Ad / promo placeholder */
.widget-promo {
  background: var(--surface);
  border: 1px dashed var(--border2);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted2);
  margin-bottom: 20px;
  border-radius: var(--radius);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 4px;
  margin: 20px 0;
  align-items: center;
}
.pagination a,
.pagination span {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.pagination a:hover { border-color: var(--red); color: var(--red); }
.pagination .current { background: var(--red); border-color: var(--red); color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--header-bg);
  color: #999;
  padding: 28px 0;
  font-size: 12px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
.footer-logo { font-size: 1.1rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--red); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }
.footer-disclaimer {
  border-top: 1px solid #333;
  padding-top: 14px;
  margin-top: 14px;
  font-size: 11px;
  color: #666;
  line-height: 1.7;
}

/* ============================================================
   BADGE / LABEL
   ============================================================ */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 2px;
  vertical-align: middle;
}
.badge-red { background: var(--red); color: #fff; }
.badge-blue { background: #0066cc; color: #fff; }
.badge-gray { background: var(--surface2); color: var(--muted); }

/* ============================================================
   HAMBURGER MENU
   ============================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s;
}
.mobile-nav {
  display: none;
  background: #111;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
}
.mobile-nav a {
  display: block;
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 20px;
  border-left: 3px solid transparent;
}
.mobile-nav a.active,
.mobile-nav a:hover {
  color: #fff;
  border-left-color: var(--red);
  background: #1a1a1a;
}
.mobile-search {
  display: none;
  padding: 10px 16px;
  background: #111;
  border-bottom: 1px solid #2a2a2a;
}
.mobile-search form { display: flex; }
.mobile-search input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 20px;
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  outline: none;
  width: 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .page-grid { grid-template-columns: 1fr; }
  .main-nav a { padding: 0 10px; font-size: 11px; }
}

@media (max-width: 768px) {
  /* Header */
  .util-bar { display: none; }
  .main-nav { display: none; }
  .header-search { display: none; }
  .hamburger { display: flex; }
  .logo { font-size: 1.3rem; }
  .header-inner { gap: 12px; }

  /* Hero */
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .hero-main img { height: 200px; }
  .hero-main h2 { font-size: 1.2rem; }

  /* Market strip */
  .market-strip { overflow: hidden; }
  .market-strip-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Category tabs */
  .cat-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .cat-tabs a { white-space: nowrap; flex-shrink: 0; }

  /* News list */
  .ni-thumb-wrap { width: 80px; height: 60px; flex-shrink: 0; }
  .ni-thumb-wrap img { height: 60px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 8px; }

  /* Subscribe banner */
  section h2 { font-size: 1.1rem !important; }
}

@media (max-width: 480px) {
  .ni-thumb-wrap { display: none; }
  .page-grid { gap: 16px; }
  .container { padding: 0 12px; }
  .hero-main img { height: 160px; }
  .ni-body h3 { font-size: 13px; }
  .news-item { grid-template-columns: 1fr; }
  .ni-title { font-size: 14px; }
  .stock-table { font-size: 12px; }
  .widget { margin-bottom: 16px; }
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--red);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}
