/* Biomethane spot desk ticker. Not a link and not an offer. */
#biomethane-spot {
  margin-left: auto;
  color: #fffaf0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

#biomethane-spot.spot-home {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  margin-left: 0;
}

header #biomethane-spot {
  padding-top: 12px;
}

header .spot {
  max-width: 18rem;
}

header .site-bar nav {
  gap: 10px 14px;
}

.spot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(100%, 36rem);
  padding: 6px 8px;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 8px;
  background: rgba(18, 52, 42, 0.78);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.spot-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 8px;
}

.spot-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #98c56c;
}

.spot.is-fresh .spot-dot {
  background: #98c56c;
  animation: spot-pulse 1.6s ease-in-out infinite;
}

.spot.is-stale .spot-dot {
  background: #e0a040;
  animation: none;
}

.spot-dot-held,
.spot.is-fresh .spot-dot.spot-dot-held,
.spot.is-stale .spot-dot.spot-dot-held,
.spot-dot-cpo,
.spot.is-fresh .spot-dot.spot-dot-cpo,
.spot.is-stale .spot-dot.spot-dot-cpo {
  background: #e0a040;
  animation: none;
}

.spot-dot-cpo.is-live,
.spot.is-fresh .spot-dot.spot-dot-cpo.is-live,
.spot.is-stale .spot-dot.spot-dot-cpo.is-live {
  background: #98c56c;
  animation: spot-pulse 1.6s ease-in-out infinite;
}

@keyframes spot-pulse {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .spot.is-fresh .spot-dot,
  .spot-dot-cpo.is-live,
  .spot.is-fresh .spot-dot.spot-dot-cpo.is-live {
    animation: none;
  }
}

.spot-label {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
}

.spot-prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spot-line {
  display: grid;
  grid-template-columns: minmax(8.5rem, 1fr) 72px;
  align-items: center;
  gap: 8px;
}

.spot-figure {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spot-spark {
  display: block;
  width: 72px;
  height: 28px;
}

.spot-build,
.spot-disclaimer {
  display: none;
  margin: 2px 0 0;
}

.spot:hover .spot-build,
.spot:focus-within .spot-build,
.spot.is-open .spot-build,
.spot:hover .spot-disclaimer,
.spot:focus-within .spot-disclaimer,
.spot.is-open .spot-disclaimer {
  display: block;
}

.spot-pumps,
.spot-cpo,
.spot-biolng,
.spot-meoh {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 250, 240, 0.28);
}

.spot-cpo .spot-line,
.spot-meoh .spot-line {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.spot-cpo-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: baseline;
  min-width: 0;
}

.spot-cpo .spot-pump-name {
  min-width: 5.6rem;
}

.spot-cpo .spot-asof,
.spot-cpo .spot-source {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c8c2b0;
}

.spot-cpo .spot-line.is-proxy .spot-figure,
.spot-cpo .spot-line.is-proxy .spot-asof,
.spot-cpo .spot-line.is-proxy .spot-source {
  color: #f0d7a2;
}

.spot-meoh .spot-pump-name {
  min-width: 7.8rem;
}

.spot-pump-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spot-notes {
  padding-left: 16px;
}

.spot-pump {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: baseline;
}

.spot-pump-name {
  min-width: 3.4rem;
  font-weight: 700;
}

.spot-pump .spot-figure {
  white-space: normal;
}

.spot-pump.is-stale .spot-figure {
  color: #f0d7a2;
}

.spot-status {
  margin: 2px 0 0;
  color: #e7e0cf;
}

.spot.is-stale .spot-status {
  color: #f0d7a2;
}

@media (max-width: 780px) {
  #biomethane-spot.spot-home {
    position: relative;
    top: auto;
    right: auto;
    justify-self: end;
    width: min(100% - 24px, 36rem);
    margin: 12px 12px 0 auto;
  }

  #biomethane-spot.spot-home .spot {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .spot-build,
  .spot-disclaimer {
    display: none;
  }

  .spot:hover .spot-build,
  .spot:focus-within .spot-build,
  .spot.is-open .spot-build,
  .spot:hover .spot-disclaimer,
  .spot:focus-within .spot-disclaimer,
  .spot.is-open .spot-disclaimer {
    display: block;
  }
}
