/* ============================================================
   home.css — Light homepage styles (index.html)
   Depends on: base.css (load base.css first)
   ============================================================ */

/* ── Page base ── */
body {
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ── Scrollbar (light override) ── */
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; }

/* ── Header ── */
.header-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0ee;
}

.logo-wordmark { line-height: 1.1; }
.logo-wordmark .brand   { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.logo-wordmark .accent  { color: var(--accent); }
.logo-wordmark .tld     { color: #aaa; font-weight: 400; font-size: 14px; }
.logo-wordmark .tagline { font-size: 10px; color: #999; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Search ── */
.search-wrap { flex: 1; max-width: 500px; position: relative; }
.search-input {
  background: var(--bg);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-sans);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58,125,10,0.08);
  background: #fff;
}
.search-input::placeholder { color: #aaa; }

/* ── Market status badge ── */
.market-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
}
.market-status span { font-size: 11px; font-weight: 700; color: var(--accent); }

/* ── Primary nav ── */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover  { color: var(--text-primary); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Sub nav ── */
.sub-nav-wrap {
  background: #fafaf8;
  border-top: 1px solid #eee;
}
.sub-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 7px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav::-webkit-scrollbar { display: none; }

.sub-nav-link {
  font-size: 12px;
  color: #777;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s;
}
.sub-nav-link:hover  { color: var(--text-primary); }
.sub-nav-link.active { color: var(--accent); font-weight: 600; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ── Stat tiles ── */
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: box-shadow 0.15s;
  cursor: pointer;
}
.stat-tile:hover { box-shadow: var(--shadow-md); }

/* ── Breaking news bar ── */
.breaking-bar {
  background: var(--warning-bg);
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  margin-bottom: 18px;
}
.breaking-bar .breaking-label {
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.breaking-bar .breaking-text {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #5d4037;
}
.breaking-bar .breaking-time { font-size: 11px; color: #999; flex-shrink: 0; }

/* ── News card links ── */
a.news-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  overflow: hidden;
}
a.news-card .card { transition: box-shadow 0.18s, border-color 0.18s; }
a.news-card:hover .card { box-shadow: var(--shadow-lg); border-color: var(--accent-border); }
a.news-card:hover .headline { color: var(--accent); }

/* ── News list links ── */
a.news-list-link,
div.news-list-link {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
a.news-list-link:last-child,
div.news-list-link:last-child { border-bottom: none; }
a.news-list-link:hover,
div.news-list-link:hover {
  background: var(--bg-hover);
  margin: 0 -14px;
  padding: 14px;
  border-radius: var(--radius-sm);
}
a.news-list-link:hover .headline,
div.news-list-link:hover .headline { color: var(--accent); }

/* ── Article headlines ── */
.headline { transition: color 0.15s; }

/* ── News image wrapper ── */
.news-img-wrap {
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
}
.news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
a.news-card:hover .news-img-wrap img { transform: scale(1.03); }

/* ── Tab pills ── */
.tab-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  color: #777;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.tab-pill:hover  { border-color: var(--accent); color: var(--accent); }
.tab-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Filter chips ── */
.filter-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  color: #777;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.filter-chip:hover  { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Market mover rows ── */
.mover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  transition: background 0.1s;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.mover-row:last-child { border-bottom: none; }
.mover-row:hover { background: var(--bg-hover); }

/* ── Insider table rows ── */
.it-row {
  display: grid;
  padding: 9px 16px;
  border-bottom: 1px solid #f2f2f2;
  transition: background 0.1s;
  cursor: pointer;
}
.it-row:hover { background: var(--bg-hover); }
.it-row:last-child { border-bottom: none; }

/* ── Earnings items ── */
.earnings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fafaf8;
  border: 1px solid #eeeeea;
  border-radius: var(--radius-sm);
}

/* ── Sidebar CTA block ── */
.intelligence-cta {
  background: linear-gradient(135deg, var(--accent-bg) 0%, #e0f4c0 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

/* ── Article drawer ── */
.article-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.38);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.article-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.article-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 901;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,0.14);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.article-drawer.open { transform: translateX(0); }

.drawer-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: var(--bg-deep);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 24px;
}

.drawer-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.drawer-source-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.drawer-time {
  font-size: 11px;
  color: #aaa;
}

.drawer-headline {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.drawer-summary {
  font-size: 13px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 22px;
}

.drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.15s;
}
.drawer-cta:hover { opacity: 0.88; }
.drawer-cta svg { flex-shrink: 0; }

.drawer-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 902;
  transition: background 0.15s;
}
.drawer-close:hover { background: rgba(0,0,0,0.65); }

/* news cards become clickable divs */
div.news-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}
div.news-card .card { transition: box-shadow 0.18s, border-color 0.18s; }
div.news-card:hover .card { box-shadow: var(--shadow-lg); border-color: var(--accent-border); }
div.news-card:hover .headline { color: var(--accent); }
div.news-card:hover .news-img-wrap img { transform: scale(1.03); }

