/* Adaptations mobiles communes. Chargé après les styles de chaque section. */
@media (max-width: 1000px) {
  .nav {
    background: var(--paper);
  }

  .menu {
    display: block;
    min-height: 44px;
    padding: 8px;
    flex-shrink: 0;
  }

  .links {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    padding: 20px 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
  }

  .links.open {
    display: flex;
  }

  .links a {
    padding: 12px;
    min-height: 44px;
  }

  .featurelayout {
    grid-template-columns: minmax(0, 1fr);
  }

  .featuremenu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 84px;
  }

  body {
    font-size: 17px;
  }

  .wrap {
    padding-inline: 20px;
  }

  section {
    padding-block: 52px;
  }

  h2 {
    font-size: clamp(32px, 8.5vw, 42px);
    letter-spacing: -1.3px;
    line-height: 1.12;
  }

  .sectionhead p,
  .product p {
    font-size: 17px;
  }

  .navinner {
    height: 68px;
    gap: 12px;
  }

  .logo {
    font-size: 26px;
    gap: 8px;
  }

  .logo sup {
    margin-left: -4px;
  }

  /* Laisser le contenu de la bannière définir sa hauteur évite les chevauchements. */
  .hero {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .hero .wrap {
    padding: 42px 20px 32px;
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: clamp(44px, 12vw, 64px);
    line-height: 1.04;
    letter-spacing: -.045em;
    margin: 24px 0;
  }

  .hero .eyebrow {
    font-size: 12px;
    letter-spacing: 1px;
    line-height: 1.6;
  }

  .hero .intro {
    font-size: 17px;
    line-height: 1.65;
    margin-bottom: 26px;
  }

  .hero .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 380px;
    gap: 12px;
  }

  .hero .btn {
    min-height: 50px;
    justify-content: space-between;
  }

  .herofoot {
    position: static;
    margin-top: 28px;
    gap: 20px;
    align-items: stretch;
  }

  .herofoot .small {
    font-size: 14px;
    line-height: 1.6;
  }

  .herofoot .mini {
    width: 100%;
    max-width: 380px;
  }

  .mini > div {
    min-width: 0;
    flex: 1;
  }

  .mini img.ensa-mini {
    flex-shrink: 0;
  }

  .facts .wrap {
    padding-inline: 20px;
  }

  .fact svg {
    flex-shrink: 0;
  }

  .specs {
    gap: 8px;
  }

  .spec {
    flex: 1 1 75px;
    min-width: 0;
    padding-right: 0;
  }

  .spec span {
    font-size: 12px;
    line-height: 1.5;
  }

  /* Les noms des échelles doivent rester lisibles dans le sélecteur d’outils. */
  .featuremenu {
    grid-template-columns: minmax(0, 1fr);
  }

  .featuremenu button {
    align-items: center;
    font-size: 16px;
    padding: 14px;
    min-height: 64px;
  }

  .featuremenu button > span:nth-child(2) {
    min-width: 0;
  }

  .featuremenu small {
    font-size: 13px;
  }

  .featurecopy {
    padding: 20px 16px 0;
  }

  .featurecopy h3 {
    font-size: 25px;
  }

  .product .featurecopy p,
  .featurecopy ol {
    font-size: 16px;
    line-height: 1.65;
  }

  .featurezoom {
    height: 210px;
    padding: 16px 12px;
  }

  .zoomcaption {
    gap: 8px;
    font-size: 13px;
  }

  .featuretry {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0 16px 20px;
    gap: 12px;
  }

  /* Donner un peu plus de largeur à la carte sans rogner les textes. */
  .guide > .wrap {
    padding-inline: 12px;
  }

  .guide .sectionhead {
    margin-inline: 8px;
  }

  .labcontrols {
    min-width: 0;
    padding: 20px 16px;
  }

  .control label {
    flex-wrap: wrap;
    align-items: baseline;
  }

  .control label output {
    margin-left: auto;
  }

  .control input[type=number],
  .control select {
    min-width: 0;
    font-size: 16px;
  }

  .labtabs button {
    font-size: 14px;
    min-height: 52px;
    padding: 12px 8px;
  }

  .labtools button {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 16px;
  }

  .labreadout {
    padding: 14px;
    gap: 10px;
  }

  .labreadout strong {
    min-width: 0;
    flex-shrink: 1;
    max-width: 100%;
    font-size: clamp(14px, 4.2vw, 18px);
    white-space: pre-wrap;
  }

  .labbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .labfoot a {
    white-space: normal;
  }

  .mapcredit {
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
  }

  .reportmethod {
    padding: 16px;
  }

  .reportmethod h3 {
    font-size: 20px;
  }

  .reportstep b {
    font-size: 18px;
  }

  .reportstep p,
  .reportprogress,
  .reportmethod .boundarynote {
    font-size: 16px;
  }

  .reportstep .axis {
    font-size: clamp(13px, 3.8vw, 17px);
    line-height: 1.8;
  }

  .purchase h3 {
    font-size: clamp(24px, 6.6vw, 29px);
    line-height: 1.2;
  }

  .purchasefields {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .purchasefields label {
    font-size: 16px;
  }

  .purchaseform,
  .purchaseproduct {
    padding: 20px;
  }

  .purchaseform .btn {
    gap: 12px;
  }

  .purchase .retailers {
    padding: 0;
    margin-bottom: 32px;
  }

  .retailer-heading {
    gap: 10px;
  }

  .retailer-grid h4 {
    font-size: 20px;
  }

  .trusted-client {
    padding: 20px 10px;
  }

  .trusted-client figcaption span {
    overflow-wrap: normal;
  }

  .contact h2 {
    max-width: 100%;
  }

  .footerlinks {
    gap: 14px 20px;
  }
}

@media (max-width: 600px) {
  .uses {
    grid-template-columns: minmax(0, 1fr);
  }

  .uses .use,
  .uses .use:last-child {
    margin: 0;
    padding: 24px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .use h3 {
    margin: 12px 0;
    font-size: 23px;
  }

  .use p {
    margin-block: 12px 18px;
  }
}

@media (max-width: 360px) {
  .wrap,
  .facts .wrap {
    padding-inline: 16px;
  }

  .hero .wrap {
    padding-inline: 16px;
  }

  .logo {
    font-size: 24px;
  }

  .navinner {
    gap: 8px;
  }

  .menu {
    font-size: 16px;
  }

  .topbar {
    font-size: 12px;
  }
}

/* More room to touch the manual slope controls on a phone. */
@media (max-width: 760px) {
  #slopecontrols input[type=range] {
    min-height: 44px;
  }
}

/* Sur téléphone, le bouton de démonstration reste juste au-dessus de la carte. */
@media (max-width: 760px) {
  .mobile-slope > .labtools {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    background: #f5f5ee;
    border-bottom: 1px solid #c8d4be;
  }

  .mobile-slope > .labtools button {
    min-width: 0;
    min-height: 48px;
    padding: 10px 6px;
    font-size: 15px;
  }
}
