/* ── Jugaadoos Ghost Theme ───────────────────────────────────────────────── */

/* Variables */
:root {
  --bg:         #ffffff;
  --bg2:        #f8fafc;
  --surface:    #f1f5f9;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --text-muted: #64748b;
  --accent:     #3b82f6;
  --accent-h:   #2563eb;
  --card-bg:    #ffffff;
  --header-bg:  rgba(255,255,255,0.92);
  --code-bg:    #f1f5f9;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

[data-theme="dark"] {
  --bg:         #07090f;
  --bg2:        #0d1117;
  --surface:    #141728;
  --border:     #1e2535;
  --text:       #e2e8f0;
  --text-muted: #64748b;
  --accent:     #3b82f6;
  --accent-h:   #60a5fa;
  --card-bg:    #0d1117;
  --header-bg:  rgba(7,9,15,0.92);
  --code-bg:    #141728;
  --shadow:     0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #07090f;
    --bg2:        #0d1117;
    --surface:    #141728;
    --border:     #1e2535;
    --text:       #e2e8f0;
    --text-muted: #64748b;
    --accent:     #3b82f6;
    --accent-h:   #60a5fa;
    --card-bg:    #0d1117;
    --header-bg:  rgba(7,9,15,0.92);
    --code-bg:    #141728;
    --shadow:     0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  transition: background .2s, color .2s;
}

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

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
}

.logo-text span { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.header-nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .15s, border-color .15s;
}

.theme-toggle:hover { background: var(--border); color: var(--text); }

.icon-sun, .icon-moon { line-height: 1; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: block; }
.icon-sun  { display: block; }
.icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun  { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.btn-subscribe {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-subscribe:hover { background: var(--accent-h); color: #fff; }

/* ── Hero (homepage) ── */
.site-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px;
  text-align: center;
}

.hero-inner { max-width: 680px; margin: 0 auto; }

.hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Main layout ── */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px;
}

/* ── Post grid ── */
.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Featured post — full width */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.post-card.featured .post-card-image-link {
  aspect-ratio: unset;
  height: 100%;
  min-height: 260px;
}

.post-card.featured .post-card-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 700px) {
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card.featured .post-card-image-link { min-height: 220px; }
}

/* Regular card */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.post-card-image-link {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface);
}

.post-card-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.post-card:hover .post-card-image-link img { transform: scale(1.04); }

.post-card-content { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.post-card-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
  text-wrap: balance;
}

.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--accent); }

.post-card.featured .post-card-title { font-size: 26px; }

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.post-card-author-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}

.post-card-author-name { font-weight: 600; color: var(--text); }
.post-card-date::before { content: '·'; margin-right: 10px; }

/* ── Section heading ── */
.section-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.pagination a, .pagination span {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card-bg);
  text-decoration: none;
  transition: background .15s;
}

.pagination a:hover { background: var(--surface); }
.pagination .pagination-location { border: none; background: none; color: var(--text-muted); font-weight: 400; }

/* ── Single post ── */
.post-full {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.post-full-header { margin-bottom: 40px; }

.post-full-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.post-full-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.post-full-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 20px;
}

.post-full-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.post-full-author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.post-full-author-name { font-weight: 600; color: var(--text); }

.post-full-feature-image {
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  margin-bottom: 40px;
  overflow: hidden;
}

/* Post content typography */
.gh-content { font-size: 17px; line-height: 1.8; color: var(--text); }
.gh-content h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 40px 0 16px; }
.gh-content h3 { font-size: 20px; font-weight: 700; color: var(--text); margin: 32px 0 12px; }
.gh-content p  { margin-bottom: 24px; }
.gh-content ul, .gh-content ol { padding-left: 24px; margin-bottom: 24px; }
.gh-content li { margin-bottom: 8px; }
.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  color: var(--text-muted);
  font-style: italic;
  margin: 32px 0;
}
.gh-content code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: var(--code-bg);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.gh-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.gh-content pre code { background: none; border: none; padding: 0; color: var(--text); }
.gh-content img { border-radius: 10px; margin: 32px 0; }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── Footer ── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy { font-size: 13px; color: var(--text-muted); }
.footer-copy a { color: var(--text-muted); }
.footer-copy a:hover { color: var(--accent); }

.footer-nav { display: flex; gap: 20px; list-style: none; }
.footer-nav a { font-size: 13px; color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .post-feed { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
