/* ============================================================
   RJS EXPORTS — Reset, typography, layout primitives
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ivory-50);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* Public pages stay behind this shell until the authoritative CMS data has
   been rendered. This prevents the static/pre-rendered snapshot from being
   seen first while /api/site and the media library are still loading. */
html.cms-loading main,
html.cms-loading [data-site-header],
html.cms-loading [data-site-footer],
html.cms-error main,
html.cms-error [data-site-header],
html.cms-error [data-site-footer] {
  visibility: hidden;
}

#cms-load-status {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--ivory-50);
  color: var(--ink-muted);
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

#cms-load-status .cms-load-status__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(24, 35, 32, 0.18);
  border-top-color: var(--gold-600, #b08a3e);
  border-radius: 50%;
  animation: cms-load-spin 0.8s linear infinite;
}

#cms-load-status.is-error .cms-load-status__text {
  max-width: 34rem;
  color: var(--ink);
  line-height: 1.6;
}

#cms-load-status .cms-load-status__retry {
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

@keyframes cms-load-spin {
  to {
    transform: rotate(360deg);
  }
}

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

img {
  height: auto;
}

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

p,
h1,
h2,
h3,
h4,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

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

.section {
  position: relative;
  padding-block: clamp(48px, 5.4vw, 78px);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
.font-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.005em;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.15vw, 2.15rem);
  font-weight: 600;
  color: var(--ink);
}

.section-sub {
  font-size: 0.95rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Motion preference ---------- */
@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;
  }
}
