/* AMEAQ Responsive Foundation 1.2.0 – Director’s Message only.
 * On mobile, the profile and article should be a single vertical flow.
 * This is deliberately scoped to the director template and JS-marked content;
 * it does not touch the shared header, home carousels, or desktop layout.
 */
@media (max-width: 767px) {
  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) :is(main, .site-main, .site-content, #content, .entry-content) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Some custom templates use a fixed-width outer wrapper on mobile. */
  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-overwide {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-inline: auto !important;
  }

  /* Automatically marked by the small director-specific enhancement. */
  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-layout {
    display: block !important;
    flex-direction: column !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-layout > :not(style):not(script) {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-profile {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    float: none !important;
    clear: both !important;
    width: min(100%, 300px) !important;
    max-width: 300px !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 auto 24px !important;
    transform: none !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-profile-inner {
    display: block !important;
    float: none !important;
    width: min(100%, 300px) !important;
    max-width: 300px !important;
    margin: 0 auto 24px !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-text {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    columns: 1 !important;
    transform: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-layout :is(img, picture, figure) {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-layout img {
    height: auto !important;
  }

  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-text :is(p, li) {
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    font-size: 16px !important;
    line-height: 1.75 !important;
    text-align: start !important;
    text-indent: 0 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    white-space: normal !important;
    hyphens: auto;
  }

  /* The desktop drop cap uses too much horizontal space on a phone. */
  body.ameaq-rf-enabled:is(.page-id-40168, .page-id-42074, .page-template-directeur-v1) .ameaq-rf-director-text p:first-of-type::first-letter {
    float: none !important;
    font-size: inherit !important;
    line-height: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
