/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --blue:       #0078d4;
  --blue-dark:  #005a9e;
  --purple:     #7c3aed;
  --green:      #059669;
  --amber:      #d97706;
  --cyan:       #0891b2;
  --red:        #dc2626;
  --orange:     #ea580c;
  --slate:      #475569;

  --header-bg:  #0f172a;
  --header-txt: #f1f5f9;
  --topbar-bg:  #1e293b;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #e2e8f0;

  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --max-w:      1240px;
  --gap:        20px;
}

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

/* ─── Layout Utilities ───────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Category Color Map ─────────────────────────────────────── */
.cat-news       { background: var(--blue);   color: #fff; }
.cat-windows-11 { background: var(--purple); color: #fff; }
.cat-deals      { background: var(--green);  color: #fff; }
.cat-how-to     { background: var(--amber);  color: #fff; }
.cat-software   { background: var(--cyan);   color: #fff; }
.cat-updates    { background: var(--red);    color: #fff; }
.cat-reviews    { background: var(--orange); color: #fff; }
.cat-general    { background: var(--slate);  color: #fff; }

.cat-border-news       { border-color: var(--blue);   }
.cat-border-windows-11 { border-color: var(--purple); }
.cat-border-deals      { border-color: var(--green);  }
.cat-border-how-to     { border-color: var(--amber);  }
.cat-border-software   { border-color: var(--cyan);   }
.cat-border-updates    { border-color: var(--red);    }
.cat-border-reviews    { border-color: var(--orange); }
.cat-border-general    { border-color: var(--slate);  }

/* ─── Top Bar ────────────────────────────────────────────────── */
.topbar {
  background: var(--topbar-bg);
  padding: 6px 0;
  font-size: .75rem;
  color: #94a3b8;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-date { white-space: nowrap; }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a { color: #94a3b8; transition: color .2s; }
.topbar-links a:hover { color: #f1f5f9; }

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .95rem;
  color: #fff;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.site-logo-text { line-height: 1; }
.site-logo-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -.3px;
}
.site-logo-tagline {
  font-size: .65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-search {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  font-size: 1rem;
}
.btn-search:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  align-items: center; justify-content: center;
  font-size: 1.2rem;
  transition: all .2s;
}
.btn-hamburger:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ─── Search Overlay ─────────────────────────────────────────── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.92);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}
.search-overlay.open { display: flex; }
.search-box {
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
}
.search-box form { position: relative; }
.search-box input {
  width: 100%;
  padding: 16px 52px 16px 20px;
  background: #1e293b;
  border: 2px solid var(--blue);
  border-radius: 12px;
  color: #f1f5f9;
  font-size: 1.1rem;
  font-family: var(--font);
  outline: none;
}
.search-box input::placeholder { color: #475569; }
.search-box button[type=submit] {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--blue); font-size: 1.2rem; padding: 4px;
}
.search-close {
  position: absolute; top: 20px; right: 20px;
  color: #94a3b8; font-size: 1.5rem; padding: 8px;
  transition: color .2s;
}
.search-close:hover { color: #fff; }

/* ─── Navigation ─────────────────────────────────────────────── */
.site-nav {
  background: #1a2744;
  border-top: 1px solid rgba(255,255,255,.06);
}
.site-nav .container { position: relative; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list > li { flex-shrink: 0; }
.nav-list > li > a {
  display: block;
  padding: 12px 16px;
  color: #cbd5e1;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .2px;
  transition: all .2s;
  border-bottom: 3px solid transparent;
  position: relative;
}
.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a {
  color: #fff;
  border-bottom-color: var(--blue);
}
.nav-list > li.cat-nav-deals > a:hover,
.nav-list > li.cat-nav-deals.current-menu-item > a {
  border-bottom-color: var(--green);
}
.nav-list > li.cat-nav-windows-11 > a:hover,
.nav-list > li.cat-nav-windows-11.current-menu-item > a {
  border-bottom-color: var(--purple);
}
.nav-list > li.cat-nav-how-to > a:hover,
.nav-list > li.cat-nav-how-to.current-menu-item > a {
  border-bottom-color: var(--amber);
}

/* ─── Breaking Ticker ────────────────────────────────────────── */
.breaking-bar {
  background: var(--blue);
  padding: 8px 0;
  overflow: hidden;
}
.breaking-inner { display: flex; align-items: center; gap: 0; overflow: hidden; }
.breaking-label {
  background: #fff;
  color: var(--blue);
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-right: 16px;
}
.breaking-scroller {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.breaking-track {
  display: inline-flex;
  gap: 40px;
  animation: ticker 40s linear infinite;
}
.breaking-track:hover { animation-play-state: paused; }
.breaking-track a {
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  opacity: .92;
  transition: opacity .2s;
}
.breaking-track a:hover { opacity: 1; color: #fff; text-decoration: underline; }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── Hero Section ───────────────────────────────────────────── */
.hero-section { padding: 24px 0 8px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: auto auto;
  gap: 16px;
}
.hero-main { grid-row: 1 / 3; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.hero-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  flex-shrink: 0;
}
.hero-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hero-card .post-cat { font-size: .7rem; margin-bottom: 10px; }
.hero-card .post-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 10px;
  flex: 1;
}
.hero-card .post-title:hover { color: var(--blue); }
.hero-card .post-excerpt {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-side { display: flex; flex-direction: column; }
.hero-small {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hero-small:first-child { margin-bottom: 16px; }
.hero-small-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.hero-small-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.hero-small-body { padding: 14px 16px; flex: 1; }
.hero-small .post-cat { font-size: .65rem; margin-bottom: 8px; }
.hero-small .post-title {
  font-size: 1.0rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-small .post-title:hover { color: var(--blue); }
.hero-small .post-meta { margin-top: 8px; }

/* ─── Post Meta ──────────────────────────────────────────────── */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .75rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.post-meta-sep::before { content: '·'; }

/* ─── Post Category Badge ────────────────────────────────────── */
.post-cat {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ─── Section Header ─────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--border);
  position: relative;
}
.section-header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--blue);
}
.section-header.sh-purple::after { background: var(--purple); }
.section-header.sh-green::after  { background: var(--green); }
.section-header.sh-amber::after  { background: var(--amber); }
.section-header.sh-cyan::after   { background: var(--cyan); }
.section-header.sh-red::after    { background: var(--red); }
.section-header.sh-orange::after { background: var(--orange); }

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  display: inline-block;
}
.section-title-dot.dot-purple { background: var(--purple); }
.section-title-dot.dot-green  { background: var(--green); }
.section-title-dot.dot-amber  { background: var(--amber); }
.section-title-dot.dot-cyan   { background: var(--cyan); }
.section-title-dot.dot-red    { background: var(--red); }
.section-title-dot.dot-orange { background: var(--orange); }

.section-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s;
}
.section-link:hover { gap: 8px; color: var(--blue); }

/* ─── Category Sections ──────────────────────────────────────── */
.cat-section { padding: 28px 0; }
.cat-section + .cat-section { padding-top: 4px; }

/* ─── Post Card ──────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.post-card-img-wrap {
  overflow: hidden;
  flex-shrink: 0;
}
.post-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .post-card-img { transform: scale(1.04); }
.post-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-size: 2rem;
}
.post-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-card-title {
  font-size: .97rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.post-card-title:hover { color: var(--blue); }
.post-card-excerpt {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Mixed Hero Row (first cat section) ────────────────────── */
.mixed-hero {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--gap);
}
.mixed-hero .post-card:first-child {
  grid-column: span 2;
}
.mixed-hero .post-card:first-child .post-card-title {
  font-size: 1.15rem;
  -webkit-line-clamp: 4;
}

/* ─── Ad Banner ──────────────────────────────────────────────── */
.ad-section {
  background: var(--bg);
  padding: 20px 0;
  text-align: center;
}
.ad-label {
  font-size: .65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}
.ad-slot {
  display: inline-block;
  min-height: 90px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.ad-slot-banner { width: 100%; max-width: 728px; min-height: 90px; }
.ad-slot-rect   { width: 300px; min-height: 250px; }

/* ─── Latest Posts ───────────────────────────────────────────── */
.latest-section { padding: 28px 0 40px; }
.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 0;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text);
  transition: all .2s;
  background: var(--surface);
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination .current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.pagination .dots { border-color: transparent; background: none; }
.pagination .prev, .pagination .next { width: auto; padding: 0 14px; gap: 6px; }

/* ─── Archive / Category Page ────────────────────────────────── */
.archive-header {
  background: var(--header-bg);
  padding: 40px 0 32px;
  margin-bottom: 32px;
}
.archive-cat-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
}
.archive-title {
  font-size: 2rem;
  font-weight: 900;
  color: #f1f5f9;
  line-height: 1.2;
  margin-bottom: 8px;
}
.archive-desc {
  color: #94a3b8;
  font-size: .95rem;
  max-width: 560px;
}
.archive-count {
  color: #64748b;
  font-size: .82rem;
  margin-top: 4px;
}
.archive-grid { padding: 0 0 40px; }

/* ─── Single Post ─────────────────────────────────────────────── */
.single-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding: 32px 0 60px;
  align-items: start;
}
.single-header { margin-bottom: 24px; }
.single-header .post-cat { margin-bottom: 12px; }
.single-title {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -.3px;
}
.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.single-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
}
.single-meta-item .icon { color: var(--blue); font-size: .9rem; }

.single-featured {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}
.single-featured img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.post-content {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2d3748;
}
.post-content h2 {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 32px 0 12px;
  line-height: 1.3;
}
.post-content h3 {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}
.post-content p { margin-bottom: 20px; }
.post-content ul, .post-content ol {
  margin: 0 0 20px 24px;
  list-style: disc;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--blue); text-decoration: underline; }
.post-content a:hover { color: var(--blue-dark); }
.post-content blockquote {
  border-left: 4px solid var(--blue);
  padding: 12px 20px;
  background: #f8faff;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text);
}
.post-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
  font-family: 'Consolas', 'Monaco', monospace;
  color: #c2185b;
}
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: .9rem;
  line-height: 1.6;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
  box-shadow: var(--shadow-md);
}
.post-content .wp-caption { margin: 24px 0; }
.post-content .wp-caption-text {
  font-family: var(--font);
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}
.post-content figure { margin: 24px 0; }
.post-content figcaption {
  font-family: var(--font);
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

/* Post inline ad */
.post-ad-inline {
  margin: 28px 0;
  text-align: center;
  font-family: var(--font);
}

/* Post tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.post-tags-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.tag-link {
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem;
  color: var(--text);
  transition: all .2s;
}
.tag-link:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Share buttons */
.post-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
}
.post-share-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}
.share-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  cursor: pointer;
}
.share-twitter  { background: #000;   color: #fff; }
.share-facebook { background: #1877f2; color: #fff; }
.share-copy     { background: var(--border); color: var(--text); border: 1px solid var(--border); }
.share-btn:hover { opacity: .85; color: inherit; }

/* Related posts */
.related-posts { margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--border); }
.related-posts .section-title { font-size: 1.1rem; margin-bottom: 20px; }

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.widget-title {
  padding: 14px 16px;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #fff;
  background: var(--header-bg);
}
.widget-content { padding: 0; }

.widget-post {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.widget-post:last-child { border-bottom: none; }
.widget-post:hover { background: var(--bg); }
.widget-post-thumb {
  width: 76px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.widget-post-thumb-placeholder {
  width: 76px;
  height: 48px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 4px;
  flex-shrink: 0;
}
.widget-post-title {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-post-title:hover { color: var(--blue); }
.widget-post-date {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Widget: Categories */
.widget-cat-list {}
.widget-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.widget-cat-item:last-child { border-bottom: none; }
.widget-cat-item:hover { background: var(--bg); }
.widget-cat-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
}
.widget-cat-link:hover { color: var(--blue); }
.widget-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.widget-cat-count {
  font-size: .75rem;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* Widget: Ad */
.widget-ad { text-align: center; padding: 16px; }

/* ─── Page Template ───────────────────────────────────────────── */
.page-wrap { padding: 40px 0 60px; }
.page-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--blue);
}
.page-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 780px;
}
.page-content h2 { font-size: 1.4rem; font-weight: 800; margin: 28px 0 10px; }
.page-content h3 { font-size: 1.15rem; font-weight: 700; margin: 20px 0 8px; }
.page-content p  { margin-bottom: 16px; }
.page-content a  { color: var(--blue); text-decoration: underline; }
.page-content ul, .page-content ol { margin: 0 0 16px 24px; }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }
.page-content li { margin-bottom: 6px; }

/* ─── Search Results ──────────────────────────────────────────── */
.search-header { padding: 32px 0 24px; }
.search-header h1 { font-size: 1.6rem; font-weight: 800; }
.search-header p  { color: var(--muted); margin-top: 6px; }
.search-no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.search-no-results h2 { font-size: 1.4rem; margin-bottom: 12px; color: var(--text); }
.search-no-results .search-form { max-width: 420px; margin: 24px auto 0; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .2s;
}
.search-form input:focus { border-color: var(--blue); }
.search-form button {
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--font);
  transition: background .2s;
}
.search-form button:hover { background: var(--blue-dark); }

