/* Fonds Social YCM — protections responsive ciblées V63.
   Cette feuille complète la mise en page stable sans redéfinir globalement
   les grilles, les largeurs ou les composants historiques. */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#root,
#root .app-shell,
#root .main-area,
#root .content {
  min-width: 0;
  max-width: 100%;
}

/* Keep component-specific image heights (covers, galleries and logos). */
#root img,
#root video,
#root canvas {
  max-width: 100%;
}

/* Cartes exclusives : titre, tarif et accompagnants restent dans la carte. */
#root .exclusive-offer-layout .event-card-main {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

#root .exclusive-offer-layout .event-card-main > .event-info,
#root .exclusive-offer-layout .event-card-main > .event-commercial,
#root .exclusive-offer-layout .event-card-main > .event-register {
  width: calc(100% - 36px) !important;
  max-width: calc(100% - 36px) !important;
  margin-right: 18px !important;
  margin-left: 18px !important;
  box-sizing: border-box !important;
}

#root .exclusive-offer-layout .event-info {
  padding: 20px 0 0 !important;
  overflow: visible !important;
}

#root .exclusive-offer-layout .event-title-button {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  margin: 0 0 8px !important;
  padding: 0 24px 0 0 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  transform: none !important;
  overflow-wrap: anywhere !important;
}

#root .exclusive-offer-layout .event-title-button > span {
  position: absolute !important;
  top: .2em !important;
  right: 0 !important;
}

#root .exclusive-offer-layout .event-info > span {
  display: block !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.5 !important;
}

#root .exclusive-offer-layout .event-commercial.has-companions,
#root .exclusive-offer-layout .event-commercial.single-price {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  width: calc(100% - 36px) !important;
  height: auto !important;
  overflow: visible !important;
}

#root .exclusive-offer-layout .event-commercial > .event-price {
  position: static !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  grid-column: auto !important;
  grid-row: auto !important;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 72px !important;
  padding: 12px 14px !important;
  border-top: 0 !important;
  border-left: 0 !important;
  box-sizing: border-box !important;
}

#root .exclusive-offer-layout .event-commercial > .event-price + .event-price {
  border-top: 1px solid #dfe7eb !important;
  border-left: 0 !important;
}

#root .exclusive-offer-layout .event-price > span {
  width: 40px !important;
  height: 40px !important;
}

#root .exclusive-offer-layout .event-price > div {
  min-width: 0 !important;
  width: 100% !important;
}

#root .exclusive-offer-layout .event-price :is(small, strong),
#root .exclusive-offer-layout .event-commercial > b {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
  line-height: 1.3 !important;
}

#root .exclusive-offer-layout .event-price small {
  display: block !important;
  font-size: 11px !important;
  letter-spacing: .07em !important;
}

#root .exclusive-offer-layout .event-price strong {
  display: block !important;
  margin-top: 4px !important;
  font-size: 17px !important;
}

#root .exclusive-offer-layout .event-commercial > b {
  position: static !important;
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  justify-self: stretch !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 12px 12px !important;
  padding: 9px 12px !important;
  text-align: center !important;
}

/* Les fenêtres restent intégralement accessibles, même sur petit écran. */
#root .modal-backdrop,
#root .fs-doc-backdrop,
#root .fs-confirm-backdrop,
#root .fs-info-editor-backdrop {
  max-width: 100vw !important;
  max-height: 100dvh !important;
}

#root .modal-backdrop > :is(.modal, .modal-content, .offer-modal, .event-popup, .participant-drawer, .resource-edit-modal, .team-edit-modal, .change-slot-modal, .registration-modal, .password-reset-modal),
#root :is(.fs-doc-modal, .fs-confirm-modal, .fs-info-editor, .fs-detail-dialog, .fs-excel-dialog, .fs-account-dialog, .fs-online-dialog) {
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

#root .modal-close {
  z-index: 30 !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
}

/* Tableaux : défilement horizontal local, jamais de colonnes superposées. */
#root :is(.participants-table, .fs-foire-table-wrap, .fs-formula-table-scroll, .fs-riv-diff-table, .fs-excel-preview) {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

