/* ==========================================================================
   reset.css — Modern, accessible baseline
   Load order: reset.css -> variables.css -> components.css -> styles.css
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset anchor targets so the fixed header never covers a heading */
  scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

/* Matches the header breakpoint in components.css */
@media (min-width: 1200px) {
  html { scroll-padding-top: calc(var(--header-height-lg) + var(--space-md)); }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Headings ---------------------------------------------------------------- */

/* H1/H2 carry the letterhead voice (Source Serif 4); everything below is
   Archivo, like the working lines of a well-kept estimate. */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-sm);
  color: inherit;
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: 0;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h6 { font-size: var(--fs-base); letter-spacing: var(--tracking-normal); }

/* Text -------------------------------------------------------------------- */

p, ul, ol, dl, figure, blockquote, table, pre {
  margin: 0 0 var(--space-md);
}

p { max-width: 68ch; }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: var(--space-2xs); }
li:last-child { margin-bottom: 0; }

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

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

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Links ------------------------------------------------------------------- */

a {
  color: var(--text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* Media ------------------------------------------------------------------- */

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

img, video {
  height: auto;
}

/* Images inside components should never collapse layout while loading.
   Every <img> in this project also carries explicit width/height attributes
   to keep Cumulative Layout Shift at zero. */

svg { fill: currentColor; }

iframe { border: 0; }

/* Forms ------------------------------------------------------------------- */

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

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

textarea { resize: vertical; }

/* Remove the default number spinners, which are a usability problem on
   fields such as "year" that people expect to type freely. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

/* Tables ------------------------------------------------------------------ */

table {
  border-collapse: collapse;
  width: 100%;
}

th { text-align: left; font-weight: var(--fw-semibold); }

/* Focus ------------------------------------------------------------------- */

/* Always-visible, high-contrast focus indicator. Never remove this. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Mouse users do not see the ring, keyboard users always do. */
:focus:not(:focus-visible) { outline: none; }

/* Utility ----------------------------------------------------------------- */

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* Reduced motion ---------------------------------------------------------- */

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

/* Print ------------------------------------------------------------------- */

@media print {
  .site-header,
  .utility-bar,
  .sticky-action-bar,
  .site-footer__nav,
  .nav-drawer,
  .gallery-filters { display: none !important; }

  body { font-size: 12pt; color: #000; background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: 10pt; word-break: break-all; }
  a[href^="#"]::after { content: ""; }
}
