/* ============================================================================
   PayLess Publishing — Layout & components
   ========================================================================= */

/* -------------------------------------------------------------- structure */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
.wrap-narrow { max-width: var(--maxw-narrow); margin-inline: auto; }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }

/* "dark" used to mean a deep near-black band. The client asked for lighter,
   warmer and more saturated, so it is now a bright sky-blue band with normal
   dark text — the class name is kept so existing markup is unaffected. Only the
   footer stays dark, to ground the page. */
.section-dark {
  background:
    radial-gradient(760px 420px at 92% 8%, rgba(255, 255, 255, .55), transparent 62%),
    radial-gradient(620px 380px at 6% 96%, rgba(240, 48, 192, .16), transparent 60%),
    var(--sky-soft);
  color: var(--text);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--ink); }
.section-dark p { color: var(--text-soft); }
.section-dark .lede { color: var(--text-soft); }
.section-dark .eyebrow { color: var(--cyan-dark); }
/* "btn-ghost-light" was written for white-on-near-black. On this band, which is
   now LIGHT, its white text and white border vanished completely. Restate it as
   a normal outline button here. */
.section-dark .btn-ghost-light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}
.section-dark .btn-ghost-light:hover {
  background: var(--cyan-tint);
  border-color: var(--cyan);
  color: var(--cyan-dark);
}

.section-cream { background: var(--cream-2); }

/* Pastel section bands, sampled from the book's own page backgrounds. Alternating
   them gives the page a children's-book rhythm instead of one long cream scroll. */
.section-sky { background: var(--sky-soft); }
.section-mint { background: var(--mint-soft); }
.section-pink { background: var(--pink-soft); }
.section-lilac { background: var(--lilac-soft); }
.section-peach { background: var(--peach-soft); }
.section-sun { background: var(--yellow-soft); }
.section-paper { background: var(--paper); }
.section-coral { background: var(--coral-tint); }

.center { text-align: center; }
.stack > * + * { margin-top: var(--sp-4); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
/* mt-2 and mt-3 were missing even though the markup used mt-3 in six places, so
   those margins silently did nothing. Defined here so the spacing utilities are
   actually complete. */
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lede { font-size: var(--fs-lg); color: var(--text-soft); line-height: 1.6; }
/* NOTE: no `.section-dark .lede` rule here. "section-dark" is now a LIGHT sky
   band, so a pale-on-dark colour would be invisible. The base --text-soft above
   is correct for it, and is set explicitly in the .section-dark block further
   up. Do not re-add a light colour for this selector. */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin: 0 0 var(--sp-3);
}
/* Same caution as above: no pale amber eyebrow for .section-dark any more. */

.section-head { max-width: 46rem; margin-bottom: var(--sp-6); }
.section-head.center { margin-inline: auto; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: var(--plum);
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.site-header::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral) 42%, var(--amber) 42%, var(--amber) 100%);
}
.header-inner {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-display); font-weight: 800; color: #fff;
  font-size: 1.16rem; letter-spacing: .01em;
}
.brand-tag {
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber); font-weight: 700;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); }
.nav a {
  color: var(--text-on-dark); text-decoration: none; font-weight: 600;
  font-size: var(--fs-sm); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full);
  transition: background .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--coral); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: var(--fs-sm);
  padding: .58rem 1rem; border-radius: var(--r-full);
  transition: transform .16s var(--ease), background .16s var(--ease);
}
.cart-btn:hover { background: var(--coral-deep); transform: translateY(-1px); }
.cart-count {
  background: #fff; color: var(--coral-dark); border-radius: var(--r-full);
  min-width: 1.35rem; height: 1.35rem; display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 800; padding: 0 .3rem;
}
.cart-count[data-empty="true"] { display: none; }

.nav-toggle {
  display: none; background: rgba(255,255,255,.1); border: 0; cursor: pointer;
  width: 44px; height: 40px; border-radius: var(--r-md); color: #fff;
  align-items: center; justify-content: center;
}

