/**
 * MyTrainer UK — Base styles, layout, typography
 * BEM methodology, CSS custom properties
 */

:root {
  /* Brand — fitness / health green */
  --color-primary: #0d7a4f;
  --color-primary-dark: #095c3c;
  --color-primary-light: #12a06a;
  --color-accent: #2ecc71;
  --color-accent-soft: #e8f7ef;

  --color-text: #1a1f1e;
  --color-text-muted: #5c6562;
  --color-bg: #fafcfb;
  --color-surface: #ffffff;
  --color-border: #dfe8e3;

  --font-sans:
    "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, sans-serif;
  --font-heading: "Segoe UI", system-ui, -apple-system, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(13, 122, 79, 0.08);
  --shadow-md: 0 4px 20px rgba(13, 122, 79, 0.12);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);

  --header-height: 72px;
  --max-width: 1200px;
  --transition: 0.25s ease;
  --focus-ring: 0 0 0 3px rgba(13, 122, 79, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

@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 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 var(--space-md);
}

ul,
ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

/* Skip link — accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: 10000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
  outline: 3px solid #fff;
}

/* Layout — .container is its own block; horizontal padding is not doubled inside sections */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.section--alt {
  background: var(--color-surface);
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
}

.section__eyebrow {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.section__title {
  margin-bottom: var(--space-sm);
}

.section__intro {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Page shell */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page__main {
  flex: 1;
  padding-top: var(--header-height);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs__item:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-sm);
  color: var(--color-border);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

/* Legal / article prose */
.prose {
  max-width: 720px;
}

.prose h2 {
  margin-top: var(--space-2xl);
}

.prose h3 {
  margin-top: var(--space-xl);
}

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}
