/* ============================================================
   A11Y / TOUCH TARGETS — lot R4
   Chargé en dernier : n'altère aucune couleur ni aucun dessin,
   étend uniquement les zones tactiles et l'état de focus.
   ============================================================ */

/* ---------- 1. Extension de zone (le visuel ne bouge pas) ---------- */

.header-theme-toggle,
.user-avatar,
.wg-as-close,
.wg-cal__arrow,
.wg-planning__more,
.filter-panel-close,
.wg-of-more__btn,
.wg-of-actions-badge,
.chat-action-btn,
.back-btn-mobile,
.back-link,
.view-toggles button,
.brand-logo,
.wg-form-checkbox,
button[role="checkbox"] {
  position: relative;
}

.header-theme-toggle::after,
.user-avatar::after,
.wg-as-close::after,
.wg-cal__arrow::after,
.wg-planning__more::after,
.filter-panel-close::after,
.wg-of-more__btn::after,
.wg-of-actions-badge::after,
.chat-action-btn::after,
.back-btn-mobile::after,
.back-link::after,
.view-toggles button::after,
.brand-logo::after,
button[role="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px);
  height: max(100%, 44px);
  border-radius: inherit;
  background: transparent;
  pointer-events: auto;
}

/* le label associé à une case reste cliquable sur toute sa hauteur */
label:has(> button[role="checkbox"]),
label:has(+ button[role="checkbox"]),
.form-checkbox-row {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ---------- 2. Boutons texte : hauteur réelle ---------- */

.btn {
  min-height: 44px;
}
.btn-sm {
  min-height: 40px;
}
@media (min-width: 768px) {
  .btn { min-height: 40px; }
}

.wg-of-btn,
.wg-of-segmented__btn,
.offers-tab,
.wg-tabs button,
.wg-opp-row__cta,
.wg-day-row__edit,
.wg-opp__cta,
.wg-goal__cta,
.wg-opps__link,
.wg-taff__btn,
.wg-taff__see-all,
.wg-mis__btn,
.wg-od-pass,
.wg-act__badges-link,
.wg-as-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* liens "voir tout" : la zone grandit, le texte reste aligné à sa colonne */
.wg-opps__link,
.wg-taff__see-all,
.wg-act__badges-link {
  justify-content: flex-start;
}

/* ---------- 3. Calendrier planning ---------- */

.wg-cal__grid {
  touch-action: pan-y;
}
.wg-cal__cell {
  min-height: 44px;
}

/* ---------- 4. Confort et accessibilité ---------- */

button,
a,
[role="button"],
[role="tab"],
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:active,
[role="button"]:active,
[role="tab"]:active,
a.btn:active {
  transform: scale(0.98);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* éléments d'interface non textuels : pas de sélection accidentelle */
.offers-tab,
.wg-of-segmented__btn,
.wg-tabs button,
.wg-cal__cell,
.wg-cal__arrow,
.view-toggles button,
.wg-as-chip,
.bottom-nav,
.bottom-nav * {
  user-select: none;
  -webkit-user-select: none;
}

/* mais les montants et adresses restent copiables */
.wg-amount,
.amt,
[data-copyable],
address,
.wg-mis__address,
.wg-od-address {
  user-select: text;
  -webkit-user-select: text;
}

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

/* ---------- 5. Priorité sur les CSS importés côté JS (bundle) ---------- */
.wg-as-chip.wg-as-chip,
.wg-mis__btn.wg-mis__btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wg-as-close.wg-as-close { position: relative; }
.wg-as-close.wg-as-close::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px);
  height: max(100%, 44px);
  border-radius: inherit;
  background: transparent;
}

/* ---------- 6. Compléments détectés à l'audit 390 px ---------- */
.wg-accept__btn.wg-accept__btn,
.wg-shift__btn.wg-shift__btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wg-of-focus-btn,
.wg-of-radius-btn,
.page-title-back,
.dots-btn,
.wg-week__flame { position: relative; }

.wg-of-focus-btn::after,
.wg-of-radius-btn::after,
.page-title-back::after,
.dots-btn::after,
.wg-week__flame::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px);
  height: max(100%, 44px);
  border-radius: inherit;
  background: transparent;
}

/* ---------- 7. Contrôle R5 : cibles manquées dans les overlays ---------- */
.wg-modal__close,
.wg-od-maps,
.lexkit-toolbar-button,
a.user-img { position: relative; }

.wg-modal__close::after,
.wg-od-maps::after,
.lexkit-toolbar-button::after,
a.user-img::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: max(100%, 44px);
  height: max(100%, 44px);
  border-radius: inherit;
  background: transparent;
}

.wg-chat-quick__chip,
.send-code,
.wg-confirm__actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* pilules horaires de la semaine type : pas de zone 44px (lignes contiguës) */
.wg-modal__quick button { min-height: 40px; }

/* select de l'éditeur riche : 16px pour éviter le zoom iOS */
.rte-block-select { font-size: 16px; }

/* ---------- 8. Parcours d'inscription ---------- */
.sgn-resend,
.sgn-ghost {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* .sgn-eye fait déjà 44x44 et se positionne dans le champ (signup.css) :
   aucune surcharge ici, sinon le bouton perd son ancrage à droite. */
