/* Blog-specific composition. The shared palette and typography live in /site.css. */

article,
main > section {
  padding: 44px 0 80px;
}

.masthead + article,
.masthead + section {
  padding-top: 24px;
}

.muted,
.subtitle,
.sub,
.muted-note {
  color: var(--muted);
}

.small-note {
  color: var(--muted);
  font-size: .85em;
}

.source-note {
  color: var(--muted);
  font-size: .8em;
  text-align: center;
}

.attribute-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0;
}

.accent-card {
  border-width: 2px;
}

.metric-grid-spaced,
.flow-spaced {
  margin-top: 18px;
}

.tag {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 28px;
  color: var(--muted);
}

.hero {
  margin: 28px 0;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.hero figcaption,
.post-footer,
.infographic,
.stack,
.eyebrow,
.phase-label,
.node .name,
.aside .label,
.substrate-label,
.tldr h3 {
  font-family: var(--mono);
}

.hero figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pull-quote,
.quote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--ink);
}

.pull-quote cite {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
}

.infographic {
  position: relative;
  min-height: 250px;
  margin: 28px 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.infographic-title {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.frames {
  position: relative;
  height: 170px;
  margin-top: 18px;
}

.frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: frame-cycle 16s infinite;
}

.frame:nth-child(2) { animation-delay: 4s; }
.frame:nth-child(3) { animation-delay: 8s; }
.frame:nth-child(4) { animation-delay: 12s; }

.frame .big {
  margin-bottom: 8px;
  font-size: 27px;
}

.frame .subline {
  color: var(--muted);
}

.dots {
  display: flex;
  gap: 6px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

@keyframes frame-cycle {
  0%, 3%, 28%, 100% { opacity: 0; }
  7%, 22% { opacity: 1; }
}

.stack {
  display: grid;
  grid-template-columns: 160px 1fr;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stack > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stack .k {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}

pre,
code,
.diagram,
.ts {
  font-family: var(--mono);
}

pre,
.diagram {
  max-width: 100%;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.55;
}

code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  font-size: .86em;
}

table {
  display: block;
  width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-weight: normal;
}

.post-footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.page > footer {
  margin: 64px 0 80px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

/* Index */
.post-list {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.post-list h2 {
  margin: 0 0 8px;
  font-size: var(--text-entry);
}

.post-list .post-meta {
  margin: 8px 0;
}

.post-list .excerpt {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* Shared structures in the research/playbook articles. */
.deepdive,
.playbook {
  margin-top: 44px;
}

.deepdive h1,
.playbook h1 {
  font-size: 27px;
}

.card,
.toc,
.metric,
.link-item,
.substrate,
.aside {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.card-header,
.card-head,
.kv,
.chapter {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-header,
.card-head {
  justify-content: space-between;
}

.card-header h4,
.card-head h4 {
  margin-top: 0;
}

.badge,
.phase-kind,
.phase-num,
.num,
.kv .k,
.metric .lbl,
.eyebrow,
.attribute-title {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--line);
}

.cols,
.link-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-item {
  margin: 0;
}

.diagram {
  white-space: pre;
}

.sep {
  height: 1px;
  margin: 36px 0;
  background: var(--line);
}

.kv .k {
  min-width: 90px;
}

.chapter {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric {
  margin: 0;
  text-align: center;
}

.metric .val {
  font-size: 23px;
}

/* Matt Pocock field-guide: retain the phase and hand-off diagram semantics. */
.page > .hero {
  margin: 0;
  padding: 44px 0 20px;
}

.eyebrow {
  margin-bottom: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.title em,
.tldr em {
  font-weight: normal;
}

.lede {
  color: var(--muted);
  font-size: 20px;
}

.phase {
  margin: 64px 0;
}

.phase-label {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.phase h2 {
  margin-top: 0;
}

.flow {
  margin-top: 28px;
  border-bottom: 1px solid var(--line);
}

.node {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.node .name {
  display: flex;
  gap: 10px;
  align-items: baseline;
  overflow-wrap: anywhere;
}

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--ink);
}

.optional .name::after {
  content: "optional";
  color: var(--muted);
  font-size: 11px;
}

.arrow {
  height: 20px;
  margin-left: 3px;
  border-left: 1px solid var(--line);
}

.aside {
  margin-left: 20px;
  border-width: 0 0 0 2px;
}

.aside .label,
.substrate-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
}

.ornament {
  margin: 52px 0;
  color: var(--muted);
  text-align: center;
}

.ornament::before {
  content: "* * *";
}

.substrate {
  padding: 24px;
}

.tldr {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  article,
  main > section {
    padding-top: 32px;
  }

  .cols,
  .link-grid,
  .node {
    grid-template-columns: 1fr;
  }

  .stack {
    grid-template-columns: 1fr;
  }

  .card-header,
  .card-head {
    display: block;
  }

  .badge {
    margin-top: 6px;
  }

  .diagram {
    font-size: 12px;
  }
}
