/*
 * Custom styling: cream background, serif typography (Dario Amodei–style).
 * Load after theme CSS so these rules override.
 */

/* Off-white (cream) background – base #faf9f6, low-contrast variants */
body,
.body-content {
  background-color: #faf9f6 !important;
}

/* Serif body text – Lora for comfortable long-form reading */
body {
  font-family: Lora, "Georgia", "Times New Roman", serif !important;
  color: #2c2c2c;
  line-height: 1.65;
}

/* Headings: keep elegant serif (Playfair Display from theme, or fallback) */
h1, h2, h3, h4, h5, h6,
.blog-header-logo,
#blog-title,
.entry-title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif !important;
  color: #1a1a1a;
}

/* Blog header: same cream, subtle border */
.blog-header {
  border-bottom-color: #ebe9e4 !important;
  background-color: #faf9f6;
}

/* Navbar and cards: same cream for low contrast */
.navbar,
.navbar-light,
.bg-white {
  background-color: #faf9f6 !important;
  border-color: #ebe9e4 !important;
}

.navbar-light .navbar-nav .nav-link {
  color: #2c2c2c;
}

.navbar-light .navbar-nav .nav-link:hover {
  color: #1a1a1a;
}

/* Cards and borders: same cream, soft borders */
.card,
.border-top,
.border-bottom {
  border-color: #ebe9e4 !important;
  background-color: #faf9f6;
}

/* Footer: same cream */
.blog-footer {
  background-color: #faf9f6 !important;
  border-top-color: #ebe9e4 !important;
  color: #5c5c5c;
}

/* Links: readable, not harsh blue */
a {
  color: #2d5a27;
}

a:hover {
  color: #1e3d1a;
}

/* Subtitle / description in header */
#blog-subtitle {
  color: #5c5c5c !important;
  max-width: 400px;
  font-size: 1rem;
}

/* Metadata (dates, tags) */
article .metadata,
.blog-description {
  color: #6b6b6b !important;
}

/* Code blocks: very subtle tint so low contrast with #faf9f6 */
pre,
code {
  font-family: "SF Mono", "Consolas", "Liberation Mono", "Menlo", monospace !important;
  background-color: #f6f5f2;
  border-radius: 3px;
}

pre {
  border: 1px solid #ebe9e4;
  padding: 1rem;
}

/* Blockquotes: subtle left border, same cream family */
blockquote {
  border-left-color: #ddd9d2 !important;
  color: #3d3d3d;
  background-color: #f6f5f2;
  padding: 0.75rem 1.25rem;
  border-radius: 0 4px 4px 0;
}

/*
 * Hierarchical section numbers (1., 1.1., 1.1.1., …) in post/page body only.
 * Matches Nikola’s default DEMOTE_HEADERS=1: Markdown # / ## / ### → HTML h2 / h3 / h4.
 */
.e-content.entry-content {
  counter-reset: sec-h2 sec-h3 sec-h4 sec-h5 sec-h6;
}

.e-content.entry-content h2 {
  counter-increment: sec-h2;
  counter-reset: sec-h3 sec-h4 sec-h5 sec-h6;
}

.e-content.entry-content h2::before {
  content: counter(sec-h2) ". ";
}

.e-content.entry-content h3 {
  counter-increment: sec-h3;
  counter-reset: sec-h4 sec-h5 sec-h6;
}

.e-content.entry-content h3::before {
  content: counter(sec-h2) "." counter(sec-h3) ". ";
}

.e-content.entry-content h4 {
  counter-increment: sec-h4;
  counter-reset: sec-h5 sec-h6;
}

.e-content.entry-content h4::before {
  content: counter(sec-h2) "." counter(sec-h3) "." counter(sec-h4) ". ";
}

.e-content.entry-content h5 {
  counter-increment: sec-h5;
  counter-reset: sec-h6;
}

.e-content.entry-content h5::before {
  content: counter(sec-h2) "." counter(sec-h3) "." counter(sec-h4) "." counter(sec-h5) ". ";
}

.e-content.entry-content h6 {
  counter-increment: sec-h6;
}

.e-content.entry-content h6::before {
  content: counter(sec-h2) "." counter(sec-h3) "." counter(sec-h4) "." counter(sec-h5) "." counter(sec-h6) ". ";
}
