/* ==========================================================================
   Base — reset, body, typography, links, utilities, accessibility.
   ========================================================================== */

/* ── Color scheme hint ──────────────────────────────────────────────────── */
:root {
  color-scheme: light;
}

/* ── Modern CSS reset (Josh Comeau–inspired) ─────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Inherit line-height everywhere */
* {
  line-height: inherit;
}

/* ── Document ───────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  line-height: var(--line-height-normal);
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar hidden on specific pages */
body.page-id-10441,
body.home {
  scrollbar-width: none;
}
body.page-id-10441::-webkit-scrollbar,
body.home::-webkit-scrollbar {
  display: none;
}

/* ── Media elements ─────────────────────────────────────────────────────── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Headings ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  overflow-wrap: break-word;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-h1); }
h2 { font-size: var(--font-h2); }
h3 { font-size: var(--font-h3); }
h4 { font-size: var(--font-h4); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

/* ── Body text ──────────────────────────────────────────────────────────── */
p {
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
  overflow-wrap: break-word;
}

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

strong, b { font-weight: var(--font-weight-bold); }

small { font-size: var(--font-size-sm); }

/* ── Links ──────────────────────────────────────────────────────────────── */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

/* ── Lists ──────────────────────────────────────────────────────────────── */
ul, ol {
  list-style: none;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

/* Content lists (inside .entry-content) get bullets back */
.entry-content ul  { list-style: disc; }
.entry-content ol  { list-style: decimal; }
.entry-content li  { margin-bottom: var(--space-2); }

/* ── Form elements base ─────────────────────────────────────────────────── */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(100, 198, 245, 0.25);
}

textarea { resize: vertical; min-height: 120px; }

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-semibold);
}

/* ── Focus visible (keyboard navigation) ────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Selection ──────────────────────────────────────────────────────────── */
::selection {
  background: var(--color-primary);
  color: var(--color-text);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow { max-width: var(--container-md); }
.container--wide   { max-width: var(--container-2xl); }

/* ── Accessibility ──────────────────────────────────────────────────────── */
.visually-hidden,
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.visually-hidden:focus,
.screen-reader-text:focus {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  clip: auto !important;
  clip-path: none;
  color: var(--color-text);
  display: block;
  font-size: var(--font-size-base);
  height: auto;
  left: var(--space-4);
  line-height: normal;
  padding: var(--space-3) var(--space-6);
  top: var(--space-4);
  width: auto;
  z-index: var(--z-toast);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  text-decoration: none;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ── Text utilities ──────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-pink    { color: var(--color-pink); }
.text-blue    { color: var(--color-blue); }
.text-green   { color: var(--color-green); }
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-white); }

/* ── Spacing primitives ──────────────────────────────────────────────────── */

/* Vertical rhythm — stack: same gap between all children */
.stack > * + * {
  margin-top: var(--space-4);
}

.stack--sm > * + * { margin-top: var(--space-2); }
.stack--lg > * + * { margin-top: var(--space-8); }

/* Tight flow spacing */
.flow > * + * {
  margin-top: var(--space-2);
}

/* Horizontal flex cluster */
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.cluster--sm  { gap: var(--space-2); }
.cluster--lg  { gap: var(--space-8); }

/* Auto-fit grid */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-6);
}

/* ── Misc utilities ──────────────────────────────────────────────────────── */
.required { color: var(--color-error); }

/* WordPress generated alignment classes */
.wp-caption { margin-bottom: 1.75em; max-width: 100%; }
.wp-caption img[class*="wp-image-"] { display: block; margin: 0; }
.wp-caption .wp-caption-text {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-style: italic;
  line-height: 1.615;
  padding-top: 0.538em;
}

.alignleft   { float: left; margin-right: var(--space-4); }
.alignright  { float: right; margin-left: var(--space-4); }
.aligncenter { display: block; margin: auto; }
