/*
Theme Name: MannixBooks
Theme URI: https://mannixbooks.com
Author: Mannix
Author URI: https://mannixbooks.com
Description: A light, washed polaroid author theme with cinematic scroll effects.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mannixbooks
Tags: one-column, custom-colors, featured-images, blog, portfolio
*/

/* =============================================
   CSS CUSTOM PROPERTIES — Washed Polaroid
   Pale sand backgrounds, dusty blue accents,
   warm brown text. Overexposed, faded, nostalgic.
   ============================================= */
:root {
  /* Core palette — sun-bleached, lifted */
  --clr-bg:         #f0e8d8;
  --clr-bg-surface: #e8ddc8;
  --clr-bg-card:    #ede3d0;
  --clr-bg-elevated:#e0d4be;

  /* Accent — deeper teal + sky blue highlights */
  --clr-ruby-deep:  #2a4a5a;
  --clr-ruby:       #3a6478;
  --clr-ruby-mid:   #4a7a90;
  --clr-ruby-vivid: #5a90a8;
  --clr-ruby-light: #7ab0c8;
  --clr-sky:        #8ab8d0;
  --clr-sky-light:  #b8d8e8;
  --clr-sky-pale:   #daeef8;
  --clr-gold:       #a07840;
  --clr-gold-dim:   #806030;

  /* Text — darker for contrast on sand */
  --clr-text-primary:   #0e0a04;
  --clr-text-secondary: #2a1e10;
  --clr-text-muted:     #58442c;
  --clr-text-accent:    #2a4a5a;

  /* Gradients — teal to sky blue */
  --grad-ruby: linear-gradient(135deg, var(--clr-ruby-deep) 0%, var(--clr-ruby-mid) 50%, var(--clr-ruby-deep) 100%);
  --grad-ruby-subtle: linear-gradient(135deg, rgba(42,74,90,0.15) 0%, rgba(138,184,208,0.08) 100%);
  --grad-text: linear-gradient(135deg, var(--clr-ruby-deep), var(--clr-sky));
  --grad-sky: linear-gradient(135deg, var(--clr-ruby-mid) 0%, var(--clr-sky-light) 100%);
  --grad-dark: linear-gradient(180deg, var(--clr-bg) 0%, var(--clr-bg-surface) 100%);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --font-body:    'Jost', 'Gill Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  4rem;
  --space-2xl: 8rem;

  /* Layout */
  --max-width: 860px;
  --full-width: 100%;

  /* Effects */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-ruby: 0 4px 24px rgba(58,95,111,0.15), 0 8px 48px rgba(58,95,111,0.08);
  --shadow-card:  0 2px 16px rgba(58,46,34,0.1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med:  0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--clr-bg);
  color: var(--clr-text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Sticky footer */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#site-footer {
  margin-top: auto;
}

/* Grain overlay — fine film grain on light bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
  mix-blend-mode: multiply;
}

/* Warm light vignette — overexposed center */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 40%,
    rgba(255,248,235,0.4) 0%,
    transparent 70%);
  pointer-events: none;
  z-index: 9998;
}
    rgba(28, 20, 12, 0.45) 100%);
  pointer-events: none;
  z-index: 9998;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-ruby); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--clr-ruby); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--clr-bg-surface); }
::-webkit-scrollbar-thumb { background: var(--clr-ruby-mid); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-ruby); }

/* =============================================
   SITE HEADER / NAV
   ============================================= */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 2.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  transition: background var(--transition-med), padding var(--transition-med);
}

/* Logo centered in the full header width, pushed lower */
.site-branding {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translateX(-50%) translateY(-50%);
}

#site-header.scrolled {
  background: rgba(240,232,216,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem 3rem;
  border-bottom: 2px solid rgba(79,122,138,0.2);
}

/* Keep logo fully visible when scrolled */
#site-header.scrolled .site-branding {
  top: 50%;
}

#site-header.scrolled .site-branding .site-title {
  font-size: 2rem;
}

.site-branding .site-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: font-size var(--transition-med);
}

