/* ================================================= */
/* CSS VARIABLES                                     */
/* ================================================= */
:root {
  --accent:       #06b6d4;   /* cyan  */
  --accent-dark:  #0891b2;
  --navy:         #0f172a;
  --navy-soft:    #1e293b;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --bg:           #f0f4f8;
  --bg-card:      #ffffff;
  --border:       #e2e8f0;
  --danger:       #ef4444;
  --success:      #22c55e;
}

/* ================================================= */
/* GLOBAL                                            */
/* ================================================= */
body {
  background-color: var(--bg);
  font-family: 'Inter', sans-serif;
  color: var(--text);
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* ================================================= */
/* NAVBAR                                            */
/* ================================================= */
.navbar {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff !important;
}
.navbar-brand .brand-accent {
  color: var(--accent);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.navbar .form-control {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.875rem;
}
.navbar .form-control::placeholder { color: rgba(255,255,255,0.45); }
.navbar .form-control:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.25);
}
.navbar .btn-outline-light {
  font-size: 0.875rem;
  padding: 0.35rem 0.9rem;
  border-color: rgba(255,255,255,0.3);
}
.navbar .btn-outline-light:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ================================================= */
/* HERO / INDEX                                      */
/* ================================================= */
.hero-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(6,182,212,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-card h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; }
.hero-card .lead { color: rgba(255,255,255,0.85); font-size: 1.05rem; }
.hero-card p    { color: rgba(255,255,255,0.65); font-size: 0.95rem; line-height: 1.8; }
.hero-card .hero-badge {
  display: inline-block;
  background: rgba(6,182,212,0.2);
  color: var(--accent);
  border: 1px solid rgba(6,182,212,0.35);
  border-radius: 20px;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Terminal box */
.terminal-box {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-top: 1.5rem;
}
.terminal-box .prompt { color: var(--accent); }
.terminal-box .cmd    { color: #fff; }
.terminal-box .output { color: rgba(255,255,255,0.6); margin-top: 0.25rem; }

/* ================================================= */
/* POST CARDS (index + posts)                        */
/* ================================================= */
.post-card {
  border-left: 3px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.post-card:hover {
  border-left-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}
.post-card .card-title a {
  color: var(--text);
  font-weight: 600;
}
.post-card .card-title a:hover { color: var(--accent-dark); }

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.post-meta .bi { font-size: 0.75rem; }

.read-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  color: var(--text-muted);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ================================================= */
/* BLOG TYPOGRAPHY (view page)                       */
/* ================================================= */
.blog-content {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.9;
  color: #2c3e50;
  max-width: 780px;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  font-family: 'Inter', sans-serif;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--navy);
}

.blog-content p   { margin-bottom: 1.2rem; }
.blog-content ul,
.blog-content ol  { padding-left: 2rem; margin-bottom: 1.2rem; }

.blog-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1rem 0.8rem 1.2rem;
  margin: 1.5rem 0;
  color: #555;
  font-style: italic;
  background: rgba(6,182,212,0.06);
  border-radius: 0 8px 8px 0;
}

.blog-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.blog-content table th {
  background-color: var(--navy);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
}
.blog-content table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
}
.blog-content table tr:nth-child(even) td { background-color: #f8fafc; }

/* Preserve TinyMCE forecolor */
.blog-content span[style] { color: inherit; }

/* ================================================= */
/* CODE BLOCKS — Prism.js                            */
/* ================================================= */
.blog-content pre[class*="language-"] {
  margin: 1.8rem 0;
  border-radius: 10px;
  overflow-x: auto;
  position: relative;
}
.blog-content pre[class*="language-"]::before {
  content: attr(class);
  position: absolute;
  top: 0.5rem; right: 0.8rem;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
}
.blog-content pre[class*="language-"] code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
}
.blog-content :not(pre) > code {
  background-color: #eef1f4;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88rem;
  font-family: 'JetBrains Mono', monospace;
  color: #c7254e;
}
.blog-content pre:not([class]) {
  background: #1e293b;
  color: #cbd5e1;
  padding: 1.2rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.8rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
}

/* ================================================= */
/* ARTICLE HEADER (view page)                        */
/* ================================================= */
.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}
.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ================================================= */
/* ABOUT — TIMELINE                                  */
/* ================================================= */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -0.45rem; top: 0.4rem;
  width: 12px; height: 12px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.25);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item h5 { font-weight: 600; margin-bottom: 0.15rem; color: var(--navy); }
.timeline-date {
  font-size: 0.8rem;
  color: var(--accent-dark);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.timeline-company { color: var(--text-muted); font-size: 0.875rem; }

/* ================================================= */
/* FORMS                                             */
/* ================================================= */
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.2);
}
.form-label { font-weight: 500; font-size: 0.9rem; color: var(--navy-soft); }
.invalid-feedback { font-size: 0.82rem; }

/* ================================================= */
/* BUTTONS                                           */
/* ================================================= */
.btn-primary {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}
.btn-outline-primary { color: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ================================================= */
/* TAGS                                              */
/* ================================================= */

/* Pills — post cards & view page */
.tag-pill {
  display: inline-block;
  background: rgba(6,182,212,0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 20px;
  padding: 0.15rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tag-pill:hover,
.tag-pill.active-tag {
  background: var(--accent-dark);
  color: #fff;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

/* Picker — create / edit forms */
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  min-height: 1.5rem;
}
.tag-toggle {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tag-toggle:hover { border-color: var(--accent); color: var(--accent-dark); }
.tag-toggle.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

/* ================================================= */
/* FOOTER                                            */
/* ================================================= */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card) !important;
}
footer .footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.15s;
}
footer .footer-links a:hover { color: var(--accent); }
footer .footer-links .bi { font-size: 1rem; vertical-align: -0.1em; }
