:root {
  --ink: #201c1a;
  --paper: #fff8e9;
  --white: #fffdf7;
  --sky: #4cbbe4;
  --sky-pale: #e7f7ff;
  --sand: #f9deb0;
  --gold: #f9dc69;
  --muted: #625d56;
  --line: 2.5px solid var(--ink);
  --body-font: "Atma", sans-serif;
  --display-font: "Bangers", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 3px dashed #006c9d; outline-offset: 5px; }

.top-ink-line {
  height: 10px;
  background: var(--sky);
  border-bottom: 3px solid var(--ink);
}
.site-frame {
  width: min(100% - 40px, 930px);
  margin: 0 auto;
}

/* Masthead */
.masthead {
  position: relative;
  padding: clamp(27px, 5.2vw, 44px) 0 27px;
  text-align: center;
}
.masthead__eyebrow {
  margin: 0 0 18px;
  color: #36505a;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.masthead__eyebrow span {
  color: #e9a436;
  padding: 0 8px;
  font-size: 1.05rem;
}
.masthead__wordmark {
  margin-inline: auto;
  width: min(100%, 510px);
  height: auto;
}
.masthead__tagline {
  margin-top: 16px;
  font-size: clamp(.88rem, 1.8vw, 1.05rem);
  line-height: 1.4;
  font-weight: bold;
}
.masthead__tagline p { margin: 0; }
.masthead__tagline p + p {
  margin-top: 1px;
  color: var(--muted);
  font-size: .88em;
  font-weight: 600;
}

/* Catalogue heading */
.books__heading {
  display: flex;
  gap: clamp(12px, 4vw, 30px);
  align-items: center;
  justify-content: center;
  margin: 5px auto 25px;
  text-align: center;
  font-weight: 600;
}
.books__heading h1 {
  margin: 0;
  font: normal clamp(1.65rem, 4vw, 2.65rem) / 1.05 var(--display-font);
  letter-spacing: .025em;
}
.books__heading h1 span { color: #0791c1; padding: 0 4px; }
.books__heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.books__dash {
  width: min(12vw, 76px);
  height: 3px;
  flex: 0 1 76px;
  background: var(--ink);
  transform: rotate(-2deg);
}
.books__dash:last-child { transform: rotate(2deg); }

/* Product cards */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.9vw, 26px);
  align-items: stretch;
}
.book-card {
  min-width: 0;
  display: block;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 16px 20px 17px 13px;
  box-shadow: 6px 6px 0 var(--ink); /* flat, hard-edge printed-cartoon treatment */
  overflow: hidden;
}
.book-card:nth-child(2) { border-radius: 20px 15px 12px 19px; }
.book-card__cover-box {
  position: relative;
  margin: 14px 14px 0;
  border: 2px solid var(--ink);
  background: var(--sky-pale);
  overflow: hidden;
}
.book-card__cover { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
/* Edition stamp sits BELOW the cover so no title/artwork is obscured. */
.book-card__edition {
  display: table;
  margin: 0 auto 9px;
  transform: rotate(-2deg);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 6px 4px 7px 3px;
  padding: 4px 10px 3px;
  font-weight: 900;
  font-size: .66rem;
  letter-spacing: .065em;
  line-height: 1.1;
}
.book-card:nth-child(2) .book-card__edition {
  transform: rotate(2deg);
  background: #f9e0bd;
}
.book-card__body {
  padding: 14px 18px 17px;
  text-align: center;
}
.book-card__body h2 {
  margin: 0;
  font: normal clamp(1.5rem, 3.2vw, 2.18rem) / 1.12 var(--display-font);
  letter-spacing: .025em;
}
.book-card__description {
  margin: 6px 0 0;
  font-size: .97rem;
  font-weight: 750;
  line-height: 1.3;
}
.book-card__detail {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.35;
  font-weight: 600;
}
.book-card__buy {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: min(100%, 315px);
  min-height: 49px;
  margin: 17px auto 0;
  padding: 11px 16px;
  border: var(--line);
  border-radius: 10px 12px 9px 11px;
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.17;
  transition: translate .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.book-card__buy:not(.is-pending):hover,
.book-card__buy:not(.is-pending):focus-visible {
  background: #ffea94;
  translate: 2px 2px;
  box-shadow: 1px 1px 0 var(--ink);
}
.book-card__buy-arrow { font-size: 1.25rem; line-height: .8; flex: 0 0 auto; }
.book-card__buy.is-pending {
  cursor: default;
  background: #e7e5dd;
  color: #686660;
  border-color: #89857f;
  box-shadow: 3px 3px 0 #89857f;
  font-size: .82rem;
}
.book-card__buy.is-pending .book-card__buy-arrow { display: none; }

.books__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 12px 26px;
  text-align: center;
    font-weight: 600;
}
.books__note-star { font-size: 2rem; color: #e6a429; }
.books__note p { margin: 0; font-size: .88rem; line-height: 1.55; }
.books__note [lang="es"] { color: var(--muted); font-size: .94em; }

/* Footer */
.footer {
  border-top: 2px solid var(--ink);
  padding: 18px 0 30px;
  text-align: center;
  font-size: .77rem;
}
.footer p { margin: 4px 0; }
.footer__micro { color: var(--muted); }
.footer__social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.footer__social a {
  display: inline-block;
  padding: 8px 11px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: bold;
  text-decoration: none;
}
.footer__social a:hover { background: var(--gold); }

@media (max-width: 640px) {
  .site-frame { width: min(100% - 28px, 480px); }
  .masthead { padding: 26px 0 22px; }
  .masthead__eyebrow { font-size: .56rem; letter-spacing: .12em; margin-bottom: 16px; }
  .masthead__wordmark { width: min(100%, 355px); }
  .masthead__tagline { margin-top: 12px; font-size: .84rem; }
  .books__heading { margin-top: 5px; margin-bottom: 18px; gap: 6px; }
  .books__heading h1 { font-size: clamp(1.36rem, 5vw, 1.95rem); }
  .books__heading p { font-size: .75rem; }
  .books__dash { width: 15px; flex-basis: 15px; }
  .book-grid { gap: 12px; }
  .book-card { border-width: 2px; box-shadow: 4px 4px 0 var(--ink); }
  .book-card__cover-box { margin: 8px 8px 0; border-width: 1.5px; }
  .book-card__edition { font-size: .56rem; padding: 4px 5px 3px; border-width: 1.5px; margin-bottom: 8px; letter-spacing: .03em; }
  .book-card__body { padding: 10px 8px 12px; }
  .book-card__body h2 { font-size: clamp(1.15rem, 4.7vw, 1.65rem); }
  .book-card__description { font-size: clamp(.74rem, 2.7vw, .9rem); }
  .book-card__detail { display: none; }
  .book-card__buy { min-height: 48px; padding: 8px 6px; font-size: .77rem; gap: 4px; border-width: 2px; }
  .book-card__buy.is-pending { font-size: .7rem; }
  .book-card__buy-arrow { font-size: .98rem; }
  .books__note { padding: 24px 0 21px; gap: 9px; }
  .books__note p { font-size: .74rem; }
}

/* Very narrow screens: stack books, so titles/buttons remain readable. */
@media (max-width: 339px) {
  .book-grid { grid-template-columns: 1fr; max-width: 300px; margin-inline: auto; gap: 18px; }
  .book-card__body h2 { font-size: 1.7rem; }
  .book-card__buy { font-size: .89rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
