/*
 * Home page atlas block: five fixed rows for the main jurisdictions, then a
 * looping window with every other country and region.
 * Plain CSS (no layers or colour functions) so older browsers render it too.
 */


.atlas-top { margin: 0; padding: 0; list-style: none; }

/* The looping window. It is a fixed-height scroll box even before the script
   runs, so the page never expands to the full list. */
.atlas-ticker.atlas-loop {
  height: 19.5rem;
  margin-inline: -1rem;
  padding-inline: 1rem;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.25rem, #000 calc(100% - 3rem), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.25rem, #000 calc(100% - 3rem), transparent 100%);
}
@media (min-width: 768px) {
  .atlas-ticker.atlas-loop { height: 23rem; }
}
.atlas-ticker.atlas-loop[data-mode="static"] {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.atlas-ticker.atlas-loop[data-mode="fit"] { height: auto; -webkit-mask-image: none; mask-image: none; }
.atlas-ticker.atlas-loop[data-mode="loop"] { touch-action: pan-x; }
.atlas-ticker.atlas-loop:focus-visible { outline: 2px solid #8fb0dc; outline-offset: 2px; }
.atlas-loop ul { margin: 0; padding: 0; list-style: none; }

/* Compact rows inside the window */
.atlas-row--compact { align-items: center; padding-block: .8rem; }
@media (min-width: 48rem) {
  .atlas-row--compact { padding-block: .95rem; }
}
.atlas-row--compact .atlas-name { font-size: 1.12rem; }
.atlas-row--compact .atlas-en { margin-top: .15rem; }
.atlas-row--compact .atlas-tax {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .875rem;
  line-height: 1.5rem;
}
.atlas-row--compact .atlas-quote { min-height: 2.25rem; }
.atlas-row--compact::before {
  content: "";
  position: absolute;
  left: -.9rem;
  top: 26%;
  bottom: 26%;
  width: 2px;
  background: #de4860;
  opacity: 0;
  transition: opacity .35s ease;
}

@media (max-width: 47.99rem) {
  .atlas-row--compact {
    grid-template-columns: 4.1rem minmax(0, 1fr) auto;
    column-gap: .75rem;
    row-gap: .3rem;
  }
  .atlas-row--compact .atlas-code { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: .2rem; }
  .atlas-row--compact .atlas-name-cell { grid-column: 2; grid-row: 1; display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
  .atlas-row--compact .atlas-name { flex: none; }
  .atlas-row--compact .atlas-en { display: inline; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .atlas-row--compact .atlas-time { grid-column: 3; grid-row: 1; font-size: .75rem; white-space: nowrap; text-align: right; }
  .atlas-row--compact .atlas-tax { grid-column: 2 / span 2; grid-row: 2; font-size: .8125rem; line-height: 1.35rem; }
  .atlas-row--compact .atlas-quote-cell { display: none; }
}

/* While looping: rows outside the reading line fade back, the current one
   lights up with a coral marker. */
.atlas-loop[data-mode="loop"] .atlas-row {
  opacity: .55;
  transition: opacity .35s ease, background-color .35s ease;
}
.atlas-loop[data-mode="loop"] .atlas-row.is-current { opacity: 1; background-color: rgba(255, 255, 255, .045); }
.atlas-loop[data-mode="loop"] .atlas-row.is-current::before { opacity: 1; }
.atlas-loop[data-mode="loop"] .atlas-row.is-current .atlas-name-text { transform: translateX(.375rem); }
.atlas-loop[data-mode="loop"] .atlas-row:focus-within { opacity: 1; }
@media (hover: hover) {
  .atlas-loop[data-mode="loop"] .atlas-row:hover { opacity: 1; }
}

/* Footer: scroll buttons */
.atlas-loop-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem 1.5rem;
  margin-top: 1.25rem;
}
.atlas-loop-foot[hidden] { display: none; }
.atlas-loop-ctls { display: flex; align-items: center; gap: .5rem; }
.atlas-ctl[aria-pressed="true"] { border-color: #fff; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .atlas-loop .atlas-row,
  .atlas-row--compact::before { transition: none; }
}
