/**
 * Accueil téléphone — architecture propre (≤639px).
 * Ne s’applique qu’à .majj-front-page. Desktop / tablette inchangés.
 */

@media (max-width: 639px) {
  .majj-front-page {
    --majj-phone-gutter: 1.25rem;
    --majj-phone-header: 4.65rem;
  }

  .majj-front-page .container {
    padding-inline: var(--majj-phone-gutter);
  }

  .majj-front-page .section,
  .majj-front-page .proof,
  .majj-front-page .home-identity,
  .majj-front-page .presence,
  .majj-front-page .home-call,
  .majj-front-page .publications,
  .majj-front-page .contact,
  .charte-majj-officiel.majj-front-page .proof__domains,
  .charte-majj-officiel.majj-front-page .home-identity,
  .charte-majj-officiel.majj-front-page .publications,
  .charte-majj-officiel.majj-front-page .contact,
  .charte-majj-officiel.majj-front-page .references {
    padding-block: 3.25rem 3.5rem;
  }

  .majj-front-page .section-title,
  .charte-majj-officiel.majj-front-page .section-title,
  .charte-majj-officiel.majj-front-page .about__title,
  .charte-majj-officiel.majj-front-page .contact__title {
    max-width: none;
    text-align: left;
    font-size: 1.55rem;
    line-height: 1.22;
    letter-spacing: -0.018em;
  }

  .majj-front-page .section-subtitle,
  .charte-majj-officiel.majj-front-page .section-subtitle {
    text-align: left;
    margin-inline: 0;
    max-width: 34ch;
    font-size: 1rem;
    line-height: 1.55;
  }

  .majj-front-page .accent-line {
    margin-inline: 0;
  }

  .majj-front-page .section-cta {
    justify-content: flex-start;
  }

  .majj-front-page .section-cta .btn {
    width: auto;
  }

  /* ------------------------------------------------------------------ */
  /* 1. Hero = une pièce                                                */
  /* ------------------------------------------------------------------ */

  .majj-front-page .hero,
  .majj-front-page .hero--photo {
    min-height: 100svh;
    min-height: 100dvh;
    padding: var(--majj-phone-header) var(--majj-phone-gutter) 5.25rem;
    align-items: flex-end;
    box-sizing: border-box;
    z-index: 0;
  }

  .majj-front-page .hero .container {
    padding-inline: 0;
    width: 100%;
    max-width: none;
  }

  .majj-front-page .hero__content {
    text-align: left;
    width: 100%;
    max-width: none;
    padding-inline: 0;
    padding-bottom: 0.35rem;
  }

  .majj-front-page .hero__tagline {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    margin-bottom: 0.85rem;
  }

  .majj-front-page .hero__title,
  .charte-majj-officiel.majj-front-page .hero__title {
    max-width: 13ch;
    font-size: clamp(1.9rem, 8.1vw, 2.4rem);
    line-height: 1.16;
    letter-spacing: -0.028em;
    margin-bottom: 0.85rem;
  }

  .majj-front-page .hero__chapo,
  .charte-majj-officiel.majj-front-page .hero__chapo {
    max-width: 22ch;
    margin-bottom: 1.35rem;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.42;
    letter-spacing: -0.01em;
  }

  .majj-front-page .hero__cta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    width: auto;
    max-width: calc(100% - 3.4rem);
    gap: 0.6rem 0.75rem;
    z-index: 2;
  }

  .majj-front-page .hero__cta .btn {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    padding: 0.72rem 1.15rem;
    justify-content: center;
  }

  .majj-front-page .hero__pager {
    left: var(--majj-phone-gutter);
    right: auto;
    bottom: 1.35rem;
    transform: none;
    z-index: 4;
  }

  .majj-front-page .hero__scroll {
    display: none;
  }

  /* ------------------------------------------------------------------ */
  /* 2. Stats = frise                                                   */
  /* ------------------------------------------------------------------ */

  .majj-front-page .stats-bar {
    overflow: hidden;
  }

  .majj-front-page .stats-bar__scroller {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 1.15rem 0 1.25rem;
  }

  .majj-front-page .stats-bar__scroller::-webkit-scrollbar {
    display: none;
  }

  .majj-front-page .stats-bar__inner,
  .charte-majj-officiel.majj-front-page .stats-bar__inner {
    display: flex;
    grid-template-columns: none;
    width: max-content;
    min-width: 100%;
    gap: 0;
    padding-inline: var(--majj-phone-gutter);
    padding-right: calc(var(--majj-phone-gutter) + 3.75rem);
  }

  .majj-front-page .stats-bar .container {
    max-width: none;
  }

  .majj-front-page .stats-bar__item {
    flex: 0 0 auto;
    min-width: 9.25rem;
    padding-right: 1.35rem;
    scroll-snap-align: start;
  }

  .majj-front-page .stats-bar__item p {
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.3;
    margin: 0;
  }

  .majj-front-page .stats-bar__item .counter,
  .majj-front-page .counter {
    font-size: 1.85rem !important;
    margin-bottom: 0.25rem;
  }

  .majj-front-page .whatsapp-float,
  .charte-majj-officiel.majj-front-page .whatsapp-float {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    right: 0.9rem;
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }

  /* ------------------------------------------------------------------ */
  /* 3. Expertises = index, pas 8 cartes                                */
  /* ------------------------------------------------------------------ */

  .majj-front-page .proof__domains {
    padding-top: 0.5rem;
  }

  .majj-front-page .expertise-index,
  .charte-majj-officiel.majj-front-page .expertise-index {
    display: flex;
    flex-direction: column;
    row-gap: 0;
    margin-top: 1.75rem;
  }

  .majj-front-page .expertise-index__item,
  .charte-majj-officiel.majj-front-page .expertise-index__item {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border-top: 1px solid var(--majj-hairline, rgba(11, 43, 102, 0.12));
  }

  .majj-front-page .expertise-index__item:last-child {
    border-bottom: 1px solid var(--majj-hairline, rgba(11, 43, 102, 0.12));
  }

  .majj-front-page .expertise-index__link,
  .charte-majj-officiel.majj-front-page .expertise-index__link {
    grid-template-columns: 2.15rem minmax(0, 1fr) 1.25rem;
    gap: 0.85rem;
    padding: 1.05rem 0.1rem;
    align-items: center;
    border-radius: 0;
  }

  .majj-front-page .expertise-index__link:hover,
  .majj-front-page .expertise-index__link:focus-visible,
  .charte-majj-officiel.majj-front-page .expertise-index__link:hover,
  .charte-majj-officiel.majj-front-page .expertise-index__link:focus-visible {
    background: transparent;
  }

  .majj-front-page .expertise-index__icon {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.85rem;
  }

  .majj-front-page .expertise-index__title {
    font-size: 0.98rem;
    line-height: 1.28;
  }

  .majj-front-page .expertise-index__excerpt,
  .charte-majj-officiel.majj-front-page .expertise-index__excerpt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .majj-front-page .expertise-index__go-label {
    display: none;
  }

  .majj-front-page .expertise-index__go {
    opacity: 0.55;
    transform: none;
  }

  /* ------------------------------------------------------------------ */
  /* 4. Identité — photo lieu + texte à gauche                          */
  /* ------------------------------------------------------------------ */

  .majj-front-page .home-identity__story,
  .charte-majj-officiel.majj-front-page .home-identity__story.about__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.75rem;
    text-align: left;
  }

  .majj-front-page .about__visual {
    position: relative;
    margin-inline: calc(-1 * var(--majj-phone-gutter));
    width: calc(100% + 2 * var(--majj-phone-gutter));
  }

  .majj-front-page .about__decorative-box,
  .charte-majj-officiel.majj-front-page .about__decorative-box {
    width: 100%;
    min-height: 16.5rem;
    aspect-ratio: 4 / 5;
    border-radius: 0;
    margin: 0;
  }

  .majj-front-page .about__decorative-box::before,
  .majj-front-page .about__decorative-box::after {
    display: none;
  }

  .majj-front-page .about__photo {
    min-height: 100%;
  }

  .majj-front-page .about__caption {
    position: absolute;
    left: var(--majj-phone-gutter);
    right: var(--majj-phone-gutter);
    bottom: 0.85rem;
    margin: 0;
    color: #fff;
    text-shadow: 0 1px 8px rgba(8, 16, 32, 0.55);
    z-index: 2;
  }

  .majj-front-page .about__content {
    text-align: left;
  }

  .majj-front-page .about__label {
    text-align: left;
  }

  .majj-front-page .about__title {
    text-align: left;
  }

  .majj-front-page .about__text {
    text-align: left;
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .majj-front-page .about__vision {
    text-align: left;
    margin-inline: 0;
  }

  .majj-front-page .about__cta {
    width: auto;
  }

  /* ------------------------------------------------------------------ */
  /* 5. Expert accueil                                                  */
  /* ------------------------------------------------------------------ */

  .majj-front-page .home-identity .expert__inner,
  .charte-majj-officiel.majj-front-page .home-identity .expert__inner {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    text-align: left;
    padding-top: 2rem;
  }

  .majj-front-page .expert__photo {
    max-width: none;
    margin: 0 calc(-1 * var(--majj-phone-gutter));
    width: calc(100% + 2 * var(--majj-phone-gutter));
  }

  .majj-front-page .expert__portrait,
  .majj-front-page .expert__placeholder {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 0;
  }

  .majj-front-page .expert__content {
    text-align: left;
  }

  .majj-front-page .expert__role,
  .charte-majj-officiel.majj-front-page .expert__role {
    font-size: 2.05rem;
    text-align: left;
  }

  .majj-front-page .expert__name,
  .charte-majj-officiel.majj-front-page .expert__name {
    font-size: 1.2rem;
    text-align: left;
  }

  .majj-front-page .expert__subtitle,
  .majj-front-page .expert__bio {
    text-align: left;
  }

  .majj-front-page .expert__cta {
    width: auto;
  }

  /* ------------------------------------------------------------------ */
  /* 6. Missions — un visuel fort, deux plus serrés                     */
  /* ------------------------------------------------------------------ */

  .majj-front-page .references__grid--featured {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    grid-template-columns: none;
  }

  .majj-front-page .home-call .mission-card--photo.mission-card--lead,
  .majj-front-page .home-call .references__card--lead {
    min-height: 22.5rem;
  }

  .majj-front-page .home-call .mission-card--photo:not(.mission-card--lead) {
    min-height: 11.25rem;
  }

  .majj-front-page .home-call .mission-card__body {
    padding: 1.15rem 1.2rem 1.25rem;
  }

  .majj-front-page .home-call .mission-card--photo:not(.mission-card--lead) .card__title,
  .majj-front-page .home-call .mission-card--photo:not(.mission-card--lead) h3 {
    font-size: 1.02rem;
    line-height: 1.28;
  }

  .majj-front-page .home-call .mission-card--photo:not(.mission-card--lead) .card__text {
    font-size: 0.86rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ------------------------------------------------------------------ */
  /* 7. Publications — rail                                             */
  /* ------------------------------------------------------------------ */

  .majj-front-page .publications .container {
    overflow: visible;
  }

  .majj-front-page .publications__grid {
    display: flex;
    grid-template-columns: none;
    gap: 0.85rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--majj-phone-gutter));
    padding: 0.15rem var(--majj-phone-gutter) 0.85rem;
  }

  .majj-front-page .publications__grid::-webkit-scrollbar {
    display: none;
  }

  .majj-front-page .publications__grid > .pub-card,
  .majj-front-page .publications__grid > .publications__card {
    flex: 0 0 min(78vw, 17.5rem);
    max-width: min(78vw, 17.5rem);
    scroll-snap-align: start;
  }

  /* ------------------------------------------------------------------ */
  /* 8. Contact — moins de kit                                          */
  /* ------------------------------------------------------------------ */

  .majj-front-page .contact__inner,
  .charte-majj-officiel.majj-front-page .contact__inner {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    text-align: left;
  }

  .majj-front-page .contact__title {
    text-align: left;
  }

  .majj-front-page .contact__form-wrapper,
  .charte-majj-officiel.majj-front-page .contact__form-wrapper {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
    border-radius: 0;
  }

  .majj-front-page .contact__form-wrapper .btn,
  .majj-front-page .contact .btn--primary {
    width: auto;
  }

  /* ------------------------------------------------------------------ */
  /* Mouvement : pas de lift desktop                                    */
  /* ------------------------------------------------------------------ */

  html.majj-motion .majj-front-page .expertise-index__item:hover,
  html.majj-motion .majj-front-page .mission-card:hover,
  html.majj-motion .majj-front-page .pub-card:hover,
  html.majj-motion .majj-front-page .card:hover,
  html.majj-motion .charte-majj-officiel.majj-front-page .expertise-index__item.majj-in:hover,
  html.majj-motion .charte-majj-officiel.majj-front-page .mission-card.majj-in:hover,
  html.majj-motion .charte-majj-officiel.majj-front-page .reference-card.majj-in:hover,
  html.majj-motion .charte-majj-officiel.majj-front-page .pub-card.majj-in:hover {
    transform: none;
  }
}

@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
  .majj-front-page .hero__photo,
  .majj-front-page .mission-card__media {
    animation: none !important;
    transform: none !important;
  }
}
