/**
 * Main Stylesheet
 * ERAMA - Diagnostic & Transformation Organisationnelle
 *
 * Mobile-first responsive design approach
 */

/* ===========================================
   CSS RESET / NORMALIZE
   Modern CSS reset for consistent cross-browser styling
   =========================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Prevent font size inflation on mobile */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: var(--line-height-normal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-dark);
  background-color: var(--background-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@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;
    scroll-behavior: auto !important;
  }
}

/* Remove default button styles */
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Remove default anchor styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Make images easier to work with */
img,
picture,
svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
}

/* ===========================================
   BASE TYPOGRAPHY
   Headings, paragraphs, and text styles
   =========================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-dark);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

p {
  line-height: var(--line-height-relaxed);
  color: var(--text-medium);
}

strong {
  font-weight: var(--font-weight-semibold);
  color: var(--text-dark);
}

/* Responsive typography - larger screens */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }
}

/* ===========================================
   LAYOUT - CONTAINER
   Responsive container with max-width constraints
   =========================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

/* Narrower container for text-heavy content */
.container--narrow {
  max-width: var(--container-md);
}

/* Wide container for full-width sections */
.container--wide {
  max-width: var(--container-max);
}

/* ===========================================
   LAYOUT - SECTIONS
   Base section styling with consistent padding
   =========================================== */

section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* Alternating section backgrounds */
section:nth-of-type(even) {
  background-color: var(--background-light);
}

/* Section headers (common pattern) */
section header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

section header h2 {
  margin-bottom: var(--space-sm);
}

section header p {
  font-size: var(--text-lg);
  color: var(--text-light);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================================
   BUTTONS - BASE STYLES
   Reusable button component
   =========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn:focus-visible {
  outline: 3px solid var(--primary-dark);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(10, 147, 150, 0.25);
}

/* Primary button - filled with brand color */
.btn--primary {
  background-color: var(--primary-color);
  color: var(--background-white);
  border-color: var(--primary-color);
}

.btn--primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Secondary button - outlined */
.btn--secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn--secondary:hover {
  background-color: var(--primary-color);
  color: var(--background-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--secondary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Large button variant */
.btn--large {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-lg);
}

/* Button icon styling */
.btn__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.btn--large .btn__icon {
  width: 24px;
  height: 24px;
}

/* ===========================================
   UTILITY CLASSES
   Helper classes for common patterns
   =========================================== */

/* Screen reader only - visually hidden but accessible */
.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 alignment */
.text-center {
  text-align: center;
}

/* Spacing utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ===========================================
   FOCUS STYLES
   Accessible focus indicators (WCAG 2.1 Level AA)
   =========================================== */

:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ===========================================
   HEADER / NAVIGATION
   Fixed navigation bar with mobile menu toggle
   =========================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background-color: var(--banner-dark);
  box-shadow: none;
  transition: box-shadow var(--transition-normal), background-color var(--transition-normal);
}

/* Header scrolled state - enhanced shadow */
.header--scrolled {
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

/* Navigation Logo */
.nav__logo {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--background-white);
  transition: color var(--transition-fast);
}

.nav__logo:hover {
  color: var(--banner-orange);
}

.nav__logo-text {
  white-space: nowrap;
}

/* Navigation List - Mobile (hidden by default) */
.nav__list {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background-color: var(--banner-dark);
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg) 0;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
}

/* Mobile menu open state */
.nav__list--open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav__item {
  width: 100%;
  text-align: center;
}

.nav__link {
  display: block;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--banner-text-light);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav__link:hover,
.nav__link:focus {
  color: var(--background-white);
  background-color: rgba(255, 255, 255, 0.1);
}

.nav__link--active {
  color: var(--banner-orange);
}

/* Mobile Menu Toggle Button */
.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: var(--space-sm);
  cursor: pointer;
  z-index: var(--z-fixed);
}

.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--background-white);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* Hamburger to X animation */
.nav__toggle--active .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle--active .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle--active .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop Navigation - 768px and up */
@media (min-width: 768px) {
  .nav {
    height: 80px;
  }

  .nav__logo {
    font-size: var(--text-xl);
  }

  .nav__list {
    position: static;
    display: flex;
    flex-direction: row;
    transform: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
    gap: var(--space-sm);
    background-color: transparent;
    box-shadow: none;
  }

  .nav__item {
    width: auto;
  }

  .nav__link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
  }

  .nav__link:hover,
  .nav__link:focus {
    background-color: rgba(255, 255, 255, 0.1);
  }

  /* Hide mobile toggle on desktop */
  .nav__toggle {
    display: none;
  }
}

/* ===========================================
   FOOTER
   Site footer with branding and links
   =========================================== */

.footer {
  background-color: var(--text-dark);
  color: var(--background-light);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-lg);
}

.footer__container {
  width: 100%;
}

/* Footer Content - Main section */
.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-lg);
}

/* Footer Brand */
.footer__brand {
  text-align: center;
}

.footer__logo {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--background-white);
  margin-bottom: var(--space-xs);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
}

/* Footer Social Links */
.footer__links {
  display: flex;
  gap: var(--space-md);
}

.footer__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: var(--background-white);
  transition: background-color var(--transition-normal), color var(--transition-normal), transform var(--transition-normal);
}

.footer__link:hover {
  background-color: var(--primary-color);
  color: var(--background-white);
  transform: translateY(-2px);
}

.footer__link svg {
  width: 20px;
  height: 20px;
}

/* Footer Bottom - Copyright */
.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer__copyright {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
}

.footer__copyright a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.footer__copyright a:hover {
  color: var(--background-white);
}

/* Tablet - 640px and up */
@media (min-width: 640px) {
  .footer__content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .footer__brand {
    text-align: left;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Desktop - 768px and up */
@media (min-width: 768px) {
  .footer {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-xl);
  }

  .footer__content {
    padding-bottom: var(--space-2xl);
    margin-bottom: var(--space-xl);
  }

  .footer__logo {
    font-size: var(--text-2xl);
  }

  .footer__link {
    width: 48px;
    height: 48px;
  }

  .footer__link svg {
    width: 22px;
    height: 22px;
  }
}
