/* ==========================================================================
   logimetre.css — page du projet LogiMètre
   Header fixe en haut, bannière vidéo, puis contenu classique.
   ========================================================================== */

.logimetre {
  /* Palette */
  --lm-bg: #24282c;
  --lm-header-bg: #12161a;
  --lm-blue: #29abe2;

  /* Le header (hauteur 92 px sur un écran de 1850 px) pilote les tailles
     de son titre et de ses icônes */
  --lm-header-h: clamp(64px, 5vw, 96px);

  background: var(--lm-bg);
  font-family: var(--project-font-text);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.lm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--lm-header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lm-header-bg);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.6);
}

/* Le texte est centré sur la page ; l'icône se place à sa gauche
   sans le décentrer */
.lm-header__title {
  position: relative;
  margin: 0;
  font-family: var(--project-font-title);
  font-size: calc(var(--lm-header-h) * 0.52);
  font-weight: 300;
  line-height: 1;
}

.lm-header__title img {
  position: absolute;
  top: 50%;
  right: calc(100% + var(--lm-header-h) * 0.2);
  height: calc(var(--lm-header-h) * 0.54);
  width: auto;
  translate: 0 -50%;
}

/* Lien retour, à gauche */
.lm-header__back {
  position: absolute;
  top: 50%;
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 0.6em;
  translate: 0 -50%;
  color: #c9ccd0;
  font-size: clamp(1rem, calc(var(--lm-header-h) * 0.2), 1.25rem);
  font-weight: 300;
  text-decoration: none;
  transition: color 0.2s ease;
}

.lm-header__back-arrow {
  font-size: 1.4em;
  line-height: 1;
  transition: translate 0.2s ease;
}

.lm-header__back:hover,
.lm-header__back:focus-visible {
  color: var(--lm-blue);
  outline: none;
}

.lm-header__back:hover .lm-header__back-arrow,
.lm-header__back:focus-visible .lm-header__back-arrow {
  translate: -4px 0;
}

/* Écran étroit : la flèche seule, pour laisser la place au titre */
@media (max-width: 760px) {
  .lm-header__back-text {
    display: none;
  }
}

.lm-header__partner {
  position: absolute;
  top: 50%;
  right: 10px;
  height: calc(var(--lm-header-h) * 1.05);
  width: auto;
  translate: 0 -50%;
}

/* --------------------------------------------------------------------------
   Bannière vidéo (composant banner.css)
   -------------------------------------------------------------------------- */

.lm-banner {
  --content-column: 2 / 4; /* texte aligné à droite, sur les deux derniers tiers */
  min-height: 40svh;
  background: var(--lm-bg);
}

.lm-banner .banner__content {
  padding-right: clamp(var(--gutter), 8.7vw, 10rem);
}

.lm-banner .banner__title {
  margin-bottom: 1.15em;
  font-size: clamp(1.5rem, 1.84vw, 2.3rem);
}

.lm-banner .banner__text {
  max-width: 22.5em;
}

.lm-banner .banner__text + .banner__text {
  margin-top: 1.3em;
}

/* --------------------------------------------------------------------------
   Contenu
   -------------------------------------------------------------------------- */

.lm-content {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) 8rem;
  --lm-text-muted: #a9adb2;
}

/* Passages de texte encore à écrire : bien visibles pour ne pas les oublier */
.lm-todo {
  color: var(--lm-blue);
  font-style: italic;
}

/* Accès rapide aux sections */
.lm-toc {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

.lm-toc a {
  padding: 0.55em 1.25em;
  border: 1px solid rgb(41 171 226 / 0.4);
  border-radius: 999px;
  color: #c9ccd0;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lm-toc a:hover,
.lm-toc a:focus-visible {
  border-color: var(--lm-blue);
  background: rgb(41 171 226 / 0.12);
  color: #fff;
  outline: none;
}

/* Sections */
.lm-section {
  scroll-margin-top: calc(var(--lm-header-h) + 1.5rem); /* le header fixe ne masque pas le titre */
}

.lm-section + .lm-section {
  margin-top: clamp(5rem, 12vh, 8rem);
}

.lm-section__head {
  max-width: 46rem;
  margin: 0 auto clamp(2.5rem, 6vh, 4rem);
  text-align: center;
}

.lm-section__title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
}

.lm-section__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  margin: 0.55em auto 0;
  background: var(--lm-blue);
}

.lm-section__intro {
  margin: 1.25rem 0 0;
  color: var(--lm-text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Visuel (vidéo en boucle), avec une grille "plan" en attendant le fichier */
.lm-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 10px;
  background-color: var(--lm-header-bg);
  background-image:
    linear-gradient(rgb(41 171 226 / 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgb(41 171 226 / 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}

.lm-media::before {
  content: "Vidéo à venir\A" attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: rgb(201 204 208 / 0.6);
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
}

.lm-media video,
.lm-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm-media video {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lm-media video.is-loaded {
  opacity: 1;
}

/* Visuel remplacé par une simple icône, centrée sur la grille « plan » */
.lm-media--icon {
  display: grid;
  place-items: center;
}

.lm-media--icon::before {
  content: none; /* pas de message « Vidéo à venir » */
}

.lm-media--icon img {
  position: static;
  width: clamp(4.5rem, 22%, 8rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgb(41 171 226 / 0.35));
}

/* --- Section 1 : une ligne par fonctionnalité, côtés alternés ----------- */

.lm-feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.lm-feature + .lm-feature {
  margin-top: clamp(3rem, 8vh, 5rem);
}

/* Une ligne sur deux : vidéo à gauche, en gardant la grande colonne */
.lm-features > .lm-feature:nth-child(even) {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.lm-features > .lm-feature:nth-child(even) .lm-feature__text {
  order: 2;
}

.lm-feature__num {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--lm-blue);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.lm-feature__title,
.lm-principle__title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  font-weight: 300;
}

.lm-feature__text p,
.lm-principle p,
.lm-story p {
  margin: 0;
  color: var(--lm-text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* --- Section 2 : deux principes côte à côte ----------------------------- */

.lm-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.lm-principle {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 12px;
  background: var(--lm-header-bg);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.3);
}

.lm-principle .lm-media {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.lm-principle__body {
  padding: 1.5rem 1.75rem 1.9rem;
}

/* --- Section 3 : récit sur une ligne de temps --------------------------- */

.lm-story {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 0 0 2.75rem;
  list-style: none;
}

.lm-story::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0;
  left: 0.55rem;
  width: 2px;
  background: linear-gradient(var(--lm-blue), rgb(41 171 226 / 0));
}

.lm-story__step {
  position: relative;
}

.lm-story__step + .lm-story__step {
  margin-top: 2.75rem;
}

.lm-story__step::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: -2.75rem;
  width: 1.1rem;
  height: 1.1rem;
  box-sizing: border-box;
  border: 2px solid var(--lm-blue);
  border-radius: 50%;
  background: var(--lm-bg);
}

.lm-story__title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  font-weight: 400;
}

.lm-story p + p {
  margin-top: 0.9em;
}

/* --- Écran étroit -------------------------------------------------------- */

@media (max-width: 860px) {
  .lm-feature,
  .lm-features > .lm-feature:nth-child(even),
  .lm-principles {
    grid-template-columns: minmax(0, 1fr);
  }

  .lm-features > .lm-feature:nth-child(even) .lm-feature__text {
    order: 0;
  }
}