/* Ressources légales et pied de page. */
#root .fs-official-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 34px 0 16px;
  padding-top: 28px;
  border-top: 1px solid #dce5ea;
}

#root .fs-official-heading .eyebrow {
  margin: 0 0 7px;
}

#root .fs-official-heading h2 {
  margin: 0 0 6px;
  color: #102c47;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

#root .fs-official-heading small {
  display: block;
  max-width: 720px;
  color: #6f7d88;
  font-size: 14px;
  line-height: 1.5;
}

#root .fs-legal-content {
  overflow-y: auto;
  padding: clamp(18px, 3vw, 34px);
  color: #183247;
  background: #f5f7f9;
}

#root .fs-legal-content > section {
  margin: 0 0 14px;
  padding: clamp(16px, 2.5vw, 24px);
  background: #fff;
  border: 1px solid #dbe5eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(9, 42, 72, .06);
}

#root .fs-legal-content h3 {
  margin: 0 0 10px;
  color: #0b3554;
  font: 700 clamp(18px, 2vw, 22px)/1.25 Outfit, Arial, sans-serif;
}

#root .fs-legal-content p {
  margin: 0 0 10px;
  color: #425c6d;
  font-size: 15px;
  line-height: 1.65;
}

.site-legal-footer {
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 22px !important;
  height: auto !important;
  min-height: 0 !important;
  padding-block: 18px !important;
  white-space: normal !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.site-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.site-legal-footer a {
  color: #155a7c;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  #root .main-area,
  #root .content {
    width: 100% !important;
    max-width: 100% !important;
  }

  .site-legal-footer {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 16px 18px calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 700px) {
  #root .modal-backdrop,
  #root .fs-doc-backdrop,
  #root .fs-confirm-backdrop,
  #root .fs-info-editor-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #root .modal-backdrop > :is(.modal, .modal-content, .offer-modal, .event-popup, .participant-drawer, .resource-edit-modal, .team-edit-modal, .change-slot-modal, .registration-modal, .password-reset-modal),
  #root :is(.fs-doc-modal, .fs-confirm-modal, .fs-info-editor, .fs-detail-dialog, .fs-excel-dialog, .fs-account-dialog, .fs-online-dialog) {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94dvh !important;
    border-radius: 20px 20px 0 0 !important;
    padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 420px) {
  #root .exclusive-offer-layout .event-card-main > .event-info,
  #root .exclusive-offer-layout .event-card-main > .event-commercial,
  #root .exclusive-offer-layout .event-card-main > .event-register {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-right: 12px !important;
    margin-left: 12px !important;
  }

  #root .exclusive-offer-layout .event-commercial > .event-price {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 11px 12px !important;
  }

  #root .exclusive-offer-layout .event-price > span {
    width: 36px !important;
    height: 36px !important;
  }
}

/* Profil : mêmes dimensions, mêmes espacements et aucun contrôle coupé. */
#root .fs-profile-page {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 24px !important;
}

#root .fs-profile-page > :is(.fs-profile-information, .password-card) {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-width: 0 !important;
  padding: 28px !important;
}

#root .fs-profile-page .editor-grid {
  align-content: start !important;
  gap: 18px !important;
}

#root .fs-profile-page .editor-grid > label {
  min-width: 0 !important;
  gap: 8px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

#root .fs-profile-page .editor-grid :is(input, select) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  padding: 11px 14px !important;
  overflow: hidden !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

#root .fs-profile-page .password-card > .panel-title {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 18px !important;
}

#root .fs-profile-page .password-title-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
}

#root .fs-profile-page .password-title-actions > :is(span, button) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.35 !important;
  box-sizing: border-box !important;
}

#root .fs-profile-page .password-card .editor-grid {
  flex: 1 1 auto !important;
}

#root .fs-profile-page .password-card > .primary-button {
  margin-top: auto !important;
}

