/* ═══════════════════════════════════════════════
   молли.dev — общие стили
   ═══════════════════════════════════════════════ */

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

:root {
  --bg:         #0d0f14;
  --surface:    #161a23;
  --surface2:   #1c2030;
  --border:     #242838;
  --accent:     #7c8fff;
  --accent-dim: #4a55cc;
  --text:       #e4e8f5;
  --muted:      #8892aa;
  --green:      #4ade80;
  --orange:     #fb923c;
  --pink:       #f472b6;
  --yellow:     #fbbf24;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(13,15,20,.93);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo-cat { font-size: 1.3rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.8rem; font-size: .88rem; }
.nav-links a { color: var(--muted); transition: color .15s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-rss {
  font-size: .8rem;
  color: var(--orange);
  border: 1px solid rgba(251,146,60,.35);
  padding: .35rem .9rem;
  border-radius: 6px;
  transition: background .15s;
}
.nav-rss:hover { background: rgba(251,146,60,.1); text-decoration: none; }

/* ── TAGS / BADGES ── */
.tag {
  font-size: .74rem;
  font-weight: 600;
  padding: .2rem .7rem;
  border-radius: 999px;
  border: 1px solid;
}
.tag-py  { color: #4fc3f7; border-color: rgba(79,195,247,.3);  background: rgba(79,195,247,.07); }
.tag-rs  { color: #ff8a65; border-color: rgba(255,138,101,.3); background: rgba(255,138,101,.07); }
.tag-go  { color: #80cbc4; border-color: rgba(128,203,196,.3); background: rgba(128,203,196,.07); }
.tag-ts  { color: #7c8fff; border-color: rgba(124,143,255,.3); background: rgba(124,143,255,.07); }
.tag-lua { color: #ce93d8; border-color: rgba(206,147,216,.3); background: rgba(206,147,216,.07); }
.tag-sh  { color: #a5d6a7; border-color: rgba(165,214,167,.3); background: rgba(165,214,167,.07); }

/* ── LANGUAGE PILLS (for post cards) ── */
.post-lang {
  font-weight: 700;
  font-size: .72rem;
  padding: .15rem .55rem;
  border-radius: 4px;
}
.lang-py  { background: rgba(79,195,247,.15);  color: #4fc3f7; }
.lang-rs  { background: rgba(255,138,101,.15); color: #ff8a65; }
.lang-go  { background: rgba(128,203,196,.15); color: #80cbc4; }
.lang-ts  { background: rgba(124,143,255,.15); color: #7c8fff; }
.lang-lua { background: rgba(206,147,216,.15); color: #ce93d8; }
.lang-sh  { background: rgba(165,214,167,.15); color: #a5d6a7; }

/* ── CARDS ── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s;
}
.post-card:hover { border-color: var(--accent-dim); }
.post-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .7rem;
}
.post-card h3 {
  font-size: 1.07rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .4rem;
  line-height: 1.35;
}
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
}
.read-more { color: var(--accent); }
.post-reactions { display: flex; gap: .8rem; }
.react { display: flex; align-items: center; gap: .3rem; font-size: .82rem; }

/* ── CODE ── */
.post-code, pre {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  font-size: .8rem;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  overflow-x: auto;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.kw  { color: #79b8ff; }
.fn  { color: #e1c984; }
.str { color: #9ecbff; }
.cm  { color: #555f70; font-style: italic; }
.tp  { color: #b5cea8; }
.op  { color: #d4d4d4; }
.num { color: #b5cea8; }
.mac { color: #ff8a65; }

/* code filename bar */
.code-file {
  background: #0a0c10;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: .5rem 1.1rem;
  font-size: .74rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}
.code-file + pre { border-radius: 0 0 8px 8px; margin-top: 0; }

/* ── SIDEBAR ── */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem;
}
.widget-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .84rem;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--muted); }
.stat-val { font-weight: 600; }
.lang-bar-wrap { display: flex; flex-direction: column; gap: .6rem; }
.lang-bar-item { font-size: .82rem; }
.lang-bar-label { display: flex; justify-content: space-between; margin-bottom: .25rem; color: var(--muted); }
.lang-bar-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.lang-bar-fill { height: 100%; border-radius: 3px; }
.link-list { display: flex; flex-direction: column; gap: .55rem; }
.link-item { font-size: .84rem; display: flex; align-items: flex-start; gap: .5rem; }
.link-item::before { content: "↗"; color: var(--muted); flex-shrink: 0; margin-top: .05rem; }
.link-item a { color: var(--text); }
.link-item a:hover { color: var(--accent); }
.link-item .link-src { color: var(--muted); font-size: .75rem; display: block; }

/* ── MISC ── */
hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-size: .8rem;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); text-decoration: none; }
.footer-links { display: flex; gap: 1.4rem; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  nav { padding: .9rem 1rem; }
  .nav-links { display: none; }
  footer { flex-direction: column; align-items: flex-start; }
}
