/* Shared Ramp4x4 article + component styles, mirrored from the Norwegian 4x4 hub page so the
   supporting pages share one look. Layered on top of the global /styles.css. */
:root {
  --ramp-green: #1f9d57;
  --ramp-green-bg: #e7f7ee;
  --ramp-red: #c8324a;
  --ramp-blue: #2d6cc0;
  --warn-bg: #fff7e6;
  --warn-border: #f1d9a6;
}

/* Article shell */
.article { padding-top: 2.5rem; padding-bottom: 3.5rem; max-width: 52rem; }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1.25rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.article h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.18; margin: 0 0 0.5rem; }
.lede { font-size: clamp(1.05rem, 2.4vw, 1.2rem); color: var(--text-muted); margin: 0 0 1.5rem; }
.article h2 { font-size: clamp(1.35rem, 3.5vw, 1.65rem); margin: 2.75rem 0 0.9rem; scroll-margin-top: 1.5rem; line-height: 1.25; }
.article h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.article p { margin: 0 0 1rem; }
.article ul, .article ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.article li { margin-bottom: 0.5rem; }
.article strong { color: var(--text); }
.updated { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 2rem; }

/* CTA buttons */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.5rem; }
.btn { display: inline-block; padding: 0.8rem 1.4rem; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid transparent; line-height: 1.2; }
.btn-primary { background: var(--ramp-green); color: #fff; }
.btn-primary:hover { background: #178347; }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }

/* Key facts callout */
.keyfacts { background: var(--ramp-green-bg); border: 1px solid #bfe6cd; border-radius: 10px; padding: 1.25rem 1.4rem; margin: 1.75rem 0; }
.keyfacts h2 { margin: 0 0 0.6rem; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; }
.keyfacts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; }
.keyfacts dt { font-weight: 600; color: var(--text); }
.keyfacts dd { margin: 0; color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 30rem; }
table.data caption { text-align: left; color: var(--text-muted); font-size: 0.85rem; padding-bottom: 0.5rem; }
table.data th, table.data td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); }
table.data thead th { background: var(--surface); border-bottom: 2px solid var(--border); }
table.data tbody tr:nth-child(even) { background: #f4f5f7; }

/* Phase timeline */
.phasebar { display: flex; gap: 4px; margin: 1.25rem 0 0.5rem; flex-wrap: wrap; }
.phase { flex: 1 1 auto; min-width: 2.1rem; text-align: center; border-radius: 6px; padding: 0.55rem 0.2rem; font-size: 0.78rem; font-weight: 700; color: #fff; }
.phase small { display: block; font-weight: 500; opacity: 0.85; font-size: 0.66rem; }
.phase.warm { background: var(--ramp-blue); }
.phase.hard { background: var(--ramp-red); }
.phase.rec  { background: #6b7480; }
.phase.cool { background: var(--ramp-green); }
.legend { font-size: 0.82rem; color: var(--text-muted); margin: 0.25rem 0 0; }
.legend span { display: inline-block; margin-right: 1rem; white-space: nowrap; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; vertical-align: -1px; margin-right: 0.35rem; }

/* Calculator */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin: 1.25rem 0 1.25rem; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.25rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.field input, .field select { width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--text); }
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.calc-out { margin-top: 1.5rem; }
.zone-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.zone { border-radius: 10px; padding: 1.1rem 1.2rem; border: 1px solid var(--border); }
.zone.interval { background: #fdeef0; border-color: #f1c4cc; }
.zone.recovery { background: #eef4fc; border-color: #c6daf3; }
.zone.vo2 { background: #eef7f0; border-color: #bfe6cd; }
.zone .z-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--text-muted); margin: 0 0 0.3rem; }
.zone .z-bpm { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: 0; }
.zone.interval .z-bpm { color: var(--ramp-red); }
.zone.recovery .z-bpm { color: var(--ramp-blue); }
.zone.vo2 .z-bpm { color: var(--ramp-green); }
.zone .z-sub { font-size: 0.85rem; color: var(--text-muted); margin: 0.3rem 0 0; }
.calc-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; }
.calc-karvonen { font-size: 0.9rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--border); }

/* Contextual calculator CTA */
.calc-cta { background: var(--ramp-green-bg); border: 1px solid #bfe6cd; border-radius: 10px; padding: 1.1rem 1.3rem; margin: 0 0 1.5rem; }
.calc-cta p { margin: 0 0 0.85rem; }
.calc-cta .cta-row { margin: 0; }

/* Mistakes / callout list */
.mistakes { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.mistakes li { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ramp-red); border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 0.8rem; }
.mistakes li strong { display: block; margin-bottom: 0.2rem; }

/* Feature list with square bullets */
.features { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.features li { position: relative; padding: 0 0 0 1.6rem; margin-bottom: 0.6rem; }
.features li::before { content: ""; position: absolute; left: 0; top: 0.5rem; width: 0.7rem; height: 0.7rem; border-radius: 3px; background: var(--ramp-green); }

/* Screenshot gallery */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1.1rem; margin: 1.25rem 0 1rem; }
.shot { text-align: center; margin: 0; }
.shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); background: #000; display: block; }
.shot figcaption { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.5rem; }
.shots.phone { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); max-width: 40rem; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: 8px; padding: 0 1.1rem; margin-bottom: 0.7rem; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.95rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-muted); font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details > p { padding: 0.9rem 0; margin: 0; }

/* Disclaimer / references */
.disclaimer { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 1rem 1.2rem; font-size: 0.9rem; margin: 1.5rem 0; }
.refs { font-size: 0.88rem; color: var(--text-muted); }
.refs li { margin-bottom: 0.6rem; }

