/* Yolların tarixi — Desktop 4921:36449, Mobile 5450:15486 */

.aayda-road-history-page {
  background-color: var(--aayda-colors-surface-disabled);
  overflow-x: clip;
}

.aayda-road-history-page .aayda-top-block {
  position: relative;
  min-height: 328px;
  padding: var(--aayda-numbers-spacing-32);
}

.aayda-road-history-page .aayda-top-block__inner {
  gap: 96px;
  width: 100%;
}

.aayda-road-history-page .aayda-top-block__heading {
  gap: var(--aayda-numbers-spacing-12);
}

.aayda-road-history-page .aayda-top-block__title {
  font-size: var(--aayda-typography-size-32);
  line-height: var(--aayda-typography-line-height-heading-32);
  letter-spacing: var(--aayda-typography-letter-spacing-32);
  white-space: normal;
}

.aayda-road-history-page .aayda-top-block__lede {
  display: flex;
  gap: var(--aayda-numbers-spacing-12);
  height: auto;
}

.aayda-road-history-page .aayda-top-block__description {
  width: min(100%, 292px);
  line-height: 18px;
}

.aayda-road-history__lede--desktop,
.aayda-road-history__eyebrow--desktop,
.aayda-road-history__banner--desktop {
  display: none;
}

.aayda-road-history {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 40px 0 96px;
  overflow-x: clip;
}

.aayda-road-history__intro {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.aayda-road-history__intro-content {
  display: flex;
  flex-direction: column;
  gap: 35px;
  width: 100%;
  min-width: 0;
}

.aayda-road-history__era-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-12);
  width: 338px;
  margin: 39px 32px 0;
  padding: var(--aayda-numbers-spacing-16);
  background: rgba(253, 253, 254, 0.55);
  border: 1px solid var(--aayda-colors-base-white);
  border-radius: var(--aayda-radius-accordion);
}

/* Only the selected era's card is drawn; the others stay in the page, hidden, for the script to show. */
.aayda-road-history__era-card[hidden] {
  display: none;
}

.aayda-road-history__era-badge {
  box-sizing: border-box;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--aayda-numbers-spacing-8);
  width: max-content;
  height: 28px;
  padding: 5px 13px;
  border: 0;
  border-radius: 100px;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.aayda-road-history__era-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--aayda-colors-accent);
  border-radius: 50%;
}

.aayda-road-history__era-badge-text {
  margin: 0;
  color: var(--aayda-colors-navy-700);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  font-weight: var(--aayda-typography-weight-semi-bold);
  line-height: 18px;
  letter-spacing: var(--aayda-typography-letter-spacing-12);
  white-space: nowrap;
}

.aayda-road-history__era-main,
.aayda-road-history__era-side,
.aayda-road-history__era-facts {
  display: contents;
}

.aayda-road-history__era-title {
  margin: 0;
  width: 100%;
  color: #133888;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
}

.aayda-road-history__era-copy {
  display: contents;
}

.aayda-road-history__era-paras {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-8);
  width: 100%;
}

/* __era-paras as well as its paragraphs: text stored without <p> sits directly in it (__era-copy is
 * display: contents on phones, so it is not the place for the type). */
.aayda-road-history__era-copy p,
.aayda-road-history__era-paras,
.aayda-road-history__era-paras p,
.aayda-road-history__era-note,
.aayda-road-history__era-infra-label {
  margin: 0;
  color: #133888;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: var(--aayda-typography-line-height-12);
  letter-spacing: var(--aayda-typography-letter-spacing-12);
}

.aayda-road-history__era-note {
  min-height: 42px;
  line-height: 20.8px;
}

.aayda-road-history__era-note p {
  margin: 0;
}

.aayda-road-history__era-note strong {
  font-weight: var(--aayda-typography-weight-bold);
}

.aayda-road-history__era-stats {
  display: flex;
  flex-direction: column;
  gap: var(--aayda-numbers-spacing-6);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aayda-road-history__era-stats li {
  display: flex;
  align-items: flex-start;
  gap: var(--aayda-numbers-spacing-8);
  min-height: 26px;
}

.aayda-road-history__era-bullet {
  color: #133888;
  font-size: var(--aayda-typography-size-16);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
}

.aayda-road-history__era-stats span {
  color: #133888;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: 22px;
}

.aayda-road-history__era-stats strong {
  font-weight: var(--aayda-typography-weight-bold);
}

.aayda-road-history__era-map {
  display: block;
  flex-shrink: 0;
  width: 310px;
  max-width: none;
  height: 102px;
  object-fit: cover;
  object-position: 0 -32.4%;
  border-radius: var(--aayda-radius-input);
}

.aayda-road-history__era-map--desktop {
  display: none;
}

/* A stored picture is any image, so it is centred rather than cropped to the design map's offset. */
.aayda-road-history__era-map--stored {
  object-position: center;
}

.aayda-road-history__timeline {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

/*
 * The strip is the scroller and the track inside it the row of periods. Below 1416px it scrolls natively
 * with a light snap to each period, and the page still scrolls vertically from it. From 768px a swipe only
 * scrolls it and a tap selects; below 768px see the swipe rule after the scrollbar rule (road-history.js).
 */
.aayda-road-history__eras {
  box-sizing: border-box;
  width: 100%;
  height: 80px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--aayda-numbers-spacing-20);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.aayda-road-history__eras-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--aayda-numbers-spacing-16);
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
  height: 100%;
  padding: var(--aayda-numbers-spacing-16) var(--aayda-numbers-spacing-20);
}

.aayda-road-history__eras::-webkit-scrollbar {
  display: none;
}

