/* Site-wide custom styles layered on top of the Terminus theme.
   Everything keys off the theme's CSS variables, so it follows the active
   colour scheme (and the switcher). */

/* --- Series navigation box (from the {{ series() }} shortcode) --- */
.series-box {
  margin: 1.5rem 0 2rem;
  padding: 0.7rem 1rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent-color) 55%, transparent);
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--text-color) 4%, var(--background-color));
  font-size: 0.92em;
}

.series-box__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.series-box__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72em;
  color: var(--accent-color);
  border: 1px solid color-mix(in srgb, var(--accent-color) 55%, transparent);
  border-radius: 3px;
  padding: 0.05em 0.4em;
}

.series-box__name { font-weight: 700; }

.series-box__count {
  margin-left: auto;
  color: var(--footnote-color, rgba(255, 255, 255, 0.5));
  font-size: 0.85em;
}

.series-box__list {
  margin: 0;
  padding-left: 1.6rem;
  list-style: decimal;
}

.series-box__list li { margin: 0.15rem 0; }

.series-box__list .is-current {
  color: var(--accent-color);
  font-weight: 700;
  list-style: none;
  margin-left: -1.6rem;
}

.series-box__list .is-current::before {
  content: "▸ ";
  color: var(--accent-color);
}

/* --- Post views --- */
.post-views {
  margin: -0.4rem 0 1.2rem;
  color: var(--footnote-color, rgba(255, 255, 255, 0.5));
  font-size: 0.85em;
}

/* --- Engagement footer: reactions + share --- */
.post-engagement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px dashed color-mix(in srgb, var(--text-color) 20%, transparent);
  font-size: 0.9em;
}

.reactions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.reactions button {
  padding: 0.15em 0.6em;
  font: inherit;
  color: var(--text-color);
  background: color-mix(in srgb, var(--text-color) 5%, var(--background-color));
  border: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.reactions button:hover { border-color: var(--accent-color); }
.reactions button.reacted { border-color: var(--accent-color); transform: scale(1.08); }
.reactions .count { color: var(--footnote-color); font-size: 0.9em; }

.share { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.share__label {
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72em;
}
.share a,
.share__copy {
  padding: 0;
  font: inherit;
  color: var(--text-color);
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-color) 50%, transparent);
  cursor: pointer;
}
.share a:hover,
.share__copy:hover { color: var(--accent-color); }

/* --- giscus comments --- */
.comments { margin-top: 3rem; }
.comments h2 { margin-bottom: 1rem; }

/* --- Reading progress bar --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent-color);
  z-index: 1000;
  transition: width 0.05s linear;
}

/* --- "Updated" line --- */
.post-updated {
  margin: -0.6rem 0 1rem;
  color: var(--footnote-color, rgba(255, 255, 255, 0.5));
  font-size: 0.85em;
}

/* --- Table of contents --- */
.toc {
  margin: 1.5rem 0 2rem;
  padding: 0.7rem 1rem;
  border-left: 2px solid color-mix(in srgb, var(--accent-color) 55%, transparent);
  background: color-mix(in srgb, var(--text-color) 3%, var(--background-color));
  font-size: 0.92em;
}
.toc__label {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.72em;
  color: var(--accent-color);
}
.toc ol { margin: 0; padding-left: 1.4rem; }
.toc > ol { padding-left: 1.2rem; }
.toc li { margin: 0.1rem 0; }

/* --- Related posts --- */
.related { margin-top: 2.5rem; }
.related h2 { margin-bottom: 0.6rem; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--text-color) 14%, transparent);
}
.related time { color: var(--footnote-color, rgba(255, 255, 255, 0.5)); font-size: 0.85em; white-space: nowrap; }

/* --- Popular posts (home) --- */
.popular {
  margin: 1.5rem 0 2rem;
  padding: 0.7rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent-color) 40%, transparent);
  border-radius: var(--radius, 6px);
  background: color-mix(in srgb, var(--text-color) 3%, var(--background-color));
}
.popular h2 { margin: 0 0 0.4rem; font-size: 0.95em; }
.popular ol { margin: 0; padding-left: 1.3rem; }
.popular li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.12rem 0;
}
.popular__views { color: var(--footnote-color, rgba(255, 255, 255, 0.5)); font-size: 0.82em; white-space: nowrap; }

/* --- Media embeds (responsive 16:9) --- */
.embed--video {
  position: relative;
  margin: 1.5rem 0;
  aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--text-color) 15%, transparent);
  border-radius: var(--radius, 6px);
  overflow: hidden;
  background: #000;
}
.embed--video iframe,
.embed--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
