/**
 * Base styles - Reset and foundational styles
 *
 * Import order:
 * 1. theme.css - CSS custom properties
 * 2. base.css - This file (reset, typography, layout)
 * 3. components.css - Reusable UI components (optional)
 * 4. Page-specific CSS
 */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Prevent FOUC (Flash of Unstyled Content) for web components */
gp-theme-toggle:not(:defined),
gp-tracker:not(:defined),
gp-photo-modal:not(:defined) {
  display: none;
}

/* Full-height page layout with sticky footer */
body.page {
  display: flex;
  flex-direction: column;
}

body.page main {
  flex: 1;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width-prose);
  margin: 0 auto;
  padding: var(--space-md);
}

.container--wide {
  max-width: var(--max-width-wide);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

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

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Skip to content link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  z-index: 10000;
  outline: 2px solid var(--color-text);
}

/* Focus visible - keyboard navigation indicators (WCAG 2.1 SC 2.4.7) */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Code */
code {
  font-family: var(--font-mono);
  background-color: color-mix(in srgb, var(--color-text) 10%, transparent);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
}

pre {
  background-color: color-mix(in srgb, var(--color-text) 10%, transparent);
  padding: var(--space-md);
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

pre code {
  background: none;
  padding: 0;
}

/* Borders - Neo-brutalist style */
.border {
  border: 3px solid var(--color-border);
}

.border--thick {
  border-width: 5px;
}
