/* ============================================
   Anthropic/Claude-inspired theme for Chirpy
   ============================================ */

/* --- Google Fonts: Lora (serif) for headings --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ============================================
   Light Mode — Warm cream palette
   ============================================ */
:root[data-mode="light"],
:root:not([data-mode]) {
  /* Backgrounds */
  --body-bg: #faf9f5;
  --sidebar-bg: #141413;
  --card-bg: #f5f4ef;
  --mask-bg: rgba(250, 249, 245, 0.6);
  --main-bg: #faf9f5;

  /* Text */
  --text-color: #30302e;
  --heading-color: #141413;
  --text-muted-color: #6b6a66;
  --blockquote-text-color: #5a5955;

  /* Accent */
  --link-color: #d97757;
  --link-color-dark: #c0654a;
  --btn-active-bg: #d97757;

  /* Borders & Dividers */
  --border-color: rgba(194, 192, 182, 0.3);
  --card-border-color: rgba(194, 192, 182, 0.25);

  /* Code */
  --code-bg: #f0eee7;
  --inline-code-bg: #edebd5;

  /* Tag, Category */
  --tag-hover: #d97757;
  --categories-hover-bg: rgba(217, 119, 87, 0.08);

  /* TOC */
  --toc-highlight: #d97757;

  /* Search */
  --search-border-color: rgba(194, 192, 182, 0.5);

  /* Shadow */
  --card-shadow: 0 1px 3px rgba(20, 20, 19, 0.04);
}

/* ============================================
   Dark Mode — Deep warm dark
   ============================================ */
:root[data-mode="dark"] {
  /* Backgrounds */
  --body-bg: #1a1918;
  --sidebar-bg: #141413;
  --card-bg: #242321;
  --mask-bg: rgba(26, 25, 24, 0.6);
  --main-bg: #1a1918;

  /* Text */
  --text-color: #c8c6be;
  --heading-color: #eae8e0;
  --text-muted-color: #8a887f;
  --blockquote-text-color: #9a988f;

  /* Accent */
  --link-color: #d97757;
  --link-color-dark: #e08a6e;

  /* Borders & Dividers */
  --border-color: rgba(194, 192, 182, 0.12);
  --card-border-color: rgba(194, 192, 182, 0.08);

  /* Code */
  --code-bg: #242321;
  --inline-code-bg: #2a2927;

  /* TOC */
  --toc-highlight: #d97757;

  /* Shadow */
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Typography
   ============================================ */

/* Headings: Inter sans-serif */
h1, h2, h3, h4, h5, h6,
.post-title,
.page-title,
#sidebar .site-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  font-weight: 600;
  color: var(--heading-color);
  letter-spacing: -0.02em;
}

/* Body: Lora serif (matching Anthropic blog) */
body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif !important;
  color: var(--text-color);
  background-color: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Post content slightly larger for readability */
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-content p {
  margin-bottom: 1.25rem;
}

/* ============================================
   Links — Anthropic burnt orange
   ============================================ */
a {
  color: var(--link-color);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-color-dark);
}

/* Post content links: subtle underline */
.post-content a:not(.img-link) {
  text-decoration: underline;
  text-decoration-color: rgba(217, 119, 87, 0.3);
  text-underline-offset: 2px;
}

.post-content a:not(.img-link):hover {
  text-decoration-color: var(--link-color);
}

/* ============================================
   Sidebar — Warm light tone
   ============================================ */
#sidebar {
  background: #f0eee7 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

#sidebar .site-title {
  color: #141413 !important;
}

#sidebar .site-subtitle {
  color: #6b6a66 !important;
}

#sidebar .nav-link {
  color: #4a4944 !important;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
  color: #d97757 !important;
}

#sidebar .sidebar-bottom .icon {
  color: #8a887f !important;
  transition: color 0.2s ease;
}

#sidebar .sidebar-bottom .icon:hover {
  color: #d97757 !important;
}

/* ============================================
   Cards & Containers
   ============================================ */
.card,
.post-preview {
  border-radius: 6px;
  border: 1px solid var(--card-border-color);
  box-shadow: var(--card-shadow);
}

/* ============================================
   Code blocks — Anthropic style
   ============================================ */
.highlighter-rouge {
  border: 1px solid rgba(194, 192, 182, 0.35) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.highlight {
  padding: 1rem !important;
  border-radius: 8px;
  background-color: var(--code-bg) !important;
}

.highlight code {
  padding-left: 0 !important;
  white-space: pre !important;
  font-size: 0.875rem;
  line-height: 1.6;
}

.highlight pre {
  white-space: pre !important;
  overflow-x: auto;
  margin: 0;
}

/* Code block header (language label) */
.code-header {
  background-color: transparent !important;
  border-bottom: 1px solid rgba(194, 192, 182, 0.25) !important;
}

/* Inline code — Anthropic style: light bg + subtle border */
code:not(.highlight code) {
  background-color: rgba(194, 192, 182, 0.12);
  border: 1px solid rgba(194, 192, 182, 0.4);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
  color: inherit;
}

/* ============================================
   Blockquotes — warm left border
   ============================================ */
blockquote {
  border-left: 3px solid #d97757 !important;
  color: var(--blockquote-text-color);
  background: transparent;
}

/* ============================================
   Buttons & Active States
   ============================================ */
.btn-primary,
.btn-outline-primary {
  border-color: #d97757;
  color: #d97757;
}

.btn-primary:hover,
.btn-outline-primary:hover {
  background-color: #d97757;
  border-color: #d97757;
  color: #fff;
}

/* Back to top button */
#back-to-top {
  background-color: #d97757 !important;
}

/* ============================================
   TOC highlight
   ============================================ */
#toc li a.active {
  color: #d97757 !important;
  border-color: #d97757 !important;
}

/* ============================================
   Tags & Categories
   ============================================ */
.post-tag:hover,
a[class*="tag"]:hover {
  color: #d97757 !important;
}

/* ============================================
   Footer
   ============================================ */
footer {
  color: var(--text-muted-color);
}

/* ============================================
   Selection highlight
   ============================================ */
::selection {
  background: rgba(217, 119, 87, 0.2);
  color: inherit;
}

/* ============================================
   Scrollbar (webkit)
   ============================================ */
::-webkit-scrollbar-thumb {
  background-color: rgba(176, 174, 165, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(176, 174, 165, 0.6);
}