/* ─── 404 Page ────────────────────────────────────────────────── */
.notfound-wrap {
  text-align: center;
  padding: 100px 20px;
}
.notfound-code {
  font-size: 8rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}
.notfound-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.notfound-text { color: var(--muted); margin-bottom: 32px; }
.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s;
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--header-bg);
  color: #94a3b8;
  padding: 48px 0 0;
  margin-top: 16px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .site-logo { margin-bottom: 16px; }
.footer-brand p {
  font-size: .85rem;
  line-height: 1.7;
  max-width: 280px;
  margin-bottom: 20px;
}
.footer-social {
  display: flex;
  gap: 10px;
}
.social-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  transition: all .2s;
}
.social-btn:hover {
  background: var(--blue);
  color: #fff;
}
.footer-col h4 {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #f1f5f9;
  margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: .855rem;
  color: #94a3b8;
  transition: color .2s;
}
.footer-col ul li a:hover { color: #f1f5f9; }

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { font-size: .8rem; }
.footer-bottom-links {
  display: flex;
  gap: 16px;
}
.footer-bottom-links a {
  font-size: .8rem;
  color: #64748b;
  transition: color .2s;
}
.footer-bottom-links a:hover { color: #94a3b8; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr 320px; }
  .grid-4, .mixed-hero { grid-template-columns: repeat(3, 1fr); }
  .mixed-hero .post-card:first-child { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: span 2; }
}

@media (max-width: 900px) {
  .single-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .hero-main { grid-row: auto; }
  .hero-side { flex-direction: row; gap: 16px; }
  .hero-small:first-child { margin-bottom: 0; }
  .grid-4, .mixed-hero { grid-template-columns: repeat(2, 1fr); }
  .mixed-hero .post-card:first-child { grid-column: span 2; }
  .latest-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar { display: none; }
  .breaking-bar { display: none; }
  .btn-hamburger { display: flex; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav.open .nav-list { flex-direction: column; gap: 0; }
  .site-nav.open .nav-list > li > a {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    border-left: 3px solid transparent;
  }
  .site-nav.open .nav-list > li > a:hover { border-left-color: var(--blue); border-bottom-color: rgba(255,255,255,.06); }
  .hero-side { flex-direction: column; }
  .grid-2, .grid-3, .grid-4, .mixed-hero, .latest-grid {
    grid-template-columns: 1fr;
  }
  .mixed-hero .post-card:first-child { grid-column: span 1; }
  .hero-card .post-title { font-size: 1.2rem; }
  .single-title { font-size: 1.45rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .archive-title { font-size: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .post-share { flex-wrap: wrap; }
  .hero-grid { gap: 12px; }
}

/* ─── Dark Mode ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --header-bg: #020617;
    --topbar-bg: #0f172a;
  }
  .post-content { color: #e2e8f0; }
  .post-content blockquote { background: #1e293b; }
  .post-content code { background: #334155; color: #f472b6; }
  .post-share { background: #0f172a; }
  .tag-link { background: #334155; border-color: #475569; }
  .archive-header { background: #020617; }
  .search-form input { background: #1e293b; border-color: #334155; color: #f1f5f9; }
  .search-form input::placeholder { color: #475569; }
  .breaking-bar { opacity: .9; }
}
