/*
Theme Name: OZ Books
Theme URI: https://ozbooks.org/
Author: The Clone Shop
Author URI: https://cloneshop.com/
Description: Custom theme for ozbooks.org — Janice Strohmeier's author site and writing community. Notebook paper, postcards, and writing tools. Single self-contained theme with built-in JSON-LD schema, bilingual story CPT, comment moderation with Turnstile + honeypot, and rich category landings. Pairs with the small ozbooks-newsletter plugin for Substack signup forms (carved out so theme is unaffected when Substack changes their integration).
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary — All Rights Reserved
License URI: https://cloneshop.com/
Text Domain: ozbooks
Tags: author, custom-theme
*/

/* ============================================
   OZ BOOKS — GLOBAL STYLES
   :root tokens, resets, buttons, section heads,
   airmail/postmark, header (2 variants), footer,
   notebook quote pullquotes, post-card grid.
   Page-specific styles live in assets/css/.
   ============================================ */

/* Self-hosted Special Elite (typewriter font for buttons + metadata).
   Removes the privacy concern of the Google Fonts CDN sending visitor
   IPs to Google. Subsetted to latin + latin-ext to match Google's split. */
@font-face {
	font-family: 'Special Elite';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/special-elite-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Special Elite';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/special-elite-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1B2A4A;
  --ink-light: #2D4470;
  --ink-faded: rgba(27, 42, 74, 0.6);
  --warm-gold: #C8973E;
  --warm-gold-text: #6B4A08; /* AA-compliant gold for text on light backgrounds (7.41:1 on paper) */
  --gold-light: #E8C87A;
  --gold-glow: rgba(200, 151, 62, 0.12);
  --cream: #F5F0E8;
  --cream-warm: #F2EBD9;
  --paper: #FDFAF3;
  --paper-aged: #F0E8D6;
  --kraft: #C4A882;
  --kraft-dark: #8B7355;
  --kraft-light: #DFD0B8;
  --charcoal: #3A3632;
  --charcoal-light: #5A554F;
  --stamp-red: #B84233;
  --stamp-red-dark: #8C3028;
  --airmail-blue: #5B8DB8;
  --airmail-red: #C0392B;
  --notebook-line: rgba(160, 190, 220, 0.3);
  --notebook-margin: rgba(200, 80, 80, 0.18);
  --shadow: rgba(60, 50, 40, 0.12);
  --shadow-deep: rgba(40, 30, 20, 0.2);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-type: 'Special Elite', 'Courier New', monospace;

  --max-w: 1200px;
}

/* --- Resets --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

.sr-only,
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 9999;
  font-family: var(--font-type);
  font-size: 0.78rem; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.skip-link:focus { left: 16px; top: 16px; color: #fff; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--warm-gold-text); }
:focus-visible { outline: 2px solid var(--warm-gold); outline-offset: 3px; border-radius: 2px; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============================================ BUTTONS ============================================ */
.btn {
  display: inline-block;
  padding: 13px 28px;
  font-family: var(--font-type);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-transform: uppercase;
}
.btn-ink { background: var(--ink); color: white; }
.btn-ink:hover { background: var(--ink-light); color: white; transform: translateY(-2px); box-shadow: 0 4px 12px var(--shadow); }
.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: white; transform: translateY(-2px); }
.btn-gold { background: var(--warm-gold); color: var(--ink); } /* AA fix: ink on gold = 7.13:1 */
.btn-gold:hover { background: var(--gold-light); color: var(--charcoal); transform: translateY(-2px); }
.btn-stamp { background: var(--stamp-red); color: white; }
.btn-stamp:hover { background: var(--stamp-red-dark); color: white; transform: translateY(-2px); }

/* ============================================ SECTION HEADS ============================================ */
.section-head { text-align: center; margin-bottom: 50px; position: relative; }
.section-head .label {
  font-family: var(--font-hand);
  font-size: 1.5rem; color: var(--warm-gold);
  display: block; margin-bottom: 2px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 2.4rem; font-weight: 700; color: var(--ink);
}
.section-head .scribble-rule {
  display: block; width: 160px; height: 20px;
  margin: 6px auto 0; object-fit: contain; opacity: 0.25;
}