/*
 * Below 768px, once road-history.js has upgraded the strip, a horizontal swipe on it selects the next or
 * previous period (Phase 6B). The strip leaves the browser only vertical panning and zoom, so the page still
 * scrolls from it and the sideways gesture goes to the script, which scrolls the selected period into view.
 * Without the script the strip keeps its native horizontal scroll.
 */
@media (max-width: 767.98px) {
  [data-road-history-enhanced] .aayda-road-history__eras {
    touch-action: pan-y pinch-zoom;
  }
}

.aayda-road-history__era {
  display: inline-flex;
  flex-shrink: 0;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  padding: 0;
  color: var(--aayda-colors-navy-900);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-18);
  font-weight: var(--aayda-typography-weight-extra-bold);
  line-height: var(--aayda-typography-line-height-18);
  letter-spacing: var(--aayda-typography-letter-spacing-18);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  opacity: 0.2;
  scroll-snap-align: start;
}

.aayda-road-history__era-text {
  display: inline-block;
  transform-origin: center;
}

.aayda-road-history__era.is-active {
  font-size: var(--aayda-typography-size-40);
  line-height: var(--aayda-typography-line-height-40);
  letter-spacing: var(--aayda-typography-letter-spacing-40);
  opacity: 1;
}

.aayda-road-history__ruler {
  position: relative;
  width: 100%;
  height: 29px;
  overflow: visible;
  border-top: 1.5px solid #133888;
  background-image:
    repeating-linear-gradient(to right, #133888 0 1px, transparent 1px 8.37px),
    repeating-linear-gradient(to right, #133888 0 1px, transparent 1px 66.99px);
  background-position: 0 3px, 0 3px;
  background-repeat: repeat-x;
  background-size: 8.37px 8px, 66.99px 14px;
}

/*
 * bug-fix-5 BUG 2: every dot is centred on the ruler's line, whatever its size. The dots are positioned
 * against the padding box, which starts under the 1.5px top border, so the line's centre is 0.75px above
 * it; each dot's own centre is put there by translating it back by half its height (the earlier fixed
 * offsets left the 8px dots 1.75px and the mobile dot 3.25px below the line).
 */
.aayda-road-history__ruler-dot {
  position: absolute;
  top: -0.75px;
  display: none;
  background: var(--aayda-colors-navy-900);
  border-radius: 50%;
  transform: translateY(-50%);
}

.aayda-road-history__ruler-dot--lg {
  display: block;
  left: 134px;
  width: 9px;
  height: 9px;
  background: var(--aayda-colors-accent);
}

/* With the script the dot is placed under the selected period's centre. */
[data-road-history-enhanced] .aayda-road-history__ruler-dot--lg {
  transform: translate(-50%, -50%);
}

.aayda-road-history__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
  margin-top: 64px;
  padding: 0 16px;
}

.aayda-road-history__years {
  margin-bottom: 96px;
}

.aayda-road-history__karabakh {
  margin-bottom: 40px;
}

/*
 * The blocks after the timeline can be switched off and reordered in the admin
 * (/admin/road-history/sections). Each block's own bottom margin is the gap after it, so: the last
 * block keeps none, leaving no blank space before the footer whichever block that is; and the
 * project groups, which the design always puts last, take the Karabakh block's gap when another block
 * follows them. In the design's order and with every block on, nothing here changes the page.
 */
.aayda-road-history__body > :last-child {
  margin-bottom: 0;
}

.aayda-road-history__projects:not(:last-child) {
  margin-bottom: 40px;
}

.aayda-road-history__years-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 40px;
}

.aayda-road-history__eyebrow {
  margin: 0;
  color: #00bf8c;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  font-weight: var(--aayda-typography-weight-semi-bold);
  line-height: 18px;
  letter-spacing: var(--aayda-typography-letter-spacing-12);
}

.aayda-road-history__section-title {
  margin: 0;
  color: #0b2a5b;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-32);
  font-weight: var(--aayda-typography-weight-semi-bold);
  line-height: var(--aayda-typography-line-height-heading-32);
  letter-spacing: var(--aayda-typography-letter-spacing-32);
}

.aayda-road-history__section-lead {
  margin: 0;
  color: var(--aayda-colors-gray-800);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
}

/*
 * Phase 7D: an editor's stored lead is a block of its own (editor HTML, one or more paragraphs) in place of
 * the generated sentence; its paragraphs keep the lead's type and lose their default margins.
 */
.aayda-road-history__section-lead p {
  margin: 0;
}

.aayda-road-history__section-lead p + p {
  margin-top: 8px;
}

.aayda-road-history__year-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.aayda-road-history__year-card {
  position: relative;
  box-sizing: border-box;
  width: 370px;
  max-width: 100%;
  height: 310px;
  /* The cards only show figures: no link, dialog or click action, so no pointer cursor. */
  cursor: default;
}

.aayda-road-history__year-card::after {
  position: absolute;
  inset: 86.13% 0 1.29%;
  background: var(--aayda-colors-accent);
  border-radius: 16px;
  content: "";
}

.aayda-road-history__year-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 98.71%;
  overflow: hidden;
  padding: 0;
  background: var(--aayda-colors-surface-subtle);
  border: 2px solid var(--aayda-colors-base-white);
  border-radius: 16px;
  transition:
    background-color 200ms ease-out,
    border-color 200ms ease-out;
}

.aayda-road-history__year-top {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 175px;
  padding: 24px 24px 21px;
  box-shadow: inset 0 -1px 0 #e2e8f0;
  transition: box-shadow 200ms ease-out;
}

