/* ============================================================
   CHRISBMN.COM — Design System
   Light/dark mode · Inter font · Sky-blue accent
   ============================================================ */

/* ── Signature top bar ──────────────────────────────────────── */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 101;
  background: linear-gradient(
    141deg,
    #0a02ff 0%,
    #12f12a 20%,
    rebeccapurple 40%,
    #e80000 70%,
    #860000 90%
  );
}

/* Google Fonts loaded via <link> in header.php, not @import here -
   @import forces a serial fetch (this file, then the font CSS, then the
   font files) instead of letting the browser fetch them in parallel. */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --bg-secondary: #f8fafc;
  --surface:      #ffffff;
  --surface-alt:  #f1f5f9;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-faint:   #94a3b8;
  --accent:       #0ea5e9;
  --accent-hover: #0284c7;
  --accent-dim:   rgba(14, 165, 233, 0.12);
  --link:         #0ea5e9;
  --link-visited: #7c3aed;
  --danger:       #ef4444;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.05);
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --transition:   0.2s ease;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --nav-height:   64px;
  --container:    860px;
  --container-wide: 1100px;
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --bg-secondary: #1e293b;
  --surface:      #1e293b;
  --surface-alt:  #263348;
  --border:       #334155;
  --border-light: #1e293b;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-faint:   #64748b;
  --accent:       #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-dim:   rgba(56, 189, 248, 0.12);
  --link:         #38bdf8;
  --link-visited: #a78bfa;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow:       0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.2);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.3);
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { color: var(--accent-hover); }
a:visited { color: var(--link-visited); }

img { max-width: 100%; height: auto; display: block; border-style: none; }

ul, ol { padding-left: 1.5em; margin: 0 0 1em; }
li { margin-bottom: 0.25em; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25em;
  overflow-x: auto;
  margin: 1.5em 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

th, td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

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

/* ── Layout ─────────────────────────────────────────────────── */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1 0 auto;
  padding-top: calc(var(--nav-height) + 10px);
}

/* ── Landing page (no nav) ──────────────────────────────────── */
.main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.intro {
  text-align: center;
  max-width: 640px;
}

.avatar {
  margin-bottom: 1.75rem;
}

.description {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  line-height: 1.6;
}

.social-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
}

.social-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.social-links a:hover {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: var(--container-wide);
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.85);
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .nav {
  background: rgba(15, 23, 42, 0.85);
}

.nav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.nav__logo img {
  height: 36px;
  width: auto;
  transition: opacity var(--transition), filter var(--transition);
}

.nav__logo:hover img {
  opacity: 0.85;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
  background: var(--surface-alt);
}

.nav__links a:visited { color: var(--text-muted); }
.nav__links a:visited:hover { color: var(--text); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Theme toggle switch */
.theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="dark"] .theme-toggle {
  background: var(--accent);
  border-color: var(--accent);
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform var(--transition), background var(--transition);
  pointer-events: none;
}

[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(20px);
  background: #fff;
}

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0 8px;
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Nav Dropdown ───────────────────────────────────────────── */
.nav__dropdown-wrap {
  position: relative;
  list-style: none;
}

.nav__dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}

.nav__dropdown-trigger:hover,
.nav__dropdown-trigger.active {
  color: var(--text);
  background: var(--surface-alt);
}

.nav__chevron {
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform var(--transition);
}

.nav__dropdown-wrap:hover .nav__chevron,
.nav__dropdown-wrap.open .nav__chevron {
  transform: rotate(180deg);
}

.nav__dropdown {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  min-width: 155px;
  list-style: none;
  margin: 0;
  padding: 0.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
  z-index: 200;
}

.nav__dropdown-wrap:hover .nav__dropdown,
.nav__dropdown-wrap.open .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav__dropdown li { margin: 0; }

.nav__dropdown a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.nav__dropdown a:hover,
.nav__dropdown a.active {
  color: var(--text);
  background: var(--surface-alt);
}

.nav__dropdown a:visited       { color: var(--text-muted); }
.nav__dropdown a:visited:hover { color: var(--text); }

