/* ═══════════════════════════════════════════
   Tejal's Blog — Custom Theme v2
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0a0a0a;
  --surface:   #111;
  --elevated:  #1a1a1a;
  --border:    #1e1e1e;
  --border-lt: #2a2a2a;

  --text:      #cdc8c2;
  --heading:   #f0ebe5;
  --muted:     #6e6e6e;
  --faint:     #333;

  --accent:    #d4915a;
  --accent-h:  #e8a36e;
  --accent-dim: rgba(212, 145, 90, 0.08);
  --accent-bdr: rgba(212, 145, 90, 0.18);
  --link:      #7cb8e8;
  --link-h:    #a0d0f8;

  --code-bg:   #141414;
  --code-text: #d4915a;

  --font-display: 'Outfit', sans-serif;
  --font-body:    'Newsreader', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', monospace;

  --max-w:     660px;
  --gap:       1.5rem;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-h); }

img { max-width: 100%; height: auto; border-radius: 6px; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── Header ───────────────────────────────── */
.site-header {
  position: relative;
  padding: 1.5rem 0;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-lt) 20%,
    var(--accent-bdr) 50%,
    var(--border-lt) 80%,
    transparent 100%
  );
}
.site-header .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--heading);
  letter-spacing: -0.02em;
}
.site-logo:hover { color: var(--heading); text-decoration: none; }
.site-logo .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 1.75rem;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--heading); text-decoration: none; }

/* ── Main ─────────────────────────────────── */
.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--gap) 4rem;
  flex: 1;
  width: 100%;
}

/* ── Homepage ─────────────────────────────── */
.home-intro {
  margin-bottom: 3.5rem;
}
.home-intro h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.home-intro p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 540px;
}

.posts-section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.post-list {
  list-style: none;
}
.post-item {
  position: relative;
  padding: 1.5rem 1.25rem;
  margin: 0 -1.25rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.post-item:hover {
  background: var(--surface);
}
.post-item + .post-item {
  border-top: 1px solid var(--border);
}
.post-item:hover + .post-item,
.post-item + .post-item:hover {
  border-top-color: transparent;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.post-reading-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
}
.post-reading-time::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--faint);
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.post-item h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.post-item h2 a {
  color: var(--heading);
  transition: color 0.15s ease;
}
.post-item h2 a:hover { color: var(--accent-h); text-decoration: none; }

.post-excerpt {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.post-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-bdr);
  padding: 0.15em 0.55em;
  border-radius: 3px;
}

/* ── Post (single) ────────────────────────── */
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.post-header .post-meta-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.post-header time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.post-header .reading-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--faint);
}
.post-header h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* ── Post content ─────────────────────────── */
.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--heading);
  margin: 2.75rem 0 1rem;
  letter-spacing: -0.02em;
}
.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 2.25rem 0 0.75rem;
}
.post-content p {
  margin-bottom: 1.3rem;
}
.post-content ul, .post-content ol {
  margin: 0 0 1.3rem 1.5rem;
}
.post-content li {
  margin-bottom: 0.35rem;
}
.post-content strong {
  color: var(--heading);
  font-weight: 500;
}
.post-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(124, 184, 232, 0.3);
}
.post-content a:hover {
  text-decoration-color: var(--link-h);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-style: italic;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Tables ───────────────────────────────── */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}
.post-content th {
  text-align: left;
  border-bottom: 2px solid var(--border-lt);
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
}
.post-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
}

/* ── Code ─────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.65;
}

/* ── Page layout ──────────────────────────── */
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* ── Post nav ─────────────────────────────── */
.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.post-nav a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  max-width: 45%;
  transition: color 0.15s ease;
}
.post-nav a:hover { color: var(--accent-h); }
.post-nav .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.25rem;
  color: var(--faint);
}
.post-nav .next { text-align: right; }

/* ── Back link ────────────────────────────── */
.back-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 2rem;
  transition: color 0.15s ease, gap 0.15s ease;
}
.back-link:hover { color: var(--heading); text-decoration: none; gap: 0.6em; }
.back-link::before {
  content: '\2190';
}

/* ── Footer ───────────────────────────────── */
.site-footer {
  position: relative;
  padding: 2rem 0;
  text-align: center;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-lt) 20%,
    var(--accent-bdr) 50%,
    var(--border-lt) 80%,
    transparent 100%
  );
}
.site-footer p {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover { color: var(--heading); }

/* ── Responsive ───────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-header .inner { flex-wrap: wrap; gap: 0.5rem; }
  .site-nav a { margin-left: 1rem; }
  .home-intro h1 { font-size: 1.65rem; }
  .post-header h1 { font-size: 1.6rem; }
  .site-main { padding: 2rem var(--gap) 3rem; }
  .post-item { padding: 1.25rem 0; margin: 0; }
  .post-item:hover { background: none; }
  pre { padding: 1rem; }
}

/* ═══════════════════════════════════════════
   Syntax Highlighting (Rouge / Pygments)
   Dark theme matched to blog palette
   ═══════════════════════════════════════════ */

/* ── Comments ── */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cp,
.highlight .ch,
.highlight .cpf   { color: #6a6a5a; font-style: italic; }

/* ── Strings ── */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sh,
.highlight .sd,
.highlight .se,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss,
.highlight .dl   { color: #a8c97e; }

/* ── Keywords ── */
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt   { color: #d4915a; font-weight: 500; }

/* ── Numbers ── */
.highlight .m,
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il   { color: #c9a0dc; }

/* ── Functions / Names ── */
.highlight .nf,
.highlight .fm   { color: #7cb8e8; }
.highlight .nc,
.highlight .nn   { color: #e8a36e; }
.highlight .na   { color: #7cb8e8; }

/* ── Operators / Punctuation ── */
.highlight .o,
.highlight .ow   { color: #d4915a; }
.highlight .p    { color: #cdc8c2; }

/* ── Variables / Names ── */
.highlight .n,
.highlight .nb,
.highlight .ni,
.highlight .ne,
.highlight .no,
.highlight .nv,
.highlight .bp,
.highlight .vc,
.highlight .vg,
.highlight .vi   { color: #cdc8c2; }

/* ── Other tokens ── */
.highlight .nt   { color: #d4915a; }
.highlight .nd   { color: #c9a0dc; }
.highlight .err  { color: #f07178; }
.highlight .gd   { color: #f07178; }
.highlight .gi   { color: #a8c97e; }
.highlight .w    { color: #cdc8c2; }

/* ── Diff highlighting ── */
.highlight .gd .x { background: rgba(240, 113, 120, 0.15); }
.highlight .gi .x { background: rgba(168, 201, 126, 0.15); }

