/* Thornfield Diner Mysteries — warm and cozy.
   Fonts are self-hosted on purpose (no requests to Google: DSGVO). */

@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-var.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-Italic-var.ttf") format("truetype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("fonts/WorkSans-var.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #f7ebd0;
  --cream-deep: #efdfba;
  --paper: #fdf6e6;
  --navy: #1c2b54;
  --counter: #a14121;
  --red: #d82e1d;
  --ink: #2b2420;
  --muted: #6b5d52;
  --line: #dcc9a0;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Work Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--counter); text-underline-offset: 3px; }
a:hover { color: var(--red); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.5rem; font-weight: 800; }

.kicker {
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--counter);
  margin: 0 0 .8rem;
}

/* Header */
.site-header { border-bottom: 3px solid var(--counter); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { font-family: "Playfair Display", serif; font-weight: 900; font-size: 1.25rem; color: var(--navy); text-decoration: none; }
.brand span { color: var(--red); }
.tagline { margin: 0; font-size: .85rem; color: var(--muted); }
.site-header nav a { margin-left: 20px; font-weight: 500; font-size: .95rem; text-decoration: none; color: var(--ink); }
.site-header nav a:hover { color: var(--red); }
.site-header nav a.legal-link { font-size: .85rem; color: var(--muted); }
.site-header nav a[aria-current="page"] { color: var(--counter); }

/* Hero */
.hero { padding: 56px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero p.lead { font-size: 1.2rem; max-width: 34em; }
.hero-cover img { border-radius: 4px; box-shadow: 0 14px 34px rgba(60, 30, 10, .35); transform: rotate(1.5deg); max-width: 340px; margin: 0 auto; }

.hero .status { display: inline-block; font-size: .8rem; font-weight: 600; background: var(--cream-deep); color: var(--counter); padding: 2px 10px; border-radius: 99px; margin-bottom: 16px; }
.hero p.lead { font-weight: 600; }
.hero .wrap.blurb { display: block; margin-top: 36px; }
.hero .blurb p { margin: 0 0 .9em; max-width: 40em; }
.hero .teaser-note { font-size: .9rem; color: var(--muted); font-style: italic; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  border: 2px solid var(--red);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}
.btn:hover { background: #b82416; border-color: #b82416; color: #fff; }
.btn.ghost { background: transparent; color: var(--counter); border-color: var(--counter); }
.btn.ghost:hover { background: var(--counter); color: #fff; }
.btn[aria-disabled="true"] { background: transparent; color: var(--muted); border-color: var(--line); cursor: default; pointer-events: none; }

/* Sections */
section { padding: 56px 0; }
.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Books */
.books { display: grid; gap: 28px; margin-top: 28px; }
.book {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.book .cover img { border-radius: 3px; box-shadow: 0 6px 18px rgba(60, 30, 10, .3); }
.book .num { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; color: var(--counter); margin: 0 0 4px; }
.book h3 { margin-bottom: .3em; }
.book .status { display: inline-block; font-size: .8rem; font-weight: 600; background: var(--cream-deep); color: var(--counter); padding: 2px 10px; border-radius: 99px; margin-bottom: 12px; }
.book p { margin: 0 0 .8em; }
.book .buy { margin-top: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.book .teaser-note { font-size: .85rem; color: var(--muted); }

/* The series: small tiles in reading order */
.series {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 28px 24px;
}
.series li { display: flex; flex-direction: column; gap: 4px; }
.series img { border-radius: 3px; box-shadow: 0 6px 18px rgba(60, 30, 10, .3); margin-bottom: 8px; }
.series .num { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; color: var(--counter); }
.series .title { font-family: "Playfair Display", Georgia, serif; font-weight: 800; color: var(--navy); line-height: 1.2; }
.series a.title { text-decoration: none; }
.series a.title:hover { color: var(--red); }
.series .tile-link { font-size: .85rem; font-weight: 600; }
.series a[aria-disabled="true"] { color: var(--muted); pointer-events: none; text-decoration: none; }
.series .cover-wrap { position: relative; display: block; }
.series .stamp {
  /* sits UNDER the cover, so it never hides the author line and the footer of the cover */
  position: static;
  display: block;
  width: fit-content;
  margin: 0 auto;
  transform: rotate(-3deg);
  white-space: nowrap;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(253, 246, 230, .92);
  border: 3px double var(--red);
  border-radius: 4px;
  padding: 4px 10px;
  box-shadow: 0 2px 6px rgba(60, 30, 10, .25);
}

/* Book pages: back / next links */
.book-nav { padding: 24px 0; }
.book-nav .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-weight: 600; }
.book-nav a { text-decoration: none; }

/* Placeholder cover for books without art yet */
.soon-cover {
  aspect-ratio: 1 / 1.6;
  background: var(--cream-deep);
  border: 2px dashed var(--line);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  font-family: "Playfair Display", serif;
  color: var(--navy);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.1;
}
.soon-cover small { font-family: "Work Sans", sans-serif; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .62rem; color: var(--counter); margin-bottom: 10px; }
.soon-cover em { font-weight: 600; font-size: .78rem; color: var(--muted); margin-top: 12px; font-style: italic; }

/* Newsletter */
.signup { text-align: center; }
.signup .wrap { max-width: 640px; }
.signup form { margin-top: 22px; text-align: left; }
.signup label.field { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.signup input[type="email"] {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.signup input[type="email"]:focus { outline: 3px solid rgba(216, 46, 29, .25); border-color: var(--red); }
.signup .consent { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 18px; font-size: .9rem; color: var(--muted); }
.signup .consent input { margin-top: 5px; }
.signup .btn { width: 100%; }
.signup .fine { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 12px; }
.signup-done { margin-top: 22px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 22px; font-size: 1.05rem; }
.signup-done p { margin: 0; }
#signup-failed { border-color: var(--red); }
[hidden] { display: none !important; }

/* About */
.about .wrap { max-width: 720px; }

/* Footer */
.site-footer { background: var(--navy); color: #e9e2d0; padding: 32px 0; font-size: .9rem; }
.site-footer a { color: #f3dcae; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Legal pages */
.legal { padding: 48px 0 64px; }
.legal .wrap { max-width: 760px; }
.legal h2 { font-size: 1.45rem; margin-top: 1.8em; }
.legal .draft { background: #fff3cd; border: 1px solid #e0c36a; border-radius: 6px; padding: 12px 16px; font-size: .92rem; }

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero-cover { order: -1; }
  .hero-cover img { max-width: 240px; }
  .book { grid-template-columns: 1fr; }
  .book .cover { max-width: 170px; }
  .series { grid-template-columns: repeat(2, 1fr); gap: 24px 18px; }
  .site-header nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .site-header nav a { margin-left: 0; }
}
