/* Tartan Press site styles. Mobile first: base rules target phones,
   min-width queries enhance for tablet and desktop. */

:root {
  --blue: #2C4084;          /* Kennedy Blue, primary */
  --blue-dark: #22336b;
  --ink: #141414;
  --muted: #57524b;
  --ivory: #F8F4EF;         /* Warm Ivory, reading field */
  --paper: #FFFFFF;
  --gold: #E8C000;          /* Kennedy Gold, decorative accents only */
  --rule: #e3dbcf;
  --shade: #efe8de;

  --font-display: "EB Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --gutter: 20px;
  --measure: 66ch;
  --wide: 1120px;
}

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

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.6;
}

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

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: 2rem; }          /* 32px */
h2 { font-size: 1.625rem; }      /* 26px */
h3 { font-size: 1.25rem; }       /* 20px */
p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: #fff; padding: 12px 16px; z-index: 10;
  font-family: var(--font-ui);
}
.skip-link:focus { left: 8px; top: 8px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.wrap.prose { max-width: var(--wide); }
.wrap.prose > * { max-width: var(--measure); }

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-knot { width: 40px; height: 40px; }
.brand-lockup { display: none; height: 46px; width: auto; }
.brand-name {
  font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 1;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.site-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 8px;
  font-family: var(--font-ui); font-size: 0.9375rem; color: var(--ink); text-decoration: none;
}
.site-nav a:hover { color: var(--blue); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }

@media (max-width: 479px) {
  .brand-name { display: none; }
  .site-nav a { padding: 0 6px; }
}

/* Shared bits */
.eyebrow {
  font-family: var(--font-ui); font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
  margin: 0 0 0.75rem;
}
.eyebrow::after {
  content: ""; display: block; width: 36px; height: 3px; background: var(--gold); margin-top: 8px;
}
.meta { font-family: var(--font-ui); font-size: 0.9375rem; color: var(--muted); }
.author { font-style: italic; color: var(--muted); }
.lede { font-size: 1.125rem; }

.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 20px;
  font-family: var(--font-ui); font-size: 1rem; font-weight: 600;
  border: 2px solid var(--blue); border-radius: 3px; text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: transparent; color: var(--blue); }
.btn-secondary:hover { background: var(--paper); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.status {
  display: inline-block; font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 10px; border-radius: 2px;
  border: 1px solid currentColor;
}
.status-forthcoming { color: var(--blue); }
.status-development { color: var(--muted); }

/* Hero */
.hero-photo img { width: 100%; height: 46vh; min-height: 240px; max-height: 560px; object-fit: cover; object-position: center 20%; }
.hero-text { padding-top: 32px; padding-bottom: 8px; }
.hero-text h1 { font-size: 2.25rem; max-width: 18ch; }

/* Covers */
.cover { box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.12); background: var(--paper); }
.cover-note { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.cover-placeholder {
  aspect-ratio: 2 / 3; display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 16px; background: var(--paper); border: 1px solid var(--rule);
  border-top: 6px solid var(--blue); text-align: center;
}
.cover-placeholder img { width: 36px; height: 36px; margin: 0 auto; }
.cover-placeholder .ph-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; color: var(--ink); }
.cover-placeholder .ph-note { font-family: var(--font-ui); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Featured title */
.feature { display: grid; gap: 24px; }
.feature + .feature { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--rule); }
.feature-cover { max-width: 300px; }
.feature h3 { font-size: 2.25rem; margin-bottom: 0.15em; }
.feature .subtitle { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.25; margin: 0 0 0.4em; }
.hook { font-family: var(--font-display); font-style: italic; font-size: 1.375rem; line-height: 1.3; color: var(--blue); margin: 0 0 0.75em; }

/* Book cards */
.cards { display: grid; gap: 32px; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
.card a.card-link { text-decoration: none; color: inherit; display: block; }
.card a.card-link:hover .card-title { color: var(--blue); text-decoration: underline; }
.card .cover, .card .cover-placeholder { margin-bottom: 14px; }
.card-title { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; margin: 0 0 4px; }
.card p { margin: 6px 0 0; }
.card .short { font-size: 1rem; }
.cards-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; }
.cards-books .short { display: none; }

