/*
 * Site overrides for hugo-theme-terminal, loaded by the theme's head.html
 * when static/style.css exists. Colors come from the theme tokens
 * (--background #1a170f, --foreground #eceae5, --accent #eec35e).
 */

/* Code comments and code-block titles: the theme's 50% foreground is 4.4:1 on the
   code background, under WCAG AA; 64% brings it to about 5.7:1 */
:root {
  --comment: color-mix(in srgb, var(--foreground) 64%, transparent);
}

/* Headings: more space above than below, so each heading opens its section */
.post-content h2 {
  margin: 2.6em 0 0.7em;
  padding-top: 1.1em;
  border-top: 1px solid color-mix(in srgb, var(--foreground) 15%, transparent);
}

.post-content h3 {
  margin: 1.9em 0 0.6em;
}

.post-content h2 + h3 {
  margin-top: 1em;
}

/* Heading anchors: the theme shows them only on hover, which touch screens never get */
@media (hover: none) {
  .hanchor {
    visibility: visible;
    opacity: 0.6;
  }
}

/* Tables: keep tokens like P22 or entity IDs whole and scroll sideways when too wide */
.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border: 0;
}

.post-content th,
.post-content td {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--foreground) 18%, transparent);
  padding: 0.55em 1.4em 0.55em 0;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: normal;
}

.post-content th {
  border-bottom-color: var(--accent);
  font-size: 0.85em;
}

.post-content td code {
  white-space: nowrap;
}

/* On phones give prose cells room, so the table scrolls instead of squeezing a column to one word per line */
@media (max-width: 684px) {
  .post-content th,
  .post-content td {
    min-width: 14ch;
  }
}

/* Related posts at the end of an article */
.related-posts {
  margin: 3em 0 1em;
  padding-top: 1.1em;
  border-top: 1px solid color-mix(in srgb, var(--foreground) 15%, transparent);
}

.related-posts h2 {
  margin: 0 0 0.6em;
}

.related-posts ul {
  margin: 0;
}

/* Side-by-side photos with plain captions, lighter than the theme's 8px accent frame */
.photo-pair {
  display: flex;
  gap: 1.5em;
  justify-content: center;
  align-items: flex-start;
  margin: 2em 0;
}

.photo-pair figure {
  flex: 0 1 46%;
  width: auto;
  margin: 0;
}

.photo-pair img {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--foreground) 22%, transparent);
}

.photo-pair figcaption {
  margin-top: 0.6em;
  padding: 0;
  background: none;
  color: color-mix(in srgb, var(--foreground) 72%, var(--background));
  font-size: 0.85em;
  text-align: left;
}
