/* Publications (design: publications.html) */
/* The three real books: one box each — cover, language, title, description,
   and the Amazon links (new tab). Nothing else on the page. */

.bookgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:1.4rem}
@media(max-width:1024px){.bookgrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.bookgrid{grid-template-columns:1fr}}

.bookcard{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius);
  padding:clamp(1.3rem,2.4vw,1.8rem);background:var(--surface);
  transition:transform .3s cubic-bezier(.2,.7,.3,1),border-color .3s,background .3s}
.bookcard:hover,.bookcard:focus-within{transform:translateY(-4px);border-color:var(--accent);background:var(--surface-2)}

/* Covers are never cropped (owner). The band has a definite height and the image
   is sized FROM it (height:100% + width:auto + object-fit:contain), so a tall
   portrait cover can never overflow and paint over the title below it. */
.bookcard__cover{display:grid;place-items:center;height:clamp(200px,22vw,260px);margin-block-end:1.1rem;overflow:hidden}
.bookcard__cover img{height:100%;width:auto;max-width:100%;object-fit:contain;display:block;
  border-radius:8px;box-shadow:0 24px 44px -24px rgba(0,0,0,.55)}

.bookcard .chip{align-self:flex-start}
.bookcard__title{font-family:var(--font-display);font-weight:500;font-size:var(--step-1);letter-spacing:-.01em;margin-block:.7rem .5rem}
.bookcard__desc{color:var(--ink-soft);font-size:var(--step--1);line-height:1.55}

/* Buy buttons pin to the bottom so the three boxes line up. */
.bookcard__buy{display:flex;flex-wrap:wrap;gap:.5rem;margin-block-start:auto;padding-block-start:1.3rem}
.bookcard__buy .btn{font-size:var(--step--1);padding:.55rem 1rem;gap:.4rem}

@media(prefers-reduced-motion:reduce){
  .bookcard{transition:none}
  .bookcard:hover,.bookcard:focus-within{transform:none}
}

/* Free ebook section (revision round B4) — cover + form, same split pattern as contact. */
.ebook{margin-block-start:1rem}
.ebook__inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:clamp(1.6rem,4vw,3rem);
  align-items:start;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2);
  padding:clamp(1.5rem,3vw,2.4rem)}
@media(max-width:1024px){.ebook__inner{grid-template-columns:1fr}}
.ebook__cover{display:grid;place-items:center}
.ebook__cover img{height:220px;width:auto;max-width:100%;object-fit:contain;display:block;
  border-radius:8px;box-shadow:0 24px 44px -24px rgba(0,0,0,.55)}
.ebook__copy h2{font-family:var(--font-display);font-weight:500;font-size:var(--step-1);letter-spacing:-.01em}
.ebook__copy > p{color:var(--ink-soft);font-size:var(--step--1);margin-block:.5rem 1.3rem}
.ebook__fallback{color:var(--ink-faint);font-size:var(--step--2);margin-block-start:1rem}
.ebook__fallback a{color:var(--accent);font-weight:600}
