/* louismullie.com — shared stylesheet */

:root {
  --bg: #fdfcf9;
  --bg-raised: #ffffff;
  --fg: #23211d;
  --fg-muted: #6b675f;
  --border: #e4e0d6;
  --accent: #8a3324;
  --accent-soft: #f6e8e4;
  --link: #8a3324;
  --code-bg: #f0ede5;
  --shadow: 0 10px 40px rgba(30, 25, 15, .12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #191817;
  --bg-raised: #21201e;
  --fg: #e6e2d8;
  --fg-muted: #99948a;
  --border: #37342f;
  --accent: #d98d76;
  --accent-soft: #33231e;
  --link: #d98d76;
  --code-bg: #26241f;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 52px; padding: 0 .9rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
}
.site-title {
  color: var(--fg); text-decoration: none; font-weight: 650;
  font-size: .95rem; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title .subtitle { color: var(--fg-muted); font-weight: 450; }
.topbar-right { display: flex; gap: .35rem; align-items: center; }
.topbar-link {
  font-family: var(--sans); font-size: .8rem; font-weight: 600;
  color: var(--link); text-decoration: none; margin-right: .35rem;
  padding: .3rem .35rem;
}
.topbar-link:hover { text-decoration: underline; }
.icon-btn {
  border: 1px solid var(--border); background: var(--bg-raised);
  color: var(--fg); border-radius: 8px; cursor: pointer;
  font-size: .95rem; padding: .3rem .55rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--fg-muted); }

/* ---------- layout ---------- */
article, .page {
  max-width: 760px; margin: 0 auto;
  padding: 2.2rem 2rem 4rem;
}

/* ---------- typography ---------- */
.kicker {
  font-family: var(--sans); text-transform: uppercase;
  letter-spacing: .14em; font-size: .72rem; color: var(--accent);
  margin: 0 0 -0.4rem; font-weight: 700;
}
h1 {
  font-size: 2rem; line-height: 1.2; margin: .6rem 0 1.4rem;
  letter-spacing: -.01em; font-weight: 650;
}
h2 { font-size: 1.35rem; margin: 2.4rem 0 .8rem; line-height: 1.25; font-weight: 650; }
h3 { font-size: 1.08rem; margin: 1.8rem 0 .6rem; font-weight: 650; }
p { margin: .85rem 0; }
a { color: var(--link); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--link) 35%, transparent); }
a:hover { border-bottom-color: var(--link); }
ul, ol { padding-left: 1.6rem; }
li { margin: .3rem 0; }
blockquote { margin: 1rem 0; padding: .1rem 1.2rem; border-left: 3px solid var(--border); color: var(--fg-muted); }
code {
  background: var(--code-bg); padding: .15rem .4rem;
  border-radius: 5px; font-size: .88em;
}
h2, h3 { scroll-margin-top: 70px; }
:target { scroll-margin-top: 70px; }

.byline {
  font-family: var(--sans); font-size: .82rem; color: var(--fg-muted);
  margin: 0 0 1.6rem;
}

/* ---------- badges (homepage social links) ---------- */
.badges {
  margin-top: 1.2rem; display: flex; gap: .6rem;
  align-items: center; flex-wrap: wrap; font-family: var(--sans);
}
.badges a {
  display: inline-flex; align-items: center;
  padding: .32rem .75rem; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--fg);
  font-size: .82rem; font-weight: 600; border-radius: 999px;
  text-decoration: none; transition: border-color .15s ease, color .15s ease;
}
.badges a:hover { border-color: var(--accent); color: var(--accent); }
.badges svg { height: .95rem; width: .95rem; margin-right: .45rem; fill: currentColor; }

/* ---------- publications ---------- */
.pubs li { margin-bottom: .7rem; font-size: .95em; }

/* ---------- blog listing ---------- */
.post-list { list-style: none; padding: 0; margin: 1.6rem 0; }
.post-card {
  display: block; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-raised); padding: 1.1rem 1.3rem; margin: 1rem 0;
  color: var(--fg); text-decoration: none;
  transition: border-color .15s ease;
}
.post-card:hover { border-color: var(--accent); }
.post-card .post-date {
  font-family: var(--sans); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--fg-muted);
}
.post-card h2 { margin: .3rem 0 .4rem; font-size: 1.2rem; }
.post-card p { margin: 0; font-size: .92rem; color: var(--fg-muted); }

/* ---------- blog post ---------- */
.blog-post h1 { font-size: 1.9rem; letter-spacing: -.015em; margin: .2rem 0 1rem; }
.blog-post h2 { font-size: 1.28rem; margin-top: 2.2rem; }
.blog-post figure { margin: .9rem 0 1.4rem; }
.blog-post figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: #f4efe5;
}
.blog-post figcaption {
  margin-top: .65rem; padding: 0 .2rem;
  font-family: var(--sans); font-size: .78rem;
  line-height: 1.55; color: var(--fg-muted);
}
.blog-local-toc {
  margin: 1.4rem 0 2rem; padding: .9rem 1rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-raised); font-family: var(--sans);
}
.blog-toc-label {
  display: block; margin-bottom: .4rem; color: var(--fg-muted);
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
}
.blog-local-toc ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: 2rem; }
.blog-local-toc li { break-inside: avoid; margin: .2rem 0; font-size: .82rem; line-height: 1.4; }
@media (max-width: 620px) {
  .blog-local-toc ol { columns: 1; }
}

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .93em; }
th { text-align: left; border-bottom: 2px solid var(--border); padding: .4rem .6rem; font-family: var(--sans); font-size: .85em; }
td { border-bottom: 1px solid var(--border); padding: .45rem .6rem; vertical-align: top; }
.blog-post table { font-family: var(--sans); font-size: .85em; }
.blog-post th { font-weight: 700; }
.blog-post td:nth-child(n+3), .blog-post th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 760px; margin: 0 auto; padding: 0 2rem 2.5rem;
  font-family: var(--sans); font-size: .78rem; color: var(--fg-muted);
  border-top: 1px solid var(--border); padding-top: 1.2rem;
}
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }

@media print {
  .topbar, .site-footer { display: none !important; }
  article { max-width: none; padding: 0; }
}