/* Dark app callout */
.app-callout { background: #0e1116; color: #f3f5f7; border-radius: 14px; padding: 1.6rem 1.6rem; margin: 2rem 0; }
.app-callout h2 { color: #fff; margin: 0 0 0.5rem; }
.app-callout p { color: #c3c9d2; margin: 0 0 0.9rem; }
.app-callout .btn-secondary { background: transparent; color: #8ef0b3; border-color: #2b6b46; }
.app-callout .btn-secondary:hover { border-color: #8ef0b3; }
.app-links { font-size: 0.88rem; color: var(--text-muted); margin: 0.5rem 0 0; }

/* Browser demo timer (matches the app: dark + neon green) */
.demo { background: #0d1014; color: #f3f5f7; border: 1px solid #20272f; border-radius: 16px; padding: 1.6rem 1.4rem 1.4rem; margin: 1.25rem 0 0.6rem; text-align: center; }
.demo-phase { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 800; font-size: 0.95rem; color: #cdd4dd; margin-bottom: 1rem; }
.demo-ring-wrap { position: relative; width: 220px; max-width: 72%; margin: 0 auto 1rem; aspect-ratio: 1 / 1; }
.demo-ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.demo-ring-bg { fill: none; stroke: #232a32; stroke-width: 12; }
.demo-ring-fg { fill: none; stroke: #43e08a; stroke-width: 12; stroke-linecap: round; stroke-dasharray: 565.49; stroke-dashoffset: 565.49; transition: stroke-dashoffset 0.2s linear, stroke 0.3s ease; }
.demo-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; }
.demo-time { font-size: clamp(2.3rem, 9vw, 3.3rem); font-weight: 800; line-height: 1; }
.demo-cue { font-size: 0.82rem; color: #97a0ac; }
.demo-hr { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; justify-content: center; align-items: baseline; margin-bottom: 1rem; }
.demo-hr-now { font-size: 1.45rem; font-weight: 800; }
.demo-hr-now small { font-size: 0.68rem; color: #97a0ac; font-weight: 600; }
.demo-hr-target { color: #cdd4dd; font-size: 0.95rem; }
.demo-zone { font-weight: 700; font-size: 0.95rem; }
.demo-zone.inzone { color: #43e08a; }
.demo-zone.under { color: #4aa3e0; }
.demo-zone.over { color: #ff5a6e; }
.demo-timeline { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.demo-seg { flex: 0 0 auto; min-width: 1.7rem; padding: 0.3rem 0; border-radius: 5px; font-size: 0.72rem; font-weight: 700; background: #232a32; color: #8b95a1; }
.demo-seg.done { background: #2a3b32; color: #9fd9b6; }
.demo-seg.active.warm, .demo-seg.active.rec { background: #4aa3e0; color: #04121d; }
.demo-seg.active.hard { background: #ff5a6e; color: #1d0307; }
.demo-seg.active.cool { background: #43e08a; color: #04130b; }
.demo-controls { display: flex; gap: 0.6rem; justify-content: center; }
.demo-btn { padding: 0.7rem 1.4rem; border-radius: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 1px solid #2f3a44; background: #1b222a; color: #e7ebf0; font-family: inherit; }
.demo-btn.primary { background: #43e08a; color: #04130b; border-color: #43e08a; }
.demo-btn:focus-visible { outline: 2px solid #43e08a; outline-offset: 2px; }
.demo-done { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid #20272f; }
.demo-done p { color: #cdd4dd; margin: 0 0 0.9rem; }
.demo-note { font-size: 0.8rem; color: var(--text-muted); margin: 0.4rem 0 1.5rem; }
/* Demo refinements (v2) */
.demo-head { display: flex; align-items: center; justify-content: center; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.demo-phase { margin-bottom: 0; }
.demo-effort { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.18rem 0.5rem; border-radius: 999px; }
.demo-effort.warm, .demo-effort.rec { background: rgba(74,163,224,0.18); color: #7bc0f0; }
.demo-effort.hard { background: rgba(255,90,110,0.2); color: #ff8a98; }
.demo-effort.cool { background: rgba(67,224,138,0.18); color: #6fe0a6; }
.demo-center { padding: 0 1rem; }
.demo-hr { align-items: center; }
.demo-hr-now { display: flex; align-items: baseline; gap: 0.15rem; }
.demo-bpm { font-size: 1.6rem; font-weight: 800; }
.demo-bpm-unit { font-size: 0.8rem; font-weight: 700; color: #cdd4dd; }
.demo-bpm-sim { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #79828e; margin-left: 0.3rem; }
.demo-hr-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.demo-hr-target { font-size: 0.88rem; }
.demo-timeline { flex-wrap: nowrap; }
.demo-seg { flex: 1 1 0; min-width: 0; text-align: center; }
.demo-controls { flex-wrap: wrap; }
.demo-cta { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem 1.3rem; margin: 0 0 1.5rem; }
.demo-cta-q { font-weight: 700; font-size: 1.05rem; margin: 0 0 0.3rem; color: var(--text); }
.demo-cta-sub { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 0.9rem; }
.demo-cta .cta-row { margin: 0; }

/* Cross-link cards between the hub + supporting pages */
.linkcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.25rem 0 1.5rem; }
.linkcard { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text); }
.linkcard:hover { border-color: var(--accent); }
.linkcard strong { display: block; color: var(--accent); margin-bottom: 0.25rem; }
.linkcard span { font-size: 0.9rem; color: var(--text-muted); }
