/* ============================================================
   REED HOUSE PUBLISHING - MASTER STYLESHEET
   Design system: "Organized Nature"
   Mobile-first. Breakpoints: 768px (tablet), 1024px (desktop).
   All colors and fonts defined as CSS variables for easy theming.
   ============================================================ */

/* --- CSS VARIABLES: Change these to retheme the entire site --- */
:root {
  /* Color Palette */
  --color-bg-primary: #fdfbf7;      /* Soft Cream - main page background */
  --color-bg-secondary: #e8f2eb;    /* Pale Sage - alternating sections */
  --color-accent-cool: #6b9c8d;     /* Muted Teal - links, focus rings */
  --color-accent-warm: #d4a574;     /* Warm Ochre - CTAs, badges, TL;DR borders */
  --color-accent-deep: #8c6b4a;     /* Bamboo Brown - secondary accents */
  --color-text-primary: #2a2a2a;    /* Deep Charcoal - headings, body */
  --color-text-secondary: #5c5245;  /* Warm Taupe - meta text, subtitles */
  --color-footer-bg: #2a2a2a;       /* Deep Charcoal - footer background */
  --color-footer-text: #fdfbf7;     /* Soft Cream - footer text */

  /* Typography */
  --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-cta: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Font Sizes (rem-based for accessibility scaling) */
  --fs-base: 1.125rem;  /* 18px base, larger than typical 16px for readability */
  --fs-h1: 2.5rem;
  --fs-h2: 1.875rem;
  --fs-h3: 1.25rem;
  --fs-small: 0.875rem;
  --fs-cta: 0.9375rem;

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

  /* Layout */
  --max-width: 1100px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(42, 42, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(42, 42, 42, 0.10);

  /* Click target minimum (accessibility requirement) */
  --min-touch-target: 44px;
}

/* --- RESET: Strip default browser styles for consistency --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- BASE BODY: Sets default font, color, line-height --- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;  /* 1.6 ratio is optimal for dyslexia readability */
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

/* --- HEADINGS: Serif font for literary feel --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.3;  /* Tighter than body for visual hierarchy */
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* --- LINKS: Muted Teal, underline on hover --- */
a {
  color: var(--color-accent-cool);
  text-decoration: none;
  transition: text-decoration 0.1s ease;
}
a:hover {
  text-decoration: underline;
}

/* --- SKIP LINK: Hidden until focused by keyboard --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-accent-warm);
  color: var(--color-bg-primary);
  padding: var(--space-sm) var(--space-md);
  z-index: 1000;
  font-family: var(--font-cta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.skip-link:focus {
  top: 0;
}

/* --- FOCUS STATES: Visible teal ring for keyboard navigation --- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-accent-cool);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* --- CONTAINER: Centers content with max width --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-sm);
}

/* ============================================================
   SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
  background: var(--color-bg-primary);
  border-bottom: 1px solid rgba(140, 107, 74, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-wordmark {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* Hamburger toggle: hidden on desktop, shown on mobile */
.nav-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  min-height: var(--min-touch-target);
}
.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-text-primary);
  margin: 4px 0;
  border-radius: 2px;
}