/* ============================================ AIRMAIL + POSTMARK ============================================ */
.airmail-top::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-60deg,
    var(--airmail-blue) 0 8px, var(--paper) 8px 11px,
    var(--airmail-red) 11px 19px, var(--paper) 19px 22px);
  z-index: 5;
}
.airmail-bottom::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-60deg,
    var(--airmail-blue) 0 8px, var(--paper) 8px 11px,
    var(--airmail-red) 11px 19px, var(--paper) 19px 22px);
  z-index: 5;
}
.postmark {
  position: absolute;
  width: 80px; height: 80px;
  border: 2.5px solid var(--stamp-red);
  border-radius: 50%; opacity: 0.25;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-type);
  font-size: 0.55rem; color: var(--stamp-red);
  text-transform: uppercase; letter-spacing: 1px;
  line-height: 1.3; text-align: center; z-index: 6;
}
.postmark::before {
  content: ''; position: absolute; inset: 4px;
  border: 1.5px solid var(--stamp-red); border-radius: 50%;
}

/* ============================================ HEADER — homepage variant (transparent) ============================================ */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 100; background: transparent; }
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center;
  justify-content: space-between;
  height: 110px; position: relative;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-link img {
  height: 72px; width: auto;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.15));
  transition: transform 0.3s;
}
.logo-link:hover img { transform: scale(1.03); }

.primary-nav ul { display: flex; list-style: none; gap: 0; align-items: center; }
.primary-nav > ul > li { position: relative; }
.primary-nav > ul > li > a {
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.25rem; font-weight: 600;
  padding: 6px 14px; border-radius: 2px;
  transition: all 0.25s;
  display: flex; align-items: center;
  gap: 4px; position: relative;
}
.primary-nav > ul > li > a::after {
  content: ''; position: absolute;
  bottom: 2px; left: 10px; right: 10px; height: 3px;
  background: var(--warm-gold); border-radius: 2px;
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left;
  transition: transform 0.3s ease; opacity: 0.7;
}
.primary-nav > ul > li > a:hover { color: var(--ink); }
.primary-nav > ul > li > a:hover::after,
.primary-nav > ul > li > a:focus::after { transform: scaleX(1) rotate(-1deg); }

.has-dropdown > a .dd-arrow {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--ink);
  opacity: 0.4; margin-left: 2px;
  transition: transform 0.2s;
}
.has-dropdown:hover .dd-arrow,
.has-dropdown:focus-within .dd-arrow { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 210px;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: 3px 4px 18px var(--shadow-deep);
  opacity: 0; visibility: hidden;
  transition: all 0.25s ease;
  z-index: 200; padding: 8px 0;
  border-top: 5px solid transparent;
  border-image: repeating-linear-gradient(-60deg,
    var(--airmail-blue) 0 6px, var(--paper) 6px 8px,
    var(--airmail-red) 8px 14px, var(--paper) 14px 16px) 5;
  list-style: none;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(2px);
}
.dropdown li { list-style: none; }
.dropdown li a {
  display: block; padding: 9px 22px;
  color: var(--ink) !important;
  font-size: 1.1rem;
  font-family: var(--font-hand) !important;
  font-weight: 500; transition: all 0.15s;
  background: transparent !important;
}
.dropdown li a::after { display: none !important; }
.dropdown li a:hover, .dropdown li a:focus {
  background: var(--gold-glow) !important;
  color: var(--warm-gold) !important;
  padding-left: 26px;
}
.dropdown .dd-divider { height: 1px; margin: 4px 18px; background: rgba(0,0,0,0.06); list-style: none; }
.dropdown .dd-label {
  display: block; padding: 6px 22px 2px;
  font-family: var(--font-type);
  font-size: 0.5rem; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--kraft-dark);
  pointer-events: none; list-style: none;
}

/* ============================================ HEADER — subpage variant (sticky ink) ============================================ */
.site-header.is-subpage {
  position: sticky; top: 0; background: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.site-header.is-subpage::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: repeating-linear-gradient(-60deg,
    var(--airmail-blue) 0 8px, var(--ink) 8px 11px,
    var(--airmail-red) 11px 19px, var(--ink) 19px 22px);
  z-index: 1;
}
.site-header.is-subpage .header-inner { height: 84px; }
.site-header.is-subpage .logo-link img {
	height: 52px;
	/* Brighten + saturate so the gold "Janice" script pops against navy.
	   The stock logo was designed for cream backgrounds — these filters
	   restore contrast on the dark subpage header without editing the PNG. */
	filter:
		brightness(1.4)
		saturate(1.5)
		contrast(1.1)
		drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.5));
}
.site-header.is-subpage .primary-nav > ul > li > a {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.3px;
}
.site-header.is-subpage .primary-nav > ul > li > a::after { background: var(--gold-light); }
.site-header.is-subpage .has-dropdown > a .dd-arrow { border-top-color: rgba(255,255,255,0.7); }
.site-header.is-subpage .dropdown { background: var(--paper); }

