/*
Theme Name: TheBlock Lite
Theme URI: https://yoursite.com
Author: Your Name
Description: A lightweight dark crypto news theme inspired by The Block. Optimised for speed with smaller images, simple 3-item navigation, 5-category strip, and a clean single News-by-Category homepage block.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: theblock-lite
Tags: news, dark, crypto, blog, grid, lightweight
*/

/* ==============================
   CSS CUSTOM PROPERTIES
============================== */
:root {
  /* Brand colours */
  --bg:            #0d0d0d;
  --bg-2:          #111111;
  --bg-card:       #161616;
  --bg-hover:      #1e1e1e;
  --bg-input:      #1a1a1a;
  --accent:        #3b82f6;
  --accent-h:      #2563eb;
  --accent-2:      #f59e0b;
  --green:         #22c55e;
  --red:           #ef4444;

  /* Text */
  --t1:            #f0f0f0;
  --t2:            #9ca3af;
  --t3:            #6b7280;
  --t4:            #4b5563;

  /* Borders */
  --b1:            #2a2a2a;
  --b2:            #333333;

  /* Sizing */
  --nav-h:         60px;
  --max-w:         1200px;

  /* Fonts */
  --sans:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:          'JetBrains Mono', 'Fira Code', monospace;
}

/* ==============================
   RESET & BASE
============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a   { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul  { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ==============================
   CRYPTO TICKER
============================== */
.ticker-bar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--b1);
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 45s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 28px;
  font-size: 11px;
  font-family: var(--mono);
  border-right: 1px solid var(--b1);
}
.tick-sym   { color: var(--t1); font-weight: 700; letter-spacing: .4px; }
.tick-price { color: var(--t2); }
.tick-up    { color: var(--green); }
.tick-down  { color: var(--red); }

/* ==============================
   HEADER
============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13,13,13,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--b1);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.site-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--t1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.site-logo .badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Main nav — Home, About Us, Contact */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.main-nav a {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  border-radius: 5px;
  transition: all .15s;
}
.main-nav a:hover,
.main-nav a.active { color: var(--t1); background: var(--bg-card); }
.main-nav a.active  { color: var(--accent); }

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Search */
.hdr-search         { position: relative; }
.hdr-search input {
  background: var(--bg-card);
  border: 1px solid var(--b2);
  border-radius: 5px;
  padding: 6px 12px 6px 30px;
  font-size: 13px;
  color: var(--t1);
  width: 170px;
  transition: width .2s, border-color .15s;
}
.hdr-search input:focus { outline: none; width: 210px; border-color: var(--accent); }
.hdr-search input::placeholder { color: var(--t3); }
.hdr-search .ico {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; color: var(--t3);
  pointer-events: none;
}

.btn-sub {
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 7px 16px; border-radius: 5px;
  border: none;
  transition: background .15s;
}
.btn-sub:hover { background: var(--accent-h); }

/* Mobile toggle */
.mob-toggle {
  display: none;
  background: none; border: none;
  color: var(--t1); font-size: 22px; padding: 4px;
}

/* ==============================
   CATEGORY STRIP  (5 cats)
============================== */
.cat-strip {
  background: var(--bg-2);
  border-bottom: 1px solid var(--b1);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
}
.cat-link {
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--t3);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.cat-link:hover        { color: var(--t1); border-bottom-color: var(--b2); }
.cat-link.active       { color: var(--accent); border-bottom-color: var(--accent); }

/* Category accent colours */
.cat-link[data-cat="trends"]     { }
.cat-link[data-cat="forecast"]   { }
.cat-link[data-cat="wallets"]    { }
.cat-link[data-cat="investment"] { }
.cat-link[data-cat="tools"]      { }

/* ==============================
   LAYOUT
============================== */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Two-column layout: content + sidebar */
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

/* Section header */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--b1);
}
.sec-head h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-head h2::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.sec-head a { font-size: 12px; color: var(--accent); font-weight: 500; }
.sec-head a:hover { text-decoration: underline; }

/* ==============================
   HERO CARD
============================== */
/* Image: 600 × 340 (hero banner) */
.hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--b1);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  margin-bottom: 32px;
  transition: border-color .2s;
}
.hero-card:hover { border-color: var(--b2); }

/* hero-img is now the <a> wrapping the image */
.hero-img {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 600/340;
}
.hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
  display: block;
}
.hero-card:hover .hero-img img { transform: scale(1.03); }