/* Logic Lab pairs */
.pairs { display: grid; gap: 20px; list-style: none; padding: 0; margin: 0; }
.pair { background: var(--paper); border: 1px solid var(--rule); padding: 20px; }
.pair h3 { margin-bottom: 4px; }
.pair ul { list-style: none; padding: 0; margin: 12px 0 0; }
.pair li { padding: 10px 0; border-top: 1px solid var(--rule); }
.pair li a { font-family: var(--font-display); font-size: 1.125rem; }

/* Imprint cards */
.imprint-card { background: var(--paper); border: 1px solid var(--rule); }
.imprint-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.imprint-card .body { padding: 20px; }
.imprint-card h3 { font-size: 1.5rem; margin-bottom: 2px; }
.imprint-card h3 a { color: var(--ink); text-decoration: none; }
.imprint-card h3 a:hover { color: var(--blue); text-decoration: underline; }
.tagline { font-family: var(--font-display); font-style: italic; font-size: 1.125rem; color: var(--blue); margin: 0 0 0.5em; }

/* Book page */
.crumbs { font-family: var(--font-ui); font-size: 0.9375rem; padding-top: 20px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.book { display: grid; gap: 28px; padding: 24px 0 48px; }
.book-cover { max-width: 320px; }
.book h1 { font-size: 2.25rem; margin-bottom: 0.15em; }
.book .subtitle { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.3; margin: 0 0 0.5em; }
.book .subtitle span { display: block; font-size: 1.125rem; color: var(--muted); margin-top: 4px; }
.book .author { font-size: 1.125rem; margin: 0 0 1em; }
.buy { background: var(--paper); border: 1px solid var(--rule); padding: 20px; margin: 28px 0; }
.buy h2 { font-size: 1.25rem; margin-bottom: 0.4em; }
.buy .unavailable { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px dashed var(--muted); color: var(--muted); font-family: var(--font-ui); font-weight: 600; border-radius: 3px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-family: var(--font-ui); font-size: 0.9375rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.reader { border-left: 3px solid var(--gold); padding-left: 16px; margin: 28px 0; }
.reader h2 { font-size: 1.25rem; margin-bottom: 0.3em; }
.companion { margin-top: 28px; }

/* Page intro */
.page-intro { padding-top: 40px; padding-bottom: 8px; }
.page-intro h1 { font-size: 2.25rem; }
.imprint-hero img { width: 100%; height: 36vh; min-height: 220px; max-height: 440px; object-fit: cover; }
.note { background: var(--paper); border: 1px solid var(--rule); padding: 20px; font-style: italic; }

.credits { font-family: var(--font-ui); font-size: 0.9375rem; }
.credits li { margin-bottom: 6px; }

/* Footer */
.site-footer { background: var(--blue); color: #fff; padding: 40px 0 28px; margin-top: 24px; font-family: var(--font-ui); font-size: 0.9375rem; }
.site-footer a { color: #fff; }
.site-footer .footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.site-footer .footer-brand img { width: 44px; height: 44px; background: #fff; border-radius: 50%; padding: 4px; }
.site-footer .footer-brand span { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer ul a { display: inline-flex; min-height: 44px; align-items: center; }
.site-footer .fine { color: #dfe4f2; margin: 0; }

/* Tablet */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  h1 { font-size: 2.25rem; }
  .brand-knot { display: none; }
  .brand-name { display: none; }
  .brand-lockup { display: block; }
  .site-nav a { padding: 0 12px; font-size: 1rem; }
  .feature { grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
  .book { grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }
  .cards-books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-books .short { display: block; }
  .cards-imprints { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop */
@media (min-width: 1000px) {
  .hero-text h1 { font-size: 2.875rem; }
  .page-intro h1, .book h1 { font-size: 2.625rem; }
  .feature { grid-template-columns: 300px 1fr; gap: 56px; }
  .feature h3 { font-size: 2.625rem; }
  .book { grid-template-columns: 340px 1fr; gap: 64px; padding-top: 36px; }
  .cards-books { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards-imprints { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section { padding: 64px 0; }
}

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