/* =============================================================
   Weloop — subpage components (produit · fonctionnement · souveraineté)
   Loaded after modern.css. Everything here follows the one-screen
   rule: heights are driven by the viewport (vh) on desktop.
   ============================================================= */

/* ---------- hero extras ---------- */
.hero-chips { margin-top: clamp(16px, 2.6vh, 26px); display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
.hero-chips img { width: 16px; height: 16px; object-fit: contain; }
.hero-chips .ok { color: hsl(160 64% 36%); font-weight: 800; }

/* step rail (fonctionnement hero) */
.rail { margin-top: clamp(18px, 3vh, 28px); display: flex; flex-wrap: wrap; gap: 8px; }
.rail a { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); font-size: 13.5px; font-weight: 700; color: hsl(var(--foreground)); transition: border-color .2s, box-shadow .2s, transform .2s; }
.rail a:hover { border-color: hsl(244 30% 84%); box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.rail a i { font-style: normal; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: hsl(var(--primary)); color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }

/* ---------- full-width scene (flow · arch) ---------- */
.scene-wide { max-width: min(1040px, 116vh); margin: clamp(18px, 3.2vh, 32px) auto 0; }
.scene-wide .feat-media { padding: 0; }
.sec-head.center { margin: 0 auto; text-align: center; max-width: 940px; }
.sec-head.center .feat-kicker { justify-content: center; }
.sec-head .h-section { margin-top: 14px; }
.sec-head .lede { margin-top: 14px; font-size: clamp(15.5px, 1.25vw, 18px); max-width: 760px; }
.sec-head.center .lede { margin-left: auto; margin-right: auto; }

/* ---------- prose tweaks ---------- */
.prose .feat-kicker + h2 { margin-top: 16px; }
.prose p + p { margin-top: 10px; }
.prose .check-list { margin-top: 12px; }
.prose .sub-note { margin-top: 12px; font-size: 13px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); line-height: 1.5; }
.prose .sub-note b { color: hsl(var(--foreground)); font-weight: 600; }
.feat-media.is-scene { background: #fff; }
.step-anchor { scroll-margin-top: 96px; }

/* ---------- card grids ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 18px); }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 18px); }
@media (max-width: 900px) { .cards-3, .cards-2 { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 700px) and (max-width: 999px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cards-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: clamp(14px, 2.4vh, 24px) clamp(16px, 1.8vw, 24px);
  border-radius: 20px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); box-shadow: var(--shadow-card);
}
.card .f-ic { width: clamp(30px, 4.4vh, 40px); height: clamp(30px, 4.4vh, 40px); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; background: hsl(260 100% 69% / .1); }
.card h3 { margin: 6px 0 0; font-size: clamp(15.5px, 2.2vh, 18px); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.card p { margin: 0; font-size: clamp(13.5px, 1.9vh, 15px); line-height: 1.6; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.card p b { color: hsl(var(--foreground)); font-weight: 700; }
.card .num { position: absolute; top: 16px; right: 18px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: hsl(var(--muted-foreground)); }
.card .foot { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-family: var(--font-mono); color: hsl(var(--muted-foreground)); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.card .foot b { color: hsl(160 64% 36%); font-weight: 700; }
.card.is-dark { background: linear-gradient(180deg, hsl(240 18% 11%), hsl(240 18% 9%)); border-color: hsl(240 8% 18%); color: #fff; }
.card.is-dark h3 { color: #fff; }
.card.is-dark p { color: hsl(240 8% 70%); }
.card.is-dark p b { color: #fff; }
.card.is-dark .f-ic { background: hsl(260 100% 69% / .18); }
.card.is-dark .foot { color: hsl(240 8% 60%); }
.card.is-dark .num { color: hsl(240 8% 50%); }

/* step cards: numbered, with a small "what you get" foot */
.setup-steps { counter-reset: setup; }
.setup-steps .card::before { counter-increment: setup; content: counter(setup, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: hsl(var(--primary)); font-weight: 700; }

/* ---------- spec tables (souveraineté) ---------- */
.spec-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid hsl(var(--border)); border-radius: 16px; overflow: hidden; background: hsl(var(--card)); font-size: clamp(12px, 1.7vh, 14px); line-height: 1.35; }
.spec-table th, .spec-table td { padding: clamp(5px, 1vh, 11px) 12px; text-align: left; vertical-align: top; border-top: 1px solid hsl(var(--border)); }
.spec-table thead th { border-top: 0; background: hsl(244 50% 98%); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); font-weight: 600; }
.spec-table td b { font-weight: 700; }
.spec-table td small { display: block; font-size: 11.5px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); margin-top: 2px; }
.spec-table td.muted { color: hsl(var(--muted-foreground)); }
.spec-table .pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.spec-table .pill.fr { background: hsl(260 100% 69% / .1); color: hsl(260 80% 45%); }
.spec-table .pill.eu { background: hsl(160 70% 46% / .12); color: hsl(160 64% 30%); }
.spec-table .pill.us { background: hsl(42 100% 50% / .16); color: hsl(36 80% 32%); }
.spec-table .pill.none { background: hsl(160 70% 46% / .12); color: hsl(160 64% 30%); }
.spec-table .pill.opt { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.table-note { margin-top: 10px; font-size: 12.5px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); line-height: 1.5; }
.table-note a { color: hsl(var(--primary)); font-weight: 600; }
.prose-cols.wide-right { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
@media (max-width: 900px) { .prose-cols.wide-right { grid-template-columns: minmax(0, 1fr); } }

/* compact "essentials" strip under a dark band */
.essentials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: clamp(14px, 2.4vh, 22px); }
@media (max-width: 900px) { .essentials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.essentials > div { padding: clamp(12px, 2vh, 18px) 16px; border-radius: 16px; border: 1px solid hsl(240 8% 18%); background: hsl(240 18% 11% / .8); }
.essentials b { display: block; font-size: clamp(22px, 3.4vh, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1; background: linear-gradient(180deg, #fff 0%, hsl(240 10% 72%) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.essentials span { display: block; margin-top: 8px; font-size: clamp(12px, 1.8vh, 13.5px); line-height: 1.45; color: hsl(240 8% 68%); }

/* ---------- desktop rhythm: shrink to fit short screens ---------- */
@media (min-width: 1000px) {
  .page .page-hero { padding: clamp(48px, 9vh, 96px) 0 clamp(28px, 5vh, 56px); }
  .page .page-hero h1 { font-size: clamp(32px, min(4.2vw, 6.6vh), 58px); }
  .page .page-hero .lede { font-size: clamp(15px, min(1.3vw, 2.3vh), 19px); margin-top: clamp(12px, 2vh, 20px); }
  .page .section-tight { padding: clamp(24px, 6vh, 96px) 0; }
  .page .feat-row { gap: clamp(28px, 4.5vw, 88px); }
  .page .prose h2 { font-size: clamp(22px, min(2.4vw, 3.8vh), 34px); margin-bottom: clamp(12px, 2vh, 18px); }
  .page .prose p, .page .prose li { font-size: clamp(14px, 2.1vh, 17px); line-height: 1.65; }
  .page .check-list { gap: clamp(8px, 1.6vh, 14px); margin-top: clamp(14px, 2.4vh, 22px); }
  .page .check-list li { font-size: clamp(14px, 2vh, 16px); line-height: 1.55; }
  /* media panels: never taller than what the row leaves on screen */
  .page .feat-row > .feat-media { max-width: min(100%, 92vh); justify-self: center; width: 100%; }
  .page .feat-row > .feat-media.tall { max-width: min(100%, 66vh); }
  .page .cta-band { padding: clamp(28px, 5.6vh, 64px) clamp(24px, 4vw, 56px); }
  .page .cta-band h2 { font-size: clamp(26px, min(3.4vw, 5.4vh), 48px); }
  .page .cta-band p { margin-bottom: clamp(16px, 2.6vh, 28px); }
  .page .integration-grid { gap: clamp(8px, 1.4vh, 12px); }
  .page .integration { padding: clamp(10px, 1.8vh, 20px); gap: 6px; }
  .page .integration .desc { font-size: clamp(11.5px, 1.6vh, 12.5px); }
  .page .trust-card p { font-size: clamp(12px, 1.75vh, 14px); }
  .page .badge-strip { margin-top: clamp(14px, 2.4vh, 26px); }
}

/* fluid widget scene: never taller than the row allows */
@media (min-width: 1000px) {
  .page .pi-widget { height: min(700px, 66vh) !important; }
  .page .pi-widget .pi-stage { height: 100% !important; }
  .page .card { gap: clamp(5px, 1vh, 8px); }
  .page .card h3 { margin-top: clamp(2px, .8vh, 6px); }
}

/* short desktop screens: one more step down so six cards and long rows still fit */
@media (min-width: 1000px) and (max-height: 800px) {
  .page .card { padding: 12px 16px; gap: 5px; border-radius: 16px; }
  .page .card p { font-size: 12.5px; line-height: 1.42; }
  .page .card h3 { font-size: 15px; }
  .page .card .foot { display: none; }
  .page .cards-3 { gap: 10px; }
  .page .sec-head .lede { font-size: 15px; margin-top: 10px; }
  .page .sec-head .h-section { font-size: clamp(24px, 3vw, 36px); }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .page .prose p, .page .prose li, .page .check-list li { font-size: 13px; line-height: 1.45; }
  .page .check-list { gap: 4px; margin-top: 8px; }
  .page .prose h2 { font-size: clamp(20px, 2.1vw, 26px); margin-bottom: 8px; }
  .page .page-hero .lede { font-size: 14.5px; }
  .page .spec-table { font-size: 11.5px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .page .card { padding: 10px 14px; }
  .page .card p { font-size: 12px; line-height: 1.38; }
  .page .card .f-ic { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
  .page .cards-3 { gap: 8px; }
}
@media (min-width: 1000px) and (max-height: 760px) {
  .page .hide-short, .page .spec-table small, .page .table-note { display: none; }
  .page .spec-table th, .page .spec-table td { padding: 4px 9px; }
  .page .spec-table { font-size: 11.5px; line-height: 1.3; }
  .page .spec-table .pill { font-size: 10.5px; padding: 1px 7px; }
}

/* phones: tables scroll sideways instead of squeezing, chips wrap */
@media (max-width: 720px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
  .table-scroll .spec-table { min-width: 560px; }
  .hero-chips span { font-size: 12px; padding: 6px 10px; }
  .rail a { font-size: 13px; }
  .essentials { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .scene-wide { margin-top: 16px; }
}