/* Nav links: collapsed by default on mobile, expanded on toggle */
.nav-links {
  list-style: none;
  display: none;
  flex-direction: column;
  width: 100%;
  gap: var(--space-xs);
}
.nav-links.open {
  display: flex;
}
.nav-links a {
  display: block;
  padding: var(--space-xs) 0;
  min-height: var(--min-touch-target);
  display: flex;
  align-items: center;
  color: var(--color-text-primary);
  font-family: var(--font-cta);
  font-size: var(--fs-cta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.nav-links a:hover {
  color: var(--color-accent-cool);
  text-decoration: none;
}

/* --- TABLET BREAKPOINT (768px): Show horizontal nav --- */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    gap: var(--space-md);
  }
  .nav-links li {
    display: inline-block;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Base button: meets 44px minimum touch target */
.btn {
  display: inline-block;
  font-family: var(--font-cta);
  font-size: var(--fs-cta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  min-height: var(--min-touch-target);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn:active {
  transform: scale(0.98);  /* Subtle press feedback */
}

/* Primary button: Warm Ochre background, white text */
.btn-primary {
  background: var(--color-accent-warm);
  color: var(--color-bg-primary);
}
.btn-primary:hover {
  background: #c6985f;  /* Slightly darker ochre on hover */
  text-decoration: none;
}

/* Secondary button: Teal outline for secondary actions */
.btn-secondary {
  background: transparent;
  color: var(--color-accent-cool);
  border: 2px solid var(--color-accent-cool);
}
.btn-secondary:hover {
  background: var(--color-accent-cool);
  color: var(--color-bg-primary);
  text-decoration: none;
}

/* ============================================================
   HERO SECTION (Section A)
   ============================================================ */
.hero {
  background: var(--color-bg-primary);
  padding: var(--space-xl) var(--space-sm);
  text-align: center;
}
.hero-content {
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}
.hero-subhead {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
  .hero {
    padding: var(--space-xl) var(--space-sm);
  }
  .hero h1 {
    font-size: var(--fs-h1);
  }
}

/* ============================================================
   TWO-COLUMN LAYOUT: Used by About and Book sections
   Stacks on mobile, side-by-side on desktop
   ============================================================ */
.two-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
@media (min-width: 768px) {
  .two-col {
    flex-direction: row;
    align-items: center;
  }
  .two-col > * {
    flex: 1;
  }
}

/* ============================================================
   IMAGE PLACEHOLDERS
   Styled boxes that show dimensions and content type
   ============================================================ */
.img-placeholder {
  background: repeating-linear-gradient(
    45deg,
    #e0dccf,
    #e0dccf 10px,
    #e8e4d7 10px,
    #e8e4d7 20px
  );
  border: 2px dashed var(--color-accent-deep);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-accent-deep);
  font-size: var(--fs-small);
  font-family: var(--font-body);
  padding: var(--space-sm);
  position: relative;
}
.img-placeholder::before {
  content: attr(data-label);
  font-style: italic;
  line-height: 1.4;
}

/* Placeholder size variants */
.img-placeholder-portrait {
  aspect-ratio: 4 / 5;
  max-width: 480px;
}
.img-placeholder-book {
  aspect-ratio: 2 / 3;
  max-width: 400px;
}
.img-placeholder-square {
  aspect-ratio: 1 / 1;
}
.img-placeholder-wide {
  aspect-ratio: 16 / 10;
}

/* ============================================================
   ABOUT PREVIEW (Section B)
   ============================================================ */
.about-preview {
  background: var(--color-bg-secondary);
  padding: var(--space-lg) 0;
}
.about-portrait {
  display: flex;
  justify-content: center;
}
.about-text h2 {
  color: var(--color-text-primary);
}
.about-text strong {
  color: var(--color-accent-deep);
}

/* Arrow-style link for inline CTAs */
.link-arrow {
  font-family: var(--font-cta);
  font-size: var(--fs-cta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-cool);
  display: inline-block;
  margin-top: var(--space-sm);
}
.link-arrow::after {
  content: " \2192";  /* Right arrow unicode */
}
.link-arrow:hover {
  color: var(--color-accent-deep);
  text-decoration: none;
}

/* ============================================================
   BOOK SECTION (Section C)
   ============================================================ */
.book-section {
  background: var(--color-bg-primary);
  padding: var(--space-lg) 0;
}
.book-cover-wrap {
  display: flex;
  justify-content: center;
}
.book-volume {
  font-family: var(--font-cta);
  font-size: var(--fs-cta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-deep);
  margin-bottom: var(--space-sm);
}
.book-blurb {
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}
.book-cta {
  margin: var(--space-md) 0;
}

/* Badges */
.badge {
  display: inline-block;
  font-family: var(--font-cta);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius);
}
.badge-neurodivergent {
  background: var(--color-accent-cool);
  color: var(--color-bg-primary);
}
.badge-small {
  font-size: 0.75rem;
  padding: 4px var(--space-xs);
}

/* Feature list: three bullets with icons */
.feature-list {
  list-style: none;
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
}
.feature-icon {
  font-size: 1.25rem;
  color: var(--color-accent-cool);
}

/* ============================================================
   COMPANION PRODUCTS (Section D)
   ============================================================ */
.products {
  background: var(--color-bg-secondary);
  padding: var(--space-lg) 0;
}
.section-intro {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.product-card {
  background: var(--color-bg-primary);
  border-radius: var(--radius);
  padding: var(--space-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.product-card h3 {
  margin-top: var(--space-sm);
}
.product-price {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}
.products-note {
  text-align: center;
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
}

/* ============================================================
   BLOG PREVIEW (Section E)
   ============================================================ */
.blog-preview {
  background: var(--color-bg-primary);
  padding: var(--space-lg) 0;
}
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.blog-card {
  background: var(--color-bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  padding: var(--space-sm);
}
.blog-tag {
  display: inline-block;
  font-family: var(--font-cta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent-cool);
  margin: var(--space-xs) 0;
}
.blog-card time {
  display: block;
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}
.blog-card p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

/* ============================================================
   FOOTER (Section F)
   ============================================================ */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: var(--space-lg) 0 var(--space-sm);
}
.footer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: center;
}
.footer-wordmark {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
}
.footer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.footer-nav a {
  color: var(--color-footer-text);
  font-family: var(--font-cta);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-nav a:hover {
  color: var(--color-accent-warm);
}
.footer-badge {
  display: flex;
  justify-content: center;
}

/* --- FOOTER COPYRIGHT TEXT --- */
.footer-copyright {
  text-align: center;
  font-size: var(--fs-small);
  color: rgba(253, 251, 247, 0.7); /* Semi-transparent cream */
  margin-top: var(--space-md);
}
@media (min-width: 768px) {
  .footer-copyright {
    text-align: right;
    margin-top: 0;
  }
}

/* --- DESKTOP FOOTER: Side-by-side layout --- */
@media (min-width: 768px) {
  .footer-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  .footer-nav ul {
    flex-direction: row;
    gap: var(--space-md);
  }
}

/* ============================================================
   ACCESSIBILITY: Reduce motion for users who request it
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- PRINT STYLES: Clean output for anyone printing pages --- */
@media print {
  .site-header,
  .nav-toggle,
  .site-footer {
    display: none;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
