/*
Theme Name: JEBWizard — Joe Broadmeadow
Theme URI: https://jebwizardpublishing.com
Author: JEBWizard Publishing
Author URI: https://jebwizardpublishing.com
Description: A dark, editorial noir theme for Joe Broadmeadow — retired police captain, crime fiction author, and founder of JEBWizard Publishing. Features the Josh Williams series, true crime, young adult fiction, and memoir.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jebwizard
Tags: dark, literary, books, author, one-column, two-columns, custom-menu, featured-images, post-formats, blog
*/

/* ============================================================
   VARIABLES
============================================================ */
:root {
  --ink:        #0d0c0b;
  --charcoal:   #1c1a18;
  --smoke:      #2a2724;
  --ash:        #3d3a36;
  --gold:       #c8a84b;
  --gold-light: #e2c97e;
  --gold-dim:   #7a6428;
  --cream:      #f4ede0;
  --parchment:  #e0d5c0;
  --fog:        #a09080;
  --mist:       #6e6358;
  --badge-red:  #8b1a1a;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-accent:  'Oswald', 'Arial Narrow', sans-serif;
  --font-mono:    'Courier Prime', 'Courier New', monospace;
  --max-w: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --ease: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--gold-light); }
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -.01em;
}
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }
blockquote {
  border-left: 3px solid var(--gold);
  padding: .9rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--parchment);
  background: var(--smoke);
}

/* ============================================================
   LAYOUT
============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 780px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(4rem,8vw,8rem) 0; }

/* ============================================================
   TYPOGRAPHY HELPERS
============================================================ */
.eyebrow {
  font-family: var(--font-accent);
  font-size: .65rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: .75rem;
}
.rule-gold {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.rule-gold::before,.rule-gold::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.rule-gold span {
  font-family: var(--font-accent);
  font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold);
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-accent); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; padding: .85rem 1.75rem;
  border: none; cursor: pointer; transition: all var(--ease);
}
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-light); color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,168,75,.3); }
.btn--outline { background: transparent; color: var(--cream); border: 1px solid var(--ash); }
.btn--outline:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

