/* ─────────────────────────────────────────────────────────────────────────
   Blog.

   A single feed column, narrower than the other pages: a timeline is read
   top to bottom, not scanned across. Everything is drawn from the page
   tokens, so the phosphor and paper themes both come for free.
   ───────────────────────────────────────────────────────────────────────── */
.bl-page {
  --page-max: 780px;
  --rail: 2.6rem;
}

/* ── Censor switch ── */
.bl-censor {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.1rem;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--ink-dim);
  cursor: pointer;
}

.bl-censor-track {
  position: relative;
  width: 2.1rem;
  height: 1rem;
  border: 1px solid var(--rule-strong);
  background: rgba(var(--fg-rgb), 0.12);
  transition: background var(--ease), border-color var(--ease);
}

.bl-censor-knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: calc(1rem - 6px);
  height: calc(1rem - 6px);
  background: var(--fg);
  box-shadow: 0 0 8px rgba(var(--fg-rgb), 0.6);
  transition: right var(--ease), background var(--ease);
}

.bl-censor[aria-pressed="false"] .bl-censor-track {
  background: transparent;
  border-color: var(--rule);
}

.bl-censor[aria-pressed="false"] .bl-censor-knob {
  right: calc(100% - 1rem + 4px);
  background: var(--ink-faint);
  box-shadow: none;
}

.bl-censor:is(:hover, .is-hover) { color: var(--fg); }

/* ── Redactions ── */
.bl-bleep {
  cursor: pointer;
  border-radius: 1px;
  -webkit-tap-highlight-color: transparent;
  /* A hair of space either side, so a masked swear inside a word (████hole)
     reads as its own piece rather than running into the letters beside it. */
  margin-inline: 0.14em;
}

.bl-bleep-mask {
  color: var(--fg);
  /* Tightened so the blocks form one bar; the margin gives back the spacing
     the last block would otherwise pull out of the next letter. */
  letter-spacing: -0.08em;
  margin-right: 0.08em;
  opacity: 0.85;
  animation: bl-flicker 5s steps(1) infinite;
}

.bl-bleep-raw { display: none; }

.bl-page.is-raw .bl-bleep-mask,
.bl-bleep.is-open .bl-bleep-mask { display: none; }

.bl-page.is-raw .bl-bleep-raw,
.bl-bleep.is-open .bl-bleep-raw { display: inline; }

/* An opened redaction stays marked, so the reader can see what was hidden. */
.bl-bleep.is-open .bl-bleep-raw,
.bl-page.is-raw .bl-bleep-raw {
  background: rgba(var(--fg-rgb), 0.1);
  box-shadow: 0 1px 0 rgba(var(--fg-rgb), 0.45);
}

.bl-bleep:is(:hover, .is-hover) .bl-bleep-mask { opacity: 1; text-shadow: 0 0 8px rgba(var(--fg-rgb), 0.7); }

@keyframes bl-flicker {
  0%, 100% { opacity: 0.85; }
  93% { opacity: 0.5; }
  95% { opacity: 0.9; }
  97% { opacity: 0.35; }
}

/* The burst when the switch is thrown. */
.bl-page.is-glitching .bl-bleep {
  animation: bl-glitch 0.42s steps(2) 1;
}

@keyframes bl-glitch {
  0%   { transform: translateX(0);     filter: none; }
  20%  { transform: translateX(-2px);  filter: blur(0.6px); }
  40%  { transform: translateX(2px);   opacity: 0.4; }
  60%  { transform: translateX(-1px);  filter: none; }
  100% { transform: translateX(0);     opacity: 1; }
}

/* ── Profile ── */
.bl-profile {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: center;
  margin: -0.6rem 0 1rem;
}

.bl-pfp {
  aspect-ratio: 1;
  border: 1px solid var(--rule-strong);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 20px rgba(var(--fg-rgb), 0.12);
}

.bl-pfp video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--photo-rest);
}

.bl-ident-name {
  font-size: var(--t-sect);
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(var(--fg-rgb), 0.35);
}

.bl-ident-handle {
  font-size: var(--t-small);
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
}

.bl-bio {
  font-size: var(--t-body);
  color: rgba(var(--fg-rgb), 0.85);
  margin-bottom: 0.4rem;
}

.bl-bio p { margin: 0 0 0.2rem; }

