/**
 * BOOSTACADEMY.AI - Base Styles
 * Reset + Typographie + Éléments de base
 *
 * Dépend de : variables.css
 */

/* ===========================================
   RESET (Modern CSS Reset)
   =========================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--color-text-body);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Évite le scroll horizontal des pseudo-éléments pleine largeur */
}

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

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default focus styles for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===========================================
   TYPOGRAPHIE
   =========================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: var(--text-3xl);
}

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

h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

/* Responsive headings */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }
}

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

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

strong, b {
  font-weight: var(--font-semibold);
}

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

/* Lead text */
.lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

@media (min-width: 768px) {
  .lead {
    font-size: var(--text-xl);
  }
}

/* ===========================================
   LIENS
   =========================================== */

a:not([class]) {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:not([class]):hover {
  color: var(--color-primary-hover);
}

/* ===========================================
   LISTES (dans le contenu)
   =========================================== */

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

.content ul {
  list-style-type: disc;
}

.content ol {
  list-style-type: decimal;
}

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

.content li:last-child {
  margin-bottom: 0;
}

/* ===========================================
   IMAGES
   =========================================== */

img {
  font-style: italic; /* Alt text styling */
}

/* ===========================================
   SÉLECTION
   =========================================== */

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ===========================================
   LAYOUT HELPERS
   =========================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

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

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

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

/* Section spacing */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

/* Alternate background sections */
.section--alt {
  background-color: var(--color-bg-alt);
}

/* ===========================================
   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: 0;
}
