/* ══════════════════════════════════════════
   brandon.md - Obsidian Live Preview Theme
   ══════════════════════════════════════════ */

:root {
  /* Backgrounds */
  --bg-primary: #202020;
  --bg-primary-alt: #1a1a1a;
  --bg-secondary: #161616;
  --bg-border: #333;

  /* Text */
  --text-normal: #dcddde;
  --text-muted: #999;
  --text-faint: #666;
  --text-accent: #7f6df2;
  --text-accent-hover: #8875ff;

  /* Headings */
  --heading-color: #e0e0e0;

  /* Code */
  --code-bg: #2a2a2a;

  /* Typography */
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Markdown syntax */
  --md-syntax-opacity: 0.35;

  /* Layout */
  --content-width: 720px;
  --line-height: 1.65;
}

/* ── Reset ── */

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

/* ── Base ── */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--text-normal);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #17304dfc;
}

/* ── Tab Bar ── */

.tab-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-border);
  display: flex;
  align-items: stretch;
  height: 36px;
  font-size: 13px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--text-normal);
  border-right: 1px solid var(--bg-border);
  background: var(--bg-primary);
  cursor: default;
  user-select: none;
}

.tab-icon {
  opacity: 0.5;
  font-size: 14px;
}

.tab-name {
  font-family: var(--font-text);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ── Main Content ── */

.markdown-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* ── Headings ── */

h1, h2, h3 {
  color: var(--heading-color);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h2 {
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5em;
}

h3 {
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.4em;
}

/* Markdown syntax: # before headings */
h1::before, h2::before, h3::before {
  font-family: var(--font-mono);
  font-weight: 400;
  opacity: var(--md-syntax-opacity);
  margin-right: 0.35em;
  font-size: 0.6em;
  vertical-align: baseline;
  color: var(--text-faint);
}

h1::before { content: '#'; }
h2::before { content: '##'; }
h3::before { content: '###'; }

/* ── Paragraphs ── */

p {
  margin: 0 0 1em;
}

/* ── Links ── */

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Horizontal Rules ── */

hr {
  border: none;
  position: relative;
  height: 2.5em;
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

hr::before {
  content: '---';
  font-family: var(--font-mono);
  color: var(--text-faint);
  opacity: var(--md-syntax-opacity);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

hr::after {
  content: '';
  position: absolute;
  left: 2.5em;
  right: 0;
  height: 1px;
  background: var(--bg-border);
  top: 50%;
}

/* ── Lists ── */

ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1em;
}

ul li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.35em;
}

ul li::before {
  content: '-';
  position: absolute;
  left: 0.3em;
  font-family: var(--font-mono);
  color: var(--text-faint);
  opacity: 0.45;
}

/* ── Bold ── */

strong::before,
strong::after {
  content: '**';
  font-family: var(--font-mono);
  color: var(--text-faint);
  opacity: var(--md-syntax-opacity);
  font-weight: 400;
  font-size: 0.8em;
}

/* ── Italic ── */

em::before,
em::after {
  content: '_';
  font-family: var(--font-mono);
  color: var(--text-faint);
  opacity: var(--md-syntax-opacity);
  font-style: normal;
  font-size: 0.8em;
}

/* ── Inline Code ── */

code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── Sections ── */

section {
  margin-bottom: 0;
}

/* ── Editor Footer ── */

.editor-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

body {
  padding-bottom: 28px;
}

.cursor-blink {
  font-family: var(--font-mono);
  color: var(--text-accent);
  font-size: 1.1rem;
  font-weight: 300;
}

/* ── Status Bar ── */

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--bg-border);
  padding: 4px 14px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-text);
  display: flex;
  justify-content: space-between;
  user-select: none;
  z-index: 100;
}

.status-bar span {
  opacity: 0.7;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .markdown-body {
    padding: 2rem 1.25rem 3rem;
  }

  .editor-footer {
    padding: 0 1.25rem 5rem;
  }

  h1 { font-size: 1.6em; }
  h2 { font-size: 1.3em; }

  h1::before, h2::before, h3::before {
    font-size: 0.5em;
    margin-right: 0.25em;
  }

  .tab-bar {
    height: 32px;
    font-size: 12px;
  }

  .status-bar {
    font-size: 10px;
    padding: 3px 10px;
  }
}
