/* The shop: the notice line, the header's shop button, the home page's hero, filters and
   product grid, its free-room, nonogram and contact bands, and on a product page the
   related games and the phone's buy bar. site.css holds the tokens, type and the
   components every page shares; this file is what makes the site read as a shop.
   Shapes: cards and photographs take --radius, everything pressable is a pill. */

/* --- Notice ----------------------------------------------------- */

.notice {
  margin: 0;
  padding: 9px 16px;
  background: var(--navy);
  color: var(--paper);
  font-size: 0.86rem;
  text-align: center;
}

.notice a {
  margin-left: 6px;
  color: var(--orange-light);
  font-weight: 700;
}

/* --- Home hero ------------------------------------------------------------- */

.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding-block: 48px 40px;
}

.shop-hero h1 {
  margin-bottom: 20px;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
}

.shop-hero .hero-intro {
  margin-bottom: 28px;
}

/* One tall photograph beside two short ones. */
.shop-hero-art {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  height: 470px;
}

.shop-hero-art picture:first-child {
  grid-row: span 2;
}

.shop-hero-art img,
.free-band-art img,
.nonograms img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
}

/* --- Filters and the product grid ----------------------------------------- */

.shop {
  padding-block: 24px 40px;
}

.shop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.shop-head h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.shop-note {
  max-width: 62ch;
  margin: -6px 0 28px;
  color: var(--muted);
}

/* The filter targets: empty, and placed so that landing on one shows the chips. */
.shop-anchor {
  display: block;
  scroll-margin-top: 16px;
}

.shop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.shop-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

.shop-chips a:hover {
  border-color: var(--navy);
}

/* Which chip is on, and which cards it hides: shop-filters.css, built from shop.js. */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 28px;
}

/* The whole card is the link (`.card-target::after` in site.css covers it). */
.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 16px;
}

.shop-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--mist);
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-card picture {
  overflow: hidden;
  border-radius: var(--radius);
}

.shop-card:hover img {
  transform: scale(1.03);
}

.shop-card:target picture,
.shop-card:has(.card-target:focus-visible) picture {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.shop-card .card-target:focus-visible {
  outline: none;
}

.shop-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.shop-price {
  flex: none;
  color: var(--navy);
  font-size: 1.02rem;
  font-weight: 700;
}

.shop-price-free {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper);
  font-size: 0.85rem;
}

.shop-card h3 {
  margin-bottom: 4px;
  font-size: 1.5rem;
}

.shop-card h3 a {
  text-decoration: none;
}

.shop-card:hover h3 a {
  color: var(--accent);
}

.shop-facts {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- Free room, nonograms, contact ----------------------------------------- */

.free-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  margin-block: 72px 96px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--navy);
  color: var(--paper);
}

.free-band-copy {
  align-self: center;
  padding: 56px;
}

.free-band h2 {
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 3.4vw, 3rem);
}

.free-band p {
  max-width: 30em;
  margin-bottom: 28px;
  color: var(--paper-dim);
  font-size: 1.08rem;
}

.free-band-art img {
  border-radius: 0;
}

.nonograms {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
  padding-bottom: 96px;
}

.nonograms h2 {
  font-size: clamp(2.2rem, 3.4vw, 3rem);
}

.nonograms p {
  max-width: 34em;
  font-size: 1.05rem;
}

.maker {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 28px;
  max-width: 820px;
  padding-block: 96px 24px;
}

.maker-quote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* --- Product pages ------------------------------------------------------- */

.book-hero-art img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* A product page opens like a shop: the photograph first, the name, story, price and
   buy button beside it. The copy stays first in the markup, so a screen reader still
   meets the name before the picture. */
.book-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 56px;
  padding-block: 24px 84px;
}

.book-hero-art {
  order: -1;
}

.book-hero h1 {
  margin-bottom: 20px;
  font-size: clamp(2.4rem, 3.6vw, 3.5rem);
}

/* The free room's download buttons, one group per edition. */
.edition-downloads + .edition-downloads {
  margin-top: 28px;
}

.edition-downloads p {
  margin-bottom: 12px;
}

.book-note {
  margin-top: 22px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.book-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
  gap: 56px;
  padding-bottom: 96px;
}

