/* Store download badges. Surface names describe the surrounding background. */
a.fm-store-badge {
  --badge-bg: #111412;
  --badge-fg: #F5F0E1;
  --badge-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  gap: 12px;
  width: 260px;
  max-width: 100%;
  height: 64px;
  min-height: 64px;
  box-sizing: border-box;
  padding: 12px 20px;
  border: 1.5px solid var(--badge-border);
  border-radius: 18px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  transition: transform 160ms ease;
}

a.fm-store-badge--forest {
  --badge-bg: #C8F73A;
  --badge-fg: #111412;
  border-radius: 999px;
}

a.fm-store-badge--lime {
  --badge-bg: #0F2A1D;
  box-shadow: 5px 5px 0 #111412;
  margin: 0 5px 5px 0;
}

a.fm-store-badge--ink {
  --badge-bg: transparent;
  --badge-border: #F5F0E1;
}

a.fm-store-badge:hover { transform: translateY(-2px); }
a.fm-store-badge:active { transform: translateY(0); }
a.fm-store-badge:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

.fm-store-badge .fm-store-badge__icon {
  display: flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.fm-store-badge__icon svg { display: block; }
.fm-store-badge--forest.badge-google-play .fm-store-badge__icon path { fill: currentColor; }
.fm-store-badge--forest.badge-google-play .fm-store-badge__icon path:nth-child(2) { opacity: .7; }
.fm-store-badge--forest.badge-google-play .fm-store-badge__icon path:nth-child(4) { opacity: .5; }

.fm-store-badge .fm-store-badge__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  color: inherit;
}
.fm-store-badge .fm-store-badge__subtitle {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: inherit;
  opacity: .75;
}
.fm-store-badge .fm-store-badge__title {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.035em;
  color: inherit;
}
.fm-store-badge .fm-store-badge__arrow {
  display: flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: 6px;
  border-radius: 50%;
  background: #C8F73A;
  color: #111412;
}

/* Compact enough for the existing two-column mobile navigation. */
.mobile-store-grid > .fm-store-badge {
  width: 100%;
  height: 58px;
  gap: 8px;
  padding: 10px 12px;
  min-height: 58px;
}
.mobile-store-grid .fm-store-badge__title { font-size: 18px; }
.mobile-store-grid .fm-store-badge__subtitle { font-size: 7px; }
.mobile-store-grid .fm-store-badge__icon { flex-basis: 22px; }
.mobile-store-grid .fm-store-badge__icon svg { width: 22px; }

@media (max-width: 380px) {
  .mobile-store-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  a.fm-store-badge { transition: none; }
  a.fm-store-badge:hover { transform: none; }
}

/* Explicit badge roles within the site's typography layer. */
@layer site-typography {
  body.site-type a.fm-store-badge { color: var(--badge-fg) !important; }
  body.site-type .fm-store-badge .fm-store-badge__subtitle {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
  }
  body.site-type .fm-store-badge .fm-store-badge__title {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }
  body.site-type .mobile-store-grid .fm-store-badge__title { font-size: 18px !important; }
  body.site-type .mobile-store-grid .fm-store-badge__subtitle { font-size: 7px !important; }
}