.aayda-road-history__year-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 4px;
  width: 78px;
  height: 29px;
  margin-bottom: 38px;
  padding: 5px 13px;
  background: var(--aayda-colors-base-white);
  border: 1px solid var(--aayda-colors-accent);
  border-radius: 100px;
  transition:
    background-color 200ms ease-out,
    border-color 200ms ease-out;
}

.aayda-road-history__year-badge img {
  display: block;
  width: 7px;
  height: 7px;
}

.aayda-road-history__year-badge span {
  color: var(--aayda-colors-accent);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
  transition: color 200ms ease-out;
}

.aayda-road-history__year-total {
  margin: 0;
  color: #133888;
  font-family: var(--aayda-typography-font-primary);
  font-size: 30px;
  font-weight: var(--aayda-typography-weight-bold);
  line-height: 39px;
  letter-spacing: -0.6px;
  transition: color 200ms ease-out;
}

.aayda-road-history__year-caption {
  box-sizing: border-box;
  height: 24px;
  margin: 0;
  padding-top: 8px;
  color: #94a3b8;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  font-weight: var(--aayda-typography-weight-medium);
  line-height: var(--aayda-typography-line-height-12);
  letter-spacing: var(--aayda-typography-letter-spacing-12);
}

.aayda-road-history__year-rows {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-sizing: border-box;
  gap: 16px;
  width: 100%;
  height: 136px;
  padding: 20px 24px;
}

.aayda-road-history__year-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  width: 100%;
  height: 20px;
}

.aayda-road-history__year-row dt {
  margin: 0;
  padding-top: 2.5px;
  color: var(--aayda-colors-gray-800);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
  transition: color 200ms ease-out;
}

.aayda-road-history__year-row dd {
  margin: 0;
  color: #0b2a5b;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-16);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-16);
  letter-spacing: var(--aayda-typography-letter-spacing-16);
  white-space: nowrap;
  transition: color 200ms ease-out;
}

.aayda-road-history__year-card:hover .aayda-road-history__year-card-inner {
  background: #133888;
  border-color: #133888;
}

.aayda-road-history__year-card:hover .aayda-road-history__year-top {
  box-shadow: inset 0 -1px 0 rgba(226, 232, 240, 0.22);
}

.aayda-road-history__year-card:hover .aayda-road-history__year-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--aayda-colors-base-white);
}

.aayda-road-history__year-card:hover .aayda-road-history__year-badge span {
  color: var(--aayda-colors-base-white);
}

.aayda-road-history__year-card:hover .aayda-road-history__year-total,
.aayda-road-history__year-card:hover .aayda-road-history__year-row dd {
  color: var(--aayda-colors-accent);
}

.aayda-road-history__year-card:hover .aayda-road-history__year-row dt {
  color: var(--aayda-colors-base-white);
}

@media (prefers-reduced-motion: reduce) {
  .aayda-road-history__year-card-inner,
  .aayda-road-history__year-top,
  .aayda-road-history__year-badge,
  .aayda-road-history__year-badge span,
  .aayda-road-history__year-total,
  .aayda-road-history__year-row dt,
  .aayda-road-history__year-row dd {
    transition: none;
  }
}

.aayda-road-history__karabakh {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: 32px;
  width: 100%;
}

/*
 * Below 1416px the Karabakh block's managed title and narrative sit in the panel over the narrow video
 * (Phase 6A); the desktop banner carries the same text from 1416px. The slot keeps the design's 661px as a
 * minimum and grows with a longer narrative, and the panel has no fixed height, so nothing is cut off.
 */
.aayda-road-history__video-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-sizing: border-box;
  width: 370px;
  max-width: 100%;
  min-height: 661px;
  padding: 8px;
  overflow: hidden;
  border-radius: 16px;
}

.aayda-road-history__video-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.aayda-road-history__video-slot::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 16, 32, 0.35);
  border-radius: 16px;
  content: "";
  pointer-events: none;
}

.aayda-road-history__video-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  width: 354px;
  max-width: 100%;
  min-width: 0;
  padding: 16px;
  color: var(--aayda-colors-base-white);
  background: rgba(157, 158, 160, 0.07);
  border: 0.5px solid var(--aayda-colors-base-white);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

/*
 * Phase 6C: the keyboard pause/resume button over each Karabakh video. It stays in the tab order and the
 * accessibility tree but out of sight until it has keyboard focus; then it shows as a dark pill in the video's
 * top-right corner with a two-tone ring (white over navy), which reads on the light poster and the dark video
 * alike. Pointer viewing never shows it — a click on the video does the same. The script hides it ([hidden])
 * where its video is not the one on screen, has no source or must not move. The status line is never shown.
 */
.aayda-road-history__video-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 16px;
  color: var(--aayda-colors-base-white);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-14);
  font-weight: var(--aayda-typography-weight-semi-bold);
  line-height: var(--aayda-typography-line-height-14);
  white-space: nowrap;
  background: var(--aayda-colors-navy-900);
  border: 1px solid var(--aayda-colors-base-white);
  border-radius: 999px;
}

.aayda-road-history__video-toggle:focus-visible {
  outline: 2px solid var(--aayda-colors-base-white);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--aayda-colors-navy-900);
}

.aayda-road-history__video-toggle[hidden] {
  display: none;
}

.aayda-road-history__video-toggle:not(:focus),
.aayda-road-history__video-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus that came from a pointer stays out of sight; a browser without :focus-visible drops this rule. */
.aayda-road-history__video-toggle:focus:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aayda-road-history__video-heading {
  margin: 0;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-20);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-20);
  letter-spacing: var(--aayda-typography-letter-spacing-20);
}

