/* Store badges rendered by /store-links.js. */
.store-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.store-badge {
  display: inline-flex;
  transition: transform 0.2s;
}

.store-badge:hover {
  transform: scale(1.03);
}

.store-badge img {
  display: block;
  height: 44px;
}

.store-badge--primary img {
  height: 52px;
}

.store-badge-invert {
  filter: invert(1);
}

/* "Also on Android · Windows" under the primary badge (data-others="text"). */
.store-links-others {
  margin: 0;
  text-align: left;
  font-size: 0.9rem;
  opacity: 0.85;
}

.store-links-others a {
  color: inherit;
  font-weight: 500;
  text-underline-offset: 2px;
}

/* On phones the line moves under the badge. */
@media (max-width: 600px) {
  .store-links-others {
    flex-basis: 100%;
    text-align: center;
  }
}

/* Primary on its own row, the other store badges below it. With the
   text-link line instead of badges, the line sits beside the badge. */
.store-links--has-primary:not(.store-links--compact):not(.store-links--others-text) .store-badge--primary {
  flex-basis: 100%;
  justify-content: center;
}

/* Web app links. Pages mark the main web app button .web-app-primary (shown
   only where no store app fits, e.g. Linux) and the small "or try the web
   app" link .web-app-secondary (shown on Mac and Windows). Phones and
   tablets see neither. */
/* "★ 4.9 on the App Store · 580+ ratings", filled in by build.sh. Hidden
   when the build couldn't fetch it (or when previewing unbuilt pages). */
.app-store-rating {
  margin: 0;
  font-size: 0.9rem;
}

.app-store-rating:empty {
  display: none;
}

:root .web-app-primary,
:root .web-app-secondary {
  display: none;
}

html[data-primary-store="none"] .web-app-primary,
html[data-platform="mac"]:not([data-primary-store="none"]) .web-app-secondary,
html[data-platform="windows"]:not([data-primary-store="none"]) .web-app-secondary {
  display: block;
}

@media (max-width: 700px) {
  .store-links--compact.store-links--has-primary .store-badge--secondary,
  .store-links--compact .store-links-others {
    display: none;
  }
}
