@font-face {
    font-display: auto;
    font-family: "PolySans";
    font-style: normal;
    font-weight: 700;
    src: url("https://grist.org/wp-content/themes/grist/dist/fonts/PolySansUS-Median.woff2") format("woff2"),
        url("https://grist.org/wp-content/themes/grist/dist/fonts/PolySansUS-Median.woff") format("woff");
}

@font-face {
    font-display: auto;
    font-family: "Basis Grotesque Pro";
    font-style: normal;
    font-weight: 500;
    src: url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-regular-pro.woff2") format("woff2"),
        url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-regular-pro.woff") format("woff");
}

@font-face {
    font-display: auto;
    font-family: "Basis Grotesque Pro";
    font-style: normal;
    font-weight: 700;
    src: url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-bold-pro.woff2") format("woff2"),
        url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-bold-pro.woff") format("woff");
}

@font-face {
    font-display: auto;
    font-family: "Basis Grotesque Pro";
    font-style: italic;
    font-weight: 700;
    src: url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-bold-italic-pro.woff2") format("woff2"),
        url("https://grist.org/wp-content/themes/grist/dist/fonts/basis-grotesque-bold-italic-pro.woff") format("woff");
}

:root {
  --color-primary: #3c3830;
  --color-secondary: #807a70;
  --color-accent: #1f5a2e;
  --color-rail: #dadfe5;
  --color-stage: #0b0d0a;
  --color-background: #fff;
  --typography-primary: "PolySans", sans-serif;
  --typography-secondary: "Basis Grotesque Pro", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--color-background); color: var(--color-primary); font-family: var(--typography-secondary); font-weight: 500; }

.rondonia-fishbone { max-width: 700px; margin: 0 auto; padding: 4px 20px 12px; }

.rondonia-fishbone h2 {
  font-family: var(--typography-primary);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.rondonia-fishbone .subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-primary);
  opacity: .7;
  margin-bottom: 16px;
  max-width: 600px;
}

.rondonia-fishbone__year {
  font-family: var(--typography-primary);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

/* Stage: ten stacked frames; the JS sets each one's opacity directly. */
.rondonia-fishbone__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-stage);
  line-height: 0;
}
.rondonia-fishbone__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  will-change: opacity;
}

.rondonia-fishbone__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-top: 18px;
}
.rondonia-fishbone__play {
  font-family: var(--typography-secondary);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-width: 76px;
  letter-spacing: .2px;
  transition: background 120ms;
}
.rondonia-fishbone__play:hover { background: var(--color-accent); }

.rondonia-fishbone__slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: var(--color-rail);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0;
  touch-action: none;
}
.rondonia-fishbone__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: grab;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(60, 56, 48, .25);
}
.rondonia-fishbone__slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: grab;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(60, 56, 48, .25);
}
.rondonia-fishbone__slider:active::-webkit-slider-thumb { cursor: grabbing; }
.rondonia-fishbone__slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Tick marks: one per Landsat scene, at its true position in time.
   Left margin = play button width + gap + half the thumb, so ticks line up
   with the thumb's centre at either end of the track. */
.rondonia-fishbone__ticks {
  position: relative;
  height: 26px;
  margin-left: calc(90px + 9px);
  margin-right: 9px;
  font-size: 11px;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
}
.rondonia-fishbone__tick {
  position: absolute;
  top: 3px;
  width: 1px;
  height: 6px;
  background: var(--color-secondary);
  opacity: .55;
  transform: translateX(-.5px);
}
.rondonia-fishbone__tick.is-current { background: var(--color-accent); opacity: 1; height: 8px; top: 2px; }
.rondonia-fishbone__tick-label {
  position: absolute;
  top: 12px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.rondonia-fishbone__tick-label.edge-l { transform: none; }
.rondonia-fishbone__tick-label.edge-r { transform: translateX(-100%); }

.rondonia-fishbone__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 12px;
}
.rondonia-fishbone__source {
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-secondary);
}
.rondonia-fishbone__source strong {
  font-weight: 700;
  font-style: italic;
}
.rondonia-fishbone__logo {
  height: 18px;
  width: auto;
  flex-shrink: 0;
  transform: translateY(-2px);
}

@media (max-width: 600px) {
  .rondonia-fishbone h2 { font-size: 22px; }
  .rondonia-fishbone .subtitle { font-size: 13px; margin-bottom: 14px; }
  .rondonia-fishbone__year { font-size: 22px; }
  .rondonia-fishbone__play { min-width: 62px; padding: 7px 12px; font-size: 12px; }
  .rondonia-fishbone__controls { margin-top: 14px; }
  .rondonia-fishbone__ticks { margin-left: calc(76px + 9px); }
}
