/* Personal site - one shared stylesheet. Black and white, newspaper feel. */

:root {
  --ink: #111;
  --paper: #fff;
  --muted: #555;
  --rule: #111;
  --hairline: #cfcfcf;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --sidebar: 200px;
  --measure: 38em;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Layout ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-areas:
    "side head"
    "side main";
  column-gap: 2.5rem;
}

.sidebar {
  grid-area: side;
  border-right: 1px solid var(--rule);
  padding-right: 1.5rem;
}

.page-header {
  grid-area: head;
  border-bottom: 4px double var(--rule);
  margin-bottom: 2rem;
}

main {
  grid-area: main;
  min-width: 0;
}

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

.masthead {
  display: block;
  font-size: 1.35rem;
  font-weight: bold;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar nav li { margin: 0 0 0.5rem; }

.sidebar nav a {
  color: var(--ink);
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}

.sidebar nav a:hover { text-decoration: underline; }

.sidebar nav a[aria-current="page"] {
  font-weight: bold;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.sidebar .contact {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.sidebar .contact a { color: var(--muted); }

/* ---------- Page header ---------- */

.page-header h1 {
  margin: 0 0 0.4rem;
  text-align: right;
  font-size: 2.6rem;
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.page-header .dateline {
  margin: 0 0 0.5rem;
  text-align: right;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Social icons ---------- */

.social,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 0.6rem;
}

.social { justify-content: flex-end; }

.links { margin: 0.45rem 0 0; }

.social a,
.links a {
  display: inline-flex;
  transition: transform 0.1s;
}

.social a:hover,
.links a:hover { transform: translateY(-1px); }

.social img { width: 18px; height: 18px; }

.links img { width: 16px; height: 16px; }

/* ---------- Text ---------- */

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 2px; }

h2, h3 {
  line-height: 1.25;
  margin: 2rem 0 0.6rem;
}

h2 {
  font-size: 1.1rem;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-weight: bold;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
}

h3 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }

.lede {
  font-size: 1.15rem;
  max-width: var(--measure);
}

.focus-note {
  max-width: var(--measure);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--rule);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

code, pre {
  font-family: var(--mono);
  font-size: 0.85em;
}

pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--hairline);
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
}

figure { margin: 1.5rem 0; }

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ---------- Projects ---------- */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.entries li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}

.entries li:first-child { padding-top: 0; }

.entries .title {
  font-size: 1.15rem;
  font-weight: bold;
}

.entries p {
  margin: 0.25rem 0 0;
}

.projects li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.projects .logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--hairline);
  padding: 4px;
  background: #fff;
}

/* ---------- Writing index ---------- */

.post-list .date {
  display: block;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Article ---------- */

article {
  max-width: var(--measure);
}

article > p:first-of-type::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.85;
  padding: 0.08em 0.1em 0 0;
}

.series-note {
  font-style: italic;
  margin-bottom: 1rem;
}

sup {
  font-size: 0.7em;
  line-height: 0;
}

sup a { text-decoration: none; }

.footnotes {
  margin-top: 2.5rem;
  font-size: 0.85rem;
}

.footnotes h2 { margin-top: 0; }

.footnotes ol { padding-left: 1.2rem; }

.footnotes li { margin-bottom: 0.3rem; }

article table {
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

article td {
  padding: 0.25rem 1.5rem 0.25rem 0;
  border-bottom: 1px solid var(--hairline);
}

article td:last-child {
  text-align: right;
  padding-right: 0;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Resume ---------- */

.resume {
  max-width: 44em;
}

.resume .role {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 1rem;
  margin-top: 1.25rem;
}

.resume .role strong { font-size: 1.05rem; }

.resume .when {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.resume ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.resume li { margin-bottom: 0.3rem; }

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  html { font-size: 17px; }

  .page {
    padding: 1rem 16px 3rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "side"
      "head"
      "main";
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0 0 0.75rem;
    margin-bottom: 1.25rem;
  }

  .masthead {
    border-bottom: 0;
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
  }

  .sidebar nav ul {
    display: flex;
    gap: 1.25rem;
  }

  .sidebar nav li { margin: 0; }

  .sidebar .contact { display: none; }

  .page-header h1 { font-size: 2rem; }
}

/* ---------- Print ---------- */

@media print {
  .sidebar { display: none; }
  .page {
    display: block;
    max-width: none;
    padding: 0;
  }
  a { text-decoration: none; }
}