/* ── Hero (Homepage) ────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 4rem 1.5rem 3rem;
}

.hero__logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.hero__logo {
  height: auto;
  max-width: 380px;
  width: 100%;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.hero__logo-wrap:hover .hero__logo {
  transform: translateY(-6px);
}

.hero__caption {
  position: absolute;
  bottom: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hero__logo-wrap:hover .hero__caption {
  opacity: 1;
}

.hero__desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0.75rem auto 1.75rem;
  font-weight: 400;
}

.hero__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 1.2rem;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  text-decoration: none;
}

.hero__links a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hero__links a:visited { color: var(--text-muted); }
.hero__links a:visited:hover { color: #fff; }

.hero__cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14,165,233,0.35);
}

.btn--secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn--sm { padding: 0.4rem 0.875rem; font-size: 0.8rem; }
.btn--lg { padding: 0.8rem 1.75rem; font-size: 1rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card--clickable {
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

/* ── Blog Post Cards ─────────────────────────────────────────── */
.post-card {
  background: #f7faff;
  border: 1px solid #e8f0ff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition);
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.post-card:visited { color: inherit; }

[data-theme="dark"] .post-card {
  background: var(--surface);
  border-color: var(--border);
}

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

.post-card__cat {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.post-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.3;
}

.post-card:hover .post-card__title {
  color: var(--accent);
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-header__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.page-header__title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header__desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.6rem 0.875rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.3rem;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border: 1px solid transparent;
}

.alert--success {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
  color: #15803d;
}
[data-theme="dark"] .alert--success { color: #86efac; }

.alert--error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #dc2626;
}
[data-theme="dark"] .alert--error { color: #fca5a5; }

.alert--info {
  background: var(--accent-dim);
  border-color: rgba(14,165,233,0.25);
  color: #0369a1;
}
[data-theme="dark"] .alert--info { color: #7dd3fc; }

.alert--warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.25);
  color: #b45309;
}
[data-theme="dark"] .alert--warning { color: #fcd34d; }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--accent { background: var(--accent-dim); color: var(--accent); }
.badge--muted  { background: var(--surface-alt); color: var(--text-muted); }
.badge--success { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge--danger  { background: rgba(239,68,68,0.1); color: #dc2626; }
[data-theme="dark"] .badge--success { color: #86efac; }
[data-theme="dark"] .badge--danger  { color: #fca5a5; }

/* ── Tags ────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.tag:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.tag:visited { color: var(--text-muted); }
.tag:visited:hover { color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.pagination a {
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

.pagination a:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.pagination .dots {
  color: var(--text-faint);
  border: none;
  background: none;
}

/* ── Post Content ────────────────────────────────────────────── */
.prose {
  line-height: 1.8;
  color: var(--text);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.prose p { margin-bottom: 1.25em; }

.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

.prose img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5em auto;
  box-shadow: var(--shadow);
}

.prose ul, .prose ol { margin-bottom: 1.25em; }
.prose li { margin-bottom: 0.4em; }

.prose blockquote {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 1.25rem;
  margin-top: 4rem;
  background: var(--bg-secondary);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer__top,
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer__top {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
}

.footer__copy a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--transition);
}
.footer__copy a:hover { color: var(--text-muted); }

.footer__social {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.footer__social a {
  color: var(--text-faint);
  font-size: 1.6rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer__social a:hover { color: var(--accent); }
.footer__social a:visited { color: var(--text-faint); }

.footer__links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer__links a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--text-muted); }
.footer__links a:visited { color: var(--text-faint); }

.footer__logo-link { display: flex; align-items: center; }

.footer__logo {
  height: 32px;
  width: auto;
  /* brightness(0) normalises black/white logo to black; colour chain matches --text-faint */
  filter: brightness(0) saturate(100%) invert(72%) sepia(11%) saturate(491%) hue-rotate(183deg) brightness(95%);
  transition: filter var(--transition);
}

.footer__logo-link:hover .footer__logo {
  /* matches --accent (#0ea5e9) */
  filter: brightness(0) saturate(100%) invert(47%) sepia(62%) saturate(762%) hue-rotate(164deg) brightness(101%);
}

[data-theme="dark"] .footer__logo {
  /* matches dark --text-faint (#64748b) */
  filter: brightness(0) saturate(100%) invert(46%) sepia(11%) saturate(491%) hue-rotate(183deg) brightness(90%);
}

[data-theme="dark"] .footer__logo-link:hover .footer__logo {
  /* matches dark --accent (#38bdf8) */
  filter: brightness(0) saturate(100%) invert(66%) sepia(56%) saturate(783%) hue-rotate(169deg) brightness(102%);
}

/* Theme-aware logo swap */
.footer__logo--dark  { display: none; }
.footer__logo--light { display: block; }

[data-theme="dark"] .footer__logo--light { display: none; }
[data-theme="dark"] .footer__logo--dark  { display: block; }

/* ── Resume Specific ─────────────────────────────────────────── */
.resume-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.resume-avatar {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

.resume-header__info h1 {
  font-size: 1.875rem;
  margin-bottom: 0.25rem;
}

.resume-header__title {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.resume-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.resume-contact-list a { color: var(--link); }

.resume-section { margin-bottom: 2.5rem; }

.resume-section__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.resume-job { margin-bottom: 1.75rem; }

.resume-job__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.resume-job__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.resume-job__company {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.resume-job__date {
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.resume-job ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.resume-job li {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.skills-grid li {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  list-style: none;
}

.resume-footer-icons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.resume-footer-icons a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}

.resume-footer-icons a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.resume-footer-icons a:visited { color: var(--text-muted); }
.resume-footer-icons a:visited:hover { color: var(--accent); }

/* ── Single Post ─────────────────────────────────────────────── */
.post-header {
  padding: 3rem 0 2rem;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-header__title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.post-featured-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.post-nav__item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.post-nav__item:visited { color: inherit; }
.post-nav__label { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.post-nav__title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.post-nav__prev { text-align: left; }
.post-nav__next { text-align: right; }

/* ── Search Box ──────────────────────────────────────────────── */
.search-box {
  position: relative;
  max-width: 480px;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box__icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 3rem;
  align-items: start;
}

.sidebar__widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar__widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.sidebar__cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__cat-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem;
  margin: 0;
}

.sidebar__cat-list li:last-child { border-bottom: none; }

.sidebar__cat-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.sidebar__cat-list a:hover { color: var(--accent); }
.sidebar__cat-list a:visited { color: var(--text-muted); }
.sidebar__cat-list a:visited:hover { color: var(--accent); }
.sidebar__cat-list a.active { color: var(--accent); font-weight: 600; }

/* ── Sidebar: Recent Posts ───────────────────────────────────── */
.sidebar__recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar__recent-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar__recent-item:hover {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar__recent-item a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 0.55rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color var(--transition);
}

.sidebar__recent-item:hover a { color: var(--accent); }

.sidebar__recent-date {
  display: block;
  font-size: 0.6rem;
  color: var(--text-faint);
  margin-top: 0.1rem;
}

/* ── Sidebar: Tag Cloud ──────────────────────────────────────── */
.sidebar__tag-cloud {
  line-height: 1.9;
}

.sidebar__cloud-tag {
  display: inline;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.3rem;
  font-weight: 500;
  transition: color var(--transition), opacity var(--transition);
}

.sidebar__cloud-tag:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.sidebar__cloud-tag--active {
  font-weight: 700;
  text-decoration: underline;
}

[data-theme="dark"] .sidebar__cloud-tag { color: var(--accent); }

/* ── Sidebar: Archive ────────────────────────────────────────── */
.sidebar__archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--border-light);
}

.sidebar__archive-list li:last-child { border-bottom: none; }

.sidebar__archive-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition);
}

.sidebar__archive-list a:hover { color: var(--accent); }

/* ── Utilities ───────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-accent  { color: var(--accent); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.8rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
  border: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: -1; }
}

@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  .page-header__title { font-size: 1.75rem; }
  .post-header__title { font-size: 1.6rem; }
  .hero__logo { max-width: 280px; }

  .nav__links { display: none; }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: var(--shadow);
  }

  .nav-hamburger { display: flex; }

  /* Dropdown: inline accordion on mobile */
  .nav__dropdown-wrap { width: 100%; }

  .nav__dropdown-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: hidden;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    background: transparent;
    padding: 0.25rem 0 0.25rem 0.5rem;
    margin: 0.15rem 0 0.15rem 0.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, visibility 0s linear 0.2s;
  }

  .nav__dropdown-wrap.open .nav__dropdown {
    visibility: visible;
    max-height: 200px;
    transition: max-height 0.2s ease;
  }

  .resume-header { flex-direction: column; gap: 1.25rem; }
  .resume-avatar { width: 80px; height: 80px; }

  .post-nav { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 2rem 1rem; }
  .hero__logo { max-width: 220px; }
  .hero__caption { display: none; }
  .footer__top, .footer__bottom { flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
  .footer__logo { height: 32px; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .nav, .footer, .sidebar { display: none; }
  .main-content { padding-top: 0; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
