/* The hiking-apps comparison page (/appli-randonnee-reunion), generated by
   scripts/build-compare.mjs. Loaded after randonnees.css, whose palette, top bar, crumbs, kicker,
   store badges and footer it reuses. Light by default, dark with the system, like the fiches. */
:root {
  --rm-tint: rgba(26, 98, 240, 0.055);
  --rm-line: rgba(26, 98, 240, 0.32);
  --rm-head: #e9f0fe;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --part: #92400e;
  --part-bg: #fdf1dc;
  --no: #475569;
  --no-bg: #eef1f5;
  --stale: #7a5200;
  --stale-bg: #fff7e0;
  --stale-line: #f0c14b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rm-tint: rgba(91, 141, 239, 0.08);
    --rm-line: rgba(91, 141, 239, 0.42);
    --rm-head: #13244a;
    --ok: #6ee7a0;
    --ok-bg: rgba(34, 197, 94, 0.14);
    --part: #fcd28a;
    --part-bg: rgba(245, 158, 11, 0.14);
    --no: #b9c4d8;
    --no-bg: rgba(148, 163, 184, 0.14);
    --stale: #f5d36b;
    --stale-bg: rgba(234, 179, 8, 0.14);
    --stale-line: #8a6d1d;
  }
}

.compare h2 {
  margin: 4px 0 0;
}

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

.compare .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 20px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--depart);
  flex: none;
}

.pill.stale {
  background: var(--stale-bg);
  border-color: var(--stale-line);
  color: var(--stale);
}

.pill.stale i {
  background: #d99a00;
}

.pill small {
  font-size: 13px;
  font-weight: 600;
}

.compare .by {
  font-size: 14px;
  color: var(--muted);
}

.toc {
  margin: 28px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.toc b {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: inline-flex;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc);
  color: var(--muted);
  font-weight: 700;
}

/* ---- Panels ---- */

.pnl {
  margin-top: 40px;
  border-radius: 24px;
  padding: clamp(20px, 4.5vw, 44px);
  scroll-margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(11, 23, 48, 0.07);
}

.h-sub {
  margin: 8px 0 0;
  color: var(--ink-2);
}

/* The summary table needs more than the 820 px reading width: it breaks out to 1080 px, centred
   on the column, and never wider than the viewport (56 px leaves room for a classic scrollbar). */
.pnl.wide {
  --w: min(1080px, 100vw - 56px);
  width: var(--w);
  margin-left: calc((100% - var(--w)) / 2);
}

/* ---- States ---- */

.st {
  display: inline-block;
  align-self: start;
  justify-self: start;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.st-oui {
  background: var(--ok-bg);
  color: var(--ok);
}

.st-partiel {
  background: var(--part-bg);
  color: var(--part);
}

.st-non {
  background: var(--no-bg);
  color: var(--no);
}

/* "To check" stays distinct from the amber "partly": grey and dashed. Drafts only. */
.compare mark.verify {
  background: none;
  color: var(--muted);
  border: 1px dashed var(--muted);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 0.78em;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- Verdict ---- */

.answer {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-left: 4px solid var(--action);
  border-radius: 0 14px 14px 0;
  background: var(--rm-tint);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ---- Summary ---- */

.tbl-wrap {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

table.syn {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
}

.syn th,
.syn td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--border);
}

.syn thead th {
  border-top: 0;
  font-weight: 800;
  background: var(--canvas);
}

.syn tbody th {
  width: 132px;
  font-weight: 700;
}

.syn .k {
  display: block;
  margin-top: 6px;
  color: var(--ink-2);
}

.syn .rmc {
  background: var(--rm-tint);
  box-shadow: inset 1px 0 0 var(--rm-line), inset -1px 0 0 var(--rm-line);
}

.syn thead .rmc {
  color: var(--action);
  background: var(--rm-head);
  box-shadow: inset 1px 0 0 var(--rm-line), inset -1px 0 0 var(--rm-line), inset 0 3px 0 var(--action);
}

.amt-sm {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.amt-sm small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.price-row td .k {
  margin-top: 2px;
}

.appcards {
  display: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Why RandoMafate ---- */

.why {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.why li {
  padding: 18px;
  border-radius: 16px;
  background: var(--canvas);
  border: 1px solid var(--border);
}

.why b {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 800;
}

.why p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* RandoMafate, use by use, under the summary table. */
.uses-h {
  margin: 26px 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--action);
}

.uses {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.uses b {
  color: var(--ink);
}

/* ---- Prices ---- */

.prices {
  margin-top: 22px;
}

.price {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.price p {
  margin: 0;
}

.price .nm {
  font-weight: 800;
}

.price .amt {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.price .amt small {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.price .when,
.price .alt {
  font-size: 13px;
  color: var(--muted);
}

/* The weekly plan, for visitors on a short stay: a pill so it reads as its own offer. */
.price .wk {
  width: fit-content;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--ok-bg);
  color: var(--ok);
}

.price .when {
  margin-top: auto;
  padding-top: 8px;
}

.price.rm {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  border-color: var(--rm-line);
  background: var(--rm-tint);
}

.price.rm .nm {
  color: var(--action);
}

.price.rm h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.price.rm ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.45;
}

.price.rm li {
  display: flex;
  gap: 8px;
}

.price.rm li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--action);
}

.price.rm .free li::before {
  background: var(--depart);
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- FAQ ---- */

.faq {
  margin-top: 18px;
}

.faq details {
  border-top: 1px solid var(--border);
}

.faq details:last-child {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-weight: 600;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 0;
  padding: 0 2px 18px;
  color: var(--ink-2);
}

.faq summary:focus-visible,
.appcard summary:focus-visible,
.toc a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* ---- Phone ---- */

@media (max-width: 760px) {
  .tbl-wrap {
    display: none;
  }

  .appcards {
    display: grid;
    gap: 10px;
    margin-top: 18px;
  }

  .appcard {
    border: 1px solid var(--border);
    border-radius: 16px;
  }

  .appcard.rm {
    border-color: var(--rm-line);
    background: var(--rm-tint);
  }

  .appcard summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 800;
  }

  .appcard summary::-webkit-details-marker {
    display: none;
  }

  .appcard summary::after {
    content: "+";
    color: var(--muted);
  }

  .appcard[open] summary::after {
    content: "–";
  }

  .appcard.rm summary {
    color: var(--action);
  }

  .appcard dl {
    margin: 0;
    padding: 0 16px 8px;
  }

  .appcard dl > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.4;
  }

  .appcard dt {
    font-weight: 700;
  }

  .appcard dd {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--ink-2);
  }

  .appcard .st {
    grid-column: 2;
    grid-row: 1;
  }

  .appcard .dd-price .k {
    display: inline;
    margin-left: 6px;
  }

  .appcard .dd-price .amt-sm {
    display: inline;
  }
}

@media (max-width: 640px) {
  .pnl {
    margin-top: 24px;
    border-radius: 20px;
  }

  .toc ol {
    display: grid;
    gap: 2px;
  }

  .toc a {
    padding: 4px 0;
    background: none;
  }

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

  .answer {
    font-size: 17px;
  }

  .faq summary {
    font-size: 16px;
  }
}