/* ============================================================
   HEADER
============================================================ */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background var(--ease), box-shadow var(--ease);
}
#site-header.scrolled {
  background: rgba(13,12,11,.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(200,168,75,.2);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem var(--gutter); max-width: var(--max-w); margin: 0 auto;
}
.site-logo { line-height: 1; }
.site-logo__name {
  font-family: var(--font-display); font-size: clamp(1rem,2.5vw,1.4rem);
  font-weight: 700; color: var(--cream);
}
.site-logo__sub {
  font-family: var(--font-accent); font-size: .55rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold); margin-top: .15rem; display: block;
}
#primary-nav ul { list-style: none; display: flex; gap: .2rem; padding: 0; }
#primary-nav a {
  font-family: var(--font-accent); font-size: .7rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--fog); padding: .45rem .8rem;
  transition: color var(--ease), background var(--ease);
}
#primary-nav a:hover,
#primary-nav .current-menu-item > a { color: var(--gold); background: rgba(200,168,75,.08); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--ash);
  color: var(--cream); padding: .45rem .7rem; cursor: pointer;
  font-family: var(--font-accent); font-size: .65rem; letter-spacing: .15em; text-transform: uppercase;
}
.skip-link {
  position: absolute; top: -9999px; left: 0;
  background: var(--gold); color: var(--ink);
  padding: .5rem 1rem; font-family: var(--font-accent); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ============================================================
   HERO
============================================================ */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(4rem,8vh,7rem);
  position: relative; overflow: hidden; background: var(--ink);
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(200,168,75,.06) 0%, transparent 65%),
    radial-gradient(ellipse 55% 75% at 15% 65%, rgba(139,26,26,.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,.012) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,.012) 60px);
}
.hero__badge {
  position: absolute; top: clamp(5.5rem,11vh,9rem); right: var(--gutter);
  width: clamp(80px,11vw,120px); height: clamp(80px,11vw,120px);
  background: var(--badge-red);
  clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  display: flex; align-items: center; justify-content: center;
  animation: badge-spin 8s linear infinite;
}
@keyframes badge-spin { from { transform: rotate(-5deg); } to { transform: rotate(355deg); } }
.hero__badge-inner {
  font-family: var(--font-accent); font-size: .48rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cream); text-align: center; line-height: 1.4;
  padding: 1.5rem; animation: badge-counter 8s linear infinite;
}
@keyframes badge-counter { from { transform: rotate(5deg); } to { transform: rotate(-355deg); } }
.hero__content { position: relative; z-index: 2; padding: 0 var(--gutter); max-width: var(--max-w); margin: 0 auto; width: 100%; }
.hero__eyebrow {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem;
}
.hero__eyebrow::before { content: ''; width: 2rem; height: 1px; background: var(--gold); }
.hero__title {
  font-size: clamp(3rem,9vw,7.5rem); font-weight: 900; line-height: .95;
  color: var(--cream); margin-bottom: 1.5rem; max-width: 14ch;
}
.hero__title em { font-style: italic; color: var(--gold); }
.hero__desc {
  font-size: clamp(1rem,2vw,1.15rem); color: var(--fog);
  max-width: 50ch; margin-bottom: 2.5rem; line-height: 1.7;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ============================================================
   FEATURED BOOK
============================================================ */
.featured-book {
  background: var(--charcoal); position: relative; overflow: hidden;
}
.featured-book::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,transparent,var(--gold-dim),transparent);
}
.featured-book__inner {
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(2.5rem,6vw,6rem); align-items: center;
}
.featured-book__cover {
  width: clamp(160px,22vw,260px); flex-shrink: 0;
}
.featured-book__placeholder {
  aspect-ratio: 2/3; width: 100%;
  background: linear-gradient(145deg, var(--smoke) 0%, var(--ash) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.75rem; text-align: center;
  box-shadow: -10px 10px 32px rgba(0,0,0,.65), 5px -5px 0 var(--gold-dim);
  transform: rotate(-2deg); transition: transform var(--ease);
}
.featured-book__placeholder:hover { transform: rotate(0deg) scale(1.02); }
.featured-book__placeholder-title {
  font-family: var(--font-display); font-size: clamp(1rem,2vw,1.3rem);
  color: var(--cream); margin-bottom: .5rem; line-height: 1.2;
}
.featured-book__placeholder-series {
  font-family: var(--font-accent); font-size: .58rem; letter-spacing: .25em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .25rem;
}
.featured-book__placeholder-author {
  font-family: var(--font-mono); font-size: .62rem; color: var(--fog);
}
.featured-book__cover img {
  box-shadow: -10px 10px 32px rgba(0,0,0,.65), 5px -5px 0 var(--gold-dim);
  transform: rotate(-2deg); transition: transform var(--ease); width: 100%;
}
.featured-book__cover img:hover { transform: rotate(0deg) scale(1.02); }
.featured-book__series {
  font-family: var(--font-accent); font-size: .62rem; letter-spacing: .25em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .6rem;
}
.featured-book__title { font-size: clamp(1.8rem,5vw,3.2rem); margin-bottom: .9rem; }
.featured-book__desc { color: var(--fog); font-size: 1rem; margin-bottom: 2rem; max-width: 55ch; }

/* ============================================================
   BOOK GRID
============================================================ */
.books-section { background: var(--ink); }
.section-header { text-align: center; margin-bottom: clamp(2.5rem,5vw,4rem); }
.section-header h2 { font-size: clamp(1.8rem,5vw,3rem); margin-bottom: .6rem; }
.section-header p { color: var(--fog); max-width: 50ch; margin: 0 auto; }
.series-filter {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2.5rem;
}
.series-filter__btn {
  background: none; border: 1px solid var(--ash); color: var(--fog);
  font-family: var(--font-accent); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; padding: .45rem .9rem; cursor: pointer;
  transition: all var(--ease);
}
.series-filter__btn.active, .series-filter__btn:hover {
  background: rgba(200,168,75,.1); border-color: var(--gold); color: var(--gold);
}
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); gap: 2rem;
}
.book-card {
  background: var(--charcoal); border: 1px solid var(--ash);
  border-bottom: 3px solid var(--ash); padding: 1.5rem;
  display: flex; flex-direction: column;
  transition: all var(--ease); cursor: default;
}
.book-card:hover {
  border-bottom-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.book-card__genre {
  font-family: var(--font-accent); font-size: .58rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .4rem;
}
.book-card__cover {
  aspect-ratio: 2/3; background: linear-gradient(140deg,var(--smoke),var(--ash));
  margin-bottom: 1.2rem; overflow: hidden; position: relative;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 1.25rem; text-align: center;
}
.book-card__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .5s ease;
}
.book-card:hover .book-card__cover img { transform: scale(1.04); }
.book-card__cover-title {
  font-family: var(--font-display); font-size: 1.05rem; color: var(--cream);
  margin-bottom: .3rem; position: relative; z-index: 1;
}
.book-card__cover-author {
  font-family: var(--font-mono); font-size: .6rem; color: var(--gold);
  position: relative; z-index: 1;
}
.book-card__title { font-size: 1.1rem; margin-bottom: .4rem; }
.book-card__desc {
  font-size: .88rem; color: var(--fog); line-height: 1.65; flex: 1; margin-bottom: 1.1rem;
}
.book-card__link {
  font-family: var(--font-accent); font-size: .6rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: .35rem; transition: gap var(--ease);
}
.book-card__link:hover { gap: .6rem; color: var(--gold-light); }