.hero-body {
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.cat-badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(59,130,246,.1);
  padding: 3px 9px;
  border-radius: 3px;
  width: fit-content;
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--t1);
  letter-spacing: -.2px;
}
.hero-title a { color: var(--t1); }
.hero-title a:hover { color: var(--accent); }

.hero-excerpt {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--t3);
}
.post-meta .by { color: var(--t2); font-weight: 600; }
.post-meta .by:hover { color: var(--accent); }
.post-meta .dot { opacity: .4; }

/* ==============================
   NEWS GRID  — card 800×450
============================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--b1);
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s;
}
.post-card:hover {
  border-color: var(--b2);
  transform: translateY(-2px);
}

/* card-img is now a <div> — no more nested-anchor bug */
/* 800×450 = 16:9 */
.card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-2);
  position: relative;
  flex-shrink: 0;
}

/* The actual link inside .card-img that wraps the image */
.card-img-link {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.card-img-link img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
  display: block;
}
.post-card:hover .card-img-link img { transform: scale(1.04); }

/* Badge overlaid on image — safe inside <div>, not inside <a> */
.card-img .cat-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--t1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a:hover { color: var(--accent); }

.card-excerpt {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--t3);
  padding-top: 10px;
  border-top: 1px solid var(--b1);
  margin-top: auto;
}
.card-foot .by { color: var(--t2); font-weight: 600; }
.card-foot .by:hover { color: var(--accent); }

/* ==============================
   NEWS-BY-CATEGORY BLOCK
============================== */
.cat-section {
  margin-bottom: 44px;
}

/* ==============================
   SIDEBAR
============================== */
.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 18px);
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--b1);
  border-radius: 7px;
  padding: 18px;
  margin-bottom: 22px;
}

.widget-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--t2);
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  gap: 7px;
}
.widget-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 12px;
  background: var(--accent-2);
  border-radius: 2px;
}

/* Trending list */
.trend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--b1);
}
.trend-item:last-child { border-bottom: none; }
.trend-n {
  font-size: 18px;
  font-weight: 900;
  color: var(--b2);
  line-height: 1;
  min-width: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.trend-title { font-size: 12px; font-weight: 600; color: var(--t1); line-height: 1.4; }
.trend-title a:hover { color: var(--accent); }
.trend-meta  { font-size: 10px; color: var(--t3); margin-top: 3px; }

/* Newsletter widget */
.widget-nl {
  background: linear-gradient(140deg,#0f1e3d,#161616);
}
.widget-nl p { font-size: 12px; color: var(--t2); margin-bottom: 12px; }
.nl-form { display: flex; flex-direction: column; gap: 8px; }
.nl-form input {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--b2);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--t1);
}
.nl-form input::placeholder { color: var(--t3); }
.nl-form input:focus { outline: none; border-color: var(--accent); }
.nl-form button {
  background: var(--accent); color: #fff;
  border: none; border-radius: 5px;
  padding: 8px 12px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.nl-form button:hover { background: var(--accent-h); }

/* Market snapshot */
.mkt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--b1);
  font-size: 12px;
}
.mkt-row:last-child { border-bottom: none; }
.mkt-name  { font-weight: 700; color: var(--t1); }
.mkt-price { font-family: var(--mono); font-size: 11px; color: var(--t1); }
.mkt-chg   { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.mkt-chg.up   { color: var(--green); }
.mkt-chg.down { color: var(--red); }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-pill {
  background: var(--bg-2);
  border: 1px solid var(--b2);
  color: var(--t2);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  transition: all .15s;
}
.tag-pill:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==============================
   LOAD MORE
============================== */
.load-more-wrap { text-align: center; margin: 24px 0 0; }
.btn-more {
  background: var(--bg-card);
  border: 1px solid var(--b2);
  color: var(--t2);
  font-size: 13px; font-weight: 600;
  padding: 9px 30px;
  border-radius: 5px;
  transition: all .15s;
  display: inline-block;
}
.btn-more:hover { background: var(--bg-hover); color: var(--t1); border-color: var(--accent); color: var(--accent); }

/* Pagination */
.pagination { display: flex; gap: 5px; justify-content: center; margin: 28px 0; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 5px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--b1);
  background: var(--bg-card);
  color: var(--t2);
  transition: all .15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==============================
   SINGLE POST
============================== */
.single-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 44px;
  align-items: start;
}

.single-hd { margin-bottom: 22px; }

.single-title {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.25;
  color: var(--t1);
  letter-spacing: -.4px;
  margin: 10px 0 14px;
}

