/* Per-chapter year rail: local orientation without narrowing the reading column. */
.ffgf-chronicle-rail {
  display: none !important;
}

.ffgf-chronicle-entry__grid {
  position: relative;
}

.section-year-rail {
  position: relative;
  z-index: 4;
  display: block;
  align-self: stretch;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  color: rgba(255, 255, 255, .9);
  pointer-events: none;
}

.section-year-rail__inner {
  position: sticky;
  top: calc(var(--ffgf-header-compact-height, 68px) + 24px);
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 12px;
  opacity: .62;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.ffgf-chronicle-entry.is-current .section-year-rail__inner {
  opacity: 1;
  transform: translateY(0);
}

.section-year-rail strong {
  color: inherit;
  font-family: "FFGF Chronicle Display", "FFGF Chronicle Inter", Arial, sans-serif;
  font-size: clamp(1.2rem, 1.5vw, 1.55rem);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1;
  text-orientation: mixed;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.section-year-rail i {
  position: relative;
  display: block;
  width: 1px;
  height: clamp(28px, 4.5vw, 62px);
  overflow: visible;
  background: currentColor;
  opacity: .34;
}

.section-year-rail i:first-child:after {
  position: absolute;
  right: -2px;
  bottom: -8px;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--chrono-red);
}

.ffgf-chronicle-entry--red .section-year-rail i:first-child:after {
  background: #071926;
}

.ffgf-chronicle-entry--light .section-year-rail {
  color: #071926;
}

body.admin-bar .section-year-rail__inner {
  top: calc(var(--ffgf-header-compact-height, 68px) + 56px);
}

/* The former 01/14 index gives its existing column to the more useful year. */
.ffgf-chronicle-entry__index {
  display: none;
}

@media (min-width: 701px) and (max-width: 1000px) {
  .section-year-rail {
    grid-row: 1 / span 2;
  }

  .section-year-rail__inner {
    gap: 9px;
  }

  .section-year-rail strong {
    font-size: 1rem;
  }

  .section-year-rail i {
    height: 32px;
  }
}

@media (max-width: 700px) {
  .section-year-rail {
    grid-column: 1;
    grid-row: auto;
    align-self: auto;
    width: 100%;
  }

  .section-year-rail__inner,
  body.admin-bar .section-year-rail__inner {
    position: static;
    top: auto;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    opacity: 1;
    transform: none;
  }

  .section-year-rail strong {
    flex: 0 0 auto;
    color: inherit;
    font-size: 1rem;
    letter-spacing: .09em;
    text-orientation: mixed;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .section-year-rail i {
    width: auto;
    height: 1px;
    flex: 1 1 auto;
  }

  .section-year-rail i:first-child {
    max-width: 18px;
    flex-basis: 18px;
    color: var(--chrono-red);
    opacity: 1;
  }

  .section-year-rail i:first-child:after {
    display: none;
  }

  .ffgf-chronicle-entry--red .section-year-rail i:first-child {
    color: #071926;
  }

  .ffgf-chronicle-entry__copy:before {
    display: none;
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-year-rail__inner {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