.bl-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  font-size: var(--t-label);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.bl-stats b {
  font-weight: normal;
  color: var(--fg);
}

.bl-sync { color: var(--ink-faint); }

/* ── Tag filters ── */
.bl-filters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.7rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: none;
}

.bl-filters::-webkit-scrollbar { display: none; }

.bl-filter {
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 0.15rem 0.6rem;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.bl-filter:is(:hover, .is-hover) { color: var(--fg); border-color: var(--rule-strong); }

.bl-filter.is-active {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

/* ── Posts ── */
.bl-post {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: 0 0.8rem;
  padding: 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  outline: none;
  transition: background var(--ease);
}

.bl-feed .bl-post[data-href] { cursor: pointer; }

.bl-feed .bl-post[data-href]:is(:hover, .is-hover),
.bl-feed .bl-post:focus-visible {
  background: var(--wash);
}

.bl-feed .bl-post:focus-visible {
  box-shadow: inset 2px 0 0 var(--fg);
}

.bl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bl-avatar {
  width: var(--rail);
  height: var(--rail);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--fg);
  font-size: 1.15rem;
  color: var(--fg);
  text-shadow: 0 0 8px rgba(var(--fg-rgb), 0.7);
  background: rgba(var(--fg-rgb), 0.06);
}

.bl-avatar--sm {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.9rem;
  border-color: var(--rule-strong);
}

/* The line that joins a post to the rest of its thread. */
.bl-rail-line {
  flex: 1;
  width: 1px;
  min-height: 1rem;
  margin-top: 0.4rem;
  background: linear-gradient(var(--rule-strong), var(--rule));
}

.bl-main { min-width: 0; padding-bottom: 0.7rem; }

/* Title on the left, time and flags on the same line at the right. */
.bl-head {
  display: flex;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  margin-bottom: 0.25rem;
}

.bl-meta {
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
  margin-left: auto;
  gap: 0 0.45rem;
  font-size: var(--t-small);
  line-height: 1.4;
}

.bl-name { color: var(--fg); }
.bl-handle, .bl-dot, .bl-meta time { color: var(--ink-faint); }

.bl-flag {
  font-size: var(--t-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 0.35rem;
  border: 1px solid var(--rule-strong);
  color: var(--ink-dim);
}

.bl-flag--new {
  border-color: var(--fg);
  color: var(--fg);
  box-shadow: 0 0 10px rgba(var(--fg-rgb), 0.35);
  animation: bl-flicker 3s steps(1) infinite;
}

.bl-title {
  font-size: var(--t-lead);
  font-weight: normal;
  letter-spacing: 0.04em;
  margin: 0;
  min-width: 0;
  line-height: 1.3;
  text-shadow: 0 0 14px rgba(var(--fg-rgb), 0.6), 0 0 2px rgba(var(--fg-rgb), 0.45);
}

.bl-title a { color: inherit; }

.bl-title--reply {
  font-size: var(--t-body);
  color: rgba(var(--fg-rgb), 0.85);
}

.bl-body {
  font-size: var(--t-body);
  line-height: 1.6;
  color: rgba(var(--fg-rgb), 0.9);
  overflow-wrap: anywhere;
}

.bl-body p { margin: 0 0 0.55rem; }
.bl-body p:last-child { margin-bottom: 0; }

/* The feed shows the opening; the thread shows the rest. */
.bl-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.bl-link {
  color: var(--fg);
  border-bottom: 1px solid var(--rule-strong);
}

.bl-tag {
  font: inherit;
  padding: 0;
  background: none;
  border: 0;
  color: var(--fg);
  text-shadow: 0 0 6px rgba(var(--fg-rgb), 0.45);
  cursor: pointer;
}

.bl-tag:is(:hover, .is-hover) { text-decoration: underline; }

.bl-media {
  margin: 0.6rem 0 0;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: var(--wash);
}

.bl-media img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  filter: var(--photo-rest);
  transition: filter 0.35s ease;
}

.bl-post:is(:hover, .is-hover) .bl-media img,
.bl-media--full img {
  filter: none;
}

.bl-media--full img {
  max-height: 80vh;
  margin: 0 auto;
  width: auto;
  object-fit: contain;
}

.bl-actions {
  display: flex;
  gap: 1.4rem;
  margin-top: 0.4rem;
}

.bl-act {
  font-family: var(--font);
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0.15rem 0;
  cursor: pointer;
}

.bl-actions { align-items: center; }

.bl-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 0.7rem;
  font-size: var(--t-small);
}

