/* Blog: index, post pages, tags. Scoped to blog classes so the rest of the
   site keeps application.css as-is. */

:root {
  --rule: #e4e4e4;
  --tag-bg: #ececec;
  --tag-fg: #444;
  --tag-hover-bg: var(--link);
  --tag-hover-fg: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rule: #2e2e2e;
    --tag-bg: #2c2c2c;
    --tag-fg: #ccc;
    --tag-hover-fg: #111;
  }
}

/* ---------- Tags: a luggage tag, pointed on the left with a punched hole ---------- */
.tag {
  --h: 1.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: var(--h);
  margin: 0 .3rem .35rem calc(var(--h) / 2);
  padding: 0 .55rem 0 .7rem;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border-radius: 0 3px 3px 0;
  font-size: .75rem;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .12s, color .12s;
}
/* the point */
.tag::before {
  content: "";
  position: absolute;
  left: calc(var(--h) / -2);
  top: 0;
  border-style: solid;
  border-width: calc(var(--h) / 2) calc(var(--h) / 2) calc(var(--h) / 2) 0;
  border-color: transparent var(--tag-bg) transparent transparent;
  transition: border-color .12s;
}
/* the hole */
.tag::after {
  content: "";
  position: absolute;
  left: .05rem;
  top: 50%;
  width: .3rem;
  height: .3rem;
  margin-top: -.15rem;
  border-radius: 50%;
  background: var(--bg);
}
.tag:hover, .tag:focus-visible, .tag[aria-current="page"] {
  background: var(--tag-hover-bg);
  color: var(--tag-hover-fg);
}
.tag:hover::before, .tag:focus-visible::before, .tag[aria-current="page"]::before {
  border-right-color: var(--tag-hover-bg);
}
.tag:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.tag-count { font-variant-numeric: tabular-nums; opacity: .6; }

.post-tags { display: flex; flex-wrap: wrap; align-items: center; margin: .5rem 0 0; }

/* ---------- Index ---------- */
.blog-head h1 { margin: 0 0 .25rem; font-size: 2rem; letter-spacing: -.01em; }
.blog-head p { margin-bottom: 1.5rem; }
.blog-filter { display: inline-flex; align-items: center; gap: .25rem; font-size: 1rem; font-weight: 400; color: var(--muted); vertical-align: middle; }
.blog-filter .tag { font-size: .85rem; margin-bottom: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; align-items: center; padding: 0 0 1.25rem; border-bottom: 1px solid var(--rule); }
.tag-all { margin: 0 .75rem .35rem 0; font-size: .85rem; }

.post-year h2 {
  margin: 2rem 0 .25rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* No bullets, ever: list-style, padding and the ::marker all reset. */
.post-list, .post-related ul { list-style: none; margin: 0; padding: 0; }
.post-list > li::marker, .post-related li::marker { content: none; }

.post-item {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 0 1rem;
  margin: 0;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-item time {
  padding-top: .2rem;
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.post-item-title {
  color: var(--fg);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  text-decoration: none;
}
.post-item-title:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.post-kind { margin-left: .4rem; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.post-item-summary {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .post-item { grid-template-columns: 1fr; }
  .post-item time { padding: 0 0 .15rem; }
}

/* ---------- Post page ---------- */
.post-back { margin: 0 0 1.5rem; font-size: .85rem; }
.post-back a { color: var(--muted); text-decoration: none; }
.post-back a:hover { color: var(--link); }
.post-back-end { margin: 2.5rem 0 0; }

.post header { margin-bottom: 2rem; }
.post header h1 { margin: 0 0 .5rem; font-size: 2rem; line-height: 1.2; letter-spacing: -.01em; }
.post header .muted { margin-bottom: .25rem; }

.post-body { font-size: 1.0625rem; line-height: 1.7; overflow-wrap: anywhere; }
.post-body h2 { margin: 2.25rem 0 .75rem; font-size: 1.35rem; line-height: 1.3; }
.post-body h3 { margin: 1.75rem 0 .5rem; font-size: 1.1rem; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.15rem; }
.post-body li { margin: .3rem 0; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
.post-body code { font-size: .9em; padding: .1em .3em; border-radius: 3px; background: var(--tag-bg); }
.post-body pre { overflow-x: auto; padding: 1rem; border-radius: 6px; background: var(--tag-bg); font-size: .875rem; line-height: 1.5; }
.post-body pre code { padding: 0; background: none; }
.post-body hr { margin: 2.5rem 0 1.25rem; border: 0; border-top: 1px solid var(--rule); }
/* The closing "Originally posted on LinkedIn…" line after the rule. */
.post-body hr + p { font-size: .875rem; color: var(--muted); }

.post-related { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.post-related h2 { margin: 0 0 .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.post-related li { padding: .3rem 0; }