.book-prose p {
  margin-bottom: 20px;
}

.book-facts {
  align-self: start;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--mist);
}

.book-facts h2 {
  margin-bottom: 18px;
  font-size: 1.5rem;
}

.book-facts dl {
  margin: 0;
}

.book-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.book-facts dd {
  margin: 4px 0 16px;
  font-size: 0.92rem;
}

.book-facts dd:last-child {
  margin-bottom: 0;
}

/* A page that sells several games, such as the bachelorette pack: one card each, with its
   demo and its own buy button. The id on each card is the shop card's link target. */
.games {
  padding-bottom: 96px;
}

.games-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  margin-bottom: 28px;
}

.games-head h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.games-head p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 28px;
}

.game-card {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 16px;
}

.game-card picture {
  overflow: hidden;
  border-radius: var(--radius);
}

.game-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.game-card:target picture {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.game-card h3 {
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.game-card p:not(.shop-line) {
  flex: 1;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-actions .button {
  min-height: 42px;
  padding-inline: 16px;
  font-size: 0.86rem;
}

/* Related games and the phone's buy bar. */

.shop-related {
  padding-block: 24px 40px;
}

.shop-related h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.buy-bar {
  display: none;
}

/* A product page's price, above its buy button. */
.book-price {
  margin-bottom: 18px;
  font-size: 1rem;
}

.book-price strong {
  margin-right: 4px;
  color: var(--navy);
  font-size: 1.7rem;
}

.book-body ~ .faq h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

/* A product page's "What you download" and "Is this the right one?": the heading above,
   the list as tiles below. Only after .book-body, so the guides that share these classes
   keep their two-column layout. */
.book-body ~ .formats .how-layout,
.book-body ~ .book-for .how-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.book-body ~ .formats h2,
.book-body ~ .book-for h2 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.book-body ~ .formats .tick-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.book-body ~ .formats .tick-list li {
  max-width: none;
  margin: 0;
  padding: 16px 18px 16px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.book-body ~ .formats .tick-list li::before {
  top: 1.35em;
  left: 18px;
}

.book-body ~ .book-for .how-layout > div {
  max-width: 820px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--mist);
}

.book-body ~ .book-for .tick-list li {
  max-width: none;
}

@media (max-width: 900px) {
  .shop-hero,
  .free-band,
  .nonograms {
    grid-template-columns: 1fr;
  }

  .shop-hero {
    gap: 28px;
    padding-top: 24px;
  }

  .shop-hero-art {
    order: -1;
    height: 320px;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
  }

  .free-band-art {
    order: -1;
    height: 280px;
  }

  .free-band-copy {
    padding: 32px;
  }

  .nonograms {
    gap: 28px;
  }

  .book-hero,
  .book-body {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 20px;
  }

  .book-body ~ .formats .tick-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .notice {
    font-size: 0.8rem;
  }

  .shop-hero-art {
    height: 260px;
  }

  .shop-head .text-link {
    display: none;
  }

  /* The chips scroll sideways in one row, edge to edge. */
  .shop-chips {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .shop-chips a {
    flex: none;
  }

  .shop-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .shop-card h3 {
    font-size: 1.2rem;
  }

  .shop-facts {
    font-size: 0.8rem;
  }

  .free-band {
    margin-block: 48px 72px;
  }

  .free-band-copy {
    padding: 28px 24px;
  }

  .maker {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    padding-top: 72px;
  }

  .maker img {
    width: 48px;
    height: 48px;
  }

  .book-hero h1 {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }

  .book-body ~ .formats .tick-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .games {
    padding-bottom: 72px;
  }

  .book-body ~ .book-for .how-layout > div {
    padding: 24px 20px;
  }

  .buy-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    background: var(--paper);
  }

  .buy-bar p {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
  }

  .buy-bar p span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .buy-bar .button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-card img {
    transition: none;
  }

  .shop-card:hover img {
    transform: none;
  }
}

/* An Etsy sale (src/_data/sale.js): the regular price struck through and
   smaller, the sale price after it in the price's own style. */
.price-was {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 500;
}

.price-now {
  text-decoration: none;
}