.aayda-road-history__video-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-wrap: anywhere;
}

.aayda-road-history__video-copy p {
  margin: 0;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-14);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: var(--aayda-typography-line-height-14);
  letter-spacing: var(--aayda-typography-letter-spacing-14);
}

.aayda-road-history__video-copy strong {
  font-weight: var(--aayda-typography-weight-bold);
}

/*
 * The Karabakh figure cards (Figma "Statistics/Infrastructure card", 6489:27067). The phone card is
 * 179 × 173: the white-bordered panel is 172 tall and the 22px accent bar shows 1px below it. The card
 * grows with its text instead of clipping it: the panel fills the card (flex) and the bar keeps its
 * fixed height at the bottom, so an ordinary card is exactly the design's and a long one stays whole.
 * The columns shrink with a viewport narrower than the design's 402px rather than overflowing it.
 */
.aayda-road-history__infra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 370px;
  max-width: 100%;
}

.aayda-road-history__infra-card {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 173px;
  padding-bottom: 1px;
}

.aayda-road-history__infra-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 22px;
  background: #335aad;
  border-radius: 12px;
  content: "";
}

.aayda-road-history__infra-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  padding: 51px 12px 16px;
  background: var(--aayda-colors-surface-subtle);
  border: 2px solid var(--aayda-colors-base-white);
  border-radius: 12px;
}

.aayda-road-history__infra-icon {
  position: absolute;
  top: 11px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  background: rgba(220, 223, 228, 0.21);
  border-radius: 8px;
}

.aayda-road-history__infra-icon img {
  display: block;
  width: 19px;
  height: 19px;
}

/* The hover variant's light icon, laid over the default one and faded in on hover (desktop only). */
.aayda-road-history__infra-icon .aayda-road-history__infra-icon-hover {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
}

.aayda-road-history__infra-value {
  margin: 0;
  width: 100%;
  color: var(--aayda-colors-gray-800);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-18);
  font-weight: var(--aayda-typography-weight-bold);
  line-height: var(--aayda-typography-line-height-18);
  letter-spacing: var(--aayda-typography-letter-spacing-18);
}

.aayda-road-history__infra-value span {
  font-weight: var(--aayda-typography-weight-regular);
}

.aayda-road-history__infra-line {
  display: block;
  width: 147px;
  height: 1px;
}

.aayda-road-history__infra-copy {
  width: 100%;
}

.aayda-road-history__infra-copy p {
  margin: 0 0 8px;
  color: var(--aayda-colors-gray-800);
  font-family: var(--aayda-typography-font-primary);
  font-size: 10px;
  font-weight: var(--aayda-typography-weight-bold);
  line-height: 1.5;
  letter-spacing: -0.11px;
}

/* The note: the last paragraph, and any after the label — a note stored as <p> closes the view's own
 * <p>, so its text arrives in a paragraph of its own that is not the last child. The label is always
 * the first. */
.aayda-road-history__infra-copy p:last-child,
.aayda-road-history__infra-copy p:not(:first-child) {
  margin-bottom: 0;
  color: #5c6d89;
  font-weight: var(--aayda-typography-weight-regular);
}

/*
 * "Layihələr üzrə yollar" (Figma 9473:60409 desktop, 9473:60817 phone; Phase 5D). Any number of groups and
 * roads: nothing here is sized to the design's three groups. The card has no fixed height and no overflow
 * clipping; the header's own top corners follow the card's radius instead. Colours, borders and type are
 * the desktop design's at every width (the phone frame's lighter header, blue titles and uneven body
 * padding are not kept). One list per group: one column on phones, two from 768px (below).
 */
.aayda-road-history__projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.aayda-road-history__projects-title {
  margin: 0;
  color: #0b2a5b;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-32);
  font-weight: var(--aayda-typography-weight-semi-bold);
  line-height: var(--aayda-typography-line-height-heading-32);
  letter-spacing: var(--aayda-typography-letter-spacing-32);
}

.aayda-road-history__project-group {
  width: 100%;
  min-width: 0;
  background: var(--aayda-colors-base-white);
  border: 1px solid var(--aayda-colors-base-white);
  border-radius: 16px;
}

.aayda-road-history__project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 16px;
  background: #ecf3fc;
  border-bottom: 2px solid #335aad;
  border-radius: 15px 15px 0 0;
}

.aayda-road-history__project-kicker,
.aayda-road-history__project-meta {
  min-width: 0;
  margin: 0;
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-12);
  line-height: var(--aayda-typography-line-height-12);
  letter-spacing: var(--aayda-typography-letter-spacing-12);
  overflow-wrap: anywhere;
}

.aayda-road-history__project-kicker {
  color: var(--aayda-colors-navy-900);
  font-weight: var(--aayda-typography-weight-bold);
}

.aayda-road-history__project-meta {
  color: #374151;
  font-weight: var(--aayda-typography-weight-semi-bold);
}

.aayda-road-history__project-list {
  margin: 0;
  padding: 16px;
  list-style: none;
}

.aayda-road-history__project-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  color: var(--aayda-colors-navy-900);
  font-family: var(--aayda-typography-font-primary);
  font-size: var(--aayda-typography-size-14);
  font-weight: var(--aayda-typography-weight-regular);
  line-height: var(--aayda-typography-line-height-14);
  letter-spacing: var(--aayda-typography-letter-spacing-14);
  overflow-wrap: anywhere;
}

.aayda-road-history__project-list li:last-child {
  border-bottom: none;
}

.aayda-road-history__project-list li::before {
  display: block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  background: var(--aayda-colors-blue-400);
  border-radius: 50%;
  content: "";
}

