/* تنسيق صفحة المنهجيّة — نُقل من method.njk إلى ملفّ مستقلّ ويُحمَّل
   عبر componentCss. 2026-09-14 */

/* ═══════════════════════════════════════════════════════════════════════════
   Method — calculation-provenance trust page. Page-scoped selectors: mth-*
   Reuses shared tokens (_landing.css) + shared .reveal/.container/.btn/.olive-close.
   ═══════════════════════════════════════════════════════════════════════════ */

.mth-section { padding-block: clamp(52px, 7vw, 88px); }
.mth-section--tint { background: var(--bg-section); }
.mth-section--white { background: var(--white); }
.mth-section--cream { background: var(--cream); }

.mth-eyebrow {
  font-size: 12.5px; font-weight: 600;
  color: var(--olive-dark);
  margin-block-end: 12px;
}
.mth-h2 {
  font-size: clamp(25px, 3.1vw, 36px);
  font-weight: 600; line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-block-end: 14px;
  max-width: 20ch;
}
.mth-lead {
  font-size: clamp(16px, 1.5vw, 18.5px);
  line-height: 1.85; color: var(--text-soft);
  max-width: 60ch; margin: 0;
}
.mth-head { margin-block-end: clamp(28px, 4vw, 44px); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.mth-hero { background: var(--cream); padding-block: calc(var(--nav-h) + clamp(32px, 4.5vw, 56px)) clamp(44px, 6vw, 72px); }
.mth-hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 56px); align-items: center; }
@media (min-width: 900px) { .mth-hero-grid { grid-template-columns: 1.05fr 0.95fr; } }
.mth-hero-eyebrow { font-size: 13px; font-weight: 600; color: var(--olive-dark); margin-block-end: 16px; }
.mth-hero h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 600; line-height: 1.18;
  letter-spacing: -0.02em; color: var(--text);
  margin-block-end: 18px; max-width: 15ch;
}
.mth-hero-lead {
  font-size: clamp(16.5px, 1.7vw, 20px);
  line-height: 1.8; color: var(--text-soft);
  max-width: 46ch; margin-block-end: 26px;
}
.mth-hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Provenance ledger (hero signature) ──────────────────────────────────── */
.mth-ledger {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(28,28,30,0.03), 0 18px 40px rgba(28,28,30,0.055);
  padding: clamp(20px, 2.6vw, 28px);
}
.mth-ledger-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-block-end: 14px; margin-block-end: 6px;
  border-block-end: 1px solid var(--border);
}
.mth-ledger-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.mth-ledger-recipe { font-size: 12.5px; color: var(--text-soft); }
.mth-ledger-recipe a { color: var(--olive-dark); text-decoration: none; }
.mth-ledger-recipe a:hover { text-decoration: underline; }
.mth-chain { list-style: none; margin: 0; padding: 0; position: relative; }
.mth-node { position: relative; padding-inline-start: 30px; padding-block: 12px 12px; }
/* connector spine */
.mth-node::before {
  content: ""; position: absolute; inset-inline-start: 8px; inset-block: 0;
  width: 2px; background: var(--border-strong);
}
.mth-node:first-child::before { inset-block-start: 22px; }
.mth-node:last-child::before { inset-block-end: calc(100% - 22px); }
.mth-node::after {
  content: ""; position: absolute; inset-inline-start: 4px; inset-block-start: 16px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--olive);
}
.mth-node-label { font-size: 11.5px; color: var(--text-muted); margin-block-end: 3px; }
.mth-node-value { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.5; }
.mth-node-value .num { font-family: var(--font-en); font-feature-settings: "tnum" 1; }
.mth-node-sub { font-size: 12px; color: var(--text-soft); margin-block-start: 2px; }
.mth-node--result::after { background: var(--olive); border-color: var(--olive); width: 12px; height: 12px; inset-inline-start: 3px; }
.mth-node--result .mth-node-value { color: var(--olive-darker); font-size: 17px; }
.mth-ledger-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-block-start: 8px; margin-inline-start: 30px;
  font-size: 11.5px; font-weight: 600; color: var(--olive-dark);
  background: var(--olive-tint); border-radius: 999px; padding: 4px 11px;
}

