:root {
  --marble: #EDEBE4;
  --stone: #B9B2A4;
  --indigo: #232B4D;
  --gold: #B08D57;
  --charcoal: #2A2A28;
  --muted: #5B5648;
  --border: #D9D3C5;
  --panel: #E6E1D2;

  --bg: var(--marble);
  --text: var(--charcoal);
  --heading: var(--indigo);
  --accent: var(--gold);
  --max-width: 680px;

  --divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpolyline points='0,7 4,7 4,3 8,3 8,7 12,7' fill='none' stroke='%23B08D57' stroke-width='1'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cardo', Georgia, 'Times New Roman', serif;
  line-height: 1.7;
  font-size: 18px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.ornament-divider {
  height: 10px;
  background-image: var(--divider);
  background-repeat: repeat-x;
  background-position: left center;
}

.site-header {
  padding: 32px 0 20px;
  background-image: var(--divider);
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 12px 10px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 20px;
}

.site-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-title {
  font-family: 'Marcellus SC', 'Cardo', serif;
  font-size: 1.35rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--heading);
  text-decoration: none;
}

.site-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 400;
}

.site-nav a {
  margin-left: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--accent); }

main.wrap {
  padding-top: 44px;
  padding-bottom: 60px;
  min-height: 60vh;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.post-list li {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.post-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  min-width: 130px;
  flex-shrink: 0;
}

.post-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-link {
  color: var(--heading);
  text-decoration: none;
  font-weight: 700;
}

.post-link:hover { color: var(--accent); }

.post-list-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.post-title {
  margin-bottom: 4px;
  font-family: 'Marcellus SC', 'Cardo', serif;
  font-size: 1.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
  color: var(--heading);
}

.post-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin: 0;
}

.post-divider {
  margin: 22px 0 28px;
}

.post-content a { color: var(--accent); }

.post-content code {
  background: var(--panel);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--panel);
  padding: 14px;
  border-radius: 6px;
  overflow-x: auto;
}

.post-content blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Standalone centered image: ![alt](/assets/images/x.jpg){: .centered } */
.post-content img.centered {
  display: block;
  margin: 24px auto;
}

/* Image with caption, written as raw HTML in the post:
   <figure class="post-figure">
     <img src="/assets/images/x.jpg" alt="...">
     <figcaption>Caption text</figcaption>
   </figure> */
.post-content figure.post-figure {
  margin: 24px 0;
  text-align: center;
}

.post-content figure.post-figure img {
  margin: 0 auto;
}

.post-content figure.post-figure figcaption {
  margin-top: 8px;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

/* Footnotes: written as [^1] ... [^1]: text. Kramdown generates the
   reference superscript and the list at the bottom automatically; the
   popup-on-click behavior itself comes from assets/js/footnotes.js. */
.post-content sup a.footnote {
  color: var(--accent);
  text-decoration: none;
  padding: 0 2px;
  cursor: pointer;
}

.post-content sup a.footnote:hover,
.post-content sup a.footnote[aria-expanded="true"] {
  text-decoration: underline;
}

.post-content .footnotes {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.post-content .footnotes ol {
  padding-left: 20px;
}

.post-content .footnotes li {
  margin-bottom: 6px;
}

.post-content .footnotes .reversefootnote {
  text-decoration: none;
  color: var(--accent);
  margin-left: 4px;
}

/* The popup bubble itself, positioned in JS via top/left inline styles. */
.footnote-bubble {
  position: absolute;
  z-index: 50;
  max-width: min(320px, calc(100vw - 24px));
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(35, 43, 77, 0.15);
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.footnote-bubble p {
  margin: 0;
}

.footnote-bubble p + p {
  margin-top: 8px;
}

.site-footer {
  padding: 24px 0 20px;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  background-image: var(--divider);
  background-repeat: repeat-x;
  background-position: left top;
}

.site-footer .wrap {
  padding-top: 20px;
}