/*
 * From 768px the roads stand in two equal columns read down the first, then down the second (the design's
 * order), whatever their number: the list is one <ul> in document order, and its row count comes from the
 * view (--aayda-road-history-project-rows, the count halved and rounded up). The road that ends the first
 * column drops its separator, as the last road of each column does in the design.
 */
@media (min-width: 768px) {
  .aayda-road-history__project-head {
    padding: 16px 24px;
  }

  .aayda-road-history__project-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--aayda-road-history-project-rows, 1), auto);
    grid-auto-flow: column;
    column-gap: 40px;
    padding: 24px;
  }

  .aayda-road-history__project-list .aayda-road-history__project-road--column-end {
    border-bottom: none;
  }
}

@media (min-width: 768px) and (max-width: 1415px) {
  .aayda-road-history__era-card {
    width: calc(100% - 32px);
    max-width: 100%;
    min-width: 0;
    margin-left: 16px;
    margin-right: 16px;
  }

  .aayda-road-history__era-map {
    width: 100%;
    max-width: 100%;
  }

  .aayda-road-history__year-card,
  .aayda-road-history__video-slot,
  .aayda-road-history__infra {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .aayda-road-history__video-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .aayda-road-history__infra {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aayda-road-history__infra-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (min-width: 1416px) {
  .aayda-road-history-page .aayda-top-block {
    min-height: 259px;
    padding: var(--aayda-numbers-spacing-32) 0 var(--aayda-numbers-spacing-32) var(--aayda-numbers-spacing-84);
  }

  .aayda-road-history-page .aayda-top-block__inner {
    gap: var(--aayda-numbers-spacing-8);
    max-width: 1356px;
  }

  .aayda-road-history-page .aayda-top-block__heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--aayda-numbers-spacing-24);
    width: 100%;
    max-width: 1354px;
  }

  .aayda-road-history-page .aayda-top-block__title {
    flex: 0 0 auto;
    font-size: var(--aayda-typography-size-44);
    line-height: var(--aayda-typography-line-height-44);
    letter-spacing: var(--aayda-typography-letter-spacing-44);
    white-space: nowrap;
  }

  .aayda-road-history-page .aayda-top-block__lede {
    flex: 0 0 490px;
    width: 490px;
    height: 159px;
    gap: 13px;
  }

  .aayda-road-history-page .aayda-top-block__description {
    width: 403px;
    font-size: var(--aayda-typography-size-14);
    line-height: 20px;
    letter-spacing: var(--aayda-typography-letter-spacing-14);
  }

  .aayda-road-history__lede--mobile,
  .aayda-road-history__eyebrow--mobile,
  .aayda-road-history__banner--mobile {
    display: none;
  }

  .aayda-road-history__lede--desktop,
  .aayda-road-history__eyebrow--desktop,
  .aayda-road-history__banner--desktop {
    display: block;
  }

  .aayda-road-history {
    padding: 60px 0 96px;
  }

  /* At the design's content the boxes below add up to its 672px; longer content grows the intro. */
  /* bug-fix-5 BUG 2: the block's own background, Figma 4921:36470 — a vertical linear gradient (its
     transform starts the first stop 10.1% before the top edge, hence -11.23%) and the card radius. */
  .aayda-road-history__intro {
    position: relative;
    gap: 0;
    min-height: 672px;
    background: linear-gradient(180deg, #f3f4f6 -11.23%, #eff1f2 37.72%, #eaedee 100%);
    border-radius: var(--aayda-radius-card);
  }

  .aayda-road-history__intro-content {
    position: relative;
    gap: 0;
    width: 1253px;
    margin-left: calc(
      var(--aayda-border-width-card)
      + var(--aayda-numbers-spacing-84)
      + max(
        0px,
        (
          100%
          - (var(--aayda-border-width-card) * 2)
          - var(--aayda-numbers-spacing-84)
          - 1356px
        ) / 2
      )
    );
  }

  /* Bug-fix 4, correction 27: the two columns start on one line, as Figma's History/Era card (6489:27003)
     draws them — both 368px tall from the card's 32px inset, the badge and the note level at the top.
     Centred, a column shorter than the other started lower and the note no longer lined up with the badge. */
  .aayda-road-history__era-card {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 64px;
    width: 1006px;
    min-height: 432px;
    margin: 52px 0 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.5);
    border-width: 2px;
  }

  .aayda-road-history__era-main {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 417px;
    flex-shrink: 0;
  }

  .aayda-road-history__era-badge {
    height: 30px;
    padding: 5px 13px 5px 9px;
  }

  .aayda-road-history__era-badge-text {
    line-height: 20px;
  }

  .aayda-road-history__era-title {
    font-size: 32px;
    line-height: 41.6px;
    letter-spacing: -0.64px;
    min-height: 84px;
  }

  .aayda-road-history__era-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .aayda-road-history__era-paras {
    gap: 0;
  }

  .aayda-road-history__era-copy p,
  .aayda-road-history__era-paras,
  .aayda-road-history__era-paras p,
  .aayda-road-history__era-note,
  .aayda-road-history__era-infra-label {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.28px;
  }

  .aayda-road-history__era-copy p,
  .aayda-road-history__era-paras p {
    width: 399px;
  }

  .aayda-road-history__era-note {
    width: 399px;
    line-height: 22.4px;
    padding-bottom: 16px;
  }

  .aayda-road-history__era-infra-label {
    padding-bottom: 12px;
    line-height: 21px;
  }

  .aayda-road-history__era-side {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 461px;
    min-height: 368px;
    flex-shrink: 0;
  }

  .aayda-road-history__era-facts {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    width: 100%;
  }

  .aayda-road-history__era-stats li {
    align-items: center;
  }

  .aayda-road-history__era-stats span {
    font-size: 14px;
    line-height: 22.4px;
  }

  .aayda-road-history__era-map--mobile {
    display: none;
  }

  .aayda-road-history__era-map--desktop {
    display: block;
    width: 461px;
    height: 153px;
    object-position: 0 -37.09%;
  }

  .aayda-road-history__era-map--stored {
    width: 461px;
    height: 153px;
    object-position: center;
  }

  /* The strip overlaps the card's last 16px, as in Figma (card 52 + 432 = 484, strip at 468). */
  .aayda-road-history__timeline {
    position: relative;
    width: 1253px;
    margin-top: -16px;
  }

  .aayda-road-history__eras {
    height: 128px;
  }

  .aayda-road-history__eras-track {
    gap: 0;
    padding: 0;
  }

  /*
   * With the script the strip no longer scrolls: the track slides so the selected period sits 8px inside
   * the strip's left edge (Figma 9473:59115 at -471.8px in its 1253px clip with the second period selected).
   */
  [data-road-history-enhanced] .aayda-road-history__eras {
    overflow: hidden;
  }

  [data-road-history-enhanced] .aayda-road-history__eras-track {
    transform: translateX(var(--aayda-road-history-era-offset, 0px));
  }

  .aayda-road-history__era {
    width: 480px;
    justify-content: flex-start;
    font-size: 32px;
    line-height: 41.6px;
    letter-spacing: -0.64px;
    opacity: 0.15;
  }

  /* Bug-fix 4, correction 27: the selected period's box is Figma's 107px (4921:36516: y 21, 107 tall, at the
     foot of the 128px strip), not the strip's whole 128px. Both sit on the strip's foot, so the 128px line
     drew the label 10.5px higher, too close to the card above it; it now keeps the design's distance. */
  .aayda-road-history__era.is-active {
    font-size: 96px;
    line-height: 107px;
    letter-spacing: -2px;
    opacity: 1;
  }

  /*
   * bug-fix-5 BUG 2: a selected four-digit period at 96px ("1994–2003" is about 546px) is wider than its
   * 480px slot, so it ran over the next label — and, scrolling back, over the period it had just
   * replaced. road-history.js measures the selected label and moves only the labels after it right by the
   * overflow plus a 40px clearance (--aayda-road-history-era-shift); the slots, the strip's travel and the
   * period under the dot stay as they were, and a label that fits leaves every shift at 0.
   */
  [data-road-history-enhanced] .aayda-road-history__era {
    transform: translateX(var(--aayda-road-history-era-shift, 0px));
  }

  /* 20px under the strip (Figma: strip 468 + 128, ruler at 616). */
  .aayda-road-history__ruler {
    position: relative;
    width: 100%;
    height: 19px;
    margin: 20px 0 0;
    overflow: visible;
    background-image:
      repeating-linear-gradient(to right, #133888 0 1px, transparent 1px 10px),
      repeating-linear-gradient(to right, #133888 0 1px, transparent 1px 70px);
    /* The ticks move with the strip (Figma moves them 480px per period); the script sets the shift. */
    background-position:
      calc(85px + var(--aayda-road-history-ruler-shift, 0px)) 0,
      calc(85px + var(--aayda-road-history-ruler-shift, 0px)) 0;
    background-size: 10px 8px, 70px 14px;
  }

  .aayda-road-history__ruler-dot {
    display: block;
  }

  /* Figma 4921:38913 (12px) and 4921:38914/38915 (8px), centred on the 1.5px line (base rule). */
  .aayda-road-history__ruler-dot--lg {
    left: 233px;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    background: var(--aayda-colors-accent);
  }

  .aayda-road-history__ruler-dot--md {
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
  }

  /* Under the next two periods' centres (Figma 9473:60338 and 9473:60339); the script follows the strip. */
  .aayda-road-history__ruler-dot--a {
    left: 634px;
  }

  .aayda-road-history__ruler-dot--b {
    left: 1113px;
  }

  /* The desktop scroll-linked timeline: the intro stays in view while the page scrolls through its eras. */
  .aayda-road-history__pin[data-road-history-pinning] {
    height: var(--aayda-road-history-pin-height);
  }

  .aayda-road-history__pin[data-road-history-pinning] > .aayda-road-history__intro {
    position: sticky;
    top: var(--aayda-road-history-pin-top, 0px);
  }

  .aayda-road-history__body {
    gap: 0;
    width: 1272px;
    margin: 96px auto 0;
    padding: 0;
  }

  .aayda-road-history__years,
  .aayda-road-history__karabakh {
    margin-bottom: 120px;
  }

  .aayda-road-history__projects:not(:last-child) {
    margin-bottom: 120px;
  }

  .aayda-road-history__years-head {
    width: 516px;
    margin-bottom: 36px;
  }

  .aayda-road-history__eyebrow {
    line-height: 20px;
  }

  /* bug-fix-5 batch 3 (owner decision): the desktop badge is Figma's pill 13228:40223 — 2px white inside
     stroke, white at 48%, fully rounded, 3/12/3/8 padding, an 8px #00f296 dot 8px before a #365383 label;
     197×30 with the design's wording. The mobile badge stays the design's plain green text (5951:21178). */
  .aayda-road-history__eyebrow--desktop {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: var(--aayda-numbers-spacing-8);
    width: max-content;
    max-width: 100%;
    height: 30px;
    padding: 3px 12px 3px 8px;
    color: var(--aayda-colors-navy-700);
    background: rgba(255, 255, 255, 0.48);
    border: 2px solid var(--aayda-colors-base-white);
    border-radius: 100px;
  }

  .aayda-road-history__eyebrow--desktop::before {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--aayda-colors-accent);
    border-radius: 50%;
    content: "";
  }

  .aayda-road-history__section-title {
    font-size: 40px;
    line-height: 52px;
    letter-spacing: -0.8px;
  }

  /*
   * One card per year, however many there are. Four fill the 1272px body exactly (4 × 300px + 3 × 24px),
   * as in the design; a fifth and later cards wrap onto further rows of the same cards, in document
   * order, instead of overflowing the body.
   */
  .aayda-road-history__year-cards {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .aayda-road-history__year-card {
    flex-shrink: 0;
    width: 300px;
    height: 308px;
  }

  .aayda-road-history__year-card::after {
    inset: 87.34% 0 0;
  }

  .aayda-road-history__year-card-inner {
    height: 99.03%;
  }

  .aayda-road-history__year-top {
    height: 174px;
  }

  .aayda-road-history__year-badge {
    margin-bottom: 37px;
  }

  .aayda-road-history__year-rows {
    height: 140px;
  }

  .aayda-road-history__year-row dt {
    color: var(--aayda-colors-neutral-text-secondary);
    font-size: var(--aayda-typography-size-12);
    line-height: var(--aayda-typography-line-height-12);
    letter-spacing: var(--aayda-typography-letter-spacing-12);
  }

  .aayda-road-history__year-row dd {
    font-size: var(--aayda-typography-size-14);
    line-height: var(--aayda-typography-line-height-14);
    letter-spacing: var(--aayda-typography-letter-spacing-14);
  }

  .aayda-road-history__year-card:hover .aayda-road-history__year-card-inner {
    border-color: #133888;
  }

  /*
   * Figma 9473:60354: 1272 × 878 with the design's text and four cards. A minimum rather than a fixed
   * height, so a longer narrative or a second row of cards (the admin allows more than four) extends
   * the block instead of being clipped by its overflow.
   */
  .aayda-road-history__karabakh {
    align-items: center;
    width: 1272px;
    min-height: 878px;
    margin-bottom: 120px;
    padding: 46px 48px 45px 47px;
    overflow: hidden;
    background: rgba(234, 237, 238, 0.52);
    border-radius: 24px;
    gap: 28px;
  }

  /*
   * Figma 9473:60360: a 1176 × 478 media frame with the 614 × 459 text panel 10px from its top and 12px
   * from its left. The panel sits in the flow (not absolutely) with a minimum height, and the video
   * covers the frame behind it, so the frame is exactly the design's for the design's text and grows
   * with a longer narrative rather than cutting it off.
   */
  .aayda-road-history__banner {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    width: 1176px;
    min-height: 478px;
    overflow: hidden;
    border-radius: 12px;
  }

  .aayda-road-history__banner-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .aayda-road-history__banner-overlay {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    width: 614px;
    min-height: 459px;
    margin: 10px 0 9px 12px;
    padding: 36px 32px;
    background: rgba(36, 35, 35, 0.02);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .aayda-road-history__banner-overlay h2 {
    margin: 0;
    color: #f7f7f7;
    font-family: var(--aayda-typography-font-primary);
    font-size: 36px;
    font-weight: var(--aayda-typography-weight-bold);
    line-height: 46.8px;
    letter-spacing: -0.72px;
  }

  .aayda-road-history__banner-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 542px;
  }

  .aayda-road-history__banner-copy p {
    margin: 0;
    color: var(--aayda-colors-base-white);
    font-family: var(--aayda-typography-font-primary);
    font-size: 16px;
    font-weight: var(--aayda-typography-weight-regular);
    line-height: 26px;
    letter-spacing: -0.32px;
  }

  .aayda-road-history__banner-copy p:first-child {
    line-height: 22.75px;
    letter-spacing: 0;
  }

  .aayda-road-history__banner-copy strong {
    color: #f7f7f7;
    font-weight: var(--aayda-typography-weight-bold);
  }

  /*
   * Figma 9473:60369: a row as wide as the block's 1177px content, starting at its left edge, with four
   * 280px cards 20px apart (1180px, so the last card ends 3px into the block's right padding, as in the
   * design). Further cards wrap onto rows of the same cards.
   */
  .aayda-road-history__infra {
    grid-template-columns: repeat(4, 280px);
    gap: 20px;
    width: 100%;
    max-width: none;
  }

  /* Figma 6489:27099 (Device=Desktop): 280 × 281; the panel is 278 tall and the 27px bar shows 3px below. */
  .aayda-road-history__infra-card {
    width: 280px;
    min-height: 281px;
    padding-bottom: 3px;
  }

  .aayda-road-history__infra-card::after {
    height: 27px;
  }

  .aayda-road-history__infra-inner {
    gap: 20px;
    padding: 78px 20px 16px;
    background: #f6f8f8;
  }

  .aayda-road-history__infra-icon {
    top: 14px;
    left: 18px;
    width: 50px;
    height: 50px;
  }

  .aayda-road-history__infra-icon img {
    width: 22px;
    height: 22px;
  }

  .aayda-road-history__infra-value {
    color: var(--aayda-colors-navy-900);
    font-size: 40px;
    line-height: 1.5;
    letter-spacing: -1.2px;
  }

  .aayda-road-history__infra-line {
    width: 100%;
  }

  .aayda-road-history__infra-copy p {
    font-size: 16px;
    letter-spacing: -0.176px;
  }

  .aayda-road-history__projects {
    gap: 40px;
  }

  .aayda-road-history__projects-title {
    font-size: 32px;
    line-height: 41.6px;
    letter-spacing: -0.64px;
  }
}

/*
 * Karabakh figure cards: hover (Figma 6489:27099 → 10911:77425, "On hover → Change to", Dissolve,
 * 300ms, ease out). Desktop only: the phone variant (6489:27065) has no hover, and (hover: hover)
 * keeps a tap from leaving a touch screen's card stuck in the hover look. The cards are information,
 * not controls, so nothing here makes them focusable or gives them a pointer. The border stays and
 * turns transparent (the hover variant hides its stroke), so nothing moves.
 */
@media (min-width: 1416px) and (hover: hover) {
  .aayda-road-history__infra-card::after,
  .aayda-road-history__infra-inner,
  .aayda-road-history__infra-value,
  .aayda-road-history__infra-copy p,
  .aayda-road-history__infra-icon,
  .aayda-road-history__infra-icon img {
    transition:
      background-color 300ms ease-out,
      border-color 300ms ease-out,
      color 300ms ease-out,
      opacity 300ms ease-out;
  }

  .aayda-road-history__infra-card:hover::after {
    background: #00f296;
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-inner {
    background: #133888;
    border-color: transparent;
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-value {
    color: #00f296;
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-copy p {
    color: var(--aayda-colors-base-white);
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-copy p:last-child,
  .aayda-road-history__infra-card:hover .aayda-road-history__infra-copy p:not(:first-child) {
    color: rgba(255, 255, 255, 0.8);
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-icon {
    background: rgba(220, 223, 228, 0.07);
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-icon img {
    opacity: 0;
  }

  .aayda-road-history__infra-card:hover .aayda-road-history__infra-icon .aayda-road-history__infra-icon-hover {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aayda-road-history__infra-card::after,
  .aayda-road-history__infra-inner,
  .aayda-road-history__infra-value,
  .aayda-road-history__infra-copy p,
  .aayda-road-history__infra-icon,
  .aayda-road-history__infra-icon img {
    transition: none;
  }
}

/*
 * The desktop era change, from Figma's 2000ms reference loop (9473:57931), played once per change:
 *   - the strip, its ticks and the two small dots slide 480px per period over 1200ms, ease-in-out;
 *   - the outgoing label shrinks from 2.55x and fades to 0.15, the incoming grows from 0.4x and fades in,
 *     each with Figma's 32px vertical offset, over 1200ms, ease-in-out;
 *   - the selected card fades in from 24px lower between 550ms and 1150ms, ease-out;
 *   - the accent dot grows from 0.7x over 1200ms, ease-out.
 * Only without a reduced-motion preference, and only at the desktop width: Figma has no mobile motion.
 * The script adds the is-entering / is-leaving classes only under the same conditions.
 */
@media (min-width: 1416px) and (prefers-reduced-motion: no-preference) {
  [data-road-history-enhanced] .aayda-road-history__eras-track {
    transition: transform 1200ms ease-in-out;
  }

  [data-road-history-enhanced] .aayda-road-history__ruler {
    transition: background-position 1200ms ease-in-out;
  }

  [data-road-history-enhanced] .aayda-road-history__ruler-dot--md {
    transition: left 1200ms ease-in-out;
  }

  /* The labels after a wide selected period make room at the strip's own pace. */
  [data-road-history-enhanced] .aayda-road-history__era {
    transition: transform 1200ms ease-in-out;
  }

  /*
   * bug-fix-5 BUG 2: the grow and shrink scale from the label's left edge, where the label is anchored in
   * its slot, not from its centre. Scaled 2.55x around its centre, the outgoing label started some 140px
   * left of its own slot, so stepping back (keyboard, scrolling up) it covered the incoming period. The
   * vertical origin is unchanged, so the keyframes' 32px offset still keeps the label on the strip's foot.
   */
  .aayda-road-history__era-text {
    transform-origin: left center;
  }

  .aayda-road-history__era.is-entering {
    animation: aayda-road-history-era-fade-in 1200ms ease-in-out both;
  }

  .aayda-road-history__era.is-entering .aayda-road-history__era-text {
    animation: aayda-road-history-era-grow 1200ms ease-in-out both;
  }

  .aayda-road-history__era.is-leaving {
    animation: aayda-road-history-era-fade-out 1200ms ease-in-out both;
  }

  .aayda-road-history__era.is-leaving .aayda-road-history__era-text {
    animation: aayda-road-history-era-shrink 1200ms ease-in-out both;
  }

  .aayda-road-history__era-card.is-entering {
    animation: aayda-road-history-era-card-in 600ms ease-out 550ms both;
  }

  .aayda-road-history__ruler-dot--lg.is-entering {
    animation: aayda-road-history-era-dot-in 1200ms ease-out both;
  }
}

@keyframes aayda-road-history-era-fade-in {
  from {
    opacity: 0.15;
  }

  to {
    opacity: 1;
  }
}

@keyframes aayda-road-history-era-fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.15;
  }
}

@keyframes aayda-road-history-era-grow {
  from {
    transform: translateY(32px) scale(0.4);
  }

  to {
    transform: none;
  }
}

@keyframes aayda-road-history-era-shrink {
  from {
    transform: translateY(-32px) scale(2.55);
  }

  to {
    transform: none;
  }
}

@keyframes aayda-road-history-era-card-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes aayda-road-history-era-dot-in {
  from {
    scale: 0.7;
  }

  to {
    scale: 1;
  }
}
