/* ------------------------------------------------------------------
   martinbholm.com — site styles
   Layout: fixed left sidebar (profile + nav), scrolling content column
   ------------------------------------------------------------------ */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c2129;
  --muted: #5c6672;
  --faint: #8a939e;
  --accent: #1e4d7b;
  --accent-hover: #163b5e;
  --accent-soft: #e6eef6;
  --border: #e3e0d8;
  --tag-bg: #f0eee8;
  --sidebar-w: 300px;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181d;
    --surface: #1b2027;
    --text: #e7e9ec;
    --muted: #a5adb7;
    --faint: #7c8590;
    --accent: #8fb6dd;
    --accent-hover: #b3cee9;
    --accent-soft: #22303f;
    --border: #2b323b;
    --tag-bg: #242b33;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.2; margin: 0; }
h1 { font-size: 2.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin-top: 3rem; margin-bottom: 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
h2:first-of-type { margin-top: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.profile { text-align: left; }

.profile .portrait {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
  margin-bottom: 1rem;
}

.profile .name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
}
.profile .name a { color: inherit; }
.profile .name a:hover { text-decoration: none; }

.profile .role {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  margin-top: .4rem;
}

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li + li { margin-top: .15rem; }
.nav a {
  display: block;
  padding: .4rem .6rem;
  margin-left: -.6rem;
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
}
.nav a:hover { background: var(--tag-bg); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.side-block .label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .5rem;
}
.side-block ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.side-block li { margin: .25rem 0; color: var(--muted); }
.side-block li a { display: inline-flex; align-items: center; gap: .45rem; }
.side-block svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }

.sidebar .foot {
  margin-top: auto;
  font-size: .75rem;
  color: var(--faint);
}

/* ---------- Main column ---------- */

main {
  padding: 3.5rem 4rem 5rem;
  max-width: 860px;
  width: 100%;
}

.page-header { margin-bottom: 1.5rem; }
.page-header .kicker {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.page-header p.lead { font-size: 1.1rem; color: var(--muted); margin-top: .75rem; max-width: 60ch; }

.lead { font-size: 1.1rem; color: var(--muted); }

/* Section jump links */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1.25rem 0 .5rem;
}
.jump a {
  font-size: .82rem;
  padding: .3rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
}
.jump a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Papers ---------- */

.paper { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.paper:last-child { border-bottom: 0; }

.paper .title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
}
.paper .title a { color: var(--text); }
.paper .title a:hover { color: var(--accent); }
.paper .title .note { font-family: var(--font-sans); font-size: .85rem; color: var(--muted); }

.paper .meta {
  color: var(--muted);
  font-size: .92rem;
  margin-top: .25rem;
}
.paper .meta .venue { font-style: italic; }
.paper .meta .status {
  display: inline-block;
  font-style: normal;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .1rem .45rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  vertical-align: 1px;
  margin-right: .35rem;
}

.paper .authors { color: var(--muted); font-size: .92rem; margin-top: .15rem; }

.paper .links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.paper .links a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 500;
  padding: .28rem .65rem;
  border-radius: 6px;
  background: var(--tag-bg);
  color: var(--text);
  border: 1px solid transparent;
}
.paper .links a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.paper .links a.primary { background: var(--accent); color: #fff; }
.paper .links a.primary:hover { background: var(--accent-hover); color: #fff; }
.paper .links svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Home page ---------- */

.project-list { list-style: none; margin: 0; padding: 0; }
.project-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.project-list li:last-child { border-bottom: 0; }
.project-list a { font-family: var(--font-serif); font-size: 1.05rem; color: var(--text); }
.project-list a:hover { color: var(--accent); }
.project-list .years { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: .55rem 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: baseline; }
.recent li:last-child { border-bottom: 0; }
.recent .t { font-family: var(--font-serif); font-size: 1.05rem; }
.recent .t a { color: var(--text); }
.recent .t a:hover { color: var(--accent); }
.recent .s { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.more { display: inline-block; margin-top: .75rem; font-size: .9rem; font-weight: 500; }

/* ---------- Op-eds ---------- */

.oped { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.oped:last-child { border-bottom: 0; }
.oped .date { color: var(--faint); font-size: .85rem; padding-top: .2rem; }
.oped .t { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.3; }
.oped .t a { color: var(--text); }
.oped .t a:hover { color: var(--accent); }
.oped .o { color: var(--muted); font-size: .88rem; margin-top: .15rem; }

/* ---------- Conference page ---------- */

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin: 1.5rem 0; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem; }
.fact .k { font-size: .72rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.fact .v { font-family: var(--font-serif); font-size: 1.15rem; margin-top: .2rem; line-height: 1.3; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1rem; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 500; font-size: .92rem;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.committee { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.committee li { padding: .3rem 0; break-inside: avoid; }
.committee .aff { display: block; color: var(--muted); font-size: .85rem; }

.prose { max-width: 66ch; }
.prose h2 { margin-top: 2.25rem; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1rem;
    gap: 1.1rem;
  }
  .profile { display: grid; grid-template-columns: 76px 1fr; column-gap: 1rem; align-items: center; }
  .profile .portrait { width: 76px; height: 76px; margin: 0; }
  .profile .name { font-size: 1.3rem; }
  .nav ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  .nav a { margin-left: 0; padding: .35rem .7rem; }
  .side-block ul { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
  .side-block li { margin: 0; }
  .sidebar .foot { display: none; }
  main { padding: 1.75rem 1rem 3rem; }
  h1 { font-size: 1.8rem; }
  .facts { grid-template-columns: 1fr; }
  .project-list li { grid-template-columns: 1fr; gap: .1rem; }
  .committee { columns: 1; }
  .recent li { grid-template-columns: 1fr; gap: .1rem; }
  .recent .s { white-space: normal; }
  .oped { grid-template-columns: 1fr; gap: .1rem; }
}

@media print {
  body { display: block; background: #fff; color: #000; }
  .sidebar { position: static; height: auto; border: 0; padding: 0 0 1rem; }
  .nav, .sidebar .foot, .jump, .portrait { display: none; }
  main { padding: 0; max-width: none; }
  a { color: #000; }
  .paper .links a.primary { background: none; color: #000; border: 1px solid #999; }
}
