.shop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-block: 1.25rem 1.75rem;
}

.shop-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  min-height: 44px;
  max-width: 100%;
  box-sizing: border-box;
  padding: .6rem .95rem;
  border: 1px solid #87929f;
  border-radius: 5px;
  background: #faf9f5;
  color: #263b58;
  font-family: inherit;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
}

.shop-action--solid {
  border-color: #35496c;
  background: #35496c;
  color: #fff;
}

.shop-action > span[aria-hidden] {
  flex: none;
  font-weight: 400;
}

.shop-action:focus-visible {
  outline: 3px solid #8a641d;
  outline-offset: 3px;
}

@media (hover: hover) {
  .shop-action:hover { border-color: #35496c; background: #e9edef; }
  .shop-action--solid:hover { background: #263b58; }
}

#compare-editions,
#books,
#study-guide {
  scroll-margin-top: 1rem;
}

#compare-editions .shop-tools { margin-bottom: 0; }

#study-guide .content-cards > article { position: relative; }
#study-guide .content-cards > article::before {
  position: absolute;
  top: 0;
  left: 24px;
  width: 34px;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: var(--gold, #b99a58);
  content: "";
}

#study-guide .shop-guide-summary > a.shop-action {
  display: flex;
  width: fit-content;
  margin-top: .85rem;
  color: #fff;
  text-decoration: none;
}

/* The reveal module owns this transition when the browser supports it. */
#book-grid.has-scroll-reveal.sets-switching > .set-card { animation: none; }

@media (max-width: 700px) {
  #compare-editions table { min-width: 0; table-layout: fixed; }
  #compare-editions thead th:first-child { width: 23%; }
  #compare-editions :is(th, td) { padding: .7rem .4rem; overflow-wrap: anywhere; }
}

@media (max-width: 560px) {
  .shop-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  }
}

#study-guide > .content-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#study-guide::after {
  background: linear-gradient(180deg, rgba(247,245,239,.96), rgba(247,245,239,.9) 135px, rgba(247,245,239,.48) 245px, rgba(247,245,239,.6));
}
#study-guide > .eyebrow { color: #705829; }
#study-guide > h2, #study-guide > .eyebrow { text-shadow: none; }
#study-guide > p.shop-guide-summary { color: var(--ink, #202d48); }

@media (min-width: 701px) and (max-width: 1150px) {
  #study-guide > .content-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #study-guide > .content-cards > article { padding: 18px 22px; }
  #study-guide > .content-cards h3 { margin: 0 0 6px; }
  #study-guide > .content-cards p { margin: 0; }
}
@media (max-width: 700px) {
  #study-guide > .content-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .shop-action > span[aria-hidden] { transition: translate 160ms ease-out; }
  .shop-action:is([href="#compare-editions"], [href="#study-guide"]) { --arrow-shift: 0 3px; }
  .shop-action--solid[href="#books"] { --arrow-shift: 0 -3px; }
  .shop-action:is(:hover, :focus-visible) > span[aria-hidden] { translate: var(--arrow-shift, 3px 0); }
}

@media (prefers-reduced-motion: no-preference) {
  #sets-preview[open] {
    --preview-lift: 24px;
    animation: shop-preview-open 380ms ease-out;
  }
  #sets-preview[open]::backdrop {
    animation: shop-preview-backdrop 260ms ease-out;
  }
  @keyframes shop-preview-open {
    from { opacity: 0; transform: translateY(var(--preview-lift)) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes shop-preview-backdrop {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 700px) {
  #sets-preview[open] {
    --preview-lift: 14px;
    animation-duration: 320ms;
  }
}
