/* ==========================================================================
   The Geek's Genre Guide — theme stylesheet
   A microsite of SFcrowsnest.info. Flat HTML/CSS/JS only.
   --------------------------------------------------------------------------
   BRAND TINT: the entire palette hangs off --ggg-paper below.
   To match the logo background exactly, change that ONE value.
   ========================================================================== */

:root {
  /* ---- Brand (sampled from The Geek's Genre Guide logo) ---- */
  --ggg-paper:       #F2EEE6;   /* logo's outer ivory background tint */
  --ggg-paper-deep:  #EAE0C9;   /* the badge-banner cream — section bands */
  --ggg-card:        #F9F5EC;   /* card surfaces */
  --ggg-ink:         #1E1B14;   /* logo near-black */
  --ggg-ink-soft:    #5C5444;   /* secondary text */
  --ggg-line:        #DACFB6;   /* hairlines & borders */

  --ggg-accent:      #A8512B;   /* logo rust/burnt sienna — links, buttons */
  --ggg-accent-dark: #7C3A1E;   /* hover / active */
  --ggg-gold:        #C0913E;   /* logo gold — stars, ribbons, flourishes */

  /* Genre colours (used on chips, card spines, hub tiles) */
  --ggg-sf:          #1F5F5B;   /* science fiction — deep teal */
  --ggg-fantasy:     #5C448C;   /* fantasy — violet */
  --ggg-horror:      #6E2231;   /* horror — oxblood */

  /* ---- Type ---- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:    Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-ui:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Rhythm ---- */
  --max-width: 1100px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34,28,18,.08), 0 6px 18px -8px rgba(34,28,18,.25);
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ggg-ink);
  background: var(--ggg-paper);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--ggg-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ggg-accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

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

/* Skip link for accessibility */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ggg-ink); color: var(--ggg-paper);
  padding: .5rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  background: var(--ggg-paper);
  border-bottom: 3px double var(--ggg-line);
  position: relative;
}
.mothership-bar {
  background: var(--ggg-ink);
  color: var(--ggg-paper);
  font-family: var(--font-ui);
  font-size: .78rem;
  letter-spacing: .04em;
}
.mothership-bar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: .35rem; padding-bottom: .35rem; gap: 1rem;
}
.mothership-bar a { color: var(--ggg-gold); text-decoration: none; font-weight: 600; }
.mothership-bar a:hover { text-decoration: underline; }

.masthead {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 0 .75rem;
}
.masthead .logo img, .masthead .logo svg { display: block; height: 64px; width: auto; }
.masthead .site-title { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.masthead .site-title a { color: var(--ggg-ink); text-decoration: none; }
.masthead .strapline {
  margin: .1rem 0 0; color: var(--ggg-ink-soft);
  font-style: italic; font-size: .95rem;
}

.site-nav { font-family: var(--font-ui); }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--ggg-line); border-radius: 6px;
  padding: .4rem .7rem; font: inherit; cursor: pointer; color: var(--ggg-ink);
}
.site-nav ul {
  list-style: none; display: flex; flex-wrap: wrap; gap: .25rem;
  margin: 0; padding: 0 0 .8rem;
}
.site-nav a {
  display: block; padding: .45rem .85rem;
  text-decoration: none; color: var(--ggg-ink);
  font-weight: 600; font-size: .92rem; letter-spacing: .02em;
  border-radius: 999px; border: 1px solid transparent;
}
.site-nav a:hover { border-color: var(--ggg-line); background: var(--ggg-card); }
.site-nav a[aria-current="page"] { background: var(--ggg-ink); color: var(--ggg-paper); }
.site-nav .soon { opacity: .55; }
.site-nav .soon::after { content: " ·soon"; font-size: .7em; color: var(--ggg-accent); font-weight: 700; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -50%, rgba(201,155,63,.18), transparent 70%),
    var(--ggg-paper-deep);
  border-bottom: 1px solid var(--ggg-line);
  padding: 3rem 0 2.5rem;
}
.hero .kicker {
  font-family: var(--font-ui); font-size: .8rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ggg-accent);
  margin: 0 0 .6rem;
}
.hero h1 { max-width: 18ch; }
.hero .lede { font-size: 1.15rem; max-width: 58ch; color: var(--ggg-ink-soft); }

