/* J. Boylston & Company / J. T. Colby & Company  —  modernized site styles */

:root {
  --bg:           #ffffff;
  --bg-soft:      #fafaf7;
  --ink:          #111111;
  --ink-soft:     #4a4a4a;
  --rule:         #e3e1da;
  --header-bg:    #000000;
  --header-fg:    #ffffff;
  --footer-bg:    #595959;
  --footer-fg:    #ffd400;     /* yellow on grey, matching the original */
  --accent:       #1a4f7a;
  --accent-soft:  #f1efe9;
  --shadow:       0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans:  "Helvetica Neue", Calibri, Arial, sans-serif;
  --maxw:       1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

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

/* ===== Site header ===== */
.site-header {
  background: var(--header-bg);
  color: var(--header-fg);
  padding: 28px 24px;
}
.site-header .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}
.site-header .brand img {
  width: 120px;
  height: auto;
  filter: invert(1);   /* parent logo is dark on light; show as white on black */
}
.site-header .brand-text {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .02em;
}
.site-header .brand-text strong { display:block; font-size:20px; }
.site-header .right-banner {
  justify-self: end;
  max-height: 80px;
}
.site-header .right-banner img { max-height: 80px; width: auto; }

.site-nav {
  background: #1a1a1a;
  color: #f3f3f3;
  border-top: 1px solid #2a2a2a;
}
.site-nav .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
}
.site-nav a { color: #f3f3f3; text-decoration: none; opacity: .85; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }
.site-nav .crumb-sep { opacity: .4; }

/* ===== Page wrap ===== */
main { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 64px; }

h1, h2, h3 { font-family: var(--font-serif); margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 36px; letter-spacing: -.01em; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

.page-intro { color: var(--ink-soft); margin-bottom: 32px; max-width: 70ch; }

/* ===== Imprint grid (parent home) ===== */
.imprint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.imprint-tile {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.imprint-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #cbc7bc;
}
.imprint-tile img {
  max-width: 160px;
  max-height: 110px;
  object-fit: contain;
  margin-bottom: 12px;
}
.imprint-tile .imprint-name { font-family: var(--font-serif); font-size: 15px; }
.imprint-tile .count {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ===== Category nav (imprint home) ===== */
.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 40px;
}
.cat-strip a {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
}
.cat-strip a:hover { background: var(--accent); color: white; }
.cat-strip a .n { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ===== Book grid ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
}
.book-card {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.book-card .cover-wrap {
  background: var(--accent-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  margin-bottom: 14px;
}
.book-card .cover-wrap img { width: 100%; height: 100%; object-fit: contain; }
.book-card .cover-wrap.placeholder {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  text-align: center;
  padding: 20px;
}
.book-card .title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.25;
}
.book-card .subtitle {
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
  margin: 0 0 6px;
  line-height: 1.3;
}
.book-card .author { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; }
.book-card a.card-link { text-decoration: none; color: inherit; }
.book-card a.card-link:hover .title { color: var(--accent); }
.book-card a.card-link .cover-wrap { transition: transform .15s ease; }
.book-card a.card-link:hover .cover-wrap { transform: scale(1.02); }
.book-card .meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }

.buy-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.buy-btn {
  display: inline-block;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--rule);
  color: var(--ink);
  background: white;
  letter-spacing: .02em;
}
.buy-btn:hover { border-color: var(--ink); }
.buy-btn.amazon { background: #ff9900; border-color: #ff9900; color: #111; }
.buy-btn.amazon:hover { background: #ffb340; border-color: #ffb340; }
.buy-btn.kindle { background: #232f3e; color: white; border-color:#232f3e; }
.buy-btn.bn     { background: #00643c; color: white; border-color:#00643c; }
.buy-btn.nook   { background: #1f7a3a; color: white; border-color:#1f7a3a; }
.buy-btn.audible { background: #F8991C; border-color: #F8991C; color: #111; }
.buy-btn.audible:hover { background: #ffb340; border-color: #ffb340; }
.buy-btn.lsi { background: #FEBE10; border-color: #FEBE10; color: #111; }
.buy-btn.lsi:hover { background: #ffd34a; border-color: #ffd34a; }



/* ===== Contact page ===== */
.contact-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.contact-hero img { max-height: 120px; width: auto; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.contact-block {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
}
.contact-block h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--accent);
}
.contact-block p { margin: 0 0 8px; line-height: 1.45; }
.contact-block .role { color: var(--ink-soft); font-size: 14px; }
.contact-block a { color: var(--accent); text-decoration: none; word-break: break-word; }
.contact-block a:hover { text-decoration: underline; }

.submissions {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 32px 36px;
  margin-bottom: 40px;
}
.submissions h2 {
  margin: 0 0 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 22px;
}
.submissions .lede {
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.submissions h3 {
  margin: 24px 0 8px;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--accent);
}
.submissions p { margin: 0 0 12px; max-width: 70ch; }
.submissions .example {
  background: white;
  border: 1px solid var(--rule);
  padding: 12px 16px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  margin: 12px 0;
}

.about-blurb {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 20px 28px;
  margin-bottom: 40px;
  max-width: 75ch;
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; }
  .submissions { padding: 24px 18px; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  text-align: center;
  padding: 24px;
  margin-top: 64px;
  font-size: 14px;
  line-height: 1.6;
}
.site-footer a { color: var(--footer-fg); text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .site-header .wrap { grid-template-columns: 1fr; text-align: center; }
  .site-header .brand { justify-content: center; }
  .site-header .right-banner { justify-self: center; }
  h1 { font-size: 28px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
  .imprint-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .imprint-tile { min-height: 160px; padding: 18px 12px; }
}
