/* Landing La Marinaa — mise en page tablette (700 à 1 099 px) et mobile (moins de 700 px).
   La maquette n'avait qu'une mise en page d'ordinateur, faite de grilles « auto-fit » : sur tablette elles laissaient des
   demi-écrans vides (carte, photos, plan), sur mobile la page défilait de côté et l'en-tête collant mangeait un quart de
   l'écran. Les blocs portent des classes posées par scripts/preparer_landing.py ; les styles de la maquette sont en
   ligne, d'où les !important. Le bureau (1 100 px et plus) reste exactement celui de la maquette. */

/* ——— En-tête : logo et Habiter/Investir sur une ligne, le menu dessous, qui se range quand on descend ——— */
@media (max-width: 1000px) {
  html { scroll-padding-top: 80px; }
  .lm-header > div { gap: 6px 14px !important; padding: 10px 32px !important; }
  .lm-header.is-compact > div { padding: 8px 32px !important; }
  .lm-logo { height: 48px; }
  .lm-header.is-compact .lm-logo { height: 40px; }
  .lm-switch { margin-left: auto; }
  .lm-nav {
    order: 3; flex: 1 0 100% !important; flex-wrap: nowrap !important; gap: 26px !important; max-height: 40px;
    margin: 0 -32px; padding: 6px 32px 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    border-top: 1px solid #ecebe5;
    transition: max-height .4s cubic-bezier(.16, 1, .3, 1), padding .4s cubic-bezier(.16, 1, .3, 1), opacity .25s, border-color .25s;
  }
  .lm-nav::-webkit-scrollbar { display: none; }
  .lm-nav a { flex: none; white-space: nowrap; }
  .lm-header.is-compact.is-down .lm-nav { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; border-color: transparent; pointer-events: none; }
}

/* ——— Tablette et mobile : marges et respirations des sections ——— */
@media (max-width: 1099px) {
  :root { --lm-col: 1 / -1; }
  .lm-wrap { padding-left: 32px !important; padding-right: 32px !important; }
  .lm-sec { padding-top: 76px !important; padding-bottom: 76px !important; }
  /* Marge haute du héros, comme sur ordinateur (finitions.css) : « Gravelines (59) » restait à 68 px sous l'en-tête en
     tablette à l'horizontale (1 024 × 768). Le mobile (moins de 700 px) la remet à zéro plus bas. */
  .lm-hero-inner { padding: 120px 32px 56px !important; gap: 32px !important; }

  /* Territoire : la carte sur toute la largeur, la fiche du site et la liste côte à côte dessous. */
  .lm-g-territoire, .lm-g-plan, .lm-g-fisc { grid-template-columns: minmax(0, 1fr) !important; }
  .lm-territoire-panel { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px !important; align-items: start; }

  /* Programme : la photo du port et le séjour côte à côte, à la même hauteur. */
  .lm-g-photos { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) !important; grid-auto-rows: clamp(320px, 46vw, 480px); }
  .lm-photo-port, .lm-photo-sejour { aspect-ratio: auto !important; height: 100%; }
  .lm-photo-port { grid-column: auto !important; }

  /* Plan de situation : les huit adresses sur deux colonnes sous le plan. */
  .lm-walk { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px !important; }

  .lm-beci-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .lm-typos { grid-template-columns: repeat(var(--lm-typos-tablette, 3), minmax(0, 1fr)); gap: 14px !important; }
  .lm-reals { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 18px !important; }
  .lm-avis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lm-g-contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important; gap: 40px !important; }
}

