/* Paid routes: the paywall, the pages after payment, and "get my links
   again". Loaded after home.css, which provides the top bar and brand. */

.page-shop { background: var(--paper); }

.shop {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px) clamp(16px, 4vw, 48px) 64px;
}

/* ---------- paywall ---------- */
/* One column: the photo on top, the details and payment under it. */
.buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 680px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: rise .6s var(--ease) both;
}

/* The illustrated cover sits behind the photo, so a photo that fails to
   load shows the illustration instead of a broken image. */
.buy-media {
  position: relative;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .16), transparent 45%),
    repeating-radial-gradient(circle at 70% 120%, transparent 0 18px, rgba(255, 255, 255, .07) 18px 19px),
    linear-gradient(135deg, #d6452a, #9c2f1a);
}
.buy-media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.buy-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
}
.buy-fallback .icon { width: 56px; height: 56px; opacity: .9; }

.buy-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 4vw, 40px);
}
.buy-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -.02em;
}
.buy-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
}
.buy-stats li { display: inline-flex; align-items: center; gap: .4em; }
.buy-stats .icon { color: var(--red); }
.buy-intro { color: var(--ink-2); white-space: pre-line; }

/* ---------- forms ---------- */
.buy-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  text-align: left;
}
.buy-form label { font-size: .875rem; font-weight: 650; }
.buy-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  font: inherit;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.buy-form input:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent);
}
.buy-form small { font-size: .8rem; color: var(--muted); }

.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  margin-top: 8px;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(214, 69, 42, .3);
  cursor: pointer;
  transition: background .2s, transform .2s var(--ease);
}
.btn-buy:hover { background: var(--red-deep); transform: translateY(-1px); }
.btn-buy[hidden], .notice[hidden], .paypal-buttons[hidden] { display: none; }

.buy-price { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.buy-price strong {
  margin-right: .3em;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
}

/* PayPal's buttons (public/js/buy.js). Their frames have their own z-index;
   the stacking context keeps them under anything that overlays the page. */
.paypal-buttons {
  position: relative;
  z-index: 0;
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.fine, .restore { font-size: .85rem; color: var(--muted); }
.restore a { color: var(--jade); font-weight: 600; }

/* ---------- paste an access link ---------- */
.restore-box summary {
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--jade);
}
.restore-box[open] summary { margin-bottom: 8px; }
.restore-box .unlock-form { margin-top: 10px; padding-top: 0; border-top: 0; }
.unlock-row { display: flex; gap: 8px; }
.unlock-row input { flex: 1; min-width: 0; font: .9rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.btn-unlock {
  flex: none;
  min-width: 84px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--jade);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}
.btn-unlock:hover { background: #174a42; }
.unlock-form.is-compact label { font-size: .8rem; }
.tip[hidden] { display: none; }

.notice {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  text-align: left;
}
.notice-error { background: var(--red-soft); color: var(--red-deep); }
.notice-info { background: var(--jade-soft); color: var(--jade); }

/* ---------- after payment / get my links ---------- */
.shop-centre {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 72px);
}
.shop-card {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(24px, 5vw, 40px);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  color: var(--ink-2);
  animation: rise .6s var(--ease) both;
}
.shop-card h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--ink);
}
.shop-card strong { color: var(--ink); }
.shop-card .seal { margin-bottom: 6px; }
.shop-card .buy-form { width: 100%; border-top: 0; padding-top: 4px; }
.shop-card .btn-buy { align-self: stretch; }

.keybox {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--jade) 45%, var(--line));
  border-radius: var(--r-md);
  background: var(--paper-2);
  text-align: left;
}
.keybox label { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jade); }
.keybox p { font-size: .85rem; }
.keybox-row { display: flex; gap: 8px; }
.keybox input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font: .85rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
}
.btn-copy {
  flex: none;
  min-width: 84px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--jade);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}
.btn-copy:hover { background: #174a42; }

.tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .85rem;
  color: var(--muted);
  text-align: left;
}
.tip .icon { flex: none; margin-top: 2px; color: var(--jade); }

@media (max-width: 760px) {
  .shop-centre { min-height: 0; place-items: start center; }
}