.single-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--t3); flex-wrap: wrap;
}
.single-meta .by { color: var(--t2); font-weight: 600; }
.single-meta .by:hover { color: var(--accent); }

/* Featured image: 600×340 */
.single-feat {
  border-radius: 7px; overflow: hidden;
  margin-bottom: 26px;
  border: 1px solid var(--b1);
  /* 600×340 aspect ratio */
  aspect-ratio: 600/340;
  background: var(--bg-card);
}
.single-feat img { width: 100%; height: 100%; object-fit: cover; display: block; }

.single-body {
  font-size: 15px; line-height: 1.75; color: #d1d5db;
}
.single-body h2 { font-size: 20px; font-weight: 800; color: var(--t1); margin: 28px 0 12px; }
.single-body h3 { font-size: 17px; font-weight: 700; color: var(--t1); margin: 24px 0 10px; }
.single-body p  { margin-bottom: 18px; }
.single-body a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.single-body a:hover { color: #60a5fa; }
.single-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 18px;
  margin: 22px 0;
  background: rgba(59,130,246,.05);
  border-radius: 0 5px 5px 0;
  font-style: italic;
  color: var(--t2);
}
.single-body ul, .single-body ol { padding-left: 22px; margin-bottom: 18px; }
.single-body li { margin-bottom: 6px; }
.single-body ul li { list-style: disc; }
.single-body img { border-radius: 6px; margin: 20px 0; border: 1px solid var(--b1); }
.single-body pre {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  border-radius: 6px;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  margin: 18px 0;
}
.single-body code {
  background: var(--bg-2);
  border: 1px solid var(--b1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}

/* Share */
.share-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--b1);
  border-bottom: 1px solid var(--b1);
  margin: 24px 0;
  flex-wrap: wrap;
}
.share-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--t3); }
.share-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--b2);
  background: var(--bg-card);
  color: var(--t2);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Post tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.post-tag {
  font-size: 11px; color: var(--t3);
  border: 1px solid var(--b1);
  padding: 3px 10px; border-radius: 3px;
  transition: all .15s;
}
.post-tag:hover { color: var(--accent); border-color: var(--accent); }

/* Related */
.related-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--b1);
}
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 16px; }

/* ==============================
   ARCHIVE
============================== */
.archive-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}
.archive-hd {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--b1);
}
.archive-eyebrow {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--accent); margin-bottom: 6px;
}
.archive-title {
  font-size: 26px; font-weight: 900;
  color: var(--t1); letter-spacing: -.3px;
}
.archive-desc { font-size: 13px; color: var(--t2); margin-top: 6px; }

/* ==============================
   FOOTER — 3 cols × 3 links
============================== */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--b1);
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 44px 20px 32px;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 36px;
  border-bottom: 1px solid var(--b1);
}

.footer-brand .site-logo { margin-bottom: 12px; }
.footer-brand p {
  font-size: 12px; color: var(--t3);
  line-height: 1.6; max-width: 240px;
  margin-bottom: 16px;
}
.footer-socials { display: flex; gap: 9px; }
.footer-socials a {
  width: 32px; height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--b1);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--t3);
  transition: all .15s;
}
.footer-socials a:hover { border-color: var(--accent); color: var(--accent); }

.footer-col h4 {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--t2); margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a { font-size: 13px; color: var(--t3); transition: color .15s; }
.footer-col ul li a:hover { color: var(--t1); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px; color: var(--t4);
  flex-wrap: wrap; gap: 10px;
}
.footer-bottom a { color: var(--t3); }
.footer-bottom a:hover { color: var(--t1); }

/* ==============================
   MOBILE NAV OVERLAY
============================== */
#mob-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--b1);
  z-index: 99;
  padding: 12px 20px 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
#mob-menu a {
  display: block;
  padding: 10px 0;
  font-size: 15px; font-weight: 600;
  color: var(--t2);
  border-bottom: 1px solid var(--b1);
}
#mob-menu a:hover { color: var(--t1); }

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 1024px) {
  .two-col,
  .single-wrap,
  .archive-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .main-nav, .hdr-search { display: none; }
  .mob-toggle { display: block; }
  .hero-card  { grid-template-columns: 1fr; }
  .hero-img   { height: 220px; aspect-ratio: unset; display: block; }
  .news-grid  { grid-template-columns: repeat(2,1fr); }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .news-grid  { grid-template-columns: 1fr; }
  .hero-title { font-size: 17px; }
  .single-title { font-size: 22px; }
  .footer-inner { grid-template-columns: 1fr; }
}