/* ── Principles ──────────────────────────────────────────────────────────── */
.mth-principles { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .mth-principles { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.mth-principle { padding-block-start: 20px; border-block-start: 2px solid var(--olive); }
.mth-principle h3 { font-size: 19px; font-weight: 600; color: var(--text); margin-block-end: 8px; }
.mth-principle p { font-size: 15px; line-height: 1.8; color: var(--text-soft); margin: 0; }

/* ── Trace ledger (deep) ─────────────────────────────────────────────────── */
.mth-trace-grid { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 3.5vw, 40px); align-items: start; }
@media (min-width: 900px) { .mth-trace-grid { grid-template-columns: 1.1fr 0.9fr; } }
.mth-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.mth-step {
  position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 16px;
  padding-block: 16px; border-block-end: 1px solid var(--border);
}
.mth-step:last-child { border-block-end: none; }
.mth-step-num {
  counter-increment: step;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--olive-tint); color: var(--olive-darker);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-size: 16px; font-weight: 600;
  font-feature-settings: "tnum" 1;
}
.mth-step-num::before { content: counter(step); }
.mth-step-label { font-size: 16px; font-weight: 600; color: var(--text); margin-block-end: 4px; line-height: 1.5; }
.mth-step-detail { font-size: 14px; line-height: 1.75; color: var(--text-soft); }
.mth-step-detail .num { font-family: var(--font-en); font-feature-settings: "tnum" 1; }
.mth-formula {
  display: inline-block; margin-block-start: 4px;
  font-family: var(--font-en); font-size: 13px; direction: ltr;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; color: var(--text);
}

/* result card */
.mth-result {
  background: var(--white); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: clamp(20px, 2.6vw, 26px);
  position: sticky; inset-block-start: 84px;
}
.mth-result-title { font-size: 13px; color: var(--text-muted); margin-block-end: 4px; }
.mth-result-recipe { font-size: 17px; font-weight: 600; color: var(--text); margin-block-end: 16px; }
.mth-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mth-metric { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; }
.mth-metric-val { font-family: var(--font-en); font-feature-settings: "tnum" 1; font-size: 20px; font-weight: 600; color: var(--text); }
.mth-metric-val .u { font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 12px; font-weight: 500; color: var(--text-soft); margin-inline-start: 3px; }
.mth-metric-key { font-size: 12.5px; color: var(--text-soft); margin-block-start: 2px; }
.mth-gly-row { display: flex; gap: 10px; margin-block-start: 10px; }
.mth-gly { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; }
.mth-gly b { font-family: var(--font-en); font-feature-settings: "tnum" 1; font-size: 18px; color: var(--olive-darker); }
.mth-gly span { font-size: 12.5px; color: var(--text-soft); }
.mth-note {
  display: flex; gap: 12px; align-items: flex-start;
  margin-block-start: clamp(24px, 3vw, 32px);
  padding: 16px 18px; background: var(--info-bg); color: var(--info-text);
  border-radius: 12px; font-size: 13.5px; line-height: 1.75;
}
.mth-note svg { width: 18px; height: 18px; flex-shrink: 0; margin-block-start: 2px; color: var(--info-text); }
.mth-note strong { color: var(--text); font-weight: 600; }

/* evidence figure (real ingredients of the traced recipe) */
.mth-evidence { max-width: 680px; margin: 0 auto clamp(28px, 4vw, 40px); }
.mth-evidence img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(28,28,30,0.03), 0 14px 34px rgba(28,28,30,0.05); }
.mth-evidence figcaption { margin-block-start: 14px; }
.mth-evidence-lead { display: block; font-size: 13.5px; color: var(--text-soft); margin-block-end: 10px; }
.mth-evidence-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mth-evidence-legend li { font-size: 12.5px; color: var(--text); background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }

/* ── Certainty cards ─────────────────────────────────────────────────────── */
.mth-cards { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 760px) { .mth-cards { grid-template-columns: repeat(3, 1fr); } }
.mth-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 24px 22px; border-block-start: 3px solid var(--c, var(--olive)); }
.mth-card[data-kind="calc"] { --c: var(--olive-dark); }
.mth-card[data-kind="est"] { --c: var(--warning); }
.mth-card[data-kind="user"] { --c: var(--info-text); }
.mth-card-tag { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--white)); border-radius: 999px; padding: 4px 11px; margin-block-end: 12px; }
.mth-card h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-block-end: 8px; }
.mth-card p { font-size: 14.5px; line-height: 1.8; color: var(--text-soft); margin: 0; }

/* ── Prose blocks (target / gi / allergen) ───────────────────────────────── */
.mth-prose-grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 44px); }
@media (min-width: 860px) { .mth-prose-grid { grid-template-columns: 1fr 1fr; } }
.mth-block h2 { font-size: clamp(21px, 2.5vw, 27px); font-weight: 600; line-height: 1.35; color: var(--text); margin-block-end: 12px; }
.mth-block p { font-size: 15.5px; line-height: 1.85; color: var(--text-soft); margin: 0 0 12px; }
.mth-inline-note { font-size: 13.5px; color: var(--text-muted); margin-block-start: 4px; }