/* ——— Mobile ——— */
@media (max-width: 699px) {
  html { scroll-padding-top: 72px; }
  .lm-header > div { padding: 8px 20px !important; }
  .lm-header.is-compact > div { padding: 6px 20px !important; }
  .lm-logo { height: 44px; }
  .lm-header.is-compact .lm-logo { height: 38px; }
  .lm-nav { gap: 22px !important; margin: 0 -20px; padding: 6px 20px 8px; font-size: 12.5px !important;
    -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
  .lm-switch button { padding: 8px 15px !important; font-size: 12px !important; }

  .lm-wrap { padding-left: 20px !important; padding-right: 20px !important; }
  .lm-sec { padding-top: 60px !important; padding-bottom: 60px !important; }

  /* Héros : texte et chiffres clés empilés, boutons pleine largeur. */
  .lm-hero { min-height: 92svh !important; }
  .lm-hero-inner { padding: 0 20px 36px !important; gap: 26px !important; }
  .lm-hero-ctas { gap: 10px !important; }
  .lm-hero-ctas > a, .lm-hero-ctas > button { flex: 1 1 100%; justify-content: center; }
  .lm-kpis { grid-template-columns: minmax(0, 1fr) !important; }
  .lm-kpis > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 13px 20px !important; border-right: 0 !important; border-bottom: 1px solid #4d6679; }
  .lm-kpis > div:last-child { border-bottom: 0; }
  .lm-kpis > div > div + div { margin-top: 0 !important; font-size: 20px !important; white-space: nowrap; text-align: right; }
  .lm-kpi__sub { font-size: 12px; white-space: normal; }

  /* Carte du territoire : l'étiquette volante n'a pas la place ; une légende la remplace, dans un coin libre. */
  .lm-territoire-panel { display: flex !important; flex-direction: column; gap: 20px !important; }
  .lm-map-label { display: none !important; }
  .lm-carte::after {
    content: "MarinAa"; position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 7px;
    padding: 4px 11px 4px 6px; border-radius: 999px; background: #204057; color: #fff; border: 2px solid #fff;
    font: 600 10.5px/1.2 Poppins, sans-serif; letter-spacing: .04em; text-transform: uppercase; pointer-events: none;
  }
  .lm-carte::before {
    content: ""; position: absolute; z-index: 1; right: 103px; bottom: 19px; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 3px #204057; pointer-events: none;
  }
  .lm-insee > div { padding: 22px 0 4px !important; }

  /* Programme : photos l'une sous l'autre, au même format ; la maquette 3D s'ouvre en plein écran. */
  .lm-g-photos { grid-template-columns: minmax(0, 1fr) !important; grid-auto-rows: auto; gap: 14px !important; }
  .lm-photo-port, .lm-photo-sejour { aspect-ratio: 4 / 3 !important; height: auto; }
  .lm-photo-sejour img { object-position: 35% 50% !important; }
  .lm-3d { position: fixed !important; z-index: 300; padding: 12px !important; background: rgba(20, 36, 50, .97) !important; }
  .lm-presta { gap: 6px !important; }
  .lm-walk { grid-template-columns: minmax(0, 1fr); gap: 8px !important; }
  .lm-walk-pin { width: 24px !important; height: 24px !important; font-size: 11px !important; border-width: 2px !important; }

  /* Appartements (Habiter) : une carte par type, l'une sous l'autre ; tableaux resserrés. */
  .lm-typos { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .lm-typo { padding: 20px 18px !important; }
  .lm-typo__id { font-size: 28px !important; margin-bottom: 10px !important; }
  .lm-h3s { grid-template-columns: minmax(0, 1fr) !important; gap: 22px !important; margin-top: 30px !important; }
  .lm-h3s__titre, .lm-acc__t, .lm-typo__titre, .lm-sous-titre { font-size: 17.5px !important; }
  .lm-table { font-size: 13.5px !important; }
  .lm-table th, .lm-table td { padding: 11px 8px !important; }
  .lm-table thead th { font-size: 10.5px !important; letter-spacing: .04em !important; white-space: normal !important; }
  /* H1 du héros : la phrase du cahier tient sur la largeur d'un petit téléphone. */
  .lm-h1 { font-size: clamp(22px, 7vw, 34px) !important; }

  .lm-beci-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 16px !important; }
  /* Réalisations : un carrousel qu'on fait glisser, la suivante dépasse pour inviter au geste. */
  .lm-reals {
    display: flex !important; gap: 14px !important; margin-left: -20px; margin-right: -20px; padding: 0 20px 6px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; scrollbar-width: none;
  }
  .lm-reals::-webkit-scrollbar { display: none; }
  .lm-reals > * { flex: 0 0 82%; scroll-snap-align: start; }
  /* Lancement des travaux : plus serré, l'intitulé au-dessus de la date. */
  .lm-jalon { margin-top: 36px; padding: 14px 22px 14px 18px; border-radius: 18px; }
  .lm-jalon__d { font-size: 18px; flex-basis: 100%; padding-left: 32px; }
  /* Attiques : le visuel au-dessus, puis le texte et les chiffres. */
  .lm-attiques { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 12px; padding: 14px 18px 18px 14px !important; }
  .lm-attiques__visuel { padding: 20px 16px; }
  .lm-attiques__chiffre { font-size: 38px; }
  .lm-onglet { padding: 9px 14px; font-size: 12.5px; }
  .lm-avis { grid-template-columns: minmax(0, 1fr) !important; }
  .lm-avis > div { padding: 22px 22px !important; }
  .lm-g-contact { grid-template-columns: minmax(0, 1fr) !important; gap: 36px !important; }
  .lm-g-contact > div:last-child { padding: 24px 20px !important; box-shadow: 8px 8px 0 #1a3448 !important; }

  /* Visionneuse des perspectives : l'image prend la largeur, les flèches passent sous l'image. */
  .lm-lightbox { padding: 60px 12px 84px !important; }
  /* Photo plafonnée pour que légende (jusqu'à trois lignes) et vignettes tiennent sous elle : marges 144 + 32 + 116. */
  .lm-lightbox > img { max-height: calc(100vh - 300px) !important; }
  .lm-lb-prev, .lm-lb-next { top: auto !important; bottom: 18px; transform: none !important; width: 46px !important; height: 46px !important; }
  .lm-lb-prev { left: 16px !important; }
  .lm-lb-next { right: 16px !important; }
}

/* Héros sur la perspective d'été : voile mesuré par largeur (texte blanc à 4,5:1 sur le fond le plus clair, 3:1 pour
   le grand titre) — tablette : le texte reste bas ; téléphone : il remonte sur le ciel et les toits, le voile aussi. */
@media (min-width: 700px) and (max-width: 1099px) {
  .lm-hero-voile { background: linear-gradient(180deg, rgba(26,52,72,0.36) 0%, rgba(26,52,72,0.66) 38%, rgba(26,52,72,0.92) 100%) !important; }
}
/* Téléphone : héros en deux temps — la photo d'été, à découvert, puis le texte sur le bandeau marine (contraste plein,
   sans voile sur la photo). Le bas de la photo se fond dans le marine. */
@media (max-width: 699px) {
  .lm-hero { display: block !important; min-height: 0 !important; background: #1a3448 !important; }
  .lm-hero > img { position: relative !important; inset: auto !important; display: block; height: 46svh !important; min-height: 280px; }
  .lm-hero-voile { inset: 0 0 auto 0 !important; height: 46svh !important; min-height: 280px;
    background: linear-gradient(180deg, rgba(26,52,72,0) 58%, rgba(26,52,72,0.55) 82%, #1a3448 100%) !important; }
  .lm-hero-inner { position: relative; margin-top: -44px; padding-top: 0 !important; }
}

/* ——— Téléphone : menu ☰ plein écran et barre d'actions (finitions.js) ——— */
.lm-burger, .lm-menu, .lm-barre { display: none; }
@media (max-width: 699px) {
  .lm-nav { display: none !important; }
  .lm-switch { margin-left: auto; }
  .lm-burger { display: inline-grid; place-content: center; gap: 4px; flex: none; width: 44px; height: 44px; margin-left: 2px;
    padding: 0; border: 0; border-radius: 50%; background: #e2e1d9; cursor: pointer; }
  .lm-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #204057; transition: transform .25s, opacity .2s; }
  .lm-menu-ouvert .lm-burger { background: #204057; }
  .lm-menu-ouvert .lm-burger span { background: #ffffff; }
  .lm-menu-ouvert .lm-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .lm-menu-ouvert .lm-burger span:nth-child(2) { opacity: 0; }
  .lm-menu-ouvert .lm-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  html.lm-menu-ouvert, html.lm-menu-ouvert body { overflow: hidden; }

  .lm-menu { display: flex; position: fixed; inset: 0; z-index: 45; flex-direction: column; justify-content: space-between; gap: 24px;
    padding: 84px 20px calc(24px + env(safe-area-inset-bottom)); background: #f6f5f1; color: #204057; overflow-y: auto;
    animation: lm-menu-entree .28s cubic-bezier(.16, 1, .3, 1); }
  .lm-menu[hidden] { display: none; }
  .lm-menu ul { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid #204057; }
  .lm-menu li { border-bottom: 1px solid #cdcdc3; }
  .lm-menu nav a { display: flex; align-items: baseline; gap: 14px; padding: 17px 2px; color: #204057; text-decoration: none;
    font-family: 'Lemon Milk', Poppins, sans-serif; font-weight: 600; font-size: 21px; text-transform: uppercase; line-height: 1.1; }
  .lm-menu nav a span { font-family: Poppins, sans-serif; font-style: italic; font-weight: 500; font-size: 13px; color: #4d6679; min-width: 22px; }
  .lm-menu__actions { display: grid; gap: 10px; }
  .lm-menu__actions a { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 999px;
    text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
  .lm-menu__rappel { background: #204057; color: #ffffff; }
  .lm-menu__tel { border: 1.5px solid #204057; color: #204057; text-transform: none !important; letter-spacing: 0 !important; }
  @keyframes lm-menu-entree { from { opacity: 0; transform: translateY(-8px); } }

  .lm-barre { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; position: fixed; left: 12px; right: 12px; z-index: 55;
    bottom: calc(12px + env(safe-area-inset-bottom)); padding: 7px; border-radius: 999px; background: rgba(26, 52, 72, .96);
    box-shadow: 0 16px 34px -14px rgba(20, 40, 56, .65); transform: translateY(calc(100% + 30px)); transition: transform .32s cubic-bezier(.16, 1, .3, 1); }
  .lm-barre.is-on { transform: none; }
  .lm-barre a { display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 999px; text-decoration: none;
    font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
  .lm-barre__tel { color: #ffffff; border: 1.5px solid rgba(255, 255, 255, .45); }
  .lm-barre__rappel { background: #e8b04a; color: #204057; }

  /* Saisie : 16 px au moins, sinon iOS agrandit la page à chaque champ touché. */
  input, select, textarea { font-size: 16px !important; }
}
/* Tableau des lots investisseurs (six colonnes depuis la taxe foncière, 29/10/2026 : 760 px de large) : une carte par
   type, l'intitulé de chaque valeur à sa gauche, du téléphone à la tablette en portrait (banc-landing.cjs, 700–820 px). */
@media (max-width: 899px) {
  .lm-table--cartes, .lm-table--cartes tbody, .lm-table--cartes tr { display: block; }
  .lm-table--cartes thead { display: none; }
  .lm-table--cartes tr { margin-bottom: 10px; padding: 12px 16px; border: 1px solid #e2e1d9; border-radius: 14px; }
  .lm-table--cartes th[scope="row"] { display: block; padding: 0 0 6px !important; border: 0; font-size: 17px; }
  .lm-table--cartes td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0 !important; border-bottom: 0; border-top: 1px solid #efeee9; white-space: normal !important; text-align: right; }
  .lm-table--cartes td::before { content: attr(data-label); flex: none; color: #4d6679; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
}
@media (max-width: 699px) and (prefers-reduced-motion: reduce) {
  .lm-menu { animation: none; }
  .lm-barre, .lm-burger span { transition: none; }
}
/* Petits téléphones (360 px) : logo, choix Habiter/Investir et bouton du menu tiennent sur une seule ligne ; le tableau
   des appartements (quatre colonnes) passe en cartes comme celui des investisseurs (304 px pour 280 à 320 px). */
@media (max-width: 400px) {
  .lm-table, .lm-table tbody, .lm-table tr { display: block; }
  .lm-table thead { display: none; }
  .lm-table tr { margin-bottom: 10px; padding: 12px 16px; border: 1px solid #e2e1d9; border-radius: 14px; }
  .lm-table th[scope="row"] { display: block; padding: 0 0 6px !important; border: 0; font-size: 17px; }
  .lm-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0 !important; border-bottom: 0; border-top: 1px solid #efeee9; white-space: normal !important; text-align: right; }
  .lm-table td::before { content: attr(data-label); flex: none; color: #4d6679; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
  .lm-header > div { gap: 8px !important; flex-wrap: nowrap !important; }
  .lm-switch button { padding: 8px 11px !important; font-size: 11.5px !important; }
  .lm-logo, .lm-header.is-compact .lm-logo { height: 36px; }
  .lm-burger { width: 42px; height: 42px; }
}

/* ——— Plans 3D et maquette 3D (17/11/2026) ——— */
@media (max-width: 1099px) {
  .lm-maquette__cadre { aspect-ratio: 16 / 10; min-height: 0; margin-top: 32px; }
}
@media (max-width: 699px) {
  .lm-typo .lm-plan3d { margin: -6px -4px 18px; width: calc(100% + 8px); }
  .lm-maquette__cadre { aspect-ratio: 4 / 3; max-height: none; margin-top: 26px; border-radius: 14px; }
  .lm-maquette__bouton { padding: 14px 22px; font-size: 13px; gap: 10px; }
  /* Sur téléphone, la maquette s'ouvre en plein écran : dans la page, elle capterait le défilement. */
  .lm-maquette__vue { position: fixed; z-index: 300; inset: 0; padding: 12px; background: #10202e; }
  .lm-maquette__actions { justify-content: center; }
}

/* Bandeau de chiffres à quatre valeurs (Habiter, remarque n° 35 : Dunkerque en voiture) : deux par ligne sur tablette
   plutôt que trois et un seul ; quatre sur une ligne sur ordinateur (la grille auto-fit du gabarit les y met déjà). */
@media (min-width: 700px) and (max-width: 1099px) {
  .lm-insee:has(> div:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Attiques : le visuel à gauche du texte, les chiffres dessous sur toute la largeur. */
  .lm-attiques { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); padding: 16px 24px 20px 16px; }
  .lm-attiques .lm-typo__faits { grid-column: 1 / -1; }
}
