/* ————————————————————————————————
   pressionarterielle.fr — design system
   Palette : signalétique santé publique
———————————————————————————————— */
:root {
  --encre:   #14303C;   /* deep petrol ink */
  --encre-2: #1F4453;
  --papier:  #F5F8F7;   /* clinical off-white */
  --blanc:   #FFFFFF;
  --brume:   #D9E4E1;   /* cool border */
  --texte:   #24404A;
  --texte-2: #59707A;
  --pouls:   #D9463C;   /* pulse red — alerts & heartbeat only */
  --sauge:   #2F8F6B;
  --focus:   #1F6FEB;
  --r: 14px;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--texte);
  background: var(--papier);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--encre-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pouls); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }
.section { padding: 56px 20px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--encre); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-stretch: 108%;
  color: var(--encre);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); font-weight: 750; margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.4em; }
.lead { font-size: 1.16rem; color: var(--texte-2); max-width: 62ch; }
.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-stretch: 115%;
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem;
  color: var(--pouls); margin: 0 0 10px;
}

/* ——— header ——— */
.site-header { background: var(--encre); color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-pulse { width: 52px; color: var(--pouls); }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; letter-spacing: 0.01em; }
.brand-name b { font-weight: 800; }
.brand-tld { opacity: 0.55; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a { color: #fff; text-decoration: none; font-weight: 500; font-size: 0.95rem; opacity: 0.9; }
.site-nav a:hover { opacity: 1; color: #fff; text-decoration: underline; text-decoration-color: var(--pouls); text-decoration-thickness: 2px; }

/* ——— home hero ——— */
.home-hero { background: linear-gradient(180deg, var(--blanc), var(--papier)); border-bottom: 1px solid var(--brume); padding: 72px 0 56px; }
.home-hero h1 em { font-style: normal; color: var(--pouls); }
.bp-form {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  margin-top: 28px; background: var(--blanc); border: 1px solid var(--brume);
  border-radius: var(--r); padding: 20px 22px; max-width: 560px;
  box-shadow: 0 8px 28px rgba(20, 48, 60, 0.07);
}
.bp-field { display: flex; flex-direction: column; gap: 6px; }
.bp-field span { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texte-2); }
.bp-field input {
  width: 118px; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem;
  padding: 8px 12px; border: 2px solid var(--brume); border-radius: 10px;
  color: var(--encre); background: var(--papier); font-variant-numeric: tabular-nums;
}
.bp-field input:focus { border-color: var(--encre-2); outline: none; }
.bp-slash { font-family: var(--font-display); font-size: 2.2rem; font-weight: 300; color: var(--brume); padding-bottom: 4px; }
.btn-primary {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  background: var(--pouls); color: #fff; border: 0; border-radius: 10px;
  padding: 14px 26px; cursor: pointer; transition: transform 0.12s ease, background 0.12s ease;
}
.btn-primary:hover { background: #C13A31; transform: translateY(-1px); }
.bp-hint { font-size: 0.92rem; color: var(--texte-2); margin-top: 12px; }
.bp-hint.is-error { color: var(--pouls); font-weight: 600; }

/* ——— category table ——— */
.table-scroll { overflow-x: auto; }
.cat-table { border-collapse: collapse; width: 100%; background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); overflow: hidden; }
.cat-table th, .cat-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--brume); }
.cat-table th { font-family: var(--font-display); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--texte-2); background: var(--papier); }
.cat-table tr:last-child td { border-bottom: 0; }
.cat-table .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cat-table .andor { color: var(--texte-2); font-size: 0.9rem; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }

/* ——— article cards ——— */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.more { font-weight: 600; white-space: nowrap; }
.cat-heading { margin-top: 40px; padding-top: 8px; border-top: 3px solid var(--encre); display: inline-block; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; margin-top: 18px; }
.article-card {
  background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(20, 48, 60, 0.1); color: inherit; }
.article-card img { aspect-ratio: 8 / 5; object-fit: cover; background: var(--brume); }
.article-card h3 { padding: 0 18px; margin: 8px 0 6px; }
.article-card p { padding: 0 18px 18px; margin: 0; font-size: 0.95rem; color: var(--texte-2); }
.article-cat { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pouls); padding: 14px 18px 0; }

