/* Inky Ibis Books storefront. Colours from the logo: ink navy, sky blue, and the four book colours. */
:root {
  --ink: #16224a;
  --ink-soft: #4a5578;
  --sky: #dff1fd;
  --sky-deep: #bfe3fa;
  --paper: #fffdf8;
  --cover-sky: #5ab7fd; /* the back-cover blue (John, 12 Oct 2026: the site looks like the book covers) */
  --cover-navy: #1c2d59;
  --card: #ffffff;
  --line: #e4e8f0;
  --red: #e2373f;
  --yellow: #f7b928;
  --green: #2e9b4f;
  --blue: #1f6fd1;
  --blue-dark: #1758a8;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(22, 34, 74, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.55 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--cover-sky);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 90'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='55' cy='55' r='30'/%3E%3Ccircle cx='95' cy='40' r='38'/%3E%3Ccircle cx='140' cy='55' r='28'/%3E%3Crect x='55' y='55' width='85' height='30'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 90'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='55' cy='55' r='30'/%3E%3Ccircle cx='95' cy='40' r='38'/%3E%3Ccircle cx='140' cy='55' r='28'/%3E%3Crect x='55' y='55' width='85' height='30'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 90'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='55' cy='55' r='30'/%3E%3Ccircle cx='95' cy='40' r='38'/%3E%3Ccircle cx='140' cy='55' r='28'/%3E%3Crect x='55' y='55' width='85' height='30'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 220px auto, 160px auto, 260px auto;
  background-position: 4% 140px, 96% 420px, 10% 85%;
  background-attachment: fixed;
}
/* Page content sits in a white box with a navy border, like the text box on the back cover. */
#view { background: var(--card); border: 3px solid var(--cover-navy); border-radius: 24px; margin-top: 24px; padding-top: 4px; padding-bottom: 24px; }
@media (min-width: 700px) { #view { padding-left: 28px; padding-right: 28px; } }
@media (max-width: 1152px) { #view { margin-left: 8px; margin-right: 8px; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: auto; height: 120px; }
.brand span { font-family: "Luckiest Guy", "Nunito", sans-serif; font-size: 1.5rem; letter-spacing: 0.5px; line-height: 1; padding-top: 4px; }
.brand em { font-style: normal; color: var(--blue); }
.country { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.country select { font: inherit; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }

/* Hero */
.hero {
  display: flex; align-items: center; gap: 24px; margin: 24px 0 8px; padding: 28px;
  background: var(--sky); border-radius: 24px;
}
.hero-text { flex: 1; }
.hero h1 {
  font-family: "Luckiest Guy", "Nunito", sans-serif; font-weight: 400; letter-spacing: 1px;
  font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; margin: 0 0 10px; color: var(--blue);
  text-shadow: 2px 2px 0 #fff;
}
.hero .lead { font-size: 1.25rem; font-weight: 800; margin: 0 0 8px; }
.hero p { margin: 0 0 8px; color: var(--ink-soft); }
.hero-logo { width: 220px; height: 220px; flex: none; border-radius: 28px; box-shadow: 0 6px 18px rgba(22, 34, 74, 0.12); }

.notice { background: #fff4d6; border: 1px solid #f3d88a; color: #6b4b00; border-radius: 12px; padding: 10px 14px; }

/* Search and filters */
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0; }
.tools input[type="search"] {
  flex: 1 1 260px; font: inherit; padding: 12px 16px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
}
.tools input[type="search"]:focus { border-color: var(--blue); outline: none; }
.chips { display: flex; gap: 8px; }
.chip {
  font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Book grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--card);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(22, 34, 74, 0.14); }
.card-cover { aspect-ratio: 8.5 / 11; background: var(--sky); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; }
.card h2 { font-size: 1.02rem; line-height: 1.3; margin: 0 0 6px; font-weight: 800; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.badge { background: #fff4d6; color: #7a5200; border-radius: 999px; padding: 1px 8px; font-size: 0.8rem; font-weight: 700; }
.empty, .loading { color: var(--ink-soft); padding: 24px 0; }

/* Book page */
.crumbs { margin: 18px 0; }
.crumbs a { text-decoration: none; font-weight: 700; }
.book-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; }
.book-cover img { width: 100%; border-radius: 10px; box-shadow: 0 10px 30px rgba(22, 34, 74, 0.2); }
.book-info h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 4px; font-weight: 800; }
.subtitle { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 8px; }
.facts { color: var(--ink-soft); margin: 0 0 12px; font-size: 0.95rem; }
.buy-box, .amazon-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 18px; box-shadow: var(--shadow); }
.buy-box h2, .amazon-box h2 { font-size: 1.15rem; margin: 0 0 6px; }
.small { font-size: 0.92rem; margin: 6px 0; }
.muted { color: var(--ink-soft); }
.licences { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.licences legend { font-weight: 800; margin-bottom: 6px; padding: 0; }
.licence {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio name price" "radio help price";
  column-gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
}
.licence:has(input:checked) { border-color: var(--blue); background: #f2f8ff; }
.licence input { grid-area: radio; width: 18px; height: 18px; accent-color: var(--blue); }
.licence-name { grid-area: name; font-weight: 800; }
.licence-help { grid-area: help; font-size: 0.85rem; color: var(--ink-soft); }
.licence-price { grid-area: price; font-weight: 800; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 800;
  padding: 12px 20px; border-radius: 999px; border: 2px solid var(--blue); background: var(--blue); color: #fff;
  text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: #fff; color: var(--blue); }
.button.secondary:hover { background: #f2f8ff; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button.buy { width: 100%; font-size: 1.05rem; }
.amazon-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.book-lower { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 32px; margin: 36px 0 48px; }
.description h2, .samples h2 { font-size: 1.3rem; margin: 0 0 10px; }
.description ul { padding-left: 1.2em; }
.sample-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sample { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
.lightbox { border: 0; border-radius: 16px; padding: 12px; max-width: min(92vw, 720px); text-align: center; }
.lightbox::backdrop { background: rgba(22, 34, 74, 0.7); }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto 10px; }

.missing { text-align: center; padding: 60px 0; }

/* Footer */
.site-footer { background: var(--ink); color: #dfe5f5; margin-top: 40px; }
.site-footer a { color: #fff; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; padding-bottom: 24px; font-size: 0.92rem; }
.footer-row p { margin: 4px 0; }
.footer-row img { width: 64px; height: 64px; border-radius: 50%; background: #fff; }

@media (max-width: 760px) {
  .hero { flex-direction: column-reverse; text-align: center; padding: 20px 16px; }
  .hero-logo { width: 150px; height: 150px; }
  .book-top, .book-lower { grid-template-columns: 1fr; }
  .book-cover { max-width: 340px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .country-label { display: none; }
  .brand span { font-size: 1.2rem; }
  .brand img { width: auto; height: 64px; }
}

/* Cart link */
.cart-link {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none;
  color: var(--ink); padding: 6px 12px; border-radius: 999px; border: 2px solid var(--line);
}
.cart-count:not(:empty) { background: var(--red); color: #fff; border-radius: 999px; min-width: 22px; padding: 0 6px; text-align: center; font-size: 0.85rem; }
.added { color: var(--green); font-weight: 700; }

/* Cart and checkout */
.cart { max-width: 760px; margin: 24px auto 48px; }
.cart h1 { font-size: 2rem; margin: 0 0 12px; }
.cart-lines { list-style: none; padding: 0; margin: 0; }
.cart-line {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart-line img { border-radius: 6px; box-shadow: var(--shadow); }
.cart-book { display: grid; gap: 4px; min-width: 0; }
.cart-book a { font-weight: 800; text-decoration: none; color: var(--ink); }
.cart-book select { font: inherit; font-size: 0.9rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.cart-price { display: grid; justify-items: end; gap: 4px; }
.link-button { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; }
.cart-total { text-align: right; font-size: 1.2rem; margin: 16px 0; }
.checkout { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.checkout label { display: block; font-weight: 800; margin-bottom: 6px; }
.checkout input { width: 100%; font: inherit; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; }
.checkout input:focus { border-color: var(--blue); outline: none; }
#paypal-buttons { margin-top: 16px; min-height: 50px; }
.checkout-message { color: var(--red); font-weight: 700; min-height: 1.5em; }
.thanks img { margin: 0 auto 12px; }

@media (max-width: 760px) {
  .cart-line { grid-template-columns: 56px 1fr; }
  .cart-line img { width: 56px; height: auto; }
  .cart-price { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: space-between; }
  .cart-link { padding: 4px 10px; }
}

/* Licence terms */
.terms { max-width: 720px; margin: 24px auto 48px; }
.terms h1 { font-size: 2rem; margin: 0 0 8px; }
.terms h2 { font-size: 1.2rem; margin: 24px 0 4px; }
.terms .lead { font-size: 1.1rem; color: var(--ink-soft); }

/* Collections and bundles */
.section-title { font-size: 1.3rem; margin: 8px 0 12px; }
.collage { display: grid; gap: 4px; padding: 6px; height: 100%; background: var(--sky); }
.collage img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(22, 34, 74, 0.15); }
.collage-small { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage-large { grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: auto; border-radius: 10px; }
.collage-large img { height: auto; aspect-ratio: 8.5 / 11; }
.cart-collage { width: 72px; aspect-ratio: 8.5 / 11; }
.cart-collage .collage { padding: 2px; gap: 2px; border-radius: 6px; }
.bundle-banner { background: #e8f7ee; border: 1px solid #b7e4c7; color: #14532d; border-radius: 12px; padding: 8px 14px; margin: 12px 0; }
.bundle-banner p { margin: 4px 0; }
.cart-saving { text-align: right; color: var(--green); font-weight: 700; margin: 8px 0 0; }
@media (max-width: 760px) { .cart-collage { width: 56px; } }

/* Front page: one tile per series (John, 12 Oct 2026) */
.welcome { text-align: center; padding: 20px 0 4px; }
.welcome h1 { font-family: "Luckiest Guy", "Nunito", sans-serif; font-weight: 400; letter-spacing: 1px; color: var(--blue); font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 0 0 6px; }
.welcome .lead { color: var(--ink-soft); margin: 0 0 18px; }
.series-list { display: grid; gap: 22px; }
.series-tile { display: block; text-decoration: none; color: var(--ink); border: 3px solid var(--cover-navy); border-radius: 22px; overflow: hidden; background: var(--sky); box-shadow: var(--shadow); transition: transform .15s; }
.series-tile:hover { transform: translateY(-3px); }
.series-text { padding: 16px 22px 22px; }
.series-text h2 { font-family: "Luckiest Guy", "Nunito", sans-serif; font-weight: 400; letter-spacing: 1px; color: var(--blue); font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 6px; text-shadow: 2px 2px 0 #fff; }
.series-text p { margin: 0 0 10px; }
.series-meta { font-weight: 800; color: var(--ink-soft); }
.series-banner { width: 100%; aspect-ratio: 1800 / 640; object-fit: cover; border-radius: 18px; margin: 8px 0 0; }
/* The tile's cover pile (stays inside the tile) */
.series-art { position: relative; aspect-ratio: 1800 / 640; overflow: hidden; background: var(--cover-sky); }
.series-art .seal { position: absolute; left: 4%; top: 50%; transform: translateY(-50%); width: 24%; z-index: 30; filter: drop-shadow(0 4px 8px rgba(10, 30, 70, .3)); }
.pile { position: absolute; left: 38%; top: 8%; bottom: 8%; width: 26%; }
.pile img { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: none; border: 5px solid #fff; border-radius: 6px; box-shadow: 0 6px 16px rgba(10, 30, 70, .3); transition: transform 1.2s ease, opacity 1.2s ease; transform-origin: 50% 80%; }
.pile img.peel { transform: translate(90%, -70%) rotate(28deg) scale(1.15) !important; opacity: 0 !important; z-index: 25 !important; }
@media (prefers-reduced-motion: reduce) { .pile img { transition: none; } }
/* Phones: Inky and the name on one line with the cart; the country picker on its own line below (John, 12 Oct 2026). */
@media (max-width: 600px) {
  .site-header { position: static; }
  .header-row { flex-wrap: wrap; gap: 6px 10px; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 6px; }
  .brand img { height: 56px; }
  .brand span { white-space: nowrap; font-size: 1.15rem; }
  .cart-link { flex: none; }
  .country { flex: 1 1 100%; }
  .country select { width: 100%; }
}
/* Phones: a taller tile so the cover pile is big; smaller words under it. */
@media (max-width: 600px) {
  .series-art { aspect-ratio: 1 / 1; }
  .series-art .seal { left: 3%; top: 4%; transform: none; width: 26%; }
  .pile { left: 24%; top: 10%; bottom: 6%; width: 56%; --fan: 9; }
  .series-text { padding: 12px 14px 16px; }
  .series-text h2 { font-size: 1.5rem; }
  .series-text p { font-size: 0.92rem; line-height: 1.45; margin-bottom: 8px; }
  .welcome h1 { font-size: 1.7rem; }
  .welcome .lead { font-size: 0.95rem; margin-bottom: 12px; }
}
