/* ============================================================
   base.css — Reset, typography, layout primitives.
   Never edit per client. Albert only edits theme.css.
   ============================================================ */


/* ------------------------------------------------------------
   Reset
   ------------------------------------------------------------ */

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

html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

img {
  loading: lazy; /* native lazy loading via HTML attribute; see components */
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary);
}

p {
  max-width: var(--prose-max);
}

p + p {
  margin-top: var(--space-2);
}

strong {
  font-weight: 600;
}

/* ------------------------------------------------------------
   Typography scale
   ------------------------------------------------------------ */

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }
.text-5xl  { font-size: var(--text-5xl); }

.text-muted { color: var(--color-text-muted); }

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Heading size assignments */
h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }


/* ------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.container--narrow {
  max-width: 720px;
}

/* Section vertical rhythm */
.section {
  padding-block: var(--space-12);
}

.section--sm {
  padding-block: var(--space-8);
}

.section--lg {
  padding-block: var(--space-16);
}

/* Background rhythm variants */
.bg-base    { background-color: var(--color-bg); }
.bg-surface { background-color: var(--color-surface); }
.bg-primary { background-color: var(--color-primary); color: #fff; }
.bg-accent  { background-color: var(--color-accent); color: #fff; }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-fill responsive grid — avoids media query overload */
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-auto-md { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* Flex utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* Spacing helpers */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

/* Prose container */
.prose {
  max-width: var(--prose-max);
  line-height: 1.7;
}

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }

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

/* ------------------------------------------------------------
   Responsive breakpoints — mobile first
   Keep breakpoints minimal: one major break at 768px (tablet/desktop)
   ------------------------------------------------------------ */

@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-3);
  }

  .section {
    padding-block: var(--space-8);
  }

  .section--lg {
    padding-block: var(--space-10);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
