/* ============================================================
   RCMC Share Registry — Global Styles
   Resets, base typography, utility classes
   ============================================================ */

@import url('tokens.css');

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

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

body {
  background-color: var(--rcmc-bg-page);
  color: var(--rcmc-text-primary);
  font-family: var(--rcmc-font-body);
  font-weight: var(--rcmc-fw-regular);
  font-size: var(--rcmc-ts-base);
  line-height: var(--rcmc-lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
}

/* --- Base Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--rcmc-font-display);
  font-weight: var(--rcmc-fw-regular);
  line-height: var(--rcmc-lh-tight);
  letter-spacing: var(--rcmc-ls-tight);
  color: var(--rcmc-text-primary);
}

h1 { font-size: var(--rcmc-ts-h1); }
h2 { font-size: var(--rcmc-ts-h2); }
h3 { font-size: var(--rcmc-ts-h3); }
h4 { font-size: var(--rcmc-ts-h4); }

p {
  font-size: var(--rcmc-ts-base);
  line-height: var(--rcmc-lh-relaxed);
  color: var(--rcmc-text-secondary);
  max-width: var(--rcmc-content-width);
}

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

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

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

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

.section--dark {
  background-color: var(--rcmc-bg-dark);
  color: var(--rcmc-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--rcmc-text-inverse);
}

.section--dark p {
  color: var(--color-obsidian-100);
}

.section--subtle {
  background-color: var(--rcmc-bg-subtle);
}

/* --- Button Components --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--rcmc-space-2);
  font-family: var(--rcmc-font-body);
  font-size: var(--rcmc-ts-sm);
  font-weight: var(--rcmc-fw-medium);
  letter-spacing: var(--rcmc-ls-wide);
  text-transform: uppercase;
  padding: var(--rcmc-space-3) var(--rcmc-space-6);
  border-radius: var(--rcmc-radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--rcmc-duration-fast) var(--rcmc-ease-out),
    border-color var(--rcmc-duration-fast) var(--rcmc-ease-out),
    color var(--rcmc-duration-fast) var(--rcmc-ease-out),
    transform var(--rcmc-duration-fast) var(--rcmc-ease-out);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

/* Brand-mandated focus ring (Brand Guide §Buttons: 2px outline, accent, offset 2px) */
.btn:focus-visible {
  outline: 2px solid var(--rcmc-accent);
  outline-offset: 2px;
}

/* Accent / brand CTA — Brand Guide Phase 7 Component 02 (Amber-500 bg, white text).
   .btn-accent is an alias of .btn--primary: the site uses .btn--primary,
   the Insights spec uses .btn-accent; both resolve to one identical rule. */
.btn--primary,
.btn-accent {
  background-color: var(--rcmc-accent);
  border-color: var(--rcmc-accent);
  color: var(--color-white);
}

.btn--primary:hover,
.btn-accent:hover {
  background-color: var(--rcmc-accent-hover);
  border-color: var(--rcmc-accent-hover);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--rcmc-text-primary);
  color: var(--rcmc-text-primary);
}

.btn--ghost:hover {
  background-color: var(--rcmc-text-primary);
  color: var(--rcmc-bg-page);
}

.btn--ghost-inverse {
  background-color: transparent;
  border-color: var(--color-obsidian-200);
  color: var(--rcmc-text-inverse);
}

.btn--ghost-inverse:hover {
  background-color: var(--color-white);
  border-color: var(--color-white);
  color: var(--rcmc-text-primary);
}

/* --- Section Labels --- */
.section-label {
  display: inline-block;
  font-family: var(--rcmc-font-body);
  font-size: var(--rcmc-ts-label);
  font-weight: var(--rcmc-fw-medium);
  letter-spacing: var(--rcmc-ls-wider);
  text-transform: uppercase;
  color: var(--rcmc-accent);
  margin-bottom: var(--rcmc-space-4);
}

/* --- Accent Text --- */
.text-accent {
  color: var(--rcmc-accent);
}

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

/* --- Focus Ring --- */
:focus-visible {
  outline: 2px solid var(--rcmc-accent);
  outline-offset: 3px;
  border-radius: var(--rcmc-radius-sm);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background-color: var(--rcmc-bg-border);
  border: none;
}