/* ============================================ MOBILE NAV ============================================ */
.menu-toggle { display: none; background: transparent; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.menu-toggle .bar {
  display: block; width: 26px; height: 2px;
  margin: 5px 0; background: currentColor;
  transition: transform 0.25s, opacity 0.25s;
}
.site-header.is-subpage .menu-toggle { color: #fff; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { display: none; position: fixed; inset: 0; background: var(--ink); z-index: 9000; padding: 100px 32px 40px; overflow-y: auto; }
.mobile-nav[aria-hidden="false"] { display: block; }
.mobile-nav ul { list-style: none; }
.mobile-nav > ul > li { margin-bottom: 8px; }
.mobile-nav > ul > li > a {
  display: block; color: #fff;
  font-family: var(--font-hand);
  font-size: 1.6rem; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mobile-nav > ul > li > a:hover, .mobile-nav > ul > li > a:focus { color: var(--gold-light); }
.mobile-nav .dropdown {
  position: static; display: block; visibility: visible;
  opacity: 1; transform: none; background: transparent;
  box-shadow: none; border-image: none; border-top: none;
  padding: 0 0 8px 16px;
}
.mobile-nav .dropdown li a {
  color: rgba(255,255,255,0.75) !important;
  background: transparent !important;
  padding: 6px 0 !important;
  font-size: 1.15rem !important;
}
.mobile-nav .dropdown li a:hover, .mobile-nav .dropdown li a:focus {
  color: var(--gold-light) !important;
  padding-left: 6px !important;
}
.mobile-nav .dd-label { color: rgba(255,255,255,0.4); }
.mobile-nav .dd-divider { background: rgba(255,255,255,0.08); }
.mobile-nav-close {
  position: absolute; top: 24px; right: 24px;
  background: transparent; border: 0; color: #fff;
  font-size: 1.6rem; font-family: var(--font-type);
  cursor: pointer; padding: 8px;
}
.mobile-nav-close:hover, .mobile-nav-close:focus { color: var(--gold-light); }

@media (max-width: 960px) {
  .primary-nav > ul { display: none; }
  .menu-toggle { display: block; }
  .header-inner { height: 80px; }
  .logo-link img { height: 52px; }
}

/* ============================================ FOOTER ============================================ */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  padding: 52px 0 20px;
  position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-60deg,
    rgba(91, 141, 184, 0.5) 0 8px, var(--ink) 8px 11px,
    rgba(192, 57, 43, 0.5) 11px 19px, var(--ink) 19px 22px);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto; padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
}
.footer-col h4 { font-family: var(--font-serif); font-size: 1rem; color: var(--gold-light); margin-bottom: 12px; }
.footer-col p { font-size: 0.88rem; line-height: 1.7; opacity: 0.72; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: rgba(255,255,255,0.62); font-size: 0.88rem; }
.footer-col ul li a:hover { color: var(--gold-light); }

.f-photo {
  width: 68px; height: 68px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(255,255,255,0.12);
  margin-bottom: 10px;
}
.f-social { display: flex; gap: 10px; margin-top: 12px; }
.f-social a {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  transition: all 0.2s;
}
.f-social a:hover { background: var(--warm-gold); color: white; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 32px auto 0; padding: 16px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; justify-content: space-between;
  font-size: 0.78rem; opacity: 0.45;
}

@media (max-width: 960px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; gap: 4px; text-align: center; }
}