/* ── Load more button ── */
.load-more-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: var(--font-sans);
}
.load-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mover link (insider sidebar row) ── */
.mover-link { text-decoration: none; color: inherit; }

/* ── Block button modifiers ── */
.load-more-btn--block { display: block; text-align: center; }
.btn-primary--block   { width: 100%; display: block; text-align: center; }

/* ── Header logo row ── */
.header-logo-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.header-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-img { height: 38px; width: auto; }

.header-wordmark { line-height: 1.1; }
.header-wordmark-brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.header-wordmark-tld  { color: #aaa; font-weight: 400; font-size: 14px; }
.header-wordmark-tag  { font-size: 10px; color: #999; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }

/* header-search already defined above (flex + max-width) */
.header-search { flex: 1; max-width: 500px; position: relative; }

.header-market-badge { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.market-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
}
.market-status-dot   { width: 7px; height: 7px; border-radius: 50%; background: #999; display: inline-block; }
.market-status-label { font-size: 11px; font-weight: 700; color: var(--accent); }
.market-time         { font-size: 12px; color: #999; }

/* ── Primary nav ── */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }

/* ── Sub nav wrap ── */
.sub-nav-wrap { background: #fafaf8; border-top: 1px solid #eee; }
.sub-nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 7px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav-inner::-webkit-scrollbar { display: none; }

/* ── Main content container ── */
.main-content { padding-top: 20px; padding-bottom: 40px; }

/* ── AdSense leaderboard slot ── */
.ad-leaderboard {
  background: #fafaf8;
  border: 1px dashed #ddd;
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 11px;
  margin-bottom: 16px;
}

/* ── AdSense sidebar slot ── */
.ad-sidebar {
  background: #fafaf8;
  border: 1px dashed #ddd;
  border-radius: var(--radius-sm);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 11px;
}

/* ── Section header row (title + "more" link) ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ── News card body padding ── */
.news-card-body       { padding: 14px; }
.news-card-body-sm    { padding: 12px; }
.news-card-meta       { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.news-card-meta-sm    { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.news-card-time       { font-size: 11px; color: #aaa; }
.news-card-headline   { font-size: 15px; font-weight: 700; line-height: 1.4; margin: 8px 0 6px; }
.news-card-headline-sm{ font-size: 13px; font-weight: 700; line-height: 1.4; margin: 7px 0 5px; }
.news-card-summary    { font-size: 12px; color: #666; line-height: 1.6; }

/* ── News list item internals ── */
.news-list-thumb {
  width: 72px;
  height: 54px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-deep);
}
.news-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-list-body      { flex: 1; min-width: 0; }
.news-list-headline  { font-size: 13px; font-weight: 600; line-height: 1.4; }
.news-list-meta      { display: flex; align-items: center; gap: 8px; margin-top: 5px; }

/* ── Stat tile internals ── */
.stat-tile-label { font-size: 10px; color: #888; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-tile-val   { font-size: 22px; font-weight: 800; }
.stat-tile-sub   { font-size: 11px; color: #aaa; margin-top: 3px; }

/* ── More Stories list card ── */
.list-card { padding: 0 14px; margin-bottom: 28px; }

/* ── Insider preview card internals ── */
.insider-card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.insider-card-head h3   { font-size: 13px; font-weight: 700; }
.insider-card-foot      { padding: 12px 16px; }
.insider-trade-ticker-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.insider-trade-title    { font-size: 11px; color: #888; }
.insider-trade-name     { font-size: 12px; color: #555; }
.insider-trade-value    { text-align: right; }
.insider-trade-time     { font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Intelligence CTA internals ── */
.intel-cta-logo   { height: 40px; margin: 0 auto 10px; display: block; }
.intel-cta-title  { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.intel-cta-desc   { font-size: 12px; color: #555; margin-bottom: 12px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT GRIDS — defined in CSS so media queries can override
   ══════════════════════════════════════════════════════════════ */

/* Main 2-col layout: news column + sidebar */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* Right sidebar */
.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero 2-up news cards */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 4-col stat tiles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* 3-col news card grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — breakpoints
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤900px): sidebar stacks below, news grid 2-col ── */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
  .news-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Mobile (≤640px): full single column ── */
@media (max-width: 640px) {
  body { overflow-x: hidden; }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Smaller logo + wordmark on mobile */
  .header-logo-img          { height: 26px !important; }
  .header-wordmark-brand    { font-size: 15px !important; }
  .header-wordmark-tld      { font-size: 12px !important; }
  .header-wordmark-tag      { display: none; }
  .header-logo-link         { gap: 7px !important; }
  .header-logo-row          { gap: 12px !important; padding: 8px 0 !important; }

  /* Hide search box and market-status badge — saves header space */
  .header-search,
  .header-market-badge { display: none !important; }

  /* Hero: 1 column */
  .hero-grid {
    grid-template-columns: 1fr;
  }

  /* News grid: 1 column */
  .news-grid {
    grid-template-columns: 1fr;
  }

  /* Stats tiles: 2×2 on small screens */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-title { font-size: 14px !important; }
}