/* ——— check hero ——— */
.check-hero { background: var(--encre); color: #fff; padding: 64px 0 48px; text-align: center; }
.check-hero .eyebrow { color: rgba(255,255,255,0.65); }
.reading { color: #fff; margin: 0; font-variant-numeric: tabular-nums; }
.reading-value { font-size: clamp(4rem, 14vw, 8.5rem); font-weight: 900; font-stretch: 62%; letter-spacing: -0.02em; }
.reading-sep { font-size: clamp(3rem, 10vw, 6rem); font-weight: 200; margin: 0 0.06em; color: rgba(255,255,255,0.4); }
.reading-unit { display: block; font-family: var(--font-body); font-size: 1rem; letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-top: 4px; }
.pulse-line { width: min(560px, 86%); height: 54px; margin: 10px auto 6px; color: var(--pouls); }
.pulse-path { stroke-dasharray: 800; stroke-dashoffset: 800; animation: pulse-draw 1.6s ease-out 0.2s forwards; }
@keyframes pulse-draw { to { stroke-dashoffset: 0; } }
.verdict-badge {
  display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  background: var(--cat-color, var(--sauge)); color: #fff; border-radius: 999px;
  padding: 10px 26px; margin: 14px 0 0;
}

.alert { text-align: left; border-radius: var(--r); padding: 16px 20px; margin: 24px auto 0; max-width: 720px; font-size: 0.98rem; }
.alert-critical { background: #FDECEA; color: #7C1D12; border: 2px solid var(--pouls); }
.alert-warning { background: #FBF3E2; color: #6E4A08; border: 2px solid #D9A83C; }
.check-hero .alert strong { font-family: var(--font-display); }

/* ——— gauge ——— */
.gauge { margin: 26px 0 30px; }
.gauge-track { position: relative; display: flex; height: 26px; border-radius: 999px; overflow: visible; }
.gauge-seg { flex: 1; opacity: 0.35; transition: opacity 0.3s; }
.gauge-seg:first-child { border-radius: 999px 0 0 999px; }
.gauge-seg:last-child { border-radius: 0 999px 999px 0; }
.gauge-seg.is-active { opacity: 1; }
.gauge-needle {
  position: absolute; top: -10px; bottom: -10px; width: 4px; margin-left: -2px;
  background: var(--encre); border-radius: 4px;
  animation: needle-in 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.gauge-needle-dot { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; background: var(--encre); border-radius: 50%; }
@keyframes needle-in { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.gauge-labels { display: flex; margin-top: 12px; }
.gauge-labels span { flex: 1; text-align: center; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-2); }
.gauge-labels .is-active { color: var(--encre); font-weight: 800; }

.note, .pp-note { background: var(--blanc); border-left: 4px solid var(--encre-2); border-radius: 0 var(--r) var(--r) 0; padding: 14px 18px; font-size: 0.98rem; }

/* ——— cards / steps ——— */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card { background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 24px; }
.card-kicker { font-family: var(--font-display); font-weight: 900; font-size: 2rem; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.num-sys { color: var(--pouls); }
.num-dia { color: var(--encre-2); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 22px; }
.step { background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 22px; }
.step h4 { margin: 0 0 8px; font-size: 1.05rem; }
.step p { margin: 0; font-size: 0.96rem; }

/* ——— related readings ——— */
.related-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 14px 0 0; }
.related-list a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blanc); border: 1px solid var(--brume); border-radius: 999px;
  padding: 8px 16px; text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums;
}
.related-list a:hover { border-color: var(--encre-2); }

/* ——— article page ——— */
.article-hero { padding-top: 48px; }
.article-cover { border-radius: var(--r); margin: 26px auto 0; background: var(--brume); }
.article-body { padding: 40px 20px 10px; }
.article-body h2 { margin-top: 1.6em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: 0.45em; }
.article-body table { border-collapse: collapse; width: 100%; background: var(--blanc); border: 1px solid var(--brume); margin: 1em 0; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--brume); text-align: left; }
.article-body th { background: var(--papier); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.article-body blockquote { border-left: 4px solid var(--pouls); margin: 1.2em 0; padding: 4px 0 4px 18px; color: var(--texte-2); font-style: italic; }
.sources { font-size: 0.88rem; color: var(--texte-2); border-top: 1px solid var(--brume); margin-top: 2.5em; padding-top: 1em; }
.article-cta { background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 26px; margin: 40px auto 60px; }
.article-cta h2 { margin-top: 0; }

/* ——— footer ——— */
.site-footer { background: var(--encre); color: rgba(255,255,255,0.85); margin-top: 60px; padding: 44px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.footer-brand { font-family: var(--font-display); font-size: 1.15rem; color: #fff; margin: 0 0 8px; }
.footer-note { font-size: 0.9rem; margin: 0; max-width: 46ch; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #fff; }
.disclaimer { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15); border-radius: var(--r); padding: 16px 20px; font-size: 0.88rem; margin: 28px 0 16px; line-height: 1.6; }
.footer-copy { font-size: 0.82rem; opacity: 0.6; }

/* ——— responsive ——— */
@media (max-width: 760px) {
  .cols-2, .steps, .footer-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .section { padding: 40px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse-path { animation: none; stroke-dashoffset: 0; }
  .gauge-needle { animation: none; }
  .article-card, .btn-primary { transition: none; }
}

/* ——— metrics ——— */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-top: 20px; }
.metric { background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 20px; }
.metric-value { font-family: var(--font-display); font-weight: 900; font-size: 2rem; color: var(--encre); margin: 0; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 0.95rem; font-weight: 600; color: var(--texte-2); }
.metric-name { font-weight: 700; margin: 6px 0 4px; font-size: 0.95rem; }
.metric-hint { font-size: 0.85rem; color: var(--texte-2); margin: 0; line-height: 1.5; }

/* ——— dynamic figures ——— */
.figures { align-items: start; }
.figure { margin: 0; background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 18px; }
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-size: 0.85rem; color: var(--texte-2); margin-top: 10px; line-height: 1.5; }
.g-line { stroke: rgba(20, 48, 60, 0.18); stroke-width: 1; stroke-dasharray: 3 4; }
.g-tick, .w-tick { font: 600 11px var(--font-body); fill: var(--texte-2); }
.g-axis { font: 700 12px var(--font-body); fill: var(--texte); }
.g-zone { font: 600 11px var(--font-body); fill: #9AABA6; letter-spacing: 0.04em; }
.g-cross { stroke: var(--encre); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0.55; }
.g-dot { fill: var(--encre); stroke: #fff; stroke-width: 2.5; }
.g-dot-halo { fill: var(--encre); opacity: 0.18; }
.g-label { font: 800 17px var(--font-display); fill: var(--encre); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.w-path { fill: none; stroke: var(--pouls); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.w-guide { stroke: var(--encre-2); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: 0.6; }
.w-tag { font: 700 10px var(--font-body); fill: var(--encre-2); letter-spacing: 0.08em; }
.w-ref { fill: #2F8F6B; opacity: 0.1; }
.w-ref-label { font: 600 10px var(--font-body); fill: #2F8F6B; }

/* ——— faq ——— */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.faq-item { background: var(--blanc); border: 1px solid var(--brume); border-radius: var(--r); padding: 4px 20px; }
.faq-item summary { font-weight: 700; cursor: pointer; padding: 14px 0; list-style: none; position: relative; padding-right: 30px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; color: var(--pouls); transition: transform 0.15s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin: 0 0 16px; color: var(--texte-2); }

/* ——— browsable index / hub pages ——— */
.index-grid { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.index-grid-wide { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.index-grid a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blanc); border: 1px solid var(--brume); border-radius: 8px;
  padding: 9px 6px; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  font-variant-numeric: tabular-nums; color: var(--encre);
}
.index-grid a:hover { border-color: var(--encre-2); background: #fff; }
.index-grid .dot { width: 8px; height: 8px; margin: 0; flex: none; }
.hub-nav { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--brume); font-weight: 600; }

/* ————————————————————————————————
   Mobile refinements (site-wide pass)
———————————————————————————————— */

/* Article tables can be wider than a phone screen: scroll instead of overflow */
.article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
.article-body table thead, .article-body table tbody, .article-body table tr { display: table; width: 100%; }
@media (min-width: 700px) {
  .article-body table { display: table; white-space: normal; }
}

@media (max-width: 640px) {
  /* Homepage form: inputs share a row, button goes full width below */
  .bp-form { padding: 16px; gap: 10px; }
  .bp-field { flex: 1; }
  .bp-field input { width: 100%; font-size: 1.7rem; }
  .bp-slash { padding-bottom: 8px; }
  .btn-primary { width: 100%; padding: 15px; }

  /* Gauge: 7 category labels don't fit — show only the active one, centered */
  .gauge-labels { position: relative; min-height: 1.4em; }
  .gauge-labels span { display: none; }
  .gauge-labels .is-active { display: block; position: absolute; left: 0; right: 0; text-align: center; font-size: 0.85rem; }

  /* Check hero: tighter spacing, full-width alerts */
  .check-hero { padding: 44px 0 36px; }
  .alert { margin-left: 16px; margin-right: 16px; }

  /* Metrics: single column reads better than a 2x2 squeeze */
  .metrics { grid-template-columns: 1fr; }

  /* Figures stack with breathing room */
  .figure { padding: 12px; }

  /* Related readings + index grids: slightly denser chips */
  .related-list a { padding: 7px 13px; font-size: 0.92rem; }
  .index-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .index-grid-wide { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }

  /* Steps / cards: reduce padding so content wins */
  .card, .step { padding: 18px; }

  /* Section rhythm */
  .section { padding: 32px 16px; }
  .wrap { padding: 0 16px; }

  /* Footer nav as tap-friendly rows */
  .site-footer nav { gap: 12px; }
  .site-footer nav a { padding: 4px 0; display: inline-block; }
}

/* Very small phones */
@media (max-width: 380px) {
  .reading-value { font-size: 3.4rem; }
  .reading-sep { font-size: 2.4rem; }
  .brand-name { font-size: 1rem; }
  .brand-pulse { width: 40px; }
}

/* Tap targets: ensure interactive chips meet 40px+ height on touch */
@media (pointer: coarse) {
  .related-list a, .index-grid a { min-height: 42px; }
  .faq-item summary { padding-top: 16px; padding-bottom: 16px; }
}