/* ============================================ POST CARDS — used everywhere ============================================ */
.post-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  position: relative;
  z-index: 2;
}
.post-card {
  background: white;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 2px 3px 14px var(--shadow);
  transition: transform 0.4s, box-shadow 0.4s;
  cursor: pointer;
}
.post-card:nth-child(3n+1) { transform: rotate(-1.3deg); }
.post-card:nth-child(3n+2) { transform: rotate(0.8deg); }
.post-card:nth-child(3n+3) { transform: rotate(-0.4deg); }
.post-card:hover { transform: rotate(0deg) translateY(-6px) scale(1.02) !important; box-shadow: 4px 8px 24px var(--shadow-deep); }
.post-card .card-img { width: 100%; height: 195px; object-fit: cover; }
.post-card .card-body {
  padding: 16px 18px 20px;
  position: relative;
  background-image: repeating-linear-gradient(
    transparent, transparent 25px,
    rgba(160, 190, 220, 0.12) 25px, rgba(160, 190, 220, 0.12) 26px);
  background-position: 0 10px;
}
.card-cat {
  display: inline-block;
  font-family: var(--font-type);
  font-size: 0.58rem; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--stamp-red);
  background: rgba(184, 66, 51, 0.06);
  padding: 3px 8px; margin-bottom: 4px;
}
.card-date {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--charcoal-light);
  margin-bottom: 6px;
}
.post-card h4 { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; color: var(--ink); margin-bottom: 8px; line-height: 1.35; }
.post-card h4 a { color: inherit; }
.post-card .excerpt { font-size: 0.86rem; line-height: 1.6; opacity: 0.72; margin-bottom: 10px; }
.post-card .read-link { font-family: var(--font-hand); font-size: 1.1rem; color: var(--warm-gold-text); }
.view-all { text-align: center; margin-top: 34px; position: relative; z-index: 2; }

/* ============================================ NOTEBOOK QUOTES — pullquote, used across pages ============================================ */
.notebook-quotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 50px 0;
}
.notebook-quotes.single { grid-template-columns: 1fr; max-width: 640px; margin-left: auto; margin-right: auto; }
.notebook-quote {
  background: var(--paper);
  padding: 28px 28px 24px 40px;
  border-radius: 2px;
  box-shadow: 2px 3px 12px var(--shadow);
  position: relative;
  background-image: repeating-linear-gradient(
    var(--paper) 0px, var(--paper) 27px,
    var(--notebook-line) 27px, var(--notebook-line) 28px);
  background-size: 100% 28px;
  background-position: 0 22px;
  transform: rotate(-0.4deg);
  transition: transform 0.4s, box-shadow 0.4s;
}
.notebook-quote:nth-child(2n) { transform: rotate(0.5deg); }
.notebook-quote:nth-child(3n) { transform: rotate(-0.8deg); }
.notebook-quote:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 3px 5px 18px var(--shadow-deep); }
.notebook-quote::before {
  content: ''; position: absolute;
  top: 0; bottom: 0; left: 28px;
  width: 1.5px; background: var(--notebook-margin);
}
.notebook-quote blockquote {
  font-family: var(--font-hand);
  font-size: 1.4rem; line-height: 1.5;
  color: var(--ink); margin-bottom: 12px;
}
.notebook-quote blockquote::before { content: '\201C'; color: var(--warm-gold); font-size: 1.3em; line-height: 0; vertical-align: -0.25em; margin-right: 2px; }
.notebook-quote blockquote::after  { content: '\201D'; color: var(--warm-gold); font-size: 1.3em; line-height: 0; vertical-align: -0.4em; margin-left: 2px; }
.notebook-quote cite {
  font-family: var(--font-type);
  font-style: normal; font-size: 0.7rem;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--kraft-dark);
}
@media (max-width: 960px) { .notebook-quotes { grid-template-columns: 1fr; max-width: 540px; margin-left: auto; margin-right: auto; } }

/* ============================================ PROSE ============================================ */
.prose {
  max-width: 720px; margin: 0 auto; padding: 60px 24px 80px;
  font-size: 1.05rem; line-height: 1.8;
}
.prose h1, .prose h2, .prose h3 {
  font-family: var(--font-serif); color: var(--ink);
  margin: 1.4em 0 0.5em; line-height: 1.3;
}
.prose h1 { font-size: 2.4rem; font-weight: 800; }
.prose h2 { font-size: 1.8rem; font-weight: 700; }
.prose h3 { font-size: 1.35rem; font-weight: 600; }
.prose p { margin-bottom: 1em; }
.prose a { color: var(--warm-gold); border-bottom: 1px dotted var(--warm-gold); }
.prose a:hover { color: var(--ink); }
.prose blockquote {
  border-left: 3px solid var(--warm-gold);
  padding-left: 18px; margin: 1.4em 0;
  font-family: var(--font-hand); font-size: 1.3rem;
  color: var(--ink);
}
.prose img { margin: 1.4em 0; border-radius: 2px; box-shadow: 2px 3px 12px var(--shadow); }
.prose ul, .prose ol { margin: 0 0 1em 1.4em; }
.prose li { margin-bottom: 0.4em; }
