/* Compléments publics : conserver style.css et la disposition des portraits. */
html {
  scroll-padding-top: var(--site-header-offset, 90px);
}

#main section,
#main .service-detail-group,
#main .service-detail-list article,
#main .legal-content article {
  scroll-margin-top: 0;
}

#main {
  overflow-wrap: anywhere;
}

.expertise-nav[aria-hidden="true"] {
  visibility: hidden;
}

.faq-answer[hidden] {
  display: none;
}

.faq-answer:not([hidden]) {
  max-height: none;
}

@media (max-width: 1244px) {
  .utility-proof,
  .header-cta {
    display: none;
  }

  .header-inner {
    min-height: 72px;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-toggle {
    display: grid;
    order: 3;
    flex-shrink: 0;
  }

  .language-switcher--header {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
  }

  .primary-nav {
    position: absolute;
    inset: var(--site-header-inner-height, 72px) 14px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 12px;
    max-height: calc(100dvh - var(--site-header-bottom, 72px) - 8px);
    overflow-y: auto;
    scroll-padding-block: 12px;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a,
  .primary-nav .nav-button {
    justify-content: flex-start;
    min-width: 0;
    min-height: 44px;
    flex-shrink: 0;
    padding: 13px 14px;
    border-radius: 10px;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .primary-nav a:hover,
  .primary-nav .nav-button:hover {
    box-shadow: none;
    transform: none;
  }

  .site-header.expertises-open {
    max-height: calc(100dvh - var(--site-header-top, 0px));
    overflow-y: auto;
    scroll-padding-top: calc(var(--site-header-inner-height, 72px) + 8px);
    scroll-padding-bottom: 8px;
    scroll-behavior: auto;
    overscroll-behavior: contain;
  }

  .site-header.expertises-open .header-inner {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #C7DEFC;
  }

  .site-header.expertises-open .expertise-nav,
  .site-header.expertises-open .mega-menu {
    max-height: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .mega-menu {
    position: static;
    max-height: 0;
    overflow: hidden;
  }

  .expertise-tabs,
  .mega-grid {
    width: min(calc(100% - 28px), var(--container));
    margin-inline: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .expertise-tabs {
    padding: 10px 0;
  }

  .expertise-tab {
    min-height: 44px;
    padding: 10px 14px;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    overflow-wrap: anywhere;
  }

  .mega-grid {
    max-height: none;
    overflow: visible;
    padding: 18px;
  }

  .mega-grid article {
    min-width: 0;
    padding: 16px 4px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .agency-anchor-nav,
  .service-detail-nav {
    position: static;
  }

  .agency-anchor-nav .container,
  .service-detail-nav,
  .portfolio-filter {
    flex-wrap: wrap;
    overflow: visible;
  }

  .agency-anchor-nav a,
  .service-detail-nav a,
  .portfolio-filter a {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-height: 500px) {
  .agency-anchor-nav,
  .service-detail-nav {
    position: static;
  }
}

/* Corrections de contraste et de relecture, sans modifier le thème original. */
.site-header .primary-nav > .is-active:not(.is-open):not(:hover):not(:focus-visible),
.site-header .brand small { color: #1D4ED8; }
.site-footer .brand small { color: #93C5FD; }
.primary-nav a, .primary-nav .nav-button {
  transition: box-shadow .2s ease, transform .2s ease;
}

/* Retour visuel des liens : mouvement léger et graisse renforcée. */
.site-header .primary-nav > :is(a, .nav-button),
.site-header .expertise-tab,
.site-header .mega-menu a,
.site-footer nav > a {
  transition: transform .18s ease-out, box-shadow .18s ease-out;
}
.site-header .primary-nav > :is(a, .nav-button):is(:hover, :focus-visible),
.site-header .expertise-tab:is(:hover, :focus-visible) {
  font-weight: 900;
}
.site-header .mega-menu a:is(:hover, :focus-visible),
.site-footer nav > a:is(:hover, :focus-visible) {
  font-weight: 700;
}
.site-header .mega-menu a:hover,
.site-footer nav > a:hover,
.site-footer nav > a:focus-visible {
  text-decoration: underline;
  text-underline-offset: .25em;
}
.site-header :is(a, button):focus-visible {
  outline: 3px solid #1D4ED8;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #FFFFFF;
}
.site-header .expertise-nav button:focus-visible {
  outline-color: #FFFFFF;
  box-shadow: 0 0 0 3px #07122A;
}
.site-footer :is(a, button):focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #07122A;
}
.site-footer nav > a:focus-visible { color: #FFFFFF; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .site-header .primary-nav > :is(a, .nav-button):hover,
  .site-header .expertise-tab:hover { transform: translateY(-2px); }
  .site-header .mega-menu a:hover,
  .site-footer nav > a:hover { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .primary-nav > :is(a, .nav-button),
  .site-header .expertise-tab,
  .site-header .mega-menu a,
  .site-footer nav > a {
    transform: none;
    transition: none;
  }
}
:is(.lead-form, .admin-form, .admin-filter-form) :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea) {
  border-color: #64748B;
  min-width: 0;
  max-width: 100%;
}
.language-switcher__menu[hidden] { display: none; }
.project-card h3, .project-card p, .blog-card h3 {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}
.agency-points h2 { margin: 0 0 10px; font-size: 1rem; }
.agency-photo-strip .agency-carousel-caption {
  position: absolute; left: 28px; bottom: 28px; z-index: 2;
  display: grid; max-width: 430px; gap: 6px; padding: 20px;
  color: white; background: rgba(15,23,42,.9);
  border: 1px solid rgba(255,255,255,.16); border-radius: 18px;
}
.agency-carousel-caption strong { font-size: 1.05rem; }
.agency-carousel-caption span { color: #F1F5F9; font-size: .9rem; line-height: 1.45; }
.animation-control {
  min-height: 44px; max-width: 100%; padding: 8px 14px;
  border: 1px solid #64748B; border-radius: 12px;
  color: #0F172A; background: white; font: inherit; font-weight: 700; cursor: pointer;
}
.hero-visual > .animation-control--compact {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: max-content; min-width: 44px; margin: 0 0 8px auto; padding: 8px 12px;
  border-color: #CBD5E1; border-radius: 999px;
  color: #1D4ED8; background: #EFF6FF; font-size: .8125rem; line-height: 1.3;
}
.animation-control--compact svg { width: 16px; height: 16px; flex: 0 0 16px; fill: currentColor; }
.hero-visual > .animation-control--compact:hover { background: #DBEAFE; border-color: #1D4ED8; }
.agency-photo-carousel > .animation-control { position: absolute; top: 14px; left: 14px; z-index: 5; }
.agency-photo-carousel .swiper-pagination-bullet {
  width: 28px; height: 28px; margin-inline: 2px !important; opacity: 1;
  background: radial-gradient(circle, #64748B 0 4px, transparent 5px);
}
.agency-photo-carousel .swiper-pagination-bullet-active { background: radial-gradient(circle, #2563EB 0 5px, transparent 6px); }
.proof-ticker.is-static div { animation: none; flex-wrap: wrap; }
.form-error-summary { border: 2px solid #B91C1C; border-radius: 12px; padding: 16px; background: #FEF2F2; color: #7F1D1D; }
.form-error-summary h2 { font-size: 1.1rem; margin: 0 0 8px; color: inherit; }
.form-error-summary ul { margin: 0; padding-left: 20px; }
.form-error-summary a { color: inherit; text-decoration: underline; }
[aria-invalid=true] { border-color: #B91C1C !important; }
.admin-main, .admin-card, .admin-form, .admin-form .form-grid > *, .admin-settings-translations > * { min-width: 0; overflow-wrap: anywhere; }
.admin-body .admin-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.admin-body .admin-table-wrap:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 3px; }
.admin-main .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.confirm-modal { overflow-y: auto; }
.confirm-modal__panel { max-height: calc(100dvh - 40px); overflow-y: auto; }
.admin-session-notice { position: fixed; bottom: 16px; right: 16px; z-index: 190; width: min(420px, calc(100% - 32px)); padding: 20px; background: white; color: #0F172A; border: 2px solid #1D4ED8; border-radius: 14px; box-shadow: var(--shadow-md); }
.admin-session-notice p { margin: 0 0 12px; }
@media (max-width: 860px) {
  .agency-photo-strip .agency-carousel-caption { left: 14px; right: 14px; bottom: 42px; max-width: none; padding: 14px; }
}
@media (max-width: 640px) {
  .admin-main .form-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-form-actions, .admin-section-actions { flex-wrap: wrap; }
  .admin-form-actions .btn, .admin-section-actions .btn { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .proof-ticker div { animation: none !important; }
}

.social-links svg { width: 20px; height: 20px; }
.required-indicator { font-size: .8em; font-weight: 500; }
