/*
 * BeginnerManuals.com — site styles
 * Built for beginners and seniors: large type, big tap targets, high contrast,
 * one clear action per screen. No web fonts, no frameworks.
 */

/* ---------- Design tokens ---------- */
:root {
  --brand: #24496a;          /* navy from the logo; 9.6:1 on white */
  --brand-dark: #173049;
  --brand-tint: #eef3f8;
  --ink: #1b1f24;            /* body text; 16:1 on white */
  --muted: #45505c;          /* secondary text; 8.3:1 on white */
  --line: #cfd8e1;
  --bg: #ffffff;
  --action: #ffc629;         /* Buy buttons: cover yellow with dark text, 12:1 */
  --action-hover: #f0b400;
  --action-ink: #1b1f24;
  --good: #1d6b3a;           /* "You save" text; 6.6:1 on white, never the only signal */
  --focus: #0b57d0;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-logo: Rockwell, "Rockwell Nova", "Roboto Slab", "Courier New", Georgia, serif;

  --text: 1.1875rem;         /* 19px body */
  --text-small: 1.125rem;    /* 18px — the smallest size used anywhere */
  --h1: clamp(2rem, 1.55rem + 2vw, 2.5rem);
  --h2: clamp(1.625rem, 1.4rem + 1vw, 2rem);
  --h3: 1.3125rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --radius: 10px;
  --measure: 68ch;           /* comfortable line length */
  --tap: 3rem;               /* 48px minimum tap target */
  --button: 3.5rem;          /* 56px buy buttons */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }
picture { display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-2); color: var(--brand-dark); }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); margin-top: var(--space-3); }
p, ul, ol, dl { margin: 0 0 var(--space-2); }

a { color: var(--brand); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.prose { max-width: calc(var(--measure) + 2rem); margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .prose { margin-left: max(1rem, calc((100% - 72rem) / 2)); } }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.5rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-buy {
  width: 100%;
  min-height: var(--button);
  background: var(--action);
  border-color: #d19c00;
  color: var(--action-ink);
  font-size: 1.3125rem;
  box-shadow: 0 2px 0 #b98a00;
}
.button-buy:hover { background: var(--action-hover); color: var(--action-ink); }
.button-buy:active { transform: translateY(1px); box-shadow: none; }
.button-buy:focus-visible { outline-color: var(--brand-dark); }

@media (min-width: 600px) { .button-buy { width: auto; min-width: 20rem; } }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-2);
  min-height: 4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-family: var(--font-logo);
  font-size: clamp(1.125rem, 0.8rem + 1.5vw, 1.375rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand);
  text-decoration: none;
}
.logo-tld { color: var(--muted); font-weight: 400; }

.menu-button {
  min-height: var(--tap);
  min-width: 5.25rem;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.menu-button[aria-expanded="true"] { background: var(--brand); color: #fff; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; }

/* With JavaScript, phones get a "Menu" button; without it the links simply show. */
@media (max-width: 899px) {
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; padding-bottom: var(--space-2); }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav li { border-top: 1px solid var(--line); }
  .js .site-nav a { width: 100%; font-size: 1.25rem; }
}
@media (min-width: 900px) {
  .menu-button { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-2) 0 var(--space-4); background: linear-gradient(var(--brand-tint), #fff 70%); }

.hero-grid {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  grid-template-areas:
    "cover title"
    "details details";
  gap: var(--space-2);
  align-items: center;
}
.hero-cover { grid-area: cover; }
.hero-title { grid-area: title; }
.hero-details { grid-area: details; }

.hero-title h1 { margin-bottom: 0.25rem; }
/* Subtitle after the colon: smaller, on its own line. The colon is visually hidden but stays for screen readers and search. */
.title-sub { display: block; margin-top: 0.25rem; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.hero-edition { margin: 0; color: var(--muted); font-size: var(--text-small); }

.cover {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(23, 48, 73, 0.25);
}

.hero-promise { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--space-1); }
.hero-coverage { color: var(--muted); }

@media (min-width: 900px) {
  .hero { padding: var(--space-5) 0; }
  .hero-grid {
    grid-template-columns: 23.75rem 1fr;
    grid-template-areas:
      "cover title"
      "cover details";
    align-items: start;
    column-gap: var(--space-5);
    row-gap: var(--space-2);
  }
  .hero-title { align-self: end; }
  .hero-promise { font-size: 1.375rem; }
}

/* ---------- Price & trust ---------- */
.price { margin: var(--space-2) 0; }
.price p { margin: 0; }
.price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.75rem; }
.price-was { color: var(--muted); font-size: 1.25rem; }
.price-now { font-size: 2.25rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.price-save { color: var(--good); font-weight: 700; }
.price-note { color: var(--muted); font-size: var(--text-small); }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-small);
}
.trust li { display: flex; align-items: center; gap: 0.4rem; min-height: var(--tap); }
.trust .icon { width: 1.35rem; height: 1.35rem; flex: none; fill: var(--good); }
.trust a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--ink); }

