/* ==========================================================================
   base.css — PromptingPress Design Foundation
   Design tokens, reset, typography, and base element styles.
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   Change these 16 values to retheme the entire site.
   See ai-instructions/retheme.md for the full retheme workflow.
   ========================================================================== */

:root {
  /* Color — change all 7 to retheme */
  --color-bg:           #ffffff;  /* Page background */
  --color-surface:      #f9fafb;  /* Card / component backgrounds */
  --color-text:         #1a1a1a;  /* Primary text */
  --color-muted:        #6b7280;  /* Secondary text, captions, placeholders */
  --color-border:       #e5e7eb;  /* Dividers, outlines */
  --color-accent:       #0055cc;  /* Primary action — WCAG AA 4.7:1 on white */
  --color-accent-hover: #0044aa;  /* Hover / active state for accent */

  /* Spacing — the layout scale */
  --space-xs:  0.25rem;   /*  4px */
  --space-sm:  0.5rem;    /*  8px */
  --space-md:  1rem;      /* 16px */
  --space-lg:  2rem;      /* 32px */
  --space-xl:  4rem;      /* 64px */
  --space-2xl: 7rem;      /* 112px */

  /* Typography — replace both to change fonts */
  --font-body:    system-ui, sans-serif;  /* Body text */
  --font-heading: system-ui, sans-serif;  /* All headings */

  /* Shape & motion */
  --radius:     0.375rem;   /* 6px — increase for rounder corners */
  --max-width:  72rem;      /* 1152px — content column max width */
  --transition: 150ms ease; /* Default transition for interactive states */
}

/* Responsive breakpoints (reference — use in media queries):
   --breakpoint-sm: 640px   single-column stacking, nav collapses
   --breakpoint-md: 768px   2-col grid, nav links visible
   --breakpoint-lg: 1024px  full 3-col grid, full nav
   --breakpoint-xl: 1280px  max-width kicks in
*/

/* ==========================================================================
   2. CSS Reset
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

/* ==========================================================================
   3. Base Typography
   Modular scale: base 1rem, ratio ~1.25
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

code,
pre {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

/* ==========================================================================
   4. Links
   ========================================================================== */

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* ==========================================================================
   5. Focus Ring
   Applied via :focus-visible — only shown for keyboard navigation.
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Remove default outline when :focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   6. Screen Reader Only utility
   Visually hidden, but accessible to assistive technology.
   ========================================================================== */

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

/* ==========================================================================
   7. Responsive breakpoint reference (CSS custom media — documentation only)

   Use standard @media queries in component / utility CSS:
     @media (min-width: 640px)  { ... }   sm
     @media (min-width: 768px)  { ... }   md
     @media (min-width: 1024px) { ... }   lg
     @media (min-width: 1280px) { ... }   xl
   ========================================================================== */
