﻿/* =========================================================================
   ITXperts â€” azurelab.blog inspired theme
   Light, magazine-style layout with an azure accent and a right-rail sidebar.
   ========================================================================= */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-alt: #ffffff;
  --bg-soft: #eef2f9;
  --ink: #0e1726;
  --ink-soft: #2a3242;
  --muted: #6b7689;
  --muted-2: #8893a7;
  --line: #e3e8f1;
  --line-soft: #eef1f7;
  --accent: #1976d2;
  --accent-dark: #0d47a1;
  --accent-2: #0d47a1;
  --accent-soft: #e3f0fc;
  --accent-ink: #0b3a78;
  --warn: #b45309;
  --ok: #0f766e;
  --bad: #b91c1c;
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, 0.05);
  --shadow-md: 0 18px 40px -22px rgba(15, 30, 60, 0.25);
  --shadow-lg: 0 30px 60px -25px rgba(15, 30, 60, 0.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--accent-2);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0.45rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.topbar a { color: #d6e6fb; }
.topbar a:hover { color: #fff; }
.topbar .topbar-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1240px; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
}
/* Public site: brand is centered (no top nav links) */
body:not(.admin) .site-header-inner { justify-content: center; }
body:not(.admin) .site-header-inner .site-nav { display: none; }
body:not(.admin) .brand { font-size: 1.9rem; }
.brand {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--ink);
  display: inline-flex; align-items: baseline;
}
.brand .brand-dot { color: var(--accent); }
.brand small { font-weight: 500; color: var(--muted); margin-left: 0.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a, .site-nav .linkbtn {
  font-weight: 500; font-size: 0.9rem; color: var(--ink-soft);
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
.site-nav a.active, .site-nav a:hover { color: var(--accent); }

/* Secondary category strip */
.cat-strip { background: #fff; border-bottom: 1px solid var(--line); }
.cat-strip-inner {
  max-width: 1240px; margin: 0 auto; padding: 0.6rem 1.5rem;
  display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center;
}
.cat-strip a {
  color: var(--ink-soft); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.74rem;
}
.cat-strip a:hover, .cat-strip a.active { color: var(--accent); }
/* The first link ("All Topics") is always dark blue */
.cat-strip-inner > a:first-child { color: #0b3d91; }
.cat-strip-inner > a:first-child:hover { color: #082b66; }

.container { max-width: 1240px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.container.narrow { max-width: 800px; }
.container.wide { max-width: 1600px; }
.with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem;
}
@media (max-width: 980px) {
  .with-sidebar { grid-template-columns: 1fr; gap: 2rem; }
}

h1 {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 2.4rem; letter-spacing: -0.02em;
  margin: 0 0 1rem; line-height: 1.15;
}
h2 {
  font-family: var(--font-serif);
  font-weight: 600; letter-spacing: -0.01em; margin: 1.5rem 0 0.75rem;
}
p { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.14em;
  font-weight: 600; color: var(--accent);
}

/* ---------- Hero (featured) ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 2.5rem;
  background: #0e1726; color: #fff;
  min-height: 420px;
  box-shadow: var(--shadow-md);
}
.hero-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,23,38,0.15) 0%, rgba(14,23,38,0.55) 55%, rgba(14,23,38,0.92) 100%);
}
.hero-body {
  position: relative; z-index: 1;
  padding: 2.5rem 2.5rem 2.25rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 420px;
  max-width: 760px;
}
.hero-body .eyebrow { color: #7ab8ff; }
.hero-body h2 {
  font-family: var(--font-serif); font-weight: 700; font-size: 2.4rem;
  margin: 0.55rem 0 0.6rem; letter-spacing: -0.01em; line-height: 1.15;
  color: #fff;
}
.hero-body h2 a { color: #fff; }
.hero-body h2 a:hover { color: #cfe4ff; }
.hero-body p { color: #d4dbe8; font-size: 1.05rem; margin: 0 0 0.9rem; max-width: 620px; }
.hero-body .meta { font-size: 0.85rem; color: #aab6cc; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }
.hero-body .meta .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.4); }
.hero-cat {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 0.3rem 0.75rem; border-radius: 4px; font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  align-self: flex-start;
}
@media (max-width: 720px) {
  .hero { min-height: 360px; }
  .hero-body { padding: 1.5rem; min-height: 360px; }
  .hero-body h2 { font-size: 1.6rem; }
  h1 { font-size: 1.9rem; }
}

/* ---------- Grid ---------- */
.section-title {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--ink); padding-bottom: 0.55rem; margin: 0 0 1.6rem;
}
.section-title h2 {
  margin: 0; font-family: var(--font-sans); font-size: 0.92rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink); font-weight: 700;
}
.section-title .more { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}
.card-article {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex; flex-direction: column;
}
.card-article:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cfd8ea; }
.card-cover-wrap { position: relative; display: block; }
.card-cover {
  aspect-ratio: 16 / 9; background-size: cover; background-position: center;
  background-color: var(--bg-soft);
  display: block;
}
.card-cover-wrap .card-cat {
  position: absolute; top: 0.85rem; left: 0.85rem;
  background: var(--accent); color: #fff;
  padding: 0.28rem 0.65rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: 0 4px 10px -3px rgba(0,0,0,0.3);
}
.card-body { padding: 1.15rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card-body h3 {
  font-family: var(--font-serif); font-size: 1.2rem; margin: 0; line-height: 1.3;
  font-weight: 700; letter-spacing: -0.01em;
}
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--accent); }
.card-body p {
  font-size: 0.92rem; margin: 0; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-readmore {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.card-meta {
  margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.8rem; color: var(--muted);
}
.card-meta .avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--bg-soft);
  border: 1px solid var(--line);
}
.card-meta .author { color: var(--ink-soft); font-weight: 600; }
.card-meta .dot { color: var(--line); }

/* ---------- Sidebar (right rail) ---------- */
.sidebar { display: flex; flex-direction: column; gap: 1.75rem; }
.widget {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
}
.widget h4 {
  margin: 0 0 1rem; font-family: var(--font-sans); font-size: 0.78rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink); display: flex; align-items: center; gap: 0.55rem;
}
.widget h4::before {
  content: ""; display: inline-block; width: 4px; height: 16px; background: var(--accent); border-radius: 2px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li + li { margin-top: 0.35rem; }
.widget a.cat-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-weight: 500; font-size: 0.92rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.widget a.cat-link:hover { background: var(--accent-soft); color: var(--accent-2); }
.widget a.cat-link .count {
  background: var(--bg-soft); color: var(--muted);
  padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
}
.widget a.cat-link:hover .count { background: var(--accent); color: #fff; }
.widget .recent-list { display: flex; flex-direction: column; gap: 0.9rem; }
.widget .recent-item {
  display: grid; grid-template-columns: 64px 1fr; gap: 0.75rem; align-items: center;
}
.widget .recent-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: var(--bg-soft) center/cover no-repeat;
}
.widget .recent-item h5 {
  margin: 0; font-family: var(--font-serif); font-size: 0.92rem; font-weight: 600;
  line-height: 1.3;
}
.widget .recent-item h5 a { color: var(--ink); }
.widget .recent-item h5 a:hover { color: var(--accent); }
.widget .recent-item .date { font-size: 0.74rem; color: var(--muted); }

/* ---------- Article page ---------- */
.article { max-width: 760px; margin: 0 auto; }
.article .cover {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 1.5rem;
}
.article .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.4rem; }
.article .subtitle {
  color: var(--ink-soft); font-size: 1.2rem; font-style: italic;
  font-family: var(--font-serif); margin: 0 0 1.5rem;
}
.prose {
  font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.8; color: #19202d;
}
.prose p { color: #19202d; margin: 1.2em 0; }
.prose h1, .prose h2, .prose h3 { font-family: var(--font-serif); margin-top: 2em; line-height: 1.25; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose pre {
  background: #0b1220; color: #e6e9f2; padding: 1rem 1.1rem; border-radius: 8px;
  overflow: auto; font-size: 0.92rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose code {
  background: #f1f3f7; padding: 0.1em 0.35em; border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
}
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose blockquote {
  border-left: 3px solid var(--accent); margin: 1.5em 0; padding: 0.2em 1.2em;
  color: var(--ink-soft); font-style: italic; background: var(--accent-soft);
}
.prose img { max-width: 100%; border-radius: 8px; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.tag {
  display: inline-flex; align-items: center;
  padding: 0.32rem 0.75rem; border-radius: 4px;
  background: var(--bg-soft); color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 500; line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag .count { opacity: 0.7; margin-left: 0.4rem; font-weight: 400; font-size: 0.72rem; }

/* ---------- Reactions + author ---------- */
.reactions { margin: 2.5rem 0 2rem; }
.reactions button {
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 0.55rem 1.1rem; font-weight: 500; cursor: pointer;
  font-family: inherit; font-size: 0.95rem;
}
.reactions button:hover { background: var(--accent); color: #fff; }
.author-card {
  display: flex; gap: 1rem; align-items: center;
  padding: 1.2rem 1.4rem; background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: var(--radius); margin-top: 2rem;
}
.author-card .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.author-card p { margin: 0.2rem 0 0; font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 4px solid var(--accent);
  margin-top: 4rem; background: #0e1726; color: #c5cee0;
}
.site-footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 3rem 1.5rem 1.5rem;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem;
}
@media (max-width: 760px) { .site-footer-inner { grid-template-columns: 1fr; } }
.site-footer h5 {
  color: #fff; font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; margin: 0 0 1rem;
}
.site-footer a { color: #c5cee0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; font-size: 1.6rem; }
.site-footer .brand .brand-dot { color: #4ea1f5; }
.site-footer p { color: #8c98b1; font-size: 0.9rem; margin: 0.6rem 0 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.4rem 0; font-size: 0.92rem; }
.site-footer .footer-bottom {
  max-width: 1240px; margin: 0 auto; padding: 1.2rem 1.5rem;
  border-top: 1px solid #1d2940; color: #6b7794; font-size: 0.82rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- Forms (shared) ---------- */
label { display: block; margin: 0.9rem 0 0.35rem; font-weight: 600; font-size: 0.88rem; color: var(--ink); }
label.inline { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search],
input:not([type]), textarea, select {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: 8px;
  border: 1px solid #cbd2dc; background: #fff; color: var(--ink);
  font: inherit; font-size: 0.98rem; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 95, 255, 0.15);
}
textarea { font-family: inherit; resize: vertical; }
button, .btn {
  display: inline-block; padding: 0.65rem 1.1rem; border-radius: 8px;
  border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; text-decoration: none; transition: background 0.12s ease;
}
button:hover, .btn:hover { background: var(--accent-dark); color: #fff; }
.btn.secondary, button.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
}
.btn.secondary:hover, button.secondary:hover { background: #f1f3f7; color: var(--ink); }
.btn.small, button.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn.danger, button.danger { background: var(--bad); }
.btn.danger:hover, button.danger:hover { background: #991b1b; }

.stack > * { display: block; }
.flash { padding: 0.8rem 1rem; border-radius: 8px; margin: 1rem 0; font-size: 0.93rem; }
.flash-error { background: #fde8e8; color: #7a1414; }
.flash-ok { background: #def7ec; color: #03543f; }
.search-form { display: flex; gap: 0.5rem; margin: 1rem 0 2rem; }
.search-form input { flex: 1; }

.stats { display: flex; flex-wrap: wrap; gap: 1rem; }
.stat {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; min-width: 160px; flex: 1;
}
.stat .num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.stat .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

table.grid-tbl {
  width: 100%; border-collapse: collapse; margin-top: 1rem; background: var(--bg-alt);
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
}
table.grid-tbl th, table.grid-tbl td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
table.grid-tbl tr:last-child td { border-bottom: 0; }
table.grid-tbl th { font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: #f8fafc; }

.badge {
  display: inline-block; font-size: 0.75rem; padding: 0.15rem 0.55rem;
  border-radius: 999px; background: var(--line); color: var(--ink-soft); font-weight: 500;
}
.badge.ok { background: #d1fae5; color: var(--ok); }
.badge.bad { background: #fee2e2; color: var(--bad); }

/* ---------- Admin portal ---------- */
body.admin { background: #f3f4f8; }
.admin .site-header { background: #fff; border-bottom: 1px solid var(--line); backdrop-filter: none; }
.admin .brand small { font-weight: 500; color: var(--muted); margin-left: 0.4rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }
.admin .container h1 { font-family: var(--font-sans); font-size: 1.6rem; font-weight: 700; }
.admin .container h2 { font-family: var(--font-sans); font-weight: 600; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin: 1rem 0; box-shadow: var(--shadow-sm);
}
.card h2 { margin-top: 0; }

/* ---------- Auth / login card (Microsoft-style) ---------- */
body.auth-shell {
  background: linear-gradient(135deg, #e8edf8 0%, #f7f7f4 50%, #f1e9e6 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(11, 18, 32, 0.25), 0 10px 20px -10px rgba(11, 18, 32, 0.15);
  width: 100%; max-width: 440px; padding: 2.6rem 2.6rem 2.2rem;
  border: 1px solid rgba(0,0,0,0.04);
}
.auth-card .brand { font-size: 1.5rem; display: block; margin-bottom: 1.4rem; }
.auth-card h1 { font-family: var(--font-sans); font-size: 1.4rem; font-weight: 500; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.auth-card .sub { color: var(--muted); font-size: 0.93rem; margin: 0 0 1.4rem; }
.auth-card label { font-weight: 500; font-size: 0.82rem; color: var(--muted); margin-top: 0.9rem; }
.auth-card input { padding: 0.75rem 0.9rem; }
.auth-card button[type=submit] { width: 100%; margin-top: 1.2rem; padding: 0.8rem; font-size: 1rem; }
.auth-card .auth-links { margin-top: 1.2rem; font-size: 0.85rem; color: var(--muted); text-align: center; }
.auth-card .auth-links a { color: var(--accent); }
.auth-qr { display: block; margin: 0 auto 1rem; max-width: 220px; }
.auth-card .flash { text-align: left; }
.auth-card .mono {
  display: block; background: #f1f3f7; padding: 0.5rem 0.7rem; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem; word-break: break-all; margin: 0.5rem 0 1rem;
}
/* ---------- Media library (admin editor) ---------- */
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem; margin-top: 0.4rem;
}
.media-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fafbfd; padding: 0.4rem; display: flex; flex-direction: column;
}
.media-item img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--radius-sm); background: #fff;
}
.media-item .media-meta { margin-top: 0.4rem; }

/* ---------- Responsive YouTube embeds ---------- */
.yt-embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  margin: 1.5em 0; background: #000;
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =========================================================================
   Obsidian-style admin editor
   ========================================================================= */

/* Save success toast (sticky, top-right, auto-dismiss) */
.toast {
  position: fixed; top: 84px; right: 24px; z-index: 200;
  padding: 0.85rem 1.2rem; border-radius: 10px;
  background: #10b981; color: #fff; font-weight: 600;
  box-shadow: 0 18px 40px -12px rgba(16, 185, 129, 0.5);
  display: flex; align-items: center; gap: 0.55rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast::before { content: "âœ“"; font-size: 1.1rem; font-weight: 700; }
.toast.toast-ok  { background: #10b981; }
.toast.toast-err { background: #ef4444; box-shadow: 0 18px 40px -12px rgba(239, 68, 68, 0.5); }
.toast.toast-err::before { content: "!"; }
.toast.hide { opacity: 0; transform: translateY(-12px); pointer-events: none; }

/* Two-column shell: sidebar + main. The right preview pane is added inside
   the main grid below at the .obs-shell rule for the editor. */
.obs-shell {
  display: grid; grid-template-columns: 260px minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem; margin-top: 0.5rem;
  align-items: stretch;
}
.obs-shell.no-preview { grid-template-columns: 260px minmax(0, 1fr); }
.obs-shell.no-preview .obs-preview { display: none; }
@media (max-width: 1200px) {
  .obs-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .obs-shell .obs-preview { display: none; }
}
@media (max-width: 820px) { .obs-shell { grid-template-columns: 1fr; } }

/* Left sidebar â€” looks like Obsidian's left rail */
.obs-sidebar {
  background: #1e2230; color: #d8dde7;
  border-radius: var(--radius); padding: 1rem 1rem 0.5rem;
  position: sticky; top: 84px;
  max-height: calc(100vh - 100px); overflow-y: auto;
  font-size: 0.92rem;
}
.obs-sidebar .obs-section { padding: 0.7rem 0; border-bottom: 1px solid #2a3042; }
.obs-sidebar .obs-section:last-child { border-bottom: 0; }
.obs-sidebar h4 {
  margin: 0 0 0.55rem; font-family: var(--font-sans);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #9aa3b8;
}
.obs-sidebar p, .obs-sidebar .small { color: #9aa3b8; }
.obs-sidebar code { background: #2a3042; color: #d8dde7; padding: 0.1em 0.35em; border-radius: 3px; }
.obs-sidebar .status-line { margin: 0; }
.obs-sidebar a { color: #7ab8ff; }
.obs-sidebar a:hover { color: #cfe4ff; }
.obs-sidebar .btn.small {
  background: #2a3042; color: #e6ebf5; border: 1px solid #3a4258;
}
.obs-sidebar .btn.small:hover { background: #3a4258; color: #fff; }
.obs-sidebar .btn.small.danger { background: #b91c1c; border-color: #b91c1c; }
.obs-sidebar .media-item {
  background: #2a3042; border-color: #3a4258;
}
.obs-sidebar .media-item .small.muted, .obs-sidebar .muted { color: #9aa3b8 !important; }

/* Outline (TOC) */
.outline { display: flex; flex-direction: column; gap: 2px; }
.outline a {
  display: block; padding: 0.25rem 0.4rem; border-radius: 4px;
  color: #d8dde7; font-size: 0.88rem; line-height: 1.3;
}
.outline a:hover { background: #2a3042; color: #fff; }
.outline a.lvl1 { font-weight: 700; }
.outline a.lvl2 { padding-left: 0.9rem; }
.outline a.lvl3 { padding-left: 1.4rem; color: #9aa3b8; }
.outline a.lvl4, .outline a.lvl5, .outline a.lvl6 { padding-left: 1.9rem; color: #7d8497; font-size: 0.82rem; }

/* Main editor column */
.obs-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem 1.2rem; }

.obs-title {
  font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700;
  border: 0; border-bottom: 2px solid transparent; padding: 0.4rem 0.2rem;
  width: 100%; outline: none; background: transparent; color: var(--ink);
  margin-bottom: 0.6rem;
}
.obs-title:focus { border-bottom-color: var(--accent); }

.obs-meta {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem 0.7rem; background: #fafbfd; margin-bottom: 0.8rem;
}
.obs-meta summary {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); cursor: pointer; padding: 0.4rem 0;
}
.obs-meta label { margin-top: 0.6rem; }

/* Toolbar above editor */
.obs-toolbar {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  padding: 0.4rem 0; margin-top: 0.4rem;
}
.obs-toolbar #autosave-status { margin-left: auto; }

/* Action bar at bottom */
.obs-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.9rem 0 0; margin-top: 1rem;
  background: linear-gradient(to top, #fff 70%, transparent);
}
.obs-actions button.primary {
  background: #10b981; border: 0;
}
.obs-actions button.primary:hover { background: #0e9b6f; }

/* Tag chips */
.tag-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.tag-chip {
  background: var(--bg-soft); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.25rem 0.7rem; font-size: 0.82rem; cursor: pointer;
  font-weight: 500; transition: background 0.12s ease, color 0.12s ease;
}
.tag-chip:hover { background: #e3f0fc; color: var(--accent); }
.tag-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }


/* =========================================================================
   Authors strip on home + Bio modal
   ========================================================================= */
.authors-strip { margin-top: 3rem; }
.authors-strip .section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.authors-strip .section-title h2 { margin: 0; }

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.authors-grid .author-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.5rem; padding: 1.2rem 0.8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; text-align: center;
  font: inherit; color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.authors-grid .author-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}
.authors-grid .author-card .avatar,
.authors-grid .author-card .avatar-placeholder {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: var(--bg-soft);
}
.authors-grid .author-card .avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent);
  background: #e3f0fc; font-size: 1.1rem;
}
.authors-grid .author-card strong { font-size: 1rem; }
.authors-grid .author-card .title { color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.authors-grid .author-card .count { font-size: 0.78rem; }

/* Bio modal */
.author-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.author-modal[hidden] { display: none; }
.author-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.author-modal-card {
  position: relative; z-index: 1;
  background: #fff; border-radius: var(--radius);
  max-width: 540px; width: 100%; padding: 2rem;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.author-modal-close {
  position: absolute; top: 0.7rem; right: 0.9rem;
  background: transparent; border: 0; font-size: 1.6rem;
  line-height: 1; color: var(--muted); cursor: pointer; padding: 0.2rem 0.5rem;
}
.author-modal-close:hover { color: var(--ink); }
.author-modal-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.author-modal-head h3 { margin: 0 0 0.2rem; }
.author-modal-head .avatar-lg,
.author-modal-head .avatar-lg.avatar-placeholder {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; background: #e3f0fc;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent); font-size: 1.4rem;
  flex-shrink: 0;
}
.author-modal-card p {
  margin: 0 0 1rem; color: var(--ink-soft); line-height: 1.6;
  white-space: pre-wrap;
}


/* =========================================================================
   Topics page filters
   ========================================================================= */
.topics-filters {
  display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
  margin: 1.4rem 0 2rem;
  padding: 1rem 1.2rem;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.topics-filters .filter-group { display: flex; flex-direction: column; gap: 0.4rem; min-width: 200px; }
.topics-filters .filter-group strong { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.topics-filters select { padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font: inherit; }
.topics-filters details.filter-authors { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.5rem 0.8rem; min-width: 240px; }
.topics-filters details.filter-authors summary { cursor: pointer; padding: 0.2rem 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.topics-filters details.filter-authors summary::-webkit-details-marker { display: none; }
.topics-filters details.filter-authors summary::after { content: "?"; margin-left: auto; transition: transform 0.15s ease; }
.topics-filters details.filter-authors[open] summary::after { transform: rotate(180deg); }
.author-filter-list { max-height: 240px; overflow-y: auto; margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.author-filter-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.3rem; border-radius: 4px; cursor: pointer; font-size: 0.92rem; }
.author-filter-row:hover { background: var(--bg-soft); }
.author-filter-row input { margin: 0; }
.author-filter-row .small.muted { margin-left: auto; }
.filter-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-soft); color: var(--ink); }


/* =========================================================================
   Obsidian dual-pane editor: source (center) + live preview (right)
   ========================================================================= */
.obs-main {
  display: flex; flex-direction: column;
  background: #1e2230; border: 1px solid #2a3042; border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
  min-height: calc(100vh - 200px);
}
.obs-main .obs-title {
  color: #e6ebf5; background: transparent;
  font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700;
  border: 0; border-bottom: 2px solid transparent; padding: 0.4rem 0.2rem;
  width: 100%; outline: none; margin-bottom: 0.4rem;
}
.obs-main .obs-title::placeholder { color: #5d667c; }
.obs-main .obs-title:focus { border-bottom-color: var(--accent); }

.obs-main .obs-meta {
  background: #262b3b; border: 1px solid #2f3548; color: #d8dde7;
  border-radius: var(--radius-sm); padding: 0.3rem 0.9rem 0.6rem;
  margin-bottom: 0.6rem;
}
.obs-main .obs-meta summary {
  color: #9aa3b8; font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  cursor: pointer; padding: 0.4rem 0;
}
.obs-main .obs-meta label { color: #c1c8d8; font-size: 0.82rem; margin-top: 0.5rem; }
.obs-main .obs-meta input, .obs-main .obs-meta textarea, .obs-main .obs-meta select {
  background: #1e2230; color: #e6ebf5; border-color: #3a4258;
}
.obs-main .obs-meta input:focus, .obs-main .obs-meta textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.25);
}

/* Toolbar */
.obs-toolbar {
  display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap;
  padding: 0.45rem 0.55rem; margin-top: 0.2rem;
  background: #262b3b; border: 1px solid #2f3548;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 0;
}
.obs-toolbar .tb {
  background: #1e2230; color: #d8dde7; border: 1px solid #3a4258;
  border-radius: 5px; padding: 0.25rem 0.55rem; font: inherit;
  font-size: 0.85rem; cursor: pointer; min-width: 32px; line-height: 1.2;
}
.obs-toolbar .tb:hover { background: #2f3548; color: #fff; border-color: #4a5374; }
.obs-toolbar .tb-sep {
  width: 1px; height: 18px; background: #3a4258; margin: 0 0.25rem;
}
.obs-toolbar .tb-select {
  background: #1e2230; color: #d8dde7; border: 1px solid #3a4258;
  border-radius: 5px; padding: 0.2rem 0.45rem; font-size: 0.85rem;
}
.obs-toolbar #autosave-status { color: #9aa3b8; }
.obs-toolbar code { background: #1e2230; color: #d8dde7; }

/* Source editor (textarea) */
textarea.obs-editor {
  flex: 1;
  background: #1e2230; color: #e6ebf5;
  border: 1px solid #2f3548; border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem 1.1rem;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.94rem; line-height: 1.65;
  resize: vertical; min-height: 520px;
  tab-size: 2; -moz-tab-size: 2;
  outline: none;
  caret-color: var(--accent);
}
textarea.obs-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.25); }
textarea.obs-editor.drop-target { box-shadow: inset 0 0 0 3px var(--accent); }

/* Live preview pane */
.obs-preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; display: flex; flex-direction: column;
  min-height: calc(100vh - 200px);
}
.obs-preview-head {
  padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  background: #fafbfd; border-radius: var(--radius) var(--radius) 0 0;
}
.obs-preview-head strong { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.obs-preview-body {
  padding: 1.4rem 1.6rem 2rem; overflow-y: auto; flex: 1;
  font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.7;
}
.obs-preview-body img { max-width: 100%; border-radius: 6px; }

/* Action bar (sticky at bottom of viewport) */
.obs-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.9rem 1rem; margin-top: 0.8rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.obs-actions button.primary { background: #10b981; border: 0; }
.obs-actions button.primary:hover { background: #0e9b6f; }

/* =========================================================================
   Obsidian callouts (rendered in both preview and public article pages)
   ========================================================================= */
.callout {
  border-left: 4px solid var(--accent);
  background: #eff6ff;
  border-radius: 8px;
  margin: 1.4em 0;
  overflow: hidden;
}
.callout-title {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem;
  color: #0b3a78;
  background: rgba(25, 118, 210, 0.08);
}
.callout-title .callout-icon { font-size: 1rem; line-height: 1; }
.callout-body { padding: 0.2rem 1.1rem 0.6rem; }
.callout-body > :first-child { margin-top: 0.4em; }
.callout-body > :last-child { margin-bottom: 0.4em; }
.callout-body p { color: var(--ink-soft); margin: 0.6em 0; }
.callout-body code { background: rgba(0,0,0,0.06); padding: 0.1em 0.35em; border-radius: 3px; }

.callout-note     { border-left-color: #6b7280; background: #f5f6f8; }
.callout-note     .callout-title { color: #374151; background: rgba(107,114,128,0.10); }
.callout-info     { border-left-color: #1976d2; background: #eff6ff; }
.callout-info     .callout-title { color: #0b3a78; background: rgba(25,118,210,0.10); }
.callout-tip      { border-left-color: #14b8a6; background: #ecfdf5; }
.callout-tip      .callout-title { color: #0f766e; background: rgba(20,184,166,0.12); }
.callout-important{ border-left-color: #8b5cf6; background: #f5f3ff; }
.callout-important.callout-important { /* specificity */ }
.callout-important .callout-title { color: #5b21b6; background: rgba(139,92,246,0.12); }
.callout-success  { border-left-color: #10b981; background: #ecfdf5; }
.callout-success  .callout-title { color: #047857; background: rgba(16,185,129,0.12); }
.callout-question { border-left-color: #d97706; background: #fffbeb; }
.callout-question .callout-title { color: #92400e; background: rgba(217,119,6,0.12); }
.callout-warning  { border-left-color: #f59e0b; background: #fffbeb; }
.callout-warning  .callout-title { color: #92400e; background: rgba(245,158,11,0.14); }
.callout-danger   { border-left-color: #ef4444; background: #fef2f2; }
.callout-danger   .callout-title { color: #991b1b; background: rgba(239,68,68,0.12); }
.callout-example  { border-left-color: #6366f1; background: #eef2ff; }
.callout-example  .callout-title { color: #3730a3; background: rgba(99,102,241,0.12); }
.callout-quote    { border-left-color: #6b7280; background: #f9fafb; font-style: italic; }
.callout-quote    .callout-title { color: #374151; background: rgba(107,114,128,0.10); }
.callout-abstract { border-left-color: #06b6d4; background: #ecfeff; }
.callout-abstract .callout-title { color: #155e75; background: rgba(6,182,212,0.12); }
.callout-todo     { border-left-color: #2563eb; background: #eff6ff; }
.callout-todo     .callout-title { color: #1e3a8a; background: rgba(37,99,235,0.12); }

