/* Hallmark · component: four-column footer · genre: editorial · theme: site palette
 * Screenshot-inspired structure with published posts and existing contact links.
 * Pre-emit critique: P5 H4 E4 S5 R4 V4.
 */
.md-footer.kb-footer {
  --footer-paper: var(--color-paper);
  --footer-ink: var(--color-ink);
  --footer-muted: var(--color-muted);
  --footer-faint: var(--color-faint);
  --footer-accent: var(--color-accent-strong);
  --footer-rule: var(--color-rule);
  --footer-surface: var(--color-surface);
  --footer-snow: #7486ad;
  --footer-emblem: color-mix(in oklab, var(--footer-faint) 38%, var(--footer-surface));
  position: relative;
  isolation: isolate;
  margin-top: var(--space-10);
  overflow: clip;
  color: var(--footer-muted);
  background: var(--footer-paper);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.8;
}

[data-md-color-scheme="slate"] .md-footer.kb-footer {
  --footer-snow: #c4d1f5;
}

.kb-footer__snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--footer-snow);
  pointer-events: none;
}

.kb-footer__inner {
  position: relative;
  padding: var(--space-12) var(--space-4) var(--space-6);
}

.kb-footer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-10) var(--space-6);
}

.kb-footer__grid > * {
  min-width: 0;
}

.kb-footer__intro,
.kb-footer__recent {
  grid-column: 1 / -1;
}

.kb-footer h2 {
  position: relative;
  margin: 0 0 var(--space-6);
  padding-bottom: var(--space-3);
  color: var(--footer-ink);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.4;
}

.kb-footer h2::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--space-6);
  height: var(--rule-focus);
  background: var(--footer-accent);
  content: "";
}

.kb-footer p,
.kb-footer ul {
  margin: 0;
  padding: 0;
}

.kb-footer ul {
  list-style: none;
}

.kb-footer a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-short) var(--ease-out);
}

.kb-footer a:focus-visible {
  border-radius: var(--radius-xs);
  outline: var(--rule-focus) solid var(--footer-accent);
  outline-offset: var(--space-1);
}

.kb-footer a:active {
  color: var(--footer-accent);
}

.kb-footer__attribution {
  display: inline-block;
  margin-inline-start: var(--space-2);
}

.kb-footer__emblem {
  width: clamp(6rem, 12vw, 8rem);
  aspect-ratio: 180 / 183;
  background: var(--footer-emblem);
  mask: url("../images/cipher-wheel.svg") center / contain no-repeat;
}

.kb-footer__posts {
  display: grid;
  gap: var(--space-5);
}

.kb-footer__post {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.kb-footer__thumbnail {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  overflow: clip;
  place-items: center;
  border: var(--rule-thin) solid var(--footer-rule);
  border-radius: var(--radius-sm);
  color: var(--footer-faint);
  background: var(--footer-surface);
}

.kb-footer__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-footer__thumbnail svg {
  width: var(--space-6);
  height: var(--space-6);
  fill: currentcolor;
}

.kb-footer__post-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--footer-ink);
  line-height: 1.65;
}

.kb-footer__post time {
  display: block;
  margin-top: var(--space-2);
  color: var(--footer-accent);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.kb-footer__navigation a {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  white-space: nowrap;
}

.kb-footer__contact ul {
  display: grid;
  gap: var(--space-4);
}

.kb-footer__contact-link {
  display: flex;
  min-height: 2.2rem;
  align-items: flex-start;
  gap: var(--space-3);
  line-height: 1.5;
  white-space: nowrap;
}

.kb-footer__contact-link small {
  display: block;
  margin-top: var(--space-1);
  color: var(--footer-faint);
  font-size: var(--text-xs);
}

.kb-footer__contact-icon {
  display: inline-flex;
  flex-shrink: 0;
  padding-top: var(--space-1);
  color: var(--footer-faint);
}

.kb-footer__contact-icon svg {
  width: var(--space-4);
  height: var(--space-4);
  fill: currentcolor;
}

.kb-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: var(--rule-thin) solid var(--footer-rule);
  color: var(--footer-faint);
  font-size: var(--text-xs);
  line-height: 1.65;
}

.kb-footer__quote {
  flex: 1 1 34rem;
  min-width: 0;
  text-wrap: pretty;
}

.kb-footer__copyright {
  flex: 0 0 auto;
}

@media (hover: hover) {
  .kb-footer a:hover {
    color: var(--footer-accent);
  }

}

@media (max-width: 39.99rem) {
  .kb-footer__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
  }

  .kb-footer__intro h2 {
    margin-bottom: 0;
  }

  .kb-footer__emblem {
    flex: 0 0 auto;
    width: 4.5rem;
  }
}

@media (min-width: 40rem) {
  .kb-footer__intro,
  .kb-footer__recent {
    grid-column: auto;
  }
}

@media (min-width: 64rem) {
  .kb-footer__inner {
    padding-top: var(--space-20);
  }

  .kb-footer__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 1fr);
    gap: var(--space-10);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kb-footer__snow {
    display: none;
  }

  .kb-footer a {
    transition: none;
  }
}