/* ============================================================
   ABOUT
============================================================ */
.about-section {
  background: var(--charcoal); position: relative; overflow: hidden;
}
.about-section::after {
  content: '"'; position: absolute; bottom: -4rem; right: -1rem;
  font-family: var(--font-display); font-size: clamp(12rem,24vw,22rem);
  color: rgba(200,168,75,.04); line-height: 1; pointer-events: none;
}
.about-grid {
  display: grid; grid-template-columns: 1fr 1.5fr;
  gap: clamp(2.5rem,7vw,7rem); align-items: center;
}
.about-photo-wrap { position: relative; }
.about-photo-wrap::before {
  content: ''; position: absolute; top: -12px; left: -12px;
  right: 12px; bottom: 12px; border: 1px solid var(--gold-dim); z-index: 0;
}
.about-photo { position: relative; z-index: 1; }
.about-photo img { width: 100%; filter: grayscale(15%) contrast(1.05); }
.about-photo-placeholder {
  aspect-ratio: 3/4; position: relative; z-index: 1;
  background: linear-gradient(155deg, var(--smoke) 0%, var(--ash) 100%);
  display: flex; align-items: flex-end; padding: 1.5rem;
}
.about-photo-caption {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--gold); letter-spacing: .08em;
}
.about-content h2 { font-size: clamp(1.8rem,4.5vw,3rem); margin-bottom: 1.1rem; }
.about-content .lead {
  font-size: 1.1rem; color: var(--parchment); line-height: 1.75; margin-bottom: 1.25rem;
}
.about-content p { color: var(--fog); }
.credentials { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.credential {
  border: 1px solid var(--ash); padding: .4rem .9rem;
  font-family: var(--font-accent); font-size: .58rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--fog);
}

/* ============================================================
   REVIEWS
============================================================ */
.reviews-section {
  background: var(--ink); position: relative;
}
.reviews-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,transparent,var(--gold-dim),transparent);
}
.reviews-grid {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 2rem;
}
.review-card {
  background: var(--charcoal); border: 1px solid var(--ash); padding: 2rem;
  position: relative;
}
.review-card::before {
  content: '\201C'; font-family: var(--font-display); font-size: 3.5rem;
  color: var(--gold-dim); line-height: 1;
  position: absolute; top: .4rem; left: 1rem;
}
.review-card__text {
  font-style: italic; color: var(--parchment); line-height: 1.75;
  margin-bottom: 1.1rem; padding-top: 1.4rem;
}
.review-card__source {
  font-family: var(--font-accent); font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
}

/* ============================================================
   NEWSLETTER
============================================================ */
.newsletter-section {
  background: var(--smoke); position: relative; overflow: hidden;
  padding: clamp(3rem,6vw,5rem) 0;
  border-top: 1px solid var(--ash); border-bottom: 1px solid var(--ash);
}
.newsletter-section::before {
  content: 'JEB'; position: absolute; right: -2rem; top: 50%;
  transform: translateY(-50%); font-family: var(--font-display);
  font-size: clamp(8rem,16vw,14rem); font-weight: 900;
  color: rgba(200,168,75,.04); pointer-events: none;
}
.newsletter-inner {
  display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center;
}
.newsletter-inner h2 { font-size: clamp(1.5rem,4vw,2.5rem); margin-bottom: .4rem; }
.newsletter-inner p { color: var(--fog); margin: 0; }
.newsletter-form { display: flex; gap: .5rem; flex-shrink: 0; }
.newsletter-form input[type="email"] {
  background: var(--ink); border: 1px solid var(--ash); color: var(--cream);
  font-family: var(--font-body); font-size: .9rem; padding: .85rem 1.2rem;
  width: 250px; outline: none; transition: border-color var(--ease);
}
.newsletter-form input[type="email"]:focus { border-color: var(--gold); }
.newsletter-form input[type="email"]::placeholder { color: var(--mist); }

