/* === TechEarnHub — Dual theme, cockonavax-inspired, ultra-light === */
/* Dark default + light toggle, card grid, ad-safe class names */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

/* --- Theme variables --- */
:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --card: rgba(255, 255, 255, .03);
  --border: rgba(255, 255, 255, .08);
  --text: #f0f0f0;
  --muted: #888;
  --accent: #00e5ff;
  --accent2: #b040f0;
  --link: #00e5ff;
  --hover-glow: rgba(0, 229, 255, .08);
  --code-bg: rgba(255, 255, 255, .04);
  --tag-color: #00e5ff;
  --shadow: rgba(0, 0, 0, .4);
}

[data-theme="light"] {
  --bg: #f4f4f8;
  --bg2: #fff;
  --card: rgba(0, 0, 0, .02);
  --border: rgba(0, 0, 0, .08);
  --text: #1a1a2e;
  --muted: #777;
  --accent: #4361ee;
  --accent2: #7209b7;
  --link: #4361ee;
  --hover-glow: rgba(67, 97, 238, .07);
  --code-bg: rgba(0, 0, 0, .03);
  --tag-color: #4361ee;
  --shadow: rgba(0, 0, 0, .08);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  transition: background .3s, color .3s
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color .2s
}

a:hover {
  opacity: .85
}

img {
  max-width: 100%;
  height: auto;
  display: block
}

::selection {
  background: var(--accent);
  color: #fff
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px
}

/* --- Header with glass effect --- */
.site-hdr {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px)
}

.hdr-inner {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.site-hdr h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px
}

.site-hdr h1 a {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text
}

.tagline {
  color: var(--muted);
  font-size: 12px
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all .2s
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--hover-glow)
}

/* --- Main grid --- */
.main-grid {
  display: flex;
  gap: 24px;
  padding: 24px 16px
}

.content {
  flex: 1;
  min-width: 0
}

.sidebar {
  width: 260px;
  flex-shrink: 0
}

/* --- Custom zones (ads) — generic names, ad-safe --- */
.custom-zone {
  padding: 8px 0
}

.top-zone,
.bottom-zone {
  text-align: center
}

/* --- Post grid: small boxes with thumbnails --- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px
}

.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex;
  flex-direction: column
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--shadow)
}

.post-card .thumb {
  height: 140px;
  overflow: hidden;
  position: relative;
  background: var(--card)
}

.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s
}

.post-card:hover .thumb img {
  transform: scale(1.05)
}

.post-card .thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, var(--bg2), transparent)
}

.post-card .card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column
}

.post-card .card-tag {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--tag-color);
  letter-spacing: .8px;
  font-weight: 600;
  margin-bottom: 4px
}

.post-card h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.35
}

.post-card h2 a {
  color: var(--text)
}

.post-card h2 a:hover {
  color: var(--accent)
}

.post-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px
}

.post-card .excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.read-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.read-more:hover {
  gap: 6px
}

.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  opacity: .15
}

.empty {
  color: var(--muted);
  padding: 60px 0;
  text-align: center
}

/* --- Single post --- */
.single-post h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
  letter-spacing: -.3px
}

.post-hero {
  margin: 14px 0;
  border-radius: 10px;
  overflow: hidden
}

.post-hero img {
  border-radius: 10px;
  max-height: 400px;
  width: 100%;
  object-fit: cover
}

.post-body {
  font-size: 15px;
  line-height: 1.78;
  color: var(--muted)
}

.post-body h1,
.post-body h2,
.post-body h3 {
  margin: 20px 0 10px;
  color: var(--text);
  font-weight: 700
}

.post-body p,
.post-body ul,
.post-body ol {
  margin-bottom: 14px
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  margin: 14px 0;
  background: var(--code-bg);
  border-radius: 0 8px 8px 0;
  font-style: italic
}

.post-body pre {
  background: var(--code-bg);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  margin: 14px 0;
  border: 1px solid var(--border);
  color: var(--accent)
}

.post-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent2)
}

.post-body img {
  border-radius: 8px;
  margin: 10px 0
}

.post-body a {
  color: var(--link)
}

.post-body li {
  margin-bottom: 4px
}

.back-link {
  padding: 20px 0;
  font-size: 14px
}

.back-link a {
  color: var(--muted)
}

.back-link a:hover {
  color: var(--accent)
}

/* --- Pagination --- */
.pagination {
  display: flex;
  gap: 6px;
  padding: 20px 0;
  flex-wrap: wrap;
  justify-content: center
}

.pagination a,
.pagination .current {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg2);
  color: var(--muted)
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none
}

.pagination .current {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
  font-weight: 700
}

/* --- Footer --- */
.site-ftr {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 20px
}

/* --- Sidebar --- */
.sidebar {
  color: var(--muted);
  font-size: 14px
}

/* --- Responsive --- */
@media(max-width:768px) {
  .main-grid {
    flex-direction: column;
    gap: 16px
  }

  .sidebar {
    width: 100%
  }

  .post-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px
  }

  .post-card .thumb {
    height: 110px
  }

  .single-post h1 {
    font-size: 22px
  }

  .hdr-inner {
    flex-wrap: wrap;
    gap: 8px
  }
}

@media(max-width:400px) {
  .post-grid {
    grid-template-columns: 1fr
  }

  .post-card h2 {
    font-size: 14px
  }

  body {
    font-size: 15px
  }
}