/*
 * mobile.css — shared responsive layer for every page on the site.
 *
 * This is the site's own "ADAPTATION MOBILE" block (already found baked
 * into mycookies.html and legalnotice.html) promoted to a shared file and
 * extended so it actually covers every page on the site, not just those
 * two. Loaded AFTER the page's own <style> block, so these rules win.
 *
 * The hamburger button/panel below is injected by mobile-nav.js — hidden
 * here by default so it never appears (unstyled) on a page viewed above
 * the 680px breakpoint.
 */
.mobile-nav-toggle { display: none; }

@media (max-width: 680px) {
  /* Global readability: less dead vertical space per section, and no
     compounding 150px-top + 150px-bottom padding stacked on top of a
     100vh hero on a small screen. */
  section { padding: 56px 0 !important; }
  .hero { height: auto !important; min-height: 92svh !important; padding: 90px 20px 40px !important; }
  body { line-height: 1.55 !important; }
  html, body { overflow-x: hidden !important; }

  /* Titres génériques */
  h1 { font-size: 32px !important; letter-spacing: -1px !important; }
  h1.page-title { margin: 90px 16px 10px !important; }
  /* Support / Tutorials / Contact / Forums use the older inline pattern
     (style="font-size:60px;margin:80px 0 20px 190px") instead of the
     .page-title class — this catches them too. */
  h1[style*="190px"] { margin: 90px 16px 10px !important; font-size: 32px !important; }
  .page-subtitle { margin: 0 16px 24px !important; font-size: 13px !important; }
  h2 { font-size: 26px !important; margin-bottom: 20px !important; }
  .description-large { font-size: 14px !important; margin-bottom: 30px !important; }

  /* Conteneurs principaux */
  #main-content { padding-left: 16px !important; padding-right: 16px !important; max-width: 100% !important; }
  /* Help.html imbrique #main-content DANS .page-wrap : les deux ont un
     padding-left, donc sans ce reset le contenu se retrouvait avec un
     retrait à gauche deux fois plus grand qu'à droite. */
  .page-wrap { padding-left: 0 !important; padding-top: 70px !important; }
  .container { padding-left: 14px !important; padding-right: 14px !important; }

  /* Liens/valeurs longues (URLs, emails) qui débordaient de leur carte
     au lieu de passer à la ligne. */
  .official-item-value, .official-item-value a,
  .contact-info-item div a, .contact-info-item div span {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  /* Nav — hamburger menu (mobile-nav.js) instead of a cramped
     horizontally-scrolling strip of 11px links. On pages with no links
     (brand-only nav, e.g. legalnotice/mycookies) mobile-nav.js never
     injects the toggle, so these rules simply don't apply there. */
  nav .nav-container { padding: 0 16px !important; position: relative; }

  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-toggle span,
  .mobile-nav-toggle span::before,
  .mobile-nav-toggle span::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: #1d1d1f;
    transition: transform 0.25s ease, opacity 0.15s ease, background 0.15s ease;
  }
  .mobile-nav-toggle span { position: relative; background: #1d1d1f; }
  .mobile-nav-toggle span::before { position: absolute; left: 0; top: -6px; }
  .mobile-nav-toggle span::after { position: absolute; left: 0; top: 6px; }
  .mobile-nav-toggle.open span { background: transparent; }
  .mobile-nav-toggle.open span::before { transform: translateY(6px) rotate(45deg); }
  .mobile-nav-toggle.open span::after { transform: translateY(-6px) rotate(-45deg); }

  nav .nav-container > div[data-mobile-links] {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: fixed !important;
    top: 52px !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100vw !important;
    max-height: 0 !important;
    overflow: hidden !important;
    white-space: normal !important;
    background: rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    transition: max-height 0.28s ease !important;
    z-index: 9999 !important;
  }
  nav .nav-container > div[data-mobile-links].open {
    max-height: 80vh !important;
    overflow-y: auto !important;
  }
  nav .nav-container > div[data-mobile-links] a {
    margin: 0 !important;
    padding: 16px 20px !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    display: block !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(0,0,0,0.06) !important;
    opacity: 0.9 !important;
  }
  nav .nav-container > div[data-mobile-links] a::after { display: none !important; }

  /* Grilles -> 1 colonne partout */
  .official-banner, .about-grid, .contact-grid, .specs-grid, .help-grid,
  .product-grid, .form-row, .details-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Cartes / cases */
  .card, .about-card, .official-item, .spec-card, .help-card, .detail-item,
  .contact-info, .contact-form-wrap, .info-box, .tuto-card { padding: 18px !important; }
  .card h3, .help-card h3 { font-size: 20px !important; margin-bottom: 8px !important; }
  .card p, .help-card p { font-size: 14px !important; }

  /* Sliders images */
  .slider-wrapper { height: 220px !important; margin-bottom: 24px !important; }
  .slide-overlay { padding: 16px !important; }
  .slide-overlay h3 { font-size: 20px !important; }
  .slider-dots { margin-top: -36px !important; margin-bottom: 24px !important; }

  /* Bandeaux sombres (Suite CS, TaskSchool, Redisk, Help hero) */
  .github-bar { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; padding: 20px !important; margin-left: 0 !important; }
  .github-bar h2 { font-size: 26px !important; }
  .github-bar > a.github-btn, .github-btn { width: 100% !important; text-align: center !important; box-sizing: border-box !important; }

  /* Boutons pleine largeur */
  .btn-actu, .btn-download-all, .btn, .btn-send, .btn-contact-strip,
  .forum-cta-btn, .footer-legal-btn, .btn-home, .btn-back {
      width: 100% !important; box-sizing: border-box !important; text-align: center !important; justify-content: center !important;
  }

  /* Pages d'erreur / coming soon */
  .error-code { font-size: 70px !important; }
  .error-title { font-size: 20px !important; }
  .error-desc { font-size: 14px !important; }

  /* Tableaux cookies — scrollent horizontalement dans leur propre cadre
     (au lieu d'être coupés par overflow-x:hidden sur le body, ou de
     forcer tout le texte des descriptions sur une seule ligne). */
  .table-scroll { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; margin: 0 -16px !important; padding: 0 16px !important; }
  table.cookie-table { min-width: 640px; }
  table.cookie-table, table.cookie-table th, table.cookie-table td { font-size: 11px !important; padding: 7px 8px !important; }

  /* Barres qui passent en colonne */
  .status-box, .contact-strip, .actions-row, .forum-cta, .forum-header,
  .forum-header-right, .official-item, .contact-info-item,
  .new-post-area-label { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; }

  /* Forum : zones de vote/actions un peu petites au doigt sur desktop */
  .vote-btn, .action-btn { padding: 9px 12px !important; font-size: 13px !important; }
  .post-title { font-size: 17px !important; }
  .post-body, .reply-body { font-size: 14.5px !important; line-height: 1.6 !important; }

  /* Formulaires — 16px minimum évite le zoom auto iOS au focus */
  .contact-inputs input, .contact-inputs textarea, .contact-inputs select,
  .post-inputs input, .post-inputs textarea, .reply-form input, .reply-form textarea,
  .modal-input, .search-wrap input { font-size: 16px !important; padding: 10px !important; }
  .search-wrap input { padding: 16px 18px !important; }

  /* Compte à rebours (TaskSchool 2.0 teaser) */
  .timer-grid { flex-wrap: wrap !important; gap: 8px !important; }
  .timer-box { width: 60px !important; padding: 12px 0 !important; }
  .timer-num { font-size: 22px !important; }
  .captcha-modal { width: 88vw !important; padding: 24px !important; box-sizing: border-box !important; }

  /* Hero page d'accueil */
  #main-logo { width: 70px !important; margin-bottom: 20px !important; }
  .hero-sub { font-size: 15px !important; max-width: 90vw !important; }
  .footer-cta-container { padding-bottom: 40px !important; margin-bottom: 40px !important; }
  div[style*="width:80%"], div[style*="width: 80%"] { width: 100% !important; }

  /* Forum */
  .post-item { padding: 16px !important; }
  .post-actions { gap: 8px !important; }
  .new-post-area { padding: 16px !important; }
  .reply-form { padding: 12px !important; }

  /* Help center */
  .accordion-trigger { padding: 14px 16px !important; font-size: 14px !important; }
  .accordion-body { padding: 0 16px !important; }
  .accordion-body.open { padding: 0 16px 18px !important; }
  .step { flex-direction: column !important; }
  #hc-modal { padding: 22px !important; box-sizing: border-box !important; }
  .modal-actions { flex-direction: column-reverse !important; }
  .modal-actions button { width: 100%; }

  /* Specs produit (Redisk/PenCS/Altos/TaskSchool 3.0) */
  .title-row { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
}
