/*
 * base.css — CSS Variables, Reset, and Typography
 * NextAIWorks Theme v3.0
 * ============================================================ */

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* Brand */
  --brand-blue:       #2563EB;
  --brand-blue-dark:  #1d4ed8;
  --brand-navy:       #0F172A;

  /* Surfaces */
  --bg-primary:       #F8FAFC;
  --bg-card:          #FFFFFF;
  --bg-muted:         #F1F5F9;

  /* Text */
  --text-main:        #0F172A;
  --text-muted:       #64748B;
  --text-light:       #94A3B8;
  --text-inverse:     #FFFFFF;

  /* Borders */
  --border-color:     #E2E8F0;
  --border-strong:    #CBD5E1;

  /* Shadows — subtle, no heavy gradients */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:  0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 4px 6px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:  0 10px 15px rgba(15, 23, 42, 0.08), 0 4px 6px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 20px 25px rgba(15, 23, 42, 0.10), 0 8px 10px rgba(15, 23, 42, 0.04);

  /* Typography */
  --font-ui:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Merriweather', Georgia, Cambria, 'Times New Roman', serif;

  /* Spacing Scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --max-width: 1200px;
  --sidebar-width: 320px;
  --content-gap: 40px;
}

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

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

body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

/* ============================================================
   Accessibility
   ============================================================ */

/* Skip to content link — hidden until focused */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 9999;
  background: var(--brand-navy);
  color: var(--text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Global focus ring */
:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Base Typography
   ============================================================ */
a {
  color: var(--brand-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--brand-navy);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  color: var(--brand-navy);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { line-height: 1.7; }

ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-1); }

/* Screen reader only utility */
.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;
}

/* ============================================================
   Image Placeholder
   ============================================================ */
.pub-img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  min-height: 160px;
}
.pub-img-placeholder--nextai-hero { min-height: 300px; font-size: 4rem; }
.pub-img-placeholder--nextai-card { min-height: 200px; }
.pub-img-placeholder--nextai-thumb { min-height: 140px; font-size: 1.8rem; }