.site-branding .site-title a {
  color: var(--clr-ruby);
  -webkit-text-fill-color: var(--clr-ruby);
  background: none;
  text-shadow: none;
}

/* Nav pushed to the right */
#primary-navigation {
  margin-left: auto;
}

#primary-navigation ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

#primary-navigation a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-text-secondary);
  position: relative;
  transition: color var(--transition-fast);
}

#primary-navigation a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--grad-ruby);
  transition: width var(--transition-med);
}

#primary-navigation a:hover {
  color: var(--clr-text-primary);
}

#primary-navigation a:hover::after { width: 100%; }

/* =============================================
   HERO SCROLL CONTAINER (Apple-style)
   ============================================= */
#hero-scroll-container {
  position: relative;
  /* Height is set by JS based on number of slides */
}

#hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* =============================================
   BOOK CAROUSEL
   ============================================= */
#book-carousel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Radiating ruby glow behind the whole carousel */
#book-carousel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 70% at 50% 55%, rgba(79,122,138,0.10) 0%, rgba(58,95,111,0.05) 40%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 50% 55%, rgba(79,122,138,0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: rubyPulse 4s ease-in-out infinite;
}

@keyframes rubyPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

/* Each slide fills the sticky viewport */
.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  /* No CSS transition — JS drives everything via inline style */
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide.prev {
  opacity: 0;
}

/* Inner layout: cover left, description right
   Both driven by JS scroll position via CSS custom properties */
.slide-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* COVER — starts centered, scrolls left + shrinks */
.book-cover-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--cover-scale, 1));
  margin-left: var(--cover-x, 0px);
  /* Book aspect ratio 2:3 — height drives the size */
  height: min(82vh, 75vw * (3/2));
  width: calc(min(82vh, 75vw * (3/2)) * (2/3));
  will-change: transform, margin-left;

  /* Radiating red glow around the cover */
  filter:
    drop-shadow(0 0 20px rgba(58,95,111,0.25))
    drop-shadow(0 0 60px rgba(58,95,111,0.15))
    drop-shadow(0 0 120px rgba(58,95,111,0.08))
    drop-shadow(0 8px 32px rgba(58,46,34,0.3));
}

.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

/* Placeholder cover if no image */
.book-cover-placeholder {
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  background: var(--clr-bg-elevated);
  border: 1px solid rgba(79,122,138,0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--clr-text-muted);
}

/* DESCRIPTION PANEL — starts hidden, slides in from right, driven by JS */
.slide-description {
  position: absolute;
  right: 8vw;
  top: 50%;
  transform: translateY(-50%) translateX(60px);
  width: min(360px, 35vw);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}

.slide-series {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-ruby-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slide-series::before {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--clr-ruby-vivid);
  box-shadow: 0 0 8px var(--clr-ruby-vivid);
}

.slide-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 0.75rem;
  text-align: center;
  color: var(--clr-ruby-deep);
  text-shadow: none;
}

.slide-subtitle {
  font-size: 0.9rem;
  color: var(--clr-text-secondary);
  margin-bottom: 1rem;
  font-style: italic;
  line-height: 1.6;
}

.slide-excerpt {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.slide-cta {
  display: inline-block;
  padding: 0.6rem 2rem;
  border: 2px solid var(--clr-ruby);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-ruby-deep);
  transition: all var(--transition-fast);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.slide-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-ruby);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.slide-cta:hover::before { opacity: 1; }
.slide-cta span { position: relative; z-index: 1; }

.slide-cta:hover {
  border-color: var(--clr-ruby);
  color: var(--clr-text-primary);
  box-shadow: var(--shadow-ruby);
}

/* Carousel indicators */
#carousel-indicators {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.carousel-dot {
  width: 24px;
  height: 2px;
  background: rgba(240,232,232,0.2);
  border-radius: 1px;
  cursor: pointer;
  transition: background var(--transition-fast), width var(--transition-fast);
}

.carousel-dot.active {
  background: linear-gradient(90deg, var(--clr-ruby-mid), var(--clr-sky));
  width: 40px;
}

