/* ───────────────────────────────────────────────────────────────
   Jazzpiano.co.nz — Shared site stylesheet
   Used by post.php, search.php, admin pages.
   The marketing index.html and archive_preview.html keep their styles
   inline so they preview standalone.
   ─────────────────────────────────────────────────────────────── */

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

:root {
  --bg:        #e2d4ce;
  --bg-alt:    #efefef;
  --bg-dark:   #1a1612;
  --bg-card:   #ebe0db;
  --text:      #000000;
  --text-mute: #5a4d48;
  --text-soft: rgba(0,0,0,0.55);
  --accent:    #b22349;
  --accent-d:  #8b1a3a;
  --line:      rgba(0,0,0,0.08);
  --line-s:    rgba(0,0,0,0.04);
  --font-head: 'Bebas Neue', Impact, sans-serif;
  --font-serif:'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: rgba(178,35,73,0.15);
  overflow-x: hidden;
  width: 100%;
}
img, video, iframe { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* ── Nav ── */
nav#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(226,212,206,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
nav#navbar.scrolled {
  background: rgba(226,212,206,0.97);
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.nav-logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-mute);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a.woodshed { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none; border: none;
  color: var(--text);
  font-size: 1.5rem; cursor: pointer;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-fill { background: var(--accent); color: #fff; }
.btn-fill:hover { background: var(--accent-d); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

/* ── Post page ── */
.post-page { background: var(--bg); }

.post-hero {
  padding: 5rem 2.5rem 3rem;
  border-bottom: 1px solid var(--line);
}
.post-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.back-link {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 2rem;
  display: inline-block;
}
.back-link:hover { color: var(--accent-d); }

.post-hero-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.post-hero-meta .back-link { margin-bottom: 0; margin-right: auto; }
.post-hero-meta time { color: var(--text-mute); }
.post-type-tag {
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.post-type-tag.type-page { background: #555; }
.post-type-tag.type-videoplaylist { background: #444; }

.post-title {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  letter-spacing: 0.015em;
  line-height: 0.98;
  margin-bottom: 1.4rem;
  color: var(--text);
}
.post-excerpt {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-mute);
  max-width: 640px;
}

/* ── Post body ── */
.post-body-wrap {
  padding: 3rem 2.5rem 5rem;
}
.post-body {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 1.13rem;
  line-height: 1.7;
  color: var(--text);
}
.post-body p { margin-bottom: 1.4rem; }
.post-body p:last-child { margin-bottom: 0; }

.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: var(--font-head);
  letter-spacing: 0.02em;
  margin: 2.5rem 0 1rem;
  line-height: 1.05;
}
.post-body h1 { font-size: 2.4rem; }
.post-body h2 { font-size: 1.9rem; color: var(--accent); }
.post-body h3 { font-size: 1.5rem; }
.post-body h4 { font-size: 1.2rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); }

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(178,35,73,0.4);
  transition: border-color 0.2s, color 0.2s;
}
.post-body a:hover { color: var(--accent-d); border-color: var(--accent-d); }

.post-body strong { font-weight: 600; }
.post-body em { font-style: italic; color: var(--accent-d); }

.post-body blockquote {
  margin: 2rem 0;
  padding: 0.5rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--text-mute);
  font-family: var(--font-serif);
  font-size: 1.08rem;
}

.post-body ul, .post-body ol {
  margin: 1.4rem 0 1.4rem 1.5rem;
}
.post-body li { margin-bottom: 0.5rem; }

.post-body code {
  font-family: 'JetBrains Mono', Menlo, monospace;
  background: var(--bg-card);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.92em;
}
.post-body pre {
  background: var(--bg-dark);
  color: #f0e8e3;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.6rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
}
.post-body pre code { background: transparent; padding: 0; color: inherit; }

.post-body img,
.post-body iframe,
.post-body video,
.post-body figure {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}
.post-body figure {
  margin: 2rem auto;
}
.post-body figure img,
.post-body figure iframe { margin: 0 auto; }
.post-body figcaption {
  font-size: 0.85rem;
  color: var(--text-mute);
  text-align: center;
  margin-top: 0.6rem;
  font-style: italic;
}

/* WordPress block-editor remnants — keep them looking decent */
.post-body .wp-block-embed,
.post-body .wp-block-embed__wrapper { margin: 2rem auto; max-width: 100%; }
.post-body .wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper {
  position: relative; padding-bottom: 56.25%; height: 0;
}
.post-body .wp-block-embed.wp-embed-aspect-16-9 iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* Strip stray script tags that came in from old posts (defensive) */
.post-body script { display: none; }

/* ── Pager (prev/next) ── */
.post-pager {
  max-width: 720px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0;
}
.pager-link.next { text-align: right; }
.pager-dir {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.pager-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
}
.pager-link:hover .pager-title { color: var(--accent); }

/* ── Footer (shared) ── */
footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.55);
  padding: 2.5rem 2.5rem;
  font-size: 0.8rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
footer a { color: rgba(255,255,255,0.8); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--accent); }
.footer-sites {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  nav#navbar { padding: 0.85rem 1rem; }
  .nav-logo { font-size: 1.15rem; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0.4rem;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(226,212,206,0.98);
    backdrop-filter: blur(12px);
    padding: 1rem 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .nav-links.open li { width: 100%; }
  .nav-links.open a {
    display: block;
    padding: 0.9rem 0.6rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line-s);
  }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border-radius: 4px;
  }
  .post-hero { padding: 3rem 1.2rem 2rem; }
  .post-hero-meta { gap: 0.6rem; font-size: 0.66rem; }
  .post-title { font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.05; }
  .post-excerpt { font-size: 1.05rem; }
  .post-body-wrap { padding: 2rem 1.2rem 4rem; }
  .post-body { font-size: 1.05rem; line-height: 1.7; }
  .post-body h1 { font-size: 1.8rem; }
  .post-body h2 { font-size: 1.5rem; }
  .post-body h3 { font-size: 1.25rem; }
  .post-pager { grid-template-columns: 1fr; gap: 1.2rem; padding-top: 1.5rem; }
  .pager-link.next { text-align: left; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer-sites { justify-content: flex-start; }
}
