/* ==========================================================================
   The Printer's Devil — static rebuild
   Hand-written vanilla CSS. No framework, no external requests.
   Palette + typography reproduce the original printers-devil.com:
   white page, black serif body text, vivid red headings, classic blue links.
   ========================================================================== */

:root {
  --ink: #17140f;
  --ink-soft: #4a443c;
  --paper: #ffffff;
  --paper-tint: #faf7f1;
  --rule: #1d1a15;
  --rule-soft: #d8d1c4;
  --red: #c01a1a;         /* headline red from the original site */
  --red-dark: #8f1212;
  --link: #0b3fb5;        /* classic browser blue */
  --link-visited: #551a8b;
  --serif: Georgia, "Times New Roman", Times, "Liberation Serif", serif;
  --measure: 62rem;
}

/* --- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
}
img { max-width: 100%; height: auto; }
figure { margin: 0; }

/* --- accessibility ------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--red);
  color: #fff;
  padding: .6rem 1rem;
  z-index: 50;
  text-decoration: none;
}
.skip-link:focus { left: 0; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* --- links --------------------------------------------------------------- */
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--red); }

/* --- shell --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

.masthead { padding: 1.5rem 0 .5rem; }
.masthead__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.logo { display: inline-block; line-height: 0; }
.logo img { width: 272px; height: 96px; }
.masthead__tag {
  margin: 0 0 .35rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* --- navigation ---------------------------------------------------------- */
.nav { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: .75rem; }
.nav__toggle {
  display: none;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .7rem 0;
  background: none;
  border: 0;
  font: 600 .95rem/1 var(--serif);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
/* hamburger glyph drawn in CSS so the control reads as a button */
.nav__toggle::before {
  content: "";
  flex: 0 0 auto;
  width: 1.35rem;
  height: .85rem;
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  background: linear-gradient(var(--red), var(--red)) center / 100% 2px no-repeat;
}
.nav__toggle[aria-expanded="true"]::before {
  border-color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
}
.nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
  margin: 0;
  padding: .55rem 0;
  list-style: none;
}
.nav__list a {
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nav__list a:hover,
.nav__list a[aria-current="page"] { color: var(--red); text-decoration: underline; }

/* --- headings + text ----------------------------------------------------- */
main { padding: 1.75rem 0 2.5rem; }
h1 {
  color: var(--red);
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 .6rem;
}
h2 { font-size: 1.4rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.12rem; margin: 1.5rem 0 .4rem; }
.lede { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.75rem 0;
}
.rule-soft { border-top-color: var(--rule-soft); }
blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--rule-soft);
  font-style: italic;
  color: var(--ink-soft);
}
.small { font-size: .92rem; color: var(--ink-soft); }
.center { text-align: center; }

/* --- catalog listings ---------------------------------------------------- */
.catalog { list-style: none; margin: 0; padding: 0; }
.catalog > li {
  display: flex;
  gap: 1.15rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.catalog > li:first-child { border-top: 1px solid var(--rule-soft); }
.catalog__thumb { flex: 0 0 auto; }
.catalog__thumb img {
  width: 84px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-tint);
}
.catalog__body { flex: 1 1 auto; }
.catalog__body h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.catalog__body p { margin: 0 0 .5rem; }
.price {
  display: inline-block;
  font-weight: 700;
  color: var(--red-dark);
  white-space: nowrap;
}

/* --- book / article layout ---------------------------------------------- */
.book { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: flex-start; }
.book__text { flex: 1 1 22rem; min-width: 0; }
.book__aside { flex: 0 0 15rem; max-width: 100%; }
.book__aside img { border: 1px solid var(--rule-soft); }
.book__aside figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .4rem; }

/* --- order box ----------------------------------------------------------- */
.order {
  border: 1px solid var(--rule);
  background: var(--paper-tint);
  padding: 1.25rem 1.35rem;
  margin: 1.75rem 0;
}
.order h2, .order h3 { margin-top: 0; }
.order__price { font-size: 1.35rem; font-weight: 700; color: var(--red-dark); margin: 0 0 .6rem; }
.btn {
  display: inline-block;
  padding: .7rem 1.35rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font: 600 1rem/1 var(--serif);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, .btn:focus { background: var(--red); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-width: 2px; }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn + .btn { margin-left: .5rem; }

/* --- table of contents --------------------------------------------------- */
.toc { list-style: none; margin: 0 0 1.5rem; padding: 0; column-gap: 2rem; }
.toc li { padding: .3rem 0; border-bottom: 1px dotted var(--rule-soft); }

/* --- gallery ------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2rem; margin: 1.5rem 0; align-items: start; }
.gallery figure { border: 1px solid var(--rule-soft); padding: .6rem; background: var(--paper-tint); }
.gallery img { display: block; margin: 0 auto; max-height: 34rem; width: auto; }
.gallery figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: .5rem; }

/* --- forms --------------------------------------------------------------- */
.form { max-width: 40rem; margin: 1.5rem 0; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; }
.field input, .field textarea {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  font: 1rem/1.5 var(--serif);
  color: var(--ink);
}
.field--short input { max-width: 18rem; }
.field textarea { min-height: 10rem; resize: vertical; }
.field__error { display: none; color: var(--red-dark); font-size: .9rem; margin-top: .3rem; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--red); }
.field.is-invalid .field__error { display: block; }
.form__note { font-size: .9rem; color: var(--ink-soft); }
.form__status { margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--rule-soft); display: none; }
.form__status.is-visible { display: block; }
.form__status.is-ok { border-color: #1d6f3a; color: #14572c; background: #f2fbf5; }
.form__status.is-error { border-color: var(--red); color: var(--red-dark); background: #fdf3f3; }

/* --- footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; }
.footer__def { font-style: italic; margin-bottom: 1rem; }
.footer__links { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 .9rem; padding: 0; font-size: .92rem; }
.footer__links a { display: inline-block; padding: .25rem 0; }
.footer__meta { font-size: .85rem; color: var(--ink-soft); margin: 0; }

/* --- print --------------------------------------------------------------- */
@media print {
  .nav, .skip-link, .btn { display: none !important; }
  body { font-size: 11pt; }
  a { color: #000; text-decoration: none; }
}