@media (max-width: 1080px) {
  .nav {
    position: fixed; inset: calc(var(--header-h) + 3px) 0 auto 0;
    background: var(--plum-2); flex-direction: column; align-items: stretch;
    padding: var(--sp-4); gap: var(--sp-1); margin: 0;
    border-bottom: 3px solid var(--coral);
    box-shadow: var(--shadow-lg); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav:not([data-open="true"]) { display: none; }
  .nav a { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header-actions { margin-left: 0; }
  .brand-tag { display: none; }
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-body); font-size: var(--fs-base); font-weight: 700;
  padding: .82rem 1.5rem; border-radius: var(--r-full);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
  line-height: 1.2; text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { font-size: var(--fs-lg); padding: 1rem 2rem; }
.btn-sm { font-size: var(--fs-sm); padding: .5rem 1rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--coral); color: #fff; box-shadow: var(--shadow-coral); }
.btn-primary:hover { background: var(--coral-deep); color: #fff; box-shadow: 0 10px 26px rgba(252,74,46,.4); }

.btn-amber { background: var(--amber); color: var(--ink); box-shadow: 0 8px 22px rgba(244,173,21,.32); }
.btn-amber:hover { background: #ffbc2e; color: var(--ink); }

.btn-ink { background: var(--plum); color: #fff; }
.btn-ink:hover { background: var(--plum-2); color: #fff; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--plum); background: rgba(0, 20, 52,.04); color: var(--ink); }

.btn-ghost-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost-light:hover { background: rgba(255,255,255,.2); color: #fff; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none;
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.btn-row.center { justify-content: center; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm);
}
.card-pad-lg { padding: var(--sp-6); }
.card-hover { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card-coral { background: var(--coral-tint); border-color: #B6E3FA; }
.card-amber { background: var(--amber-soft); border-color: #F8BEE8; }
/* Dark card. EVERY heading level has to be whitelisted, not just h3/h4 — the
   home page's closing call to action uses an h2, so without this the most
   important message on the page rendered near-black on near-black and was
   completely invisible. */
.card-ink { background: var(--plum); border-color: var(--plum); color: var(--text-on-dark); }
.card-ink h1, .card-ink h2, .card-ink h3,
.card-ink h4, .card-ink h5 { color: #fff; }
.card-ink p { color: var(--text-on-dark-soft); }
.card-ink a:not(.btn) { color: var(--amber); }

/* -------------------------------------------------------------------- grid */
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid-tight { gap: var(--sp-4); }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  /* Bright hero built from the logo's own colours: a cyan-to-white wash with a
     soft magenta glow. The client rejected the old dark brown hero, so the text
     is dark-on-light now instead of white-on-near-black. */
  background:
    radial-gradient(900px 520px at 92% -10%, rgba(240, 48, 192, .15), transparent 62%),
    radial-gradient(760px 480px at 4% 104%, rgba(0, 168, 248, .20), transparent 62%),
    linear-gradient(160deg, #EAF8FF 0%, #FCFDFF 52%, #FDF1FA 100%);
  color: var(--text);
}
.hero-grid {
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { color: var(--ink); font-size: clamp(2.3rem, 5.6vw, var(--fs-5xl)); margin-bottom: var(--sp-4); }
.hero .lede { color: var(--text-soft); font-size: clamp(1.05rem, 1.7vw, 1.32rem); }
.hero .eyebrow { color: var(--cyan-dark); }
.hero-art { position: relative; }
.hero-art img {
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  border: 8px solid #fff; transform: rotate(-1.4deg);
}
.hero-badges { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-5); margin-top: var(--sp-5); }
.hero-badge { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); }
.hero-badge svg { flex-shrink: 0; color: var(--cyan); }

/* ------------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: .38rem;
  font-size: var(--fs-xs); font-weight: 700; padding: .28rem .72rem;
  border-radius: var(--r-full); background: var(--cream-2); color: var(--text-soft);
  border: 1px solid var(--line); white-space: nowrap;
}
.pill-coral { background: var(--coral-soft); color: var(--coral-dark); border-color: #B6E3FA; }
.pill-amber { background: var(--amber-soft); color: var(--magenta-dark); border-color: #F8BEE8; }
.pill-ok    { background: var(--ok-soft); color: var(--ok); border-color: #BFE0C8; }
.pill-ink   { background: var(--plum); color: #fff; border-color: var(--plum); }
.pill-sky   { background: var(--sky-soft); color: #1E5F94; border-color: #C4DEF1; }
.pill-magenta { background: var(--magenta-soft); color: var(--magenta-dark); border-color: #F6B8E4; }
.pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Stand-in for a book cover that does not exist yet (series titles awaiting
   ISBNs). Holds the 5:7 book shape so the grid stays aligned. */
.cover-placeholder {
  width: 100%; aspect-ratio: 5 / 7;
  display: grid; place-items: center; text-align: center; padding: var(--sp-5);
  background:
    repeating-linear-gradient(45deg, rgba(0,168,248,.05) 0 12px, rgba(240,48,192,.05) 12px 24px),
    var(--cream-2);
  color: var(--text-mute);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg);
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------------ notice */
.notice {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4); border-radius: var(--r-md);
  background: var(--cream-2); border: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.notice svg { flex-shrink: 0; margin-top: 2px; }
.notice-warn { background: var(--warn-soft); border-color: #EFD9A8; }
.notice-err  { background: var(--err-soft);  border-color: #F3C9C4; }
.notice-ok   { background: var(--ok-soft);   border-color: #C6E3CE; }
.notice-info { background: var(--sky-soft);  border-color: #C9E1F2; }
.notice strong { display: block; margin-bottom: .15rem; }

/* --------------------------------------------------------------- utilities */
.muted { color: var(--text-mute); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--text-mute); }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.items-center { align-items: center; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.wrap-flex { flex-wrap: wrap; }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--plum); color: var(--text-on-dark-soft); padding-block: var(--sp-8) var(--sp-5); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: var(--sp-6); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.site-footer h4 {
  color: #fff; font-size: var(--fs-sm); text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: var(--sp-4); font-family: var(--font-body);
}
.site-footer a { color: var(--text-on-dark-soft); text-decoration: none; }
.site-footer a:hover { color: var(--amber); text-decoration: underline; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: var(--sp-2); }
.footer-brand img { width: 104px; margin-bottom: var(--sp-4); }
.footer-bottom {
  margin-top: var(--sp-7); padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between;
  font-size: var(--fs-xs);
}
.footer-pay { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.footer-pay .pill { background: rgba(255,255,255,.08); color: var(--text-on-dark-soft); border-color: rgba(255,255,255,.16); }

/* ------------------------------------------------------------ placeholder */
.todo-flag {
  background: var(--warn-soft); color: var(--warn);
  border: 1px dashed var(--warn); border-radius: var(--r-sm);
  padding: .05rem .4rem; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; margin-left: .35rem;
  white-space: nowrap;
}