/* Scroll hint */
#scroll-hint {
  position: absolute;
  bottom: 3.5rem;
  right: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.4;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-text-secondary);
  transition: opacity var(--transition-med);
}

#scroll-hint.hidden { opacity: 0; }

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--clr-sky), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* Progress bar */
#hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--clr-ruby-mid), var(--clr-sky-light));
  width: 0%;
  transition: width 0.1s linear;
  z-index: 20;
}

/* =============================================
   PAGE SECTIONS (home page)
   ============================================= */
.page-section {
  width: 100%;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-ruby);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--grad-sky);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

/* Author name in about section */
#section-about .section-heading {
  color: var(--clr-ruby-deep);
}

/* About section */
#section-about {
  background: var(--clr-bg-surface);
  border-top: 1px solid rgba(79,122,138,0.12);
  border-bottom: 1px solid rgba(79,122,138,0.12);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.author-portrait {
  position: relative;
}

.author-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: grayscale(20%) contrast(1.05);
}

.author-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-ruby-subtle);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.about-portrait-placeholder {
  aspect-ratio: 3/4;
  background: var(--clr-bg-elevated);
  border: 1px solid rgba(79,122,138,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.about-text p {
  color: var(--clr-text-secondary);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.about-text p:first-of-type {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--clr-text-primary);
  font-style: italic;
}

/* Books grid section */
#section-books {
  background: var(--clr-bg);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.book-card {
  background: var(--clr-bg-card);
  border: 2px solid rgba(79,122,138,0.2);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79,122,138,0.5);
  box-shadow: var(--shadow-ruby);
}

.book-card-cover {
  aspect-ratio: 2/3;
  background: var(--clr-bg-elevated);
  overflow: hidden;
}

.book-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-med);
}

.book-card:hover .book-card-cover img {
  transform: scale(1.04);
}

.book-card-info {
  padding: 1rem;
}

.book-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.book-card-genre {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-ruby-light);
}

/* =============================================
   QUOTE / PULL SECTION
   ============================================= */
#section-quote {
  background: linear-gradient(160deg, var(--clr-bg-surface) 0%, var(--clr-sky-pale) 60%, var(--clr-bg-surface) 100%);
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
  overflow: hidden;
}

#section-quote::before {
  content: '\201C';
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 20rem;
  color: rgba(79,122,138,0.06);
  line-height: 1;
  pointer-events: none;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  font-weight: 400;
  color: var(--clr-text-primary);
  max-width: 700px;
  margin: 0 auto 1.5rem;
  line-height: 1.4;
}

.pull-quote-attr {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
}

/* =============================================
   DIVIDER
   ============================================= */
.ruby-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-ruby-mid), var(--clr-sky), transparent);
  margin: 0;
}

/* =============================================
   BLOG PAGE — TIMELINE
   ============================================= */
.blog-header {
  padding: calc(var(--space-2xl) + 80px) var(--space-lg) var(--space-xl);
  text-align: center;
  background: var(--clr-bg);
}

.blog-header h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-header p {
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* Timeline layout */
.timeline-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  position: relative;
}

/* Vertical line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 2rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--clr-ruby) 10%, var(--clr-ruby) 90%, transparent);
}

.timeline-year {
  margin-left: 5rem;
  margin-bottom: 3rem;
}

.timeline-year-label {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-ruby-light);
  margin-bottom: 1.5rem;
  margin-left: -3rem;
}

.timeline-year-label::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%) translateX(-100%);
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-ruby-mid), var(--clr-sky));
  box-shadow: 0 0 8px var(--clr-sky-light);
}

/* Post card in timeline */
.timeline-post {
  background: var(--clr-bg-card);
  border: 2px solid rgba(79,122,138,0.18);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.timeline-post::before {
  content: '';
  position: absolute;
  left: -3.75rem;
  top: 1.75rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--clr-ruby);
  border: 1px solid var(--clr-ruby);
}

.timeline-post:hover {
  border-color: rgba(79,122,138,0.2);
  box-shadow: var(--shadow-card);
}

.post-date {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 0.5rem;
}