/* disclosure */
.mth-disc { margin-block-start: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); overflow: hidden; }
.mth-disc > summary {
  cursor: pointer; list-style: none; padding: 14px 18px;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px;
}
.mth-disc > summary::-webkit-details-marker { display: none; }
.mth-disc > summary::after {
  content: ""; width: 10px; height: 10px; flex-shrink: 0;
  border-inline-end: 2px solid var(--text-soft); border-block-end: 2px solid var(--text-soft);
  transform: rotate(45deg); transition: transform 200ms;
}
.mth-disc[open] > summary::after { transform: rotate(-135deg); }
.mth-disc > summary:hover { color: var(--olive-dark); }
.mth-disc-body { padding: 4px 18px 18px; font-size: 14px; line-height: 1.85; color: var(--text-soft); }
.mth-disc-body p { font-size: 14px; line-height: 1.85; margin: 0 0 10px; }
.mth-disc-body ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 7px; }
.mth-disc-body li { font-size: 14px; line-height: 1.7; }
.mth-disc-body a { color: var(--olive-dark); }
.mth-allergen-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
@media (max-width: 520px) { .mth-allergen-grid { grid-template-columns: 1fr; } }
.mth-allergen-grid li { font-size: 13.5px; color: var(--text); padding-block: 5px; display: flex; gap: 8px; }
.mth-allergen-grid li .n { font-family: var(--font-en); font-feature-settings: "tnum" 1; color: var(--olive-dark); font-weight: 600; }

/* ── Sources ─────────────────────────────────────────────────────────────── */
.mth-src-group { margin-block-end: clamp(24px, 3vw, 34px); }
.mth-src-group:last-child { margin-block-end: 0; }
.mth-src-group-label { font-size: 12px; font-weight: 600; color: var(--olive-dark); margin-block-end: 12px; padding-block-end: 8px; border-block-end: 1px solid var(--border); }
.mth-src-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .mth-src-list { grid-template-columns: 1fr 1fr; } }
.mth-src { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.mth-src-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mth-src-name { font-size: 15px; font-weight: 600; color: var(--text); }
.mth-src-name[lang="en"] { font-family: var(--font-en); letter-spacing: -0.005em; }
.mth-src-badge { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.mth-src-badge.primary { color: var(--olive-darker); background: var(--olive-tint); }
.mth-src-badge.support { color: var(--text-soft); background: var(--bg-section); }
.mth-src-role { font-size: 13.5px; line-height: 1.7; color: var(--text-soft); }
.mth-src-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-muted); margin-block-start: 2px; }
.mth-src-meta .en { font-family: var(--font-en); font-feature-settings: "tnum" 1; }
.mth-src-link { font-size: 13px; font-weight: 500; color: var(--olive-dark); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-block-start: 2px; }
.mth-src-link:hover { text-decoration: underline; }
.mth-src-link svg { width: 13px; height: 13px; }

/* ── Governance (review / changelog / limitations) ───────────────────────── */
.mth-gov-grid { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 3.5vw, 40px); }
@media (min-width: 860px) { .mth-gov-grid { grid-template-columns: 1fr 1fr; } }
.mth-panel { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: clamp(22px, 3vw, 30px); }
.mth-panel h2 { font-size: 20px; font-weight: 600; color: var(--text); margin-block-end: 14px; }
.mth-review-line { font-size: 16px; font-weight: 600; color: var(--text); margin-block-end: 6px; }
.mth-review-meta { font-size: 13.5px; color: var(--text-soft); line-height: 1.75; }
.mth-log { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mth-log li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; }
.mth-log-date { font-family: var(--font-en); font-feature-settings: "tnum" 1; font-size: 12.5px; color: var(--olive-dark); font-weight: 600; white-space: nowrap; }
.mth-log-what { font-size: 14px; line-height: 1.7; color: var(--text-soft); }
.mth-limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mth-limits li { position: relative; padding-inline-start: 24px; font-size: 14.5px; line-height: 1.75; color: var(--text-soft); }
.mth-limits li::before {
  content: ""; position: absolute; inset-inline-start: 4px; inset-block-start: 9px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--olive); transform: rotate(45deg);
}
.mth-disclaimer {
  grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 20px; background: var(--info-bg); color: var(--info-text);
  border-radius: 12px; font-size: 13.5px; line-height: 1.75;
}
.mth-disclaimer svg { width: 20px; height: 20px; flex-shrink: 0; margin-block-start: 2px; }
.mth-disclaimer strong { color: var(--text); font-weight: 600; }

/* Motion: honor reduced-motion for anything this page animates. */
@media (prefers-reduced-motion: reduce) {
  .mth-disc > summary::after { transition: none; }
}
