/* ==========================================================================
   Responsive - Media queries
   ========================================================================== */

/*
   Breakpoints:
   - Mobile: < 576px
   - Grand mobile: 576px - 767px
   - Tablette: 768px - 1023px
   - Desktop: >= 1024px
*/

/* ===== MOBILE FIRST (styles de base dans les autres fichiers) ===== */

/* ===== GRAND MOBILE (>= 576px) ===== */
@media (min-width: 576px) {
  /* Layout */
  .container {
    padding: 0 var(--spacing-lg);
  }

  /* Homepage grid */
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cards */
  .sheet-card-featured {
    flex-direction: row;
  }

  .sheet-card-featured .sheet-card-thumb {
    width: 120px;
    height: auto;
  }

  /* Boutons */
  .download-buttons {
    flex-direction: row;
  }

  .btn-download {
    width: auto;
  }
}

/* ===== TABLETTE (>= 768px) ===== */
@media (min-width: 768px) {
  /* Typographie */
  h1 {
    font-size: var(--font-size-4xl);
  }

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

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

  .menu-toggle {
    display: none;
  }

  .main-nav {
    display: flex;
  }

  .lang-switcher {
    display: flex;
  }

  .header-search {
    display: flex;
  }

  /* Layout */
  .site-main {
    padding-top: calc(var(--header-height) + var(--spacing-2xl));
  }

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

  .footer-support {
    margin-top: 0;
    text-align: right;
  }

  /* Page title */
  .page-title {
    font-size: var(--font-size-4xl);
  }

  /* Single sheet */
  .sheet-title {
    font-size: var(--font-size-3xl);
  }

  .sheet-downloads-buttons {
    flex-direction: row;
  }

  /* Comment form */
  .comment-form-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
}

/* ===== DESKTOP (>= 1024px) ===== */
@media (min-width: 1024px) {
  /* Layout */
  .container {
    padding: 0 var(--spacing-xl);
  }

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

  .sheet-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Layout avec sidebar */
  .layout-with-sidebar {
    grid-template-columns: 1fr var(--sidebar-width);
  }

  /* Single sheet */
  .sheet-title {
    font-size: var(--font-size-4xl);
  }
}

/* ===== GRAND DESKTOP (>= 1200px) ===== */
@media (min-width: 1200px) {
  /* Optionnel: styles pour grands écrans */
}

/* ===== STYLES MOBILES UNIQUEMENT ===== */
@media (max-width: 575px) {
  /* Boutons full width */
  .btn-download {
    width: 100%;
    justify-content: center;
  }

  /* Cards compactes */
  .sheet-card-thumb {
    width: 60px;
    height: 60px;
  }

  /* Tables en mode carte */
  .results-table-mobile thead {
    display: none;
  }

  .results-table-mobile tbody tr {
    display: block;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
  }

  .results-table-mobile tbody td {
    display: block;
    padding: var(--spacing-xs) 0;
    border: none;
  }
}

/* ===== STYLES TABLETTE ET MOINS ===== */
@media (max-width: 767px) {
  /* Navigation mobile visible */
  .mobile-nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav.is-active {
    transform: translateX(0);
  }

  /* Header simplifié */
  .header-search {
    display: none;
  }

  .lang-switcher {
    display: none;
  }
}

/* ===== ORIENTATION PAYSAGE MOBILE ===== */
@media (max-width: 767px) and (orientation: landscape) {
  .site-header {
    height: 56px;
  }

  .site-main {
    padding-top: calc(56px + var(--spacing-lg));
  }
}

/* ===== 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;
    scroll-behavior: auto !important;
  }
}

/* ===== MODE SOMBRE (préparation future) ===== */
@media (prefers-color-scheme: dark) {
  /* À activer si besoin
  :root {
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-text: #f1f5f9;
    --color-text-light: #94a3b8;
    --color-text-muted: #64748b;
    --color-border: #334155;
    --color-border-light: #1e293b;
  }
  */
}

/* ===== PRINT ===== */
@media print {
  .site-header,
  .site-footer,
  .mobile-nav,
  .mobile-nav-overlay,
  .menu-toggle,
  .search-form,
  .btn-download,
  .sheet-support {
    display: none !important;
  }

  .site-main {
    padding-top: 0;
  }

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

  a {
    color: #000;
    text-decoration: underline;
  }

  .sheet-video-wrapper {
    display: none;
  }
}