#root .fs-profile-page > .fs-profile-preferences {
  grid-column: 1 / -1 !important;
  padding: 28px !important;
}

#root .fs-profile-page .fs-notification-preferences > h2 {
  margin-bottom: 8px !important;
  font-size: clamp(23px, 2vw, 28px) !important;
  line-height: 1.25 !important;
}

#root .fs-profile-page .fs-preference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 18px !important;
}

#root .fs-profile-page .fs-preference-grid > fieldset {
  height: 100% !important;
  min-width: 0 !important;
  padding: 18px !important;
  box-sizing: border-box !important;
}

#root .fs-profile-page .fs-preference-topics {
  margin-top: 18px !important;
}

#root .fs-profile-page .fs-profile-preferences > .consent-field {
  width: 100% !important;
  max-width: 100% !important;
  margin: 20px 0 0 !important;
  padding: 18px !important;
  box-sizing: border-box !important;
}

#root .fs-profile-page .fs-profile-preferences > .primary-button {
  width: min(100%, 300px) !important;
  min-width: 0 !important;
  margin-top: 20px !important;
}

/* Trois ensembles autonomes : ressources, informations légales, documents. */
#root .fs-legal-resources {
  margin-top: 24px !important;
  border-color: #d5e3ea !important;
  background: linear-gradient(145deg, #f8fbfc, #f2f7f9) !important;
}

#root .fs-legal-resources > header small {
  display: block !important;
  margin-top: 7px !important;
  color: #657c8b !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

@media (max-width: 1050px) {
  #root .fs-profile-page {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #root .fs-profile-page > .fs-profile-preferences {
    grid-column: 1 !important;
  }
}

@media (max-width: 900px) {
  #root .fs-profile-page .fs-preference-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 600px) {
  #root .fs-profile-page > :is(.fs-profile-information, .password-card, .fs-profile-preferences) {
    padding: 18px !important;
  }

  #root .fs-profile-page .editor-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 15px !important;
  }

  #root .fs-profile-page .fs-preference-grid > fieldset {
    padding: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #root *,
  #root *::before,
  #root *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Shared controls and dialogs on narrow screens. */
#root :is(.fs-admin-content,.fs-community-card-body,.fs-news-card-body,.fs-news-crop-controls,.fs-announcement-info,.fs-conversation,.fs-ticket-content) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#root :is(.fs-news-editor,.fs-news-detail,.fs-community-editor,.fs-detail-dialog) :is(fieldset,label) { min-width: 0; }
#root :is(.fs-news-editor,.fs-community-editor,.fs-admin-form-grid) :is(input,select,textarea) { box-sizing: border-box; max-width: 100%; }
#root :is(.fs-news-manage,.fs-community-manage,.fs-account-actions,.fs-foire-admin-pagination) { flex-wrap: wrap; }
@media (max-width: 700px) {
  #root :is(.fs-news-editor,.fs-community-editor,.fs-detail-dialog,.fs-admin-form-grid) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea) { font-size: 16px !important; }
  #root :is(.fs-news-read,.fs-news-manage button,.fs-community-manage button,.fs-news-crop-formats button,.fs-news-crop-controls button,.fs-collaborators-tabs button) { min-height: 44px; }
  #root :is(.fs-news-editor,.fs-community-editor) footer { flex-wrap: wrap; }
  #root :is(.fs-news-editor,.fs-community-editor) footer > button { flex: 1 1 130px; max-width: 100%; white-space: normal; }
  #root .mobile-drawer { max-width: 100vw; box-sizing: border-box; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 420px) {
  #root .topbar.fs-has-edit-toggle > .topbar-shortcuts { flex: 1 1 100% !important; flex-wrap: wrap !important; }
  #root .topbar.fs-has-edit-toggle .fs-admin-edit-toggle { margin-right: auto; }
  #root :is(.fs-account-filters,.request-filter-controls) { grid-template-columns: minmax(0,1fr) !important; }
  #root :is(.fs-admin-metrics,.fs-foire-admin-metrics) article { padding: 12px; }
}
