/*
 * LaFactory Blocks 2.15.0: post timeline (lafactory/post-timeline).
 * Loaded only on a page that shows the block, header included. No at-rule that the editor's
 * nesting drops (no @keyframes, @font-face, @import).
 *
 *   --lfb-cat-<term id>   colour of a category: set by the block on :where(:root) from its
 *                         settings, replaced by any rule of the site (dark mode)
 *   --lfb-tl-other        #9ca3af                posts without a coloured category
 *   --lfb-tl-now          --lfb-accent           the "now" slot
 *   --lfb-tl-active       --lfb-accent-strong    mark of the current year, chip picked
 *   --lfb-tl-needle       --lfb-ink              needle of the strip, square of the current post
 *   --lfb-tl-axis         --lfb-border-strong    year axis, dotted gaps
 *   --lfb-tl-label        --lfb-muted            years, counts, month initials
 *   --lfb-tl-dim          0.28                   opacity of what a chip sets aside
 *   --lfb-tl-strip-bar    20px                   height of the bars of the strip
 *   --lfb-year-font       --lfb-font             big year number of the year view
 */

.lfb-tl {
  font-family: var(--lfb-font, inherit);
  color: var(--lfb-ink, #111827);
  container-type: inline-size;
}

.lfb-tl svg path {
  fill: var(--lfb-c, var(--lfb-tl-other, #9ca3af));
  transition: opacity 0.2s;
}

.lfb-tl .lfb-tl__cur {
  fill: var(--lfb-tl-needle, var(--lfb-ink, #111827));
}

.lfb-tl__sq {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 1.5px;
  background: var(--lfb-c, var(--lfb-tl-other, #9ca3af));
}

.lfb-tl a {
  text-decoration: none;
  color: inherit;
}

/* ------------------------------------------------------------ chart */

.lfb-tl__cols {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lfb-tl__col {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.lfb-tl__col > a,
.lfb-tl__col > span {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 1px;
  border-radius: 4px 4px 0 0;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl__col > a:hover {
  background: var(--lfb-surface-soft, #f9fafb);
  color: var(--lfb-ink, #111827);
}

.lfb-tl__n {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lfb-tl__units {
  display: block;
}

.lfb-tl__svg {
  display: block;
  width: 100%;
  height: auto;
}

.lfb-tl__svg--narrow {
  display: none;
}

.lfb-tl__zero {
  display: block;
  height: 2px;
  margin: 0 30%;
  background: var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db));
}

.lfb-tl__y {
  margin-top: 3px;
  padding: 6px 0 2px;
  border-top: 1px solid var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db));
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lfb-tl__y-s {
  display: none;
}

/* Counts and year labels never break inside a narrow column ("24 / 1", "Au / j."). */
.lfb-tl__n,
.lfb-tl__y {
  white-space: nowrap;
  overflow: visible;
}

.lfb-tl__gap {
  flex: 0 0 22px;
  align-self: flex-end;
  height: 2px;
  margin: 0 0 23px;
  list-style: none;
  background: radial-gradient(circle, var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db)) 1px, transparent 1.3px) 0 0 / 4px 2px repeat-x;
}

.lfb-tl__col--now > a {
  color: var(--lfb-tl-now, var(--lfb-accent, #2563eb));
}

.lfb-tl__dash {
  display: block;
  height: 30px;
  margin: 0 12%;
  border: 1.5px dashed var(--lfb-tl-now, var(--lfb-accent, #2563eb));
  border-radius: 2px;
}

.lfb-tl__col--now .lfb-tl__y {
  font-weight: 700;
  border-top-color: var(--lfb-tl-now, var(--lfb-accent, #2563eb));
}

.lfb-tl__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

button.lfb-tl__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--lfb-border, #e5e7eb);
  border-radius: 999px;
  background: transparent;
  color: var(--lfb-ink, #111827);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

button.lfb-tl__chip:hover {
  border-color: var(--lfb-border-strong, #d1d5db);
}

button.lfb-tl__chip[aria-pressed="true"] {
  background: var(--lfb-surface, #ffffff);
  border-color: var(--lfb-tl-active, var(--lfb-accent-strong, #1d4ed8));
  box-shadow: inset 0 0 0 1px var(--lfb-tl-active, var(--lfb-accent-strong, #1d4ed8));
}

.lfb-tl__chip-n {
  font-weight: 400;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
  font-variant-numeric: tabular-nums;
}

.lfb-tl .lfb-is-dimmed,
.lfb-tl path.lfb-is-dimmed {
  opacity: var(--lfb-tl-dim, 0.28);
}

@container (max-width: 760px) {
  .lfb-tl__cols {
    gap: 2px;
  }

  .lfb-tl__svg--wide {
    display: none;
  }

  .lfb-tl__svg--narrow {
    display: block;
  }

  .lfb-tl__n {
    font-size: 10px;
    letter-spacing: -0.02em;
  }

  .lfb-tl__y {
    font-size: 11px;
  }

  .lfb-tl__y-l {
    display: none;
  }

  .lfb-tl__y-s {
    display: inline;
  }

  .lfb-tl__gap {
    flex-basis: 8px;
    margin-bottom: 21px;
  }

  .lfb-tl__dash {
    height: 22px;
  }

  button.lfb-tl__chip {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* ------------------------------------------------------------ strip */

.lfb-tl--strip {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: stretch;
  gap: 3px;
  height: calc(var(--lfb-tl-strip-bar, 20px) + 20px);
}

.lfb-tl__s {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  border-radius: 4px 4px 0 0;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

a.lfb-tl__s:hover {
  background: var(--lfb-surface-soft, #f9fafb);
}

.lfb-tl__bar {
  display: flex;
  flex-direction: column-reverse;
  width: 72%;
  max-width: 30px;
  height: calc(var(--h, 0) * var(--lfb-tl-strip-bar, 20px));
  overflow: hidden;
  border-radius: 1.5px 1.5px 0 0;
  opacity: 0.62;
}

.lfb-tl__bar i {
  display: block;
  flex-basis: 0;
  min-height: 0;
  background: var(--lfb-c, var(--lfb-tl-other, #9ca3af));
  transition: opacity 0.2s;
}

.lfb-tl__bar--zero {
  height: 2px;
  background: var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db));
}

.lfb-tl__lab {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.lfb-tl__s.is-active {
  color: var(--lfb-ink, #111827);
}

.lfb-tl__s.is-active .lfb-tl__bar {
  opacity: 1;
}

.lfb-tl__s.is-active .lfb-tl__lab {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--lfb-tl-active, var(--lfb-accent-strong, #1d4ed8));
}

.lfb-tl__s--gap {
  flex: 0 0 10px;
  align-self: center;
  height: 2px;
  margin-bottom: 0;
  background: radial-gradient(circle, var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db)) 1px, transparent 1.3px) 0 0 / 4px 2px repeat-x;
}

.lfb-tl__s--now {
  flex-grow: 2;
  color: var(--lfb-tl-now, var(--lfb-accent, #2563eb));
}

.lfb-tl__bar--now {
  height: var(--lfb-tl-strip-bar, 20px);
  max-width: 46px;
  background: var(--lfb-tl-now, var(--lfb-accent, #2563eb));
  opacity: 1;
}

.lfb-tl__s--now .lfb-tl__lab {
  font-weight: 700;
}

.lfb-tl__needle {
  position: absolute;
  bottom: 17px;
  width: 2px;
  height: var(--lfb-tl-strip-bar, 20px);
  margin-left: -1px;
  border-radius: 1px;
  background: var(--lfb-tl-needle, var(--lfb-ink, #111827));
}

.lfb-tl--strip .lfb-tl__y-s {
  display: none;
}

@container (max-width: 760px) {
  .lfb-tl--strip .lfb-tl__y-l {
    display: none;
  }

  .lfb-tl--strip .lfb-tl__y-s {
    display: inline;
  }
}

/* ------------------------------------------------------------ year of the post */

.lfb-tl__kicker {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl .lfb-tl__bigyear {
  margin: 0;
  font-family: var(--lfb-year-font, var(--lfb-font, inherit));
  font-size: 72px;
  font-weight: 800;
  line-height: 0.85;
  color: var(--lfb-ink, #111827);
}

.lfb-tl__pos {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl__months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
}

.lfb-tl__m {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.lfb-tl__m path {
  opacity: 0.55;
}

.lfb-tl__m .lfb-tl__cur {
  opacity: 1;
}

.lfb-tl__m-l {
  padding: 5px 0 2px;
  border-top: 1px solid var(--lfb-tl-axis, var(--lfb-border-strong, #d1d5db));
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl__m.is-active .lfb-tl__m-l {
  font-weight: 700;
  color: var(--lfb-ink, #111827);
  box-shadow: inset 0 -2px 0 var(--lfb-tl-active, var(--lfb-accent-strong, #1d4ed8));
}

.lfb-tl__pn {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

a.lfb-tl__pn-card {
  display: block;
  padding: 12px 13px 14px;
  border: 1px solid var(--lfb-border, #e5e7eb);
  border-radius: 6px;
  background: var(--lfb-surface, #ffffff);
  color: var(--lfb-ink, #111827);
}

a.lfb-tl__pn-card:hover {
  border-color: var(--lfb-border-strong, #d1d5db);
}

.lfb-tl__pn-k {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl__pn-d {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lfb-tl-label, var(--lfb-muted, #6b7280));
}

.lfb-tl__pn-t {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.28;
}

a.lfb-tl__back {
  display: inline-block;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--lfb-accent-strong, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 3px;
}