/* Links inside sentences: invisible padding above and below makes the tap
   area 48px tall without changing the line spacing or the look. */
.prose p a:not(.button):not(.tap-link),
.prose li a:not(.button):not(.tap-link) { padding: 0.75rem 0; }

/* Stand-alone text links (email, publisher) get a full-size tap area too. */
.tap-link { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- Sections ---------- */
.section { padding: var(--space-4) 0; }
.section-tint { background: var(--brand-tint); }
.section-lead { color: var(--muted); }
@media (min-width: 900px) { .section { padding: var(--space-5) 0; } }

.fit-answer { font-size: 1.25rem; font-weight: 600; }

details.models {
  margin: 0 0 var(--space-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
details.models summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.5rem 1rem;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}
details.models ul { margin: 0; padding: 0 1rem 1rem 2.25rem; }

/* Look inside */
.look-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) { .look-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .look-grid { grid-template-columns: repeat(3, 1fr); } }

.look-item {
  display: block;
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.look-item:hover { border-color: var(--brand); }
.look-item img { display: block; width: 100%; }
.look-caption {
  display: block;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--text-small);
  line-height: 1.35;
  text-decoration: none;
}

/* Single book pages: two across on phones, four across on desktop. */
.look-pages { grid-template-columns: repeat(2, 1fr); gap: var(--space-2) 0.75rem; }
@media (min-width: 900px) { .look-pages { grid-template-columns: repeat(4, 1fr); gap: var(--space-3); } }

/* Checklist */
.checklist { padding: 0; list-style: none; }
.checklist li {
  position: relative;
  padding: 0.35rem 0 0.35rem 2.25rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.7rem;
  width: 1.25rem;
  height: 0.7rem;
  border-left: 4px solid var(--good);
  border-bottom: 4px solid var(--good);
  transform: rotate(-45deg);
}
@media (min-width: 900px) {
  .checklist { columns: 2; column-gap: var(--space-4); }
  .checklist li { break-inside: avoid; }
}

/* Claims */
.claims {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  color: var(--brand-dark);
  text-align: center;
}

/* Facts */
.facts { display: grid; gap: 0; margin-top: var(--space-3); border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-2); padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }

