/* =========================================
   STYLES RESPONSIVE - Cabinet Infirmier Qual'Idel
   Mobile-First Approach
   ========================================= */

/* === TABLETTE (768px et plus) === */
@media (max-width: 768px) {
  /* Typographie */
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-xl); }

  /* Header */
  .header {
    height: var(--header-height-mobile);
  }

  .header-container {
    padding: 0 var(--spacing-md);
  }

  .logo-text {
    font-size: var(--font-size-lg);
  }

  /* Navigation mobile */
  .nav-menu {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all var(--transition-base);
  }

  .nav-menu.active {
    max-height: 500px;
    opacity: 1;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--color-neutral-medium);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height-mobile) + var(--spacing-2xl));
    padding-bottom: var(--spacing-3xl);
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .hero-text h1 {
    font-size: var(--font-size-3xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .hero-image {
    order: -1;
  }

  .hero-image-placeholder {
    max-width: 300px;
  }

  /* Sections */
  .section {
    padding: var(--spacing-3xl) 0;
  }

  .section-title {
    font-size: var(--font-size-2xl);
  }

  .section-subtitle {
    font-size: var(--font-size-base);
  }

  /* Cards */
  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* Témoignages */
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* Info pratiques */
  .info-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  /* Boutons */
  .btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-base);
  }

  /* Back to top */
  .back-to-top {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 45px;
    height: 45px;
  }
  
  .mobile-only {
    display: inline-flex !important;
  }
}

/* === MOBILE (640px et moins) === */
@media (max-width: 640px) {
  /* Typographie */
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }

  /* Container */
  .container {
    padding: 0 var(--spacing-md);
  }

  /* Hero */
  .hero-text h1 {
    font-size: var(--font-size-2xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xl);
  }

  .hero-image-placeholder {
    max-width: 250px;
  }

  /* Sections */
  .section {
    padding: var(--spacing-2xl) 0;
  }

  .section-header {
    margin-bottom: var(--spacing-2xl);
  }

  /* Cards */
  .card {
    padding: var(--spacing-lg);
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-xl);
  }

  /* Témoignages */
  .testimonial {
    padding: var(--spacing-lg);
  }

  .testimonial::before {
    font-size: 3rem;
  }

  /* Info pratiques */
  .info-item {
    padding: var(--spacing-lg);
  }

  .info-icon {
    width: 60px;
    height: 60px;
    font-size: var(--font-size-xl);
  }

  /* Formulaire */
  .form-input,
  .form-textarea {
    font-size: var(--font-size-base);
  }

  /* Map */
  .map-container {
    height: 300px;
  }

  /* Footer */
  .footer {
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
  }

  /* Back to top */
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
  }
}

/* === TRÈS PETIT MOBILE (480px et moins) === */
@media (max-width: 480px) {
  /* Typographie */
  h1 { font-size: var(--font-size-xl); }
  h2 { font-size: var(--font-size-lg); }

  .logo-text {
    font-size: var(--font-size-md);
  }

  .logo-subtitle {
    display: none;
  }

  /* Hero */
  .hero-text h1 {
    font-size: var(--font-size-xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-sm);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-sm);
  }

  /* Cards */
  .card-grid {
    gap: var(--spacing-md);
  }

  .card-title {
    font-size: var(--font-size-lg);
  }
}

/* === GRAND ÉCRAN (1280px et plus) === */
@media (min-width: 1280px) {
  /* Hero */
  .hero-text h1 {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: var(--font-size-xl);
  }

  /* Sections */
  .section-title {
    font-size: 3rem;
  }

  /* Cards */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Témoignages */
  .testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Info pratiques */
  .info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* === TRÈS GRAND ÉCRAN (1536px et plus) === */
@media (min-width: 1536px) {
  /* Hero */
  .hero-text h1 {
    font-size: 4rem;
  }

  .hero-image-placeholder {
    max-width: 600px;
  }
}

/* === ACCESSIBILITÉ === */

/* Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Mode contraste élevé */
@media (prefers-contrast: high) {
  :root {
    --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 0 0 2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 0 0 3px rgba(0, 0, 0, 0.5);
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* === IMPRESSION === */
@media print {
  /* Masquer les éléments non nécessaires */
  .header,
  .nav,
  .hero-cta,
  .btn,
  .back-to-top,
  .page-loader,
  .nav-toggle {
    display: none !important;
  }

  /* Ajuster les couleurs pour l'impression */
  body {
    color: #000000;
    background: #ffffff;
  }

  /* Éviter les sauts de page dans les éléments */
  .card,
  .testimonial,
  .info-item {
    page-break-inside: avoid;
  }

  /* Afficher les liens en entier */
  a[href]::after {
    content: " (" attr(href) ")";
  }

  /* Supprimer les ombres */
  * {
    box-shadow: none !important;
  }
}

/* === ORIENTATION === */

/* Landscape sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height-mobile) + var(--spacing-xl));
    padding-bottom: var(--spacing-2xl);
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  .hero-image {
    order: 0;
  }
}

/* === TOUCH DEVICES === */
@media (hover: none) and (pointer: coarse) {
  /* Augmenter les zones de clic sur tactile */
  .btn,
  .nav-link,
  .nav-toggle {
    min-height: 44px;
    min-width: 44px;
  }

  /* Supprimer les effets de survol sur tactile */
  .card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  .back-to-top:hover {
    transform: none;
  }
}