.bl-act:is(:hover, .is-hover) {
  color: var(--fg);
  text-shadow: 0 0 8px rgba(var(--fg-rgb), 0.5);
}

/* ── Share ──
   An icon with its label in a tooltip: "copy link" on hover, "link copied"
   once clicked. On touch there is no hover, so only the confirmation shows. */
.bl-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem;
  -webkit-tap-highlight-color: transparent;
  /* Right-aligned, under the time on the title line. */
  margin-left: auto;
}

.bl-body .bl-share {
  float: right;
  margin: 0.2rem 0 0 1rem;
}

.bl-share-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter var(--ease);
}

.bl-share:is(:hover, .is-hover) .bl-share-icon,
.bl-share.is-copied .bl-share-icon {
  color: var(--fg);
  filter: drop-shadow(0 0 4px rgba(var(--fg-rgb), 0.6));
}

.bl-tip {
  position: absolute;
  /* Anchored to the icon's right edge: the icon sits at the right margin, and
     a centred label would run off a phone's screen. */
  right: -0.35rem;
  bottom: calc(100% + 0.45rem);
  transform: translateY(0.2rem);
  padding: 0.15rem 0.5rem;
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 5;
}

.bl-share:is(:hover, .is-hover, :focus-visible) .bl-tip,
.bl-share.is-copied .bl-tip {
  opacity: 1;
  transform: translateY(0);
}

.bl-share.is-copied .bl-tip { border-color: var(--fg); }

@media (hover: none) {
  .bl-share:is(:hover, .is-hover) .bl-tip { opacity: 0; }
  .bl-share.is-copied .bl-tip { opacity: 1; }
}

/* ── Thread ── */
.bl-back {
  display: inline-block;
  font-size: var(--t-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.6rem;
}

.bl-post--focus .bl-title { font-size: var(--t-sect); }
.bl-post--focus .bl-body { font-size: var(--t-lead); }

.bl-stamp {
  margin-top: 0.6rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
  font-size: var(--t-label);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* Ancestors above the opened entry, quieter; replies on the thread line. */
.bl-thread .bl-post { border-bottom: 0; padding-top: 0.5rem; }

.bl-post--parent .bl-title,
.bl-post--parent .bl-body { color: var(--ink-dim); }

.bl-post--parent .bl-clamp,
.bl-post--fork .bl-clamp { -webkit-line-clamp: 3; }

.bl-post[data-href] { cursor: pointer; }

.bl-thread .bl-post[data-href]:is(:hover, .is-hover) { background: var(--wash); }

.bl-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  font-size: var(--t-small);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: -0.8rem 0 0.4rem;
}

.bl-crumb a {
  color: var(--ink-dim);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bl-crumb a:first-child {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bl-crumb a:is(:hover, .is-hover) { color: var(--fg); }

.bl-forks {
  margin-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

.bl-forks-label {
  padding-top: 0.7rem;
  font-size: var(--t-label);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bl-thread .bl-post--fork { border-bottom: 1px solid var(--rule); }

/* ── States ── */
.bl-loading,
.bl-empty {
  padding: 2.25rem 0;
  text-align: center;
  font-size: var(--t-small);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bl-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  background: var(--fg);
  animation: bl-blink 1s steps(1) infinite;
}

@keyframes bl-blink { 50% { opacity: 0; } }

/* ── Phone ── */
@media (max-width: 720px) {
  .bl-page { --rail: 2.2rem; }

  .bl-profile {
    grid-template-columns: 4.6rem 1fr;
    gap: 0.9rem;
  }

  .bl-post { padding-left: 0; padding-right: 0; gap: 0 0.7rem; }
  .bl-media img { max-height: 340px; }
}

@media (hover: none) {
  .bl-feed .bl-post:is(:hover, .is-hover) { background: transparent; }
  .bl-post:is(:hover, .is-hover) .bl-media img { filter: var(--photo-rest); }
  .bl-post:is(:hover, .is-hover) .bl-media--full img,
  .bl-media--full img { filter: none; }
}