/* Reviews */
.reviews {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) { .reviews { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .reviews { grid-template-columns: repeat(3, 1fr); } }
.review {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.review .stars { margin: 0 0 0.25rem; color: #8a5a00; font-size: 1.375rem; letter-spacing: 0.1em; line-height: 1; }
.review blockquote { flex: 1; margin: 0; font-size: 1.25rem; }
.review blockquote p { margin: 0 0 var(--space-1); }
.review-name { margin: 0; color: var(--muted); font-weight: 700; }
.claims-after-reviews { margin-top: var(--space-4); }

/* Bottom buy box */
.section-buy { background: var(--brand-dark); color: #fff; }
.section-buy h2 { color: #fff; }
.buy-box { text-align: center; }
.buy-box .price-line { justify-content: center; }
.buy-box .price-was, .buy-box .price-note { color: #d6e1ec; }
.buy-box .price-now { color: #fff; }
.buy-box .price-save { color: #9be3b4; }
.buy-box .trust { justify-content: center; }
.buy-box .trust .icon { fill: #9be3b4; }
.buy-box .trust a { color: #fff; }
.section-buy :focus-visible { outline-color: var(--action); }

/* ---------- Sticky mobile buy bar ---------- */
.buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.6rem 0 calc(0.6rem + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 2px solid var(--line);
  box-shadow: 0 -4px 16px rgba(23, 48, 73, 0.15);
}
.buy-bar-row { display: flex; align-items: center; gap: var(--space-2); }
.buy-bar-price { margin: 0; font-size: 1.5rem; font-weight: 800; white-space: nowrap; }
.buy-bar .button-buy { flex: 1; width: auto; min-width: 0; }
body.has-buy-bar { padding-bottom: 5rem; }
@media (min-width: 900px) { .buy-bar { display: none !important; } }

/* ---------- Lightbox ---------- */
/* Pages open at their full width so the text is readable; tall pages scroll
   inside the box, and the Close button stays pinned at the top. */
.lightbox {
  width: min(96vw, 52rem);
  max-height: 94vh;
  padding: 0 var(--space-2) var(--space-2);
  overflow: auto;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
}
.lightbox::backdrop { background: rgba(10, 20, 30, 0.8); }
.lightbox img { display: block; width: 100%; height: auto; }
.lightbox form {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 0 calc(-1 * var(--space-2)) var(--space-1);
  padding: var(--space-1) 0;
  background: #fff;
}
.button-close { min-width: 10rem; background: var(--brand); color: #fff; }
.button-close:hover { background: var(--brand-dark); }

/* ---------- Home ---------- */
.home-hero { padding: var(--space-3) 0 var(--space-4); background: linear-gradient(var(--brand-tint), #fff 80%); }
.home-hero h1 { max-width: 22ch; }
.home-lead { max-width: var(--measure); font-size: 1.25rem; }
@media (min-width: 900px) { .home-hero { padding: var(--space-5) 0; } .home-lead { font-size: 1.375rem; } }

.group-jump ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
}
.group-jump a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.4rem 1rem;
  border: 2px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}
.group-jump a:hover { background: var(--brand); color: #fff; }

.book-group { margin-top: var(--space-4); scroll-margin-top: var(--space-2); }
.book-group h3 { margin-top: 0; padding-bottom: var(--space-1); border-bottom: 2px solid var(--line); }

.book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .book-grid { grid-template-columns: repeat(3, 1fr); } }

.book-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.book-card:hover { border-color: var(--brand); color: var(--ink); }
.book-card:hover .book-card-cta { text-decoration: underline; }
.card-cover { width: 100%; border-radius: 3px; box-shadow: 0 4px 12px rgba(23, 48, 73, 0.2); }
.book-card-body { display: flex; flex-direction: column; gap: 0.35rem; }
.book-card-title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; color: var(--brand-dark); }
.book-card-line { color: var(--muted); font-size: var(--text-small); line-height: 1.4; }
.card-price { margin: 0; }
.card-price .price-was { font-size: var(--text-small); }
.card-price-now { font-size: 1.375rem; font-weight: 800; }
.book-card-cta { margin-top: auto; font-weight: 700; color: var(--brand); }
@media (min-width: 900px) { .book-card { grid-template-columns: 8.5rem 1fr; } }

.claims-left { justify-content: flex-start; text-align: left; margin: var(--space-3) 0; }

/* "Have a different device? See the other book" */
.alternative { padding: var(--space-2); border-left: 4px solid var(--brand); background: var(--brand-tint); border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Content pages (Help, Contact, Terms, Privacy, Thank-you) ---------- */
.page-hero { padding: var(--space-3) 0 var(--space-4); background: linear-gradient(var(--brand-tint), #fff 80%); }
@media (min-width: 900px) { .page-hero { padding: var(--space-5) 0 var(--space-4); } }
.page-lead { font-size: 1.25rem; }
.page-hero h2 { margin-top: var(--space-3); }
.prose h2:not(:first-child) { margin-top: var(--space-4); }
.prose ul:not([class]), .prose ol:not([class]) { padding-left: 1.5rem; }
.prose ul:not([class]) li, .prose ol:not([class]) li { margin-bottom: 0.4rem; }

.button-primary {
  min-height: var(--button);
  min-width: 14rem;
  background: var(--brand);
  color: #fff;
  font-size: 1.25rem;
}
.button-primary:hover { background: var(--brand-dark); color: #fff; }

.book-finder { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.book-finder li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.book-finder a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.book-finder span { display: block; color: var(--muted); }

.steps { padding-left: 1.75rem; }
.steps li { margin-bottom: 0.5rem; padding-left: 0.25rem; }
.steps li::marker { font-weight: 800; color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-4) 0;
  background: var(--brand-dark);
  color: #fff;
}
.site-footer a { color: #fff; }
.site-footer :focus-visible { outline-color: var(--action); }
.footer-brand { font-family: var(--font-logo); font-size: 1.375rem; font-weight: 700; margin-bottom: 0.25rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
}
.footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
.copyright { color: #d6e1ec; margin: 0; }
.copyright a { color: #d6e1ec; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
