/* Substack-style typography layered over the no-style-please theme */

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 3px;
  border-radius: 3px;
}

body {
  color: #363737;
  font-family: Lora, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.w {
  max-width: 728px;
  padding: 3rem 1.5rem 5rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
  color: #000;
  font-weight: 700;
  line-height: 1.25;
}

h2, h3, h4, h5, h6 {
  margin: 2.5rem 0 1rem;
}

h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

hr {
  height: 1px;
  background: #e6e6e6;
  margin: 2.5rem 0;
}
hr:before,
hr:after {
  content: none;
}

blockquote {
  font-style: normal;
  border: 0;
  border-left: 4px solid #e6e6e6;
  margin: 1.5rem 0;
  padding: 0 0 0 1.25rem;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

code {
  color: #222;
  background: #f2f2f2;
  border-radius: 4px;
  padding: 0.1em 0.3em;
}

div.highlighter-rouge code {
  border-radius: 6px;
  line-height: 1.5;
}

table, th, td {
  border-color: #e6e6e6;
}

img,
video {
  border-radius: 4px;
}

.post-meta {
  text-align: left;
}

/* ---------- home page ---------- */

.home {
  /* shrink to the widest line so the block is optically centered */
  width: fit-content;
  max-width: 100%;
  margin: 4rem auto 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.home-header {
  margin-bottom: 3.5rem;
}

.home-title {
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0 0 0.4rem;
}

.home-description {
  color: #6e6e73;
  margin: 0 0 0.4rem;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: 0.85rem;
}

.home-links a {
  color: #6e6e73;
  text-decoration: none;
}
.home-links a:hover {
  color: #1d1d1f;
}

.home-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-posts li {
  margin: 0;
}

.home-posts a {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.3rem 0;
  text-decoration: none;
}

.home-posts time {
  flex-shrink: 0;
  color: #6e6e73;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.home-post-title {
  color: #1d1d1f;
}
.home-posts a:hover .home-post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- article pages ---------- */

.post-back {
  display: inline-block;
  margin-bottom: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: #6b6b6b;
  text-decoration: none;
}
.post-back:hover {
  color: #000;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.5rem;
  line-height: 1.15;
  margin: 0 0 1.25rem;
}

.post-subtitle {
  color: #6b6b6b;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 1.5rem;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: #6b6b6b;
}

.post-byline .author {
  color: #000;
  font-weight: 600;
  text-decoration: none;
}

.post-body {
  font-size: 19px;
  line-height: 1.65;
}

.post-body p {
  margin: 0 0 1.4rem;
}

.post-body details {
  margin: 0 0 1.4rem;
}

.post-body li {
  margin: 0.35rem 0;
}

.post-body img,
.post-body video {
  margin: 2rem auto;
}

.post-body a.img-link {
  display: block;
  cursor: zoom-in;
}

@media (max-width: 600px) {
  .w { padding: 1.25rem 1.25rem 4rem; }

  /* home: big, easy-to-tap rows like an iOS list */
  .home { width: auto; margin-top: 1.5rem; font-size: 17px; }
  .home-header { margin-bottom: 1.75rem; }
  .home-title { font-size: 1.6rem; margin-bottom: 0.25rem; }
  .home-links { gap: 0 1.5rem; font-size: 1.05rem; }
  .home-links a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
  }
  .home-posts li + li { border-top: 1px solid #f0f0f0; }
  .home-posts a {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.15rem;
    position: relative;
    min-height: 68px;
    margin: 0 -1.25rem;
    padding: 0.7rem 3rem 0.7rem 1.25rem;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
  }
  .home-posts a::after {
    content: "\203A";
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #c7c7cc;
    font-size: 1.6rem;
  }
  .home-posts a:active { background: #f2f2f7; }
  .home-posts time { order: -1; font-size: 0.85rem; }
  .home-post-title { font-size: 1.15rem; font-weight: 500; }
  .home-posts a:hover .home-post-title { text-decoration: none; }

  /* articles */
  .post-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
  }
  .post-title { font-size: 2rem; }
  .post-subtitle { font-size: 1.1rem; }
  .post-byline { flex-wrap: wrap; gap: 0.25rem 0.6rem; }
  .post-body { font-size: 18px; }

  /* full-bleed images so screenshots are as large as possible */
  .post-body img {
    width: calc(100% + 2.5rem);
    max-width: none;
    margin: 1.5rem -1.25rem;
    border-radius: 0;
  }
}
