/* abedanner.com — shared styles.
   Black ink on white paper, like the books. The three edition colors are the
   cover fields: yellow (Standard), gray (Large), red (Extra Large). Body type
   is large because the readers are; nothing on the page is smaller than 18px. */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --rule: #d6d6d6;
  --sp: #f2c300;
  --lp: #bdbdbd;
  --xlp: #c8102e;
  --tbt: #1f5fa8;   /* Town by Town: placeholder until the cover color is supplied */
  --focus: #1a56db;
  --pad: 1.1rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.wrap { max-width: 38rem; margin: 0 auto; padding: 0 var(--pad) 3rem; }

/* header */
.site-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.1rem 0 0.6rem; border-bottom: 4px solid var(--ink);
}
.brand { font-weight: 900; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-nav a { font-weight: 700; color: var(--ink); margin-left: 1.1rem; white-space: nowrap; }
.site-nav a.pill { display: inline-block; padding: 0.3rem 0.85rem; background: var(--ink); color: var(--paper); border-radius: 999px; text-decoration: none; font-weight: 800; }
.site-nav a.pill:hover, .site-nav a.pill:focus-visible { text-decoration: underline; }

/* type */
h1 { font-size: 2.1rem; line-height: 1.05; letter-spacing: -0.025em; font-weight: 900; margin: 1.5rem 0 0.6rem; }
h2 { font-size: 1.45rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 900; margin: 2.2rem 0 0.5rem; }
h3 { font-size: 1.15rem; line-height: 1.2; font-weight: 900; margin: 0 0 0.3rem; }
p  { margin: 0.55rem 0; max-width: 34rem; }
.lede { font-size: 1.15rem; }
.small { font-size: 0.9rem; }
a { color: var(--ink); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }

/* buttons */
.btn {
  display: inline-block; box-sizing: border-box; min-height: 3.1rem; line-height: 3.1rem;
  padding: 0 1.3rem; border: 0; border-radius: 0.4rem; cursor: pointer;
  background: var(--ink); color: var(--paper); font: inherit; font-weight: 800; text-decoration: none;
}
.btn.quiet { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.btn + .btn { margin-left: 0.6rem; }

/* editions — the colored edge is the cover color, the only color on the page */
.edition { border-left: 0.65rem solid var(--c, var(--rule)); padding: 0.2rem 0 0.4rem 1rem; margin: 1.4rem 0; overflow: hidden; }
.edition.sp  { --c: var(--sp); }
.edition.lp  { --c: var(--lp); }
.edition.xlp { --c: var(--xlp); }
.edition.tbt { --c: var(--tbt); }
.edition h3 a { text-decoration: none; }
.edition h3 a:hover { text-decoration: underline; }
.edition .facts { margin: 0.2rem 0 0.6rem; }
.edition .yours { display: inline-block; margin: 0 0 0.5rem; padding: 0.15rem 0.6rem; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 0.9rem; border-radius: 0.3rem; }

/* home page edition rows */
.row-link { display: block; text-decoration: none; }
.row-link:hover h3, .row-link:focus-visible h3 { text-decoration: underline; }

/* puzzle fragments — sized by JS from the point sizes; before JS runs they
   use fallback sizes so the page never shows an empty box */
.frag { --cell: 30px; --glyph: 22px; --list: 20px; margin: 0.5rem 0 0.7rem; }
.frag .grid {
  display: grid; grid-template-columns: repeat(3, var(--cell)); grid-auto-rows: var(--cell);
  border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); width: max-content;
}
.frag .grid span {
  display: flex; align-items: center; justify-content: center;
  font-size: var(--glyph); font-weight: 400; line-height: 1;
  font-family: Helvetica, Arial, sans-serif; /* the interior's own face */
}
.frag .list { margin-top: calc(var(--cell) * 0.35); font-size: var(--list); line-height: 1.35; font-family: Helvetica, Arial, sans-serif; letter-spacing: 0.01em; }
.frag .list span { display: inline-block; margin-right: 1.2em; }

/* card calibration */
.cal { border: 4px solid var(--ink); border-radius: 0.5rem; padding: 0.9rem var(--pad); margin: 1.2rem 0 1.6rem; overflow: hidden; }
.cal .card {
  box-sizing: border-box; border: 3px dashed var(--ink); border-radius: 12px;
  width: 204px; height: 323px; margin: 0.6rem 0; /* never max-width: a shrunk outline is a false ruler */
}
.cal input[type=range] { width: 100%; max-width: 30rem; height: 3rem; margin: 0.3rem 0; accent-color: var(--ink); }
.cal .state { font-weight: 800; }
.matched .cal .state { text-decoration: underline; }

/* the scan notice */
.from { border: 4px solid var(--ink); padding: 0.7rem var(--pad); margin: 1.2rem 0; }
.from p { margin: 0.2rem 0; }

/* sample form */
.sample { border-top: 4px solid var(--ink); margin-top: 2.4rem; padding-top: 0.4rem; }
.sample label { display: block; font-weight: 800; margin: 0.8rem 0 0.3rem; }
.sample input[type=email] {
  box-sizing: border-box; width: 100%; max-width: 26rem; font: inherit; padding: 0.6rem 0.8rem;
  border: 3px solid var(--ink); border-radius: 0.4rem; margin-bottom: 0.7rem;
}
.sample .note { margin-top: 0.8rem; font-weight: 700; }

/* footer */
.site-foot { border-top: 2px solid var(--rule); margin-top: 3rem; padding-top: 0.9rem; font-size: 0.9rem; }
.site-foot p { margin: 0.3rem 0; }

@media (max-width: 420px) {
  html { font-size: 18px; }
  /* the card outline must fit a phone at true size (about 320-350px): let the
     calibration box run edge to edge so the right edge of the outline stays on screen */
  .cal { margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); border-left: 0; border-right: 0; border-radius: 0; padding-left: 0.3rem; padding-right: 0.3rem; }
  .site-head { flex-direction: column; gap: 0.2rem; align-items: flex-start; }
  .site-nav a { margin: 0 0.9rem 0 0; }
  .site-nav a.pill { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .site-head, .site-nav, .cal, .sample, .site-foot, .btn { display: none; }
}

/* covers beside books */
.book { display: flex; gap: 1rem; align-items: flex-start; }
.book > div { min-width: 0; flex: 1 1 auto; }
.book .cover, .book .thumb { flex: 0 0 auto; display: block; }
.book .cover img, .book img.thumb { display: block; width: 7rem; height: auto; border: 1px solid var(--rule); }
.book img.thumb { width: 4.5rem; }
.book .cover:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
@media (max-width: 420px) {
  .book .cover img { width: 5.5rem; }
  .book img.thumb { width: 3.6rem; }
}
