/*
Theme Name: CoinPulse
Theme URI: https://example.com
Author: Business To Mark
Description: A clean, white, simple WordPress theme built for crypto news sites. Live-style price ticker, sidebar with latest posts and categories, related-article suggestions.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: coinpulse
*/

:root {
  --bg:        #FFFFFF;
  --surface:   #F7F8FA;
  --surface-2: #EEF1F5;
  --rule:      #E4E7EC;
  --text:      #14171F;
  --text-dim:  #6B7280;
  --brand:     #2E6BFF;
  --brand-dark:#1E4FD1;
  --up:        #16A34A;
  --down:      #DC2626;

  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.header-row { display: flex; align-items: center; justify-content: space-between; }
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.site-logo .dot { color: var(--brand); font-size: 28px; line-height: 0; }
.primary-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.primary-nav a { font-size: 14px; font-weight: 500; color: var(--text-dim); }
.primary-nav a:hover { color: var(--brand); }

/* ===== PRICE TICKER (signature element) ===== */
.price-ticker {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: 32px;
  padding: 8px 0;
  animation: ticker-scroll 28s linear infinite;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.ticker-track .coin { color: var(--text); font-weight: 700; }
.ticker-track .up   { color: var(--up); }
.ticker-track .down { color: var(--down); }
@keyframes ticker-scroll { from{transform:translateX(0)} to{transform:translateX(-50%)} }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ===== HERO ===== */
.hero { padding: 40px 0 34px; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-tag {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand); font-weight: 700;
}
.hero-title {
  font-family: var(--font-display); font-size: 38px; line-height: 1.12;
  font-weight: 700; margin: 10px 0 14px; color: var(--text);
}
.hero-excerpt { color: var(--text-dim); font-size: 16px; margin-bottom: 14px; }
.hero-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); text-transform: uppercase; }
.hero-image { aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--rule); }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* ===== SECTION HEADING ===== */
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 38px 0 18px; }
.section-heading h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 0; }
.section-heading .rule { flex: 1; height: 1px; background: var(--rule); margin: 0 16px; }
.section-heading .view-all { font-family: var(--font-mono); font-size: 12px; color: var(--brand); text-transform: uppercase; white-space: nowrap; }
.section-heading .view-all:hover { color: var(--brand-dark); }

/* ===== ARTICLE GRID ===== */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 40px; }
.article-card { background: #fff; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; transition: box-shadow .15s ease; }
.article-card:hover { box-shadow: 0 4px 16px rgba(20,23,31,0.06); }
.article-card .thumb { aspect-ratio: 16/10; background: var(--surface-2); }
.article-card .body { padding: 15px 17px 18px; }
.article-card .cat {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand);
}
.article-card h3 { font-family: var(--font-display); font-size: 17px; line-height: 1.32; font-weight: 600; margin: 7px 0 7px; color: var(--text); }
.article-card p { color: var(--text-dim); font-size: 13.5px; margin: 0 0 9px; }
.article-card .date { font-family: var(--font-mono); font-size: 11px; color: #9CA3AF; }

/* ===== SINGLE POST + SIDEBAR ===== */
.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 42px; padding: 40px 24px 60px; align-items: start; }
.single-article .cat {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--brand);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.single-article h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.18; margin: 12px 0 14px; }
.single-article .meta {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  border-bottom: 1px solid var(--rule); padding-bottom: 16px; margin-bottom: 24px;
}
.featured-image { width: 100%; aspect-ratio: 16/8; overflow: hidden; border-radius: 6px; margin-bottom: 24px; border: 1px solid var(--rule); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.entry-content { font-size: 17px; line-height: 1.75; color: #2B303B; }
.entry-content p { margin: 0 0 18px; }
.entry-content h2 { font-family: var(--font-display); font-size: 23px; margin: 30px 0 12px; color: var(--text); }
.entry-content a { color: var(--brand); text-decoration: underline; }

.related-articles { margin-top: 44px; }
.related-articles .article-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }

/* Sidebar */
.site-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 17px 19px; }
.widget h4 {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 700; margin: 0 0 11px;
  padding-bottom: 8px; border-bottom: 2px solid var(--brand); color: var(--text);
}
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 3px; }
.widget-list li:last-child { border-bottom: none; padding-bottom: 0; }
.widget-list a { font-size: 13px; font-weight: 500; }
.widget-date { font-family: var(--font-mono); font-size: 10.5px; color: #9CA3AF; }
.widget-cats li { flex-direction: row; justify-content: space-between; align-items: center; }
.widget-cats a { font-size: 13px; }
.widget-cats span { font-family: var(--font-mono); font-size: 11px; color: #9CA3AF; }

.widget-alert { background: #F0F6FF; border-color: #D6E4FF; }
.widget-alert h4 { border-bottom-color: var(--brand); }
.widget-alert p { color: #4B5768; font-size: 12.5px; margin: 0; }

/* ===== FOOTER ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--rule); color: var(--text-dim); margin-top: 46px; padding: 26px 0; font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .single-layout { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .article-grid, .related-articles .article-grid { grid-template-columns: 1fr; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