.hero-search { margin-top: 1.5rem; max-width: 560px; display: flex; gap: .5rem; }
.hero-search input {
  flex: 1; font: inherit; padding: .7rem 1rem;
  border: 1px solid var(--ggg-line); border-radius: var(--radius);
  background: var(--ggg-card); color: var(--ggg-ink);
}
.hero-search input:focus { outline: 2px solid var(--ggg-accent); outline-offset: 1px; }
.btn {
  display: inline-block; font-family: var(--font-ui); font-weight: 700; font-size: .95rem;
  background: var(--ggg-accent); color: #fff; border: none; cursor: pointer;
  padding: .7rem 1.3rem; border-radius: var(--radius); text-decoration: none;
}
.btn:hover { background: var(--ggg-accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ggg-accent); border: 1.5px solid var(--ggg-accent); }
.btn--ghost:hover { background: var(--ggg-accent); color: #fff; }

.hero-stats {
  display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.75rem;
  font-family: var(--font-ui);
}
.hero-stats b { display: block; font-size: 1.6rem; font-family: var(--font-display); }
.hero-stats span { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ggg-ink-soft); }

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section { padding: 2.75rem 0; }
.section--tint { background: var(--ggg-paper-deep); border-top: 1px solid var(--ggg-line); border-bottom: 1px solid var(--ggg-line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head .more { font-family: var(--font-ui); font-size: .9rem; font-weight: 600; white-space: nowrap; }

.grid { display: grid; gap: 1.1rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--ggg-card);
  border: 1px solid var(--ggg-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  position: relative;
  display: flex; flex-direction: column; gap: .4rem;
}
.card h3 { margin: 0; }
.card h3 a { color: var(--ggg-ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card h3 a:hover { color: var(--ggg-accent-dark); }
.card .meta { font-family: var(--font-ui); font-size: .8rem; color: var(--ggg-ink-soft); letter-spacing: .02em; }
.card p { margin: 0; font-size: .95rem; color: var(--ggg-ink-soft); }
.card--spine { border-left: 6px solid var(--ggg-sf); }
.card--spine.is-fantasy { border-left-color: var(--ggg-fantasy); }
.card--spine.is-horror { border-left-color: var(--ggg-horror); }

/* Genre hub tiles */
.tile {
  border-radius: var(--radius); padding: 1.5rem 1.4rem; color: #fff;
  display: flex; flex-direction: column; gap: .3rem; position: relative;
  box-shadow: var(--shadow); text-decoration: none;
}
.tile h3 { margin: 0; color: #fff; font-size: 1.35rem; }
.tile p { margin: 0; font-size: .9rem; opacity: .85; }
.tile .count { font-family: var(--font-ui); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.tile--sf { background: linear-gradient(145deg, var(--ggg-sf), #143E3B); }
.tile--fantasy { background: linear-gradient(145deg, var(--ggg-fantasy), #3D2C62); }
.tile--horror { background: linear-gradient(145deg, var(--ggg-horror), #471520); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; list-style: none; font-family: var(--font-ui); }
.chip {
  display: inline-block; padding: .28rem .8rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; text-decoration: none;
  background: var(--ggg-card); color: var(--ggg-ink);
  border: 1px solid var(--ggg-line);
}
.chip:hover { border-color: var(--ggg-accent); color: var(--ggg-accent-dark); }
.chip--sf { border-color: var(--ggg-sf); color: var(--ggg-sf); }
.chip--fantasy { border-color: var(--ggg-fantasy); color: var(--ggg-fantasy); }
.chip--horror { border-color: var(--ggg-horror); color: var(--ggg-horror); }

/* Coming-soon teaser (future reading lists etc.) */
.teaser {
  border: 2px dashed var(--ggg-gold);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, rgba(201,155,63,.10), transparent);
}
.teaser .badge {
  font-family: var(--font-ui); font-size: .7rem; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: var(--ggg-gold);
  padding: .2rem .6rem; border-radius: 4px;
}

/* ==========================================================================
   List pages
   ========================================================================== */
.page-head { padding: 2.2rem 0 1.4rem; }
.page-head .lede { color: var(--ggg-ink-soft); max-width: 65ch; margin-top: .25rem; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  font-family: var(--font-ui);
  padding: .9rem 0; border-top: 1px solid var(--ggg-line); border-bottom: 1px solid var(--ggg-line);
  margin-bottom: 1.5rem;
}
.toolbar input[type="search"] {
  font: inherit; padding: .5rem .9rem; min-width: 220px;
  border: 1px solid var(--ggg-line); border-radius: 999px; background: var(--ggg-card);
}
.alpha-index { display: flex; flex-wrap: wrap; gap: .15rem; list-style: none; margin: 0 0 1.5rem; padding: 0; font-family: var(--font-ui); }
.alpha-index a {
  display: inline-block; min-width: 2em; text-align: center;
  padding: .25rem .3rem; border-radius: 6px; text-decoration: none;
  font-weight: 700; font-size: .85rem; color: var(--ggg-ink);
}
.alpha-index a:hover { background: var(--ggg-card); color: var(--ggg-accent-dark); }
.alpha-index .is-empty { opacity: .3; pointer-events: none; }

.letter-rule {
  font-family: var(--font-display); font-size: 1.5rem; color: var(--ggg-accent);
  border-bottom: 2px solid var(--ggg-line); margin: 2rem 0 1rem; padding-bottom: .2rem;
}

/* ==========================================================================
   Article pages (author & book)
   ========================================================================== */
.breadcrumbs { font-family: var(--font-ui); font-size: .82rem; padding: 1rem 0 0; color: var(--ggg-ink-soft); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--ggg-line); }
.breadcrumbs a { color: var(--ggg-ink-soft); }

.article-head { padding: 1.2rem 0 1.6rem; }
.article-head .kicker {
  font-family: var(--font-ui); font-size: .75rem; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ggg-accent); margin: 0 0 .4rem;
}
.article-head .sub { color: var(--ggg-ink-soft); font-size: 1.05rem; font-style: italic; margin-top: .2rem; }

.article-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr); gap: 2.2rem; align-items: start; padding-bottom: 3rem; }
.prose { font-size: 1.08rem; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin-top: 1.6em; }

.callout {
  background: var(--ggg-card);
  border-left: 5px solid var(--ggg-gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.callout h2, .callout h3 { margin-top: 0; font-size: 1.1rem; }
.callout p:last-child { margin-bottom: 0; }

/* Sidebar fact file */
.factfile {
  background: var(--ggg-card); border: 1px solid var(--ggg-line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem; font-family: var(--font-ui);
  position: sticky; top: 1rem;
}
.factfile h2 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ggg-accent); font-family: var(--font-ui); }
.factfile dl { margin: 0; }
.factfile dt { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ggg-ink-soft); margin-top: .8rem; }
.factfile dd { margin: .1rem 0 0; font-size: .95rem; }
.factfile .chips { margin-top: .3rem; }

/* Works list on author page */
.work-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--ggg-line);
  position: relative;
}
.work-row:last-child { border-bottom: none; }
.work-row h3 { margin: 0; font-size: 1.15rem; }
.work-row h3 a { color: var(--ggg-ink); text-decoration: none; }
.work-row h3 a:hover { color: var(--ggg-accent-dark); }
.work-row .meta { font-family: var(--font-ui); font-size: .78rem; color: var(--ggg-ink-soft); }
.work-row p { margin: .3rem 0 0; font-size: .95rem; color: var(--ggg-ink-soft); }

/* Mini "pulp cover" placeholder, pure CSS */
.cover {
  width: 64px; height: 96px; border-radius: 4px; flex: none;
  background: linear-gradient(160deg, var(--ggg-sf) 0%, #143E3B 80%);
  color: #fff; font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem; text-align: center; padding: .3rem; line-height: 1.2;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.2);
}
.cover.is-fantasy { background: linear-gradient(160deg, var(--ggg-fantasy), #3D2C62); }
.cover.is-horror { background: linear-gradient(160deg, var(--ggg-horror), #471520); }
.cover--lg { width: 150px; height: 225px; font-size: 1rem; padding: .8rem; border-radius: 6px; }

/* Book page hero row */
.book-hero { display: flex; gap: 1.75rem; align-items: flex-start; }
.book-hero .cover--lg { flex: none; }

/* Star rating flourish */
.stars { color: var(--ggg-gold); letter-spacing: .1em; font-size: .95rem; }

/* Related rail */
.rail { border-top: 3px double var(--ggg-line); padding-top: 1.5rem; margin-top: 1rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 3rem;
  background: var(--ggg-ink); color: #CFC4AC;
  padding: 2.5rem 0 2rem; font-family: var(--font-ui); font-size: .9rem;
}
.site-footer a { color: var(--ggg-gold); }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { color: #fff; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-family: var(--font-ui); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .35rem 0; }
.site-footer .legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; opacity: .8; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 880px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .factfile { position: static; order: -1; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .masthead { flex-wrap: wrap; gap: .75rem; }
  .masthead .logo img, .masthead .logo svg { height: 48px; }
  .nav-toggle { display: inline-block; margin-bottom: .6rem; }
  .site-nav ul { display: none; flex-direction: column; gap: 0; border-top: 1px solid var(--ggg-line); }
  .site-nav.is-open ul { display: flex; }
  .site-nav a { border-radius: 6px; }
  .book-hero { flex-direction: column; }
  .hero-search { flex-direction: column; }
  .site-footer .cols { grid-template-columns: 1fr; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Print: keep it readable, drop chrome */
@media print {
  .site-nav, .mothership-bar, .hero-search, .site