/**
 * Judo WA CMS — Base styles, reset, typography
 */

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

* {
  margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

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

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-brand-gold);
  color: var(--color-text-on-gold);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-radius: var(--radius-md);
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
}

h2 {
  font-size: clamp(var(--font-size-xl), 3vw, var(--font-size-3xl));
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5 {
  font-size: var(--font-size-md);
}

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

p {
  margin-bottom: var(--space-4);
}

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

.lead {
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

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

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

.text-center {
  text-align: center;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Prose content (CMS body copy) */
.prose p {
  margin-bottom: var(--space-4);
}

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

.prose h2,
.prose h3,
.prose h4 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--color-brand-gold);
  background: var(--color-background-soft);
  font-style: italic;
}

.prose blockquote.pull-quote {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  border-left-width: 5px;
  padding: var(--space-6);
}

.prose blockquote footer {
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

.prose blockquote cite {
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.prose figure {
  margin: var(--space-6) 0;
}

.prose figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

.prose figcaption {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.prose {
  min-width: 0;
  max-width: 100%;
}

.prose-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0 0 var(--space-6);
}

.prose-table-scroll:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.prose-table-scroll > table {
  margin-bottom: 0;
  width: max-content;
  min-width: 100%;
}

.prose table {
  width: 100%;
  margin-bottom: var(--space-6);
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  background: var(--color-background-soft);
  font-weight: var(--font-weight-semibold);
}

/* Focus states */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Screen reader only */
.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;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
