/* ═══════════════════════════════════════════════════
   Nexus Theme — style.css
   ═══════════════════════════════════════════════════ */

/* ── Reset & Variables ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface2:   #22263a;
  --border:     #2e3354;
  --accent:     #6c63ff;
  --accent-h:   #5851e6;
  --text:       #e2e8f0;
  --muted:      #8892a4;
  --link:       #a78bfa;
  --radius:     10px;
  --font:       'Inter', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --max-w:      1180px;
  --sidebar-w:  300px;
  --gap:        28px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
time { color: var(--muted); font-size: 0.82rem; }

/* ── Typography ──────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.3;
  color: var(--text);
  font-weight: 700;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { margin-bottom: 1.1rem; }

/* ── Navbar ──────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 58px;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--link));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none !important;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.navbar-brand:hover {
  opacity: 0.9;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-menu a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all .18s;
  text-decoration: none;
}
.nav-menu a:hover {
  color: var(--text);
  background: var(--surface2);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}

/* ── Wrapper ─────────────────────────────────────── */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ── Layout: Home ────────────────────────────────── */
.single-layout,
.sitemap-layout,
.static-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--gap);
  align-items: start;
}
.home-main,
.single-main,
.sitemap-main,
.static-main { min-width: 0; }

/* ── Post Grid ───────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.post-grid--related { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ── Post Card ───────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1), border-color .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-5px);
  border-color: rgba(108, 99, 255, 0.4);
  box-shadow: 0 12px 30px rgba(108, 99, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.post-card-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--link));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  align-self: flex-start;
}
.post-card-title {
  font-size: 1rem;
  margin-bottom: 8px;
  flex: 1;
}
.post-card-title a { color: var(--text); text-decoration: none; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.read-more { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.read-more:hover { text-decoration: underline; }

.post-card--small .post-card-title { font-size: 0.9rem; }

/* ── Pagination ──────────────────────────────────── */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.pagination a, .btn-next {
  display: inline-block;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all .18s;
}
.pagination a:hover, .btn-next:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.pagination a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Single Post ─────────────────────────────────── */
.post-header { margin-bottom: 24px; }
.post-cat {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.post-header h1 { margin-bottom: 12px; }
.post-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.post-meta a { color: var(--muted); }
.post-meta a:hover { color: var(--accent); }
.post-featured-img {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  aspect-ratio: 16/9;
}
.post-featured-img img { width: 100%; height: 100%; object-fit: cover; }

/* ── Post Body ───────────────────────────────────── */
.post-body { color: var(--text); font-size: 1rem; line-height: 1.8; }
.post-body h2 { margin: 2rem 0 1rem; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.post-body h3 { margin: 1.5rem 0 .75rem; color: var(--accent); }
.post-body p  { margin-bottom: 1.2rem; }
.post-body ul, .post-body ol { margin: 1rem 0 1.2rem 1.5rem; }
.post-body li { margin-bottom: .4rem; }
.post-body strong { color: #fff; font-weight: 700; }
.post-body em { font-style: italic; color: var(--link); }
.post-body a { color: var(--link); text-decoration: underline; }
.post-body a:hover { color: var(--accent); }
.post-body code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.88em;
}
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  color: var(--muted);
}

/* ── Spread Image ────────────────────────────────── */
.post-spread-img {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.post-spread-img img { border-radius: var(--radius); }

/* ── Video ───────────────────────────────────────── */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Share Buttons ───────────────────────────────── */
.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.share-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  transition: opacity .18s;
}
.share-btn:hover { opacity: .85; }
.share-twitter { background: #1da1f2; }
.share-fb      { background: #1877f2; }
.share-wa      { background: #25d366; }

/* ── Related Posts ───────────────────────────────── */
.related-posts { margin-top: 36px; }
.related-posts h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.widget-list { list-style: none; }
.widget-list li {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--text); font-size: 0.875rem; font-weight: 500; }
.widget-list a:hover { color: var(--accent); text-decoration: none; }
.widget-list time { font-size: 0.75rem; }
.widget--author p { padding: 14px 16px; font-size: 0.875rem; color: var(--muted); }


/* ── Hero ────────────────────────────────────────── */
.hero {
  background: radial-gradient(circle at 50% 50%, rgba(108, 99, 255, 0.18) 0%, rgba(30, 27, 75, 0) 70%), linear-gradient(135deg, #090a0f 0%, #1e1b4b 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 20px 48px;
  text-align: center;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.hero-inner { max-width: 600px; margin: 0 auto; position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.hero-sub {
  color: #a5b4fc;
  font-size: 1.05rem;
  margin-bottom: 24px;
}
.hero-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  color: #fff;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.4);
}
.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.6);
  color: #fff;
  text-decoration: none;
}

/* ── Latest Section ──────────────────────────────── */
.latest-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px 20px 48px;
}
.section-head { margin-bottom: 22px; }
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* ── Home: no outer site-wrapper padding needed ─── */
body.page-home .site-wrapper { padding: 0; max-width: none; }

/* ── Ads ─────────────────────────────────────────── */
.ad-wrap { margin: 20px 0; text-align: center; }

/* ── Sitemap ─────────────────────────────────────── */
.sitemap-layout h1 { margin-bottom: 24px; }
.sitemap-section { margin-bottom: 32px; }
.sitemap-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sitemap-list { list-style: none; }
.sitemap-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sitemap-list a { font-size: 0.875rem; }

/* ── Static Pages ────────────────────────────────── */
.static-main h1 { margin-bottom: 20px; }
.static-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── 404 ─────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.error-page h1 { font-size: 6rem; color: var(--accent); line-height: 1; }
.error-page p { color: var(--muted); margin: 16px 0 28px; font-size: 1.1rem; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s;
}
.btn:hover { background: var(--accent-h); text-decoration: none; color: #fff; }

/* ── Footer ──────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { color: var(--muted); font-size: 0.85rem; }
.footer-links {
  list-style: none;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--muted); font-size: 0.82rem; }
.footer-links a:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
  .single-layout,
  .sitemap-layout,
  .static-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: 1; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 58px;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { display: block; }
}

@media (max-width: 560px) {
  .post-grid { grid-template-columns: 1fr; }
  .single-layout,
  .sitemap-layout,
  .static-layout { grid-template-columns: 1fr; }
  :root { --gap: 16px; }
  .site-wrapper { padding: 20px 14px 36px; }
}