.post-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.post-title a {
  color: var(--clr-text-primary);
  transition: color var(--transition-fast);
}

.post-title a:hover {
  color: var(--clr-ruby-light);
}

.post-excerpt {
  color: var(--clr-text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.post-read-more {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-ruby);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.post-read-more::after {
  content: '→';
}

.post-read-more:hover {
  color: var(--clr-gold);
  gap: 0.75rem;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.post-tag {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 2px solid rgba(79,122,138,0.22);
  border-radius: 2px;
  color: var(--clr-text-muted);
}

/* =============================================
   SINGLE POST
   ============================================= */
.single-post-header {
  padding: calc(var(--space-2xl) + 80px) var(--space-lg) var(--space-xl);
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.single-post-meta {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.single-post-meta span { color: var(--clr-ruby); }

.single-post-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.post-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-2xl);
}

.post-content p {
  color: var(--clr-text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.post-content h2, .post-content h3 {
  color: var(--clr-text-primary);
  margin: 2.5rem 0 1rem;
}

.post-content h2 { font-size: 1.8rem; }
.post-content h3 { font-size: 1.3rem; }

.post-content blockquote {
  border-left: 2px solid var(--clr-ruby);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--clr-bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.post-content blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--clr-text-primary);
  margin: 0;
}

/* =============================================
   FOOTER
   ============================================= */
#site-footer {
  background: var(--clr-bg-surface);
  border-top: 1px solid rgba(79,122,138,0.12);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--clr-ruby-deep);
  background: none;
  -webkit-text-fill-color: var(--clr-ruby-deep);
  text-shadow: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  transition: color var(--transition-fast);
}

.footer-nav a:hover { color: var(--clr-ruby-light); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  letter-spacing: 0.05em;
}

.footer-copy a { color: var(--clr-ruby-light); }

.footer-subscribe {
  max-width: 320px;
  margin: 0 auto 2rem;
}

.footer-subscribe-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 0.75rem;
}

/* =============================================
   ANIMATIONS & SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* =============================================
   UTILITY
   ============================================= */
.text-ruby {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-ruby {
  display: inline-block;
  padding: 0.75rem 2.5rem;
  background: var(--grad-ruby);
  color: var(--clr-text-primary);
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-ruby:hover {
  opacity: 0.85;
  box-shadow: var(--shadow-ruby);
  color: var(--clr-text-primary);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  #site-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  #site-header.scrolled { padding: 0.75rem 1.25rem; }

  /* On mobile, logo sits in normal flow left-aligned, not absolutely centered */
  .site-branding {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    flex: 1;
    text-align: center;
  }

  .site-branding .site-title {
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    white-space: normal;
    word-break: break-word;
  }

  #primary-navigation ul { gap: 1rem; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .author-portrait { max-width: 200px; }

  .timeline-container::before { left: 1rem; }
  .timeline-year { margin-left: 3rem; }
  .timeline-year-label { margin-left: -1.5rem; }
  .timeline-post::before { left: -2.25rem; }

  .page-section { padding: var(--space-xl) var(--space-md); }
  #scroll-hint { display: none; }
}

@media (max-width: 480px) {
  #primary-navigation { display: none; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* =============================================
   ABOUT PAGE TEMPLATE (page-about.php)
   ============================================= */
.about-page-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: calc(var(--space-2xl) + 80px) var(--space-lg) var(--space-2xl);
}

.about-page-inner {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.about-page-image {
  position: relative;
}

.about-page-image img {
  width: 100%;
  border-radius: var(--radius-sm);
  filter: grayscale(15%) contrast(1.1);
}

.about-page-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-ruby-subtle);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.about-page-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  color: var(--clr-ruby-deep);
  text-shadow: none;
  margin-bottom: 0;
}

.about-page-body {
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--clr-text-secondary);
}

.about-page-body p {
  margin-bottom: 1.25rem;
}

.about-page-body p:first-child {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--clr-text-primary);
  font-style: italic;
}

@media (max-width: 768px) {
  .about-page-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-page-image { max-width: 260px; margin: 0 auto; }
  .about-page-content { text-align: center; }
}