/* ============================================================
   BLOG POSTS
============================================================ */
.blog-section { background: var(--charcoal); }
.post-list { border-top: 1px solid var(--ash); }
.post-card {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem;
  align-items: start; padding: 2rem 0;
  border-bottom: 1px solid var(--ash);
}
.post-card__meta {
  font-family: var(--font-mono); font-size: .68rem; color: var(--mist);
  letter-spacing: .08em; margin-bottom: .35rem;
}
.post-card__title { font-size: 1.25rem; margin-bottom: .5rem; }
.post-card__title a { color: var(--cream); }
.post-card__title a:hover { color: var(--gold); }
.post-card__excerpt { font-size: .9rem; color: var(--fog); max-width: 60ch; }
.post-card__tag {
  background: var(--smoke); border: 1px solid var(--ash);
  font-family: var(--font-accent); font-size: .58rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--fog); padding: .3rem .7rem; white-space: nowrap;
}

/* ============================================================
   SINGLE ENTRY
============================================================ */
.entry-header {
  padding: clamp(6rem,12vh,10rem) 0 clamp(3rem,5vw,4rem);
  border-bottom: 1px solid var(--ash); margin-bottom: clamp(3rem,5vw,4rem);
}
.entry-title { font-size: clamp(2rem,6vw,4rem); margin-bottom: .9rem; }
.entry-meta {
  font-family: var(--font-mono); font-size: .72rem; color: var(--mist);
  letter-spacing: .08em; display: flex; gap: 2rem; flex-wrap: wrap;
}
.entry-content { font-size: 1.05rem; line-height: 1.85; color: var(--parchment); }
.entry-content h2 { font-size: 1.8rem; margin: 2.5rem 0 .9rem; }
.entry-content h3 { font-size: 1.4rem; margin: 2rem 0 .7rem; }
.entry-content p { margin-bottom: 1.5rem; }

/* ============================================================
   FOOTER
============================================================ */
#site-footer {
  background: var(--ink); border-top: 1px solid var(--ash);
  padding: clamp(3rem,6vw,5rem) 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem;
}
.footer-brand__name { font-family: var(--font-display); font-size: 1.4rem; color: var(--cream); }
.footer-brand__pub {
  font-family: var(--font-accent); font-size: .55rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold); display: block; margin-bottom: .85rem;
}
.footer-brand__bio { font-size: .88rem; color: var(--mist); max-width: 34ch; line-height: 1.7; }
.footer-nav h4 {
  font-family: var(--font-accent); font-size: .62rem; letter-spacing: .25em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .9rem;
}
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: .45rem; }
.footer-nav a { font-size: .88rem; color: var(--mist); }
.footer-nav a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid var(--ash); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-bottom p { font-family: var(--font-mono); font-size: .68rem; color: var(--mist); margin: 0; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a {
  font-family: var(--font-accent); font-size: .58rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mist);
}
.footer-social a:hover { color: var(--gold); }

/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ash); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp .7s ease both; }
.anim-1 { animation-delay: .1s; }
.anim-2 { animation-delay: .22s; }
.anim-3 { animation-delay: .34s; }
.anim-4 { animation-delay: .48s; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; }
  .featured-book__inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .newsletter-inner { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input[type="email"] { width: 100%; }
}
@media (max-width: 650px) {
  #primary-nav { display: none; }
  #primary-nav.open {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: fixed; inset: 0; background: rgba(13,12,11,.98); z-index: 99;
  }
  #primary-nav.open ul { flex-direction: column; gap: 1.25rem; }
  #primary-nav.open a { font-size: 1.1rem; }
  .nav-toggle { display: block; position: relative; z-index: 100; }
  .post-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   WP CORE
============================================================ */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 2rem auto; }
.wp-caption-text { font-family: var(--font-mono); font-size: .72rem; color: var(--mist); text-align: center; margin-top: .4rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: .5rem; }
