/* ===========================
   etuannv.com - Hugo Theme
   =========================== */

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --surface: #1e2130;
  --border: #2a2d3e;
  --accent: #4f8ef7;
  --accent2: #7c6af5;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --green: #34d399;
  --radius: 8px;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

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

/* ---- Navbar ---- */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(15,17,23,0.95);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.navbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}
.nav-links a {
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

/* ---- Container ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
main.container { padding-top: 3rem; padding-bottom: 4rem; }

/* ---- Hero ---- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
}
.hero-desc strong { color: var(--text); }

.cta-buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a7de0; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-outline { border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---- Sections ---- */
.section { margin-bottom: 3.5rem; }
.section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ---- Tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* ---- Post list ---- */
.post-list { display: flex; flex-direction: column; gap: 0.75rem; }
.post-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.post-date { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; font-family: var(--font-mono); }
.post-item a { color: var(--text); font-size: 0.95rem; }
.post-item a:hover { color: var(--accent); }

/* ---- Page header ---- */
.page-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2rem; font-weight: 700; }

/* ---- Single post ---- */
.post { max-width: 720px; }
.post-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-header h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.5px; }
.post-header time { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-mono); display: block; margin-bottom: 0.75rem; }

/* ---- Post content ---- */
.post-content h2 { font-size: 1.4rem; margin: 2rem 0 1rem; color: var(--text); }
.post-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; color: var(--text); }
.post-content p { margin-bottom: 1.25rem; color: var(--text); }
.post-content ul, .post-content ol { margin: 1rem 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content a { color: var(--accent); }
.post-content strong { color: var(--text); font-weight: 600; }

.post-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--green);
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}
.post-content th { background: var(--surface); font-weight: 600; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .nav-links { gap: 0 }
  .nav-links a { padding: 0.35rem 0.5rem; font-size: 0.82rem; }
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 2rem 0; }
}
