/*
 * ThinkMe Press — Base Styles v1.1.0
 * Reset · Typography · Accessibility · Print
 * NOTE: .site-main padding is managed in layout.css only.
 */

/* ── RESET ──────────────────────────────────────────────── */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

body {
  font-family: var(--tm-font-body);
  font-size: var(--tm-text-base);
  font-weight: var(--tm-weight-regular);
  line-height: var(--tm-leading-relaxed);
  color: var(--tm-text-body);
  background-color: var(--tm-surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

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

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

/* ── DOCUMENT STRUCTURE ─────────────────────────────────── */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

/* .site-main padding is set in layout.css */
.site-main {
  flex: 1;
}

/* ── CONTAINERS ─────────────────────────────────────────── */

.tm-container {
  width: 100%;
  max-width: var(--tm-container-max);
  margin-inline: auto;
  padding-inline: var(--tm-container-px);
}

.tm-container--wide {
  max-width: var(--tm-container-wide);
}

.tm-container--text {
  max-width: var(--tm-container-text);
}

.tm-container--narrow {
  max-width: var(--tm-container-narrow);
}

@media (min-width: 1400px) {
  .tm-container {
    padding-inline: var(--tm-container-px-lg);
  }
}

/* ── HEADINGS ────────────────────────────────────────────── */

h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
  font-family: var(--tm-font-display);
  color: var(--tm-text-heading);
  font-weight: var(--tm-weight-bold);
  line-height: var(--tm-leading-snug);
  letter-spacing: var(--tm-tracking-tight);
}

h1, .h1 {
  font-size: clamp(var(--tm-text-4xl), 5vw, var(--tm-text-6xl));
  line-height: var(--tm-leading-tight);
}

h2, .h2 {
  font-size: clamp(var(--tm-text-3xl), 4vw, var(--tm-text-5xl));
  line-height: var(--tm-leading-snug);
}

h3, .h3 {
  font-size: clamp(var(--tm-text-xl), 2.5vw, var(--tm-text-3xl));
  font-weight: var(--tm-weight-medium);
  line-height: var(--tm-leading-heading);
}

h4, .h4 {
  font-size: var(--tm-text-xl);
  font-weight: var(--tm-weight-medium);
  line-height: var(--tm-leading-heading);
}

h5, .h5 {
  font-size: var(--tm-text-lg);
  font-weight: var(--tm-weight-medium);
  font-family: var(--tm-font-body);
}

h6, .h6 {
  font-size: var(--tm-text-sm);
  font-weight: var(--tm-weight-semibold);
  font-family: var(--tm-font-ui);
  letter-spacing: var(--tm-tracking-wide);
  text-transform: uppercase;
  color: var(--tm-text-muted);
}

/* ── BODY TEXT ───────────────────────────────────────────── */

p {
  font-size: var(--tm-text-base);
  line-height: var(--tm-leading-relaxed);
  color: var(--tm-text-body);
  max-width: var(--tm-container-text);
}

.lead, .tm-lead {
  font-size: var(--tm-text-lg);
  font-weight: var(--tm-weight-light);
  line-height: var(--tm-leading-relaxed);
  color: var(--tm-text-body);
}

.tm-overline {
  font-family: var(--tm-font-ui);
  font-size: var(--tm-text-xs);
  font-weight: var(--tm-weight-semibold);
  letter-spacing: var(--tm-tracking-widest);
  text-transform: uppercase;
  color: var(--tm-color-primary);
  display: flex;
  align-items: center;
  gap: var(--tm-space-2);
  margin-block-end: var(--tm-space-3);
}

.tm-overline::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

blockquote, .tm-blockquote {
  font-family: var(--tm-font-display);
  font-size: clamp(var(--tm-text-xl), 2.5vw, var(--tm-text-2xl));
  font-weight: var(--tm-weight-light);
  font-style: italic;
  line-height: var(--tm-leading-heading);
  color: var(--tm-text-heading);
  border-inline-start: 3px solid var(--tm-color-accent);
  padding-inline-start: var(--tm-space-8);
  margin-block: var(--tm-space-8);
  max-width: var(--tm-container-text);
}

/* ── LINKS ───────────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tm-transition);
}

a:hover {
  color: var(--tm-color-primary);
}

.tm-link {
  color: var(--tm-text-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--tm-transition), color var(--tm-transition);
}

.tm-link:hover {
  color: var(--tm-text-link-hover);
  text-decoration-color: var(--tm-color-accent);
}

/* ── LISTS ───────────────────────────────────────────────── */

ul, ol {
  padding-inline-start: var(--tm-space-6);
}

li + li {
  margin-block-start: var(--tm-space-2);
}

.tm-list-unstyled {
  list-style: none;
  padding-inline-start: 0;
}

/* ── HR ──────────────────────────────────────────────────── */

hr, .tm-divider {
  border: none;
  border-block-end: 1px solid var(--tm-border-default);
  margin-block: var(--tm-space-8);
}

/* ── FOCUS & ACCESSIBILITY ───────────────────────────────── */

:focus-visible {
  outline: none;
  box-shadow: var(--tm-focus-ring);
  border-radius: var(--tm-radius-xs);
}

.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;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--tm-space-4);
  background: var(--tm-color-primary);
  color: white;
  padding: var(--tm-space-2) var(--tm-space-5);
  border-radius: var(--tm-radius-sm);
  font-family: var(--tm-font-ui);
  font-size: var(--tm-text-sm);
  font-weight: var(--tm-weight-medium);
  z-index: var(--tm-z-toast);
  transition: inset-block-start var(--tm-transition-fast);
}

.skip-link:focus {
  inset-block-start: var(--tm-space-4);
}

/* ── SELECTION ───────────────────────────────────────────── */

::selection {
  background-color: rgba(59, 151, 211, 0.2);
  color: var(--tm-blue-900);
}

/* ── PRINT ───────────────────────────────────────────────── */

@media print {
  .site-header,
  .site-footer,
  .tm-nav,
  [data-no-print] {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */

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