/* Flat parchment — matches index.html top colour, no distracting gradient on long reads */
body {
  background: #f4f1ea !important;
}

/* Cross-post line inside article header meta */
.cross-posted-line {
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #78716c;
    margin: 0 !important;
    margin-top: 4px !important;
    padding: 0 !important;
    line-height: 1;
}
.cross-posted-line a {
    color: #1c1917;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cross-posted-line a:hover { color: #a16207; }

/* --- Base Article Styles --- */
.prose {
    color: #44403c; 
    font-size: 1.25rem; 
    line-height: 1.8;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { 
    font-family: 'Lora', serif; 
    color: #1c1917; 
    font-weight: 700; 
}
.prose h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 2rem; }
.prose h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-top: 4rem; margin-bottom: 1.5rem; }
.prose h3 { font-size: clamp(1.2rem, 2.5vw, 1.875rem); margin-top: 3rem; margin-bottom: 1rem; }
.prose p { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.prose ul, .prose ol { margin: 1.5rem 0; }
.prose li { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.prose a { 
    color: #a16207; 
    text-decoration: underline; 
    text-decoration-color: #fde047;
    text-underline-offset: 4px;
    font-weight: 600; 
    transition: all 0.2s ease;
}
.prose a:hover {
    color: #1c1917;
    text-decoration-color: #a16207;
}

.prose blockquote {
    color: #57534e;
    border-left-color: #ca8a04;
    background-color: #fefce8;
    padding: 1.5rem 2.5rem;
    font-style: italic;
    border-left-width: 4px;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 3rem 0;
}
.prose blockquote footer,
.prose blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-style: normal;
    color: #a16207;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.prose blockquote p:last-child {
    margin-bottom: 0;
}

/* Inline Code */
.prose :not(pre) > code { 
    color: #a16207; 
    background-color: #fef9c3; 
    padding: 0.2em 0.4em; 
    border-radius: 6px; 
    font-size: 0.9em;
}

/* Code block wrapper — shared by all fenced code blocks */
.code-block-wrap {
    margin: 3rem 0;
    border: 1px solid #292524;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.25rem;
    background-color: #1c1917;
    border-bottom: 1px solid #292524;
    border-radius: calc(1rem - 1px) calc(1rem - 1px) 0 0;
}

.code-header-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #78716c;
    font-family: 'Inter', sans-serif;
}

.code-header-lang::before {
    content: '';
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: #a16207;
    flex-shrink: 0;
}

/* Code Blocks */
.prose pre {
    background-color: #1c1917;
    padding: 2rem;
    overflow-x: auto;
    margin: 3rem 0;
    border: 1px solid #292524;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* When inside the wrapper, the pre loses its own chrome */
.code-block-wrap .prose pre,
.code-block-wrap pre {
    margin: 0;
    border: none;
    border-radius: 0 0 calc(1rem - 1px) calc(1rem - 1px);
    box-shadow: none;
}

.prose pre code {
    color: #e7e5e4;
    background-color: transparent;
    padding: 0;
    font-size: 1rem;
    border: none;
    line-height: 1.6;
}

/* Copy Button — sits in the code-header, not absolutely positioned */
.copy-button {
    padding: 0.3rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: #78716c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.copy-button:hover {
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.prose img {
    border-radius: 1rem;
    margin: 4rem auto;
    box-shadow: 0 30px 70px -8px rgba(0, 0, 0, 0.3), 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Markdown Support --- */
.prose ul { list-style-type: disc; padding-left: 2rem; }
.prose ol { list-style-type: decimal; padding-left: 2rem; }

.prose table {
    width: 100%;
    margin: 3rem 0;
    border-collapse: collapse;
}
.prose th, .prose td {
    padding: 1rem;
    border: 1px solid #e7e5e4;
    text-align: left;
}
.prose th {
    background-color: #f9f8f6;
    color: #1c1917;
    font-weight: 700;
}

/* Enhancements */
.prose > p:first-of-type::first-letter {
    float: left;
    font-size: 4.5rem;
    line-height: 0.8;
    font-weight: 700;
    margin-right: 0.5rem;
    padding-top: 0.5rem;
    font-family: 'Lora', serif;
    color: #1c1917;
}

.meta-info { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 1rem; 
    margin-top: 1rem; 
    color: #78716c;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
}

/* Heading anchor links — appear on hover as a small # */
.prose h1, .prose h2, .prose h3,
.prose h4, .prose h5, .prose h6 {
  position: relative;
}

.heading-anchor {
  opacity: 0;
  margin-left: 0.45em;
  font-size: 0.62em;
  color: #a16207 !important;
  text-decoration: none !important;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  vertical-align: middle;
  transition: opacity 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.prose h1:hover .heading-anchor,
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor,
.prose h5:hover .heading-anchor,
.prose h6:hover .heading-anchor {
  opacity: 1;
}

/* Prev / Next post navigation */
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(161, 98, 7, 0.35);
}
.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 46%;
}
.post-nav-link.next-post {
    text-align: right;
    margin-left: auto;
}
.post-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #928d8a;
}
.post-nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d2a26;
    font-family: 'Lora', serif;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s ease;
}
.post-nav-title:hover {
    color: #a16207;
}

/* Gist / source link banner */
.gist-banner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 2.5rem 0;
    padding: 1rem 1.4rem;
    background: rgba(161, 98, 7, 0.06);
    border: 1px solid rgba(161, 98, 7, 0.22);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    color: #57534e;
    line-height: 1.5;
}

.gist-banner svg {
    flex-shrink: 0;
    color: #78716c;
}

.gist-banner a {
    color: #a16207;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #fde047;
    transition: color 0.2s;
}

.gist-banner a:hover { color: #1c1917; }

/* Lean 4 interactive snippet embeds */
.lean-embed {
    position: relative;
    margin: 3rem 0;
    background-color: #1c1917;
    border: 1px solid #292524;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.lean-embed-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background-color: #1c1917;
    border-bottom: 1px solid #292524;
    border-radius: calc(1rem - 1px) calc(1rem - 1px) 0 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #78716c;
    font-family: 'Inter', sans-serif;
}

.lean-embed-label::before {
    content: '';
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: #a16207;
}

.lean-embed iframe {
    display: block;
    width: 100%;
    border: none;
    min-height: 200px;
    background: #fff;
    border-radius: 0 0 calc(1rem - 1px) calc(1rem - 1px);
}

/* Bare iframes inside blog/note article content (e.g. embedded Lean code snippets) */
.prose div > iframe,
.prose p > iframe,
.prose > iframe {
    display: block;
    width: 100%;
    border: none;
    border-radius: 0.75rem;
    min-height: 40px;
    margin: 1.5rem 0;
    background: #1e1e1e;
}

/* Reading Progress Bar */
#reading-progress-bar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 0%; 
    height: 4px; 
    background-color: #a16207; 
    z-index: 100; 
    box-shadow: 0 0 10px rgba(161, 98, 7, 0.4);
}
