/* ECG Pro — shared editorial stylesheet for the finding pages.
   Tokens match index.html. Contrast values are the corrected ones:
   --text-tertiary is #6a6a6a (5.19:1), not the #888 the sibling site uses. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --text-primary: #1a1a1a;
  --text-secondary: #4f4f4f;
  --text-tertiary: #6a6a6a;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f5f2;
  --border: #e0ddd8;
  --accent: #2f3350;
  --accent-soft: rgba(47, 51, 80, 0.08);
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
}

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: #fbfaf9;
  background-image: url('../images/bg-texture.jpg');
  background-repeat: repeat;
  background-size: 1200px auto;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 100;
  background: var(--text-primary); color: #fff;
  padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
}

/* ── Nav ── */
.site-nav { border-bottom: 0.5px solid var(--border); padding: 1.25rem 0; }
.nav-inner {
  max-width: 720px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 500; }
.nav-logo img { width: 26px; height: 26px; border-radius: 6px; }
.nav-cta {
  font-size: 13px; font-weight: 500; background: var(--bg-secondary);
  border-radius: 6px; padding: 4.5px 14px; white-space: nowrap;
}

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: 720px; margin: 0 auto; padding: 1.5rem 2rem 0;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--text-primary); text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── Article shell ── */
.article-wrap { max-width: 720px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.article-header { margin-bottom: 1.75rem; }

h1 {
  font-family: var(--font-serif); font-weight: 400; font-size: 34px; line-height: 1.2;
  margin-bottom: 0.6rem;
}
.article-meta {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary);
}

/* The definition. First paragraph on the page, deliberately self-contained:
   no pronouns, no back-references, so it survives being lifted out of context
   by a search engine or a language model. */
.definition {
  font-family: var(--font-serif); font-size: 19px; line-height: 1.65;
  color: var(--text-primary); margin: 1.5rem 0 1.75rem;
  padding-left: 1.1rem; border-left: 3px solid var(--accent);
}

h2 {
  font-family: var(--font-serif); font-weight: 500; font-size: 23px; line-height: 1.3;
  margin: 2.75rem 0 0.9rem;
}
h3 { font-size: 16px; font-weight: 600; margin: 1.5rem 0 0.5rem; line-height: 1.4; }
p { font-size: 16px; line-height: 1.75; color: var(--text-secondary); margin-bottom: 1rem; }
article a:not(.chip):not(.cta-btn) { text-decoration: underline; text-underline-offset: 2px; color: var(--text-primary); }
ul, ol { padding-left: 1.4rem; margin-bottom: 1.1rem; }
li { font-size: 16px; line-height: 1.75; color: var(--text-secondary); margin-bottom: 0.4rem; }
li strong, p strong { font-weight: 600; color: var(--text-primary); }

/* ── Criteria table — the machine-readable core of every page ── */
.criteria-table, .dx-table {
  width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-size: 15px;
}
.criteria-table th, .dx-table th {
  text-align: left; font-weight: 600; color: var(--text-primary);
  padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.criteria-table td, .dx-table td {
  padding: 0.7rem 0.85rem; border-bottom: 0.5px solid var(--border);
  color: var(--text-secondary); vertical-align: top; line-height: 1.6;
}
.criteria-table tr:last-child td, .dx-table tr:last-child td { border-bottom: none; }
.criteria-table th[scope="row"], .criteria-table .feature {
  font-weight: 600; color: var(--text-primary); white-space: nowrap;
  font-size: 15px; letter-spacing: 0; text-transform: none;
  border-bottom: 0.5px solid var(--border);
}
.dx-table .dx-name { font-weight: 600; color: var(--text-primary); }
.table-scroll { overflow-x: auto; }

/* ── Numbered recognition steps ── */
.steps-list { counter-reset: steps; list-style: none; padding: 0; margin-bottom: 1.1rem; }
.steps-list li { counter-increment: steps; padding-left: 2.6rem; position: relative; margin-bottom: 1rem; }
.steps-list li::before {
  content: counter(steps);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ── Callouts ── */
.key-points, .pitfalls {
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 1.25rem 1.25rem 1.25rem 2.4rem; margin-bottom: 1.1rem;
}
.key-points li:last-child, .pitfalls li:last-child { margin-bottom: 0; }
.note-card {
  background: var(--bg-secondary); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 1.1rem 1.25rem; margin: 1.5rem 0;
}
.note-card p:last-child { margin-bottom: 0; }

/* ── Chips ── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.25rem 0; }
.chip {
  font-size: 13px; padding: 0.45rem 0.85rem; border-radius: 999px;
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  color: var(--text-secondary); text-decoration: none;
}
.chip:hover { background: #efede8; color: var(--text-primary); }

/* ── FAQ ── */
details.faq-acc { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
details.faq-acc summary {
  list-style: none; cursor: pointer; display: flex;
  justify-content: space-between; align-items: flex-start; gap: 14px; padding: 15px 18px;
}
details.faq-acc summary::-webkit-details-marker { display: none; }
details.faq-acc summary h3 {
  flex: 1; font-family: var(--font-serif); font-size: 16px; font-weight: 500;
  line-height: 1.5; margin: 0;
}
details.faq-acc summary::after { content: "+"; font-size: 24px; font-weight: 300; color: var(--text-tertiary); line-height: 1.3; flex-shrink: 0; }
details.faq-acc[open] summary::after { content: "\2013"; }
details.faq-acc .faq-answer { padding: 0 18px 16px; }
details.faq-acc .faq-answer p:last-child { margin-bottom: 0; }

/* ── End CTA ── */
.end-cta { margin-top: 3.5rem; padding-top: 3rem; border-top: 0.5px solid var(--border); text-align: center; }
.end-cta-text {
  font-family: var(--font-serif); font-size: 22px; font-weight: 400;
  line-height: 1.5; margin: 0 auto 1.75rem; max-width: 520px; color: var(--text-primary);
}
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--text-primary); color: #fff; border-radius: 8px;
  padding: 15px 26px; font-size: 15px; font-weight: 500;
}

/* ── Related ── */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 0.5px solid var(--border); }
.related h2 {
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 0 0 1rem;
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.related-item {
  display: block; background: var(--bg-secondary); border-radius: 10px;
  padding: 0.8rem 1rem; transition: background 0.2s ease, transform 0.2s ease;
}
.related-item:hover { background: #efede8; transform: translateY(-2px); }
.related-item strong { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 0.15rem; }
.related-item span { font-size: 13px; color: var(--text-tertiary); line-height: 1.5; }

/* ── Hub page ── */
.hub-intro { font-size: 17px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 2rem; }
.group { margin-bottom: 2.75rem; }
.group-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 0 0 0.9rem;
}
.finding-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 0.75rem 0; border-bottom: 0.5px solid var(--border);
}
.finding-row:last-child { border-bottom: none; }
.finding-name { font-size: 16px; font-weight: 500; color: var(--text-primary); min-width: 260px; }
.finding-name a { text-decoration: underline; text-underline-offset: 3px; }
.finding-desc { font-size: 14px; color: var(--text-tertiary); line-height: 1.6; }

/* ── Footer ── */
footer.site-footer { background: var(--bg-secondary); border-top: 0.5px solid var(--border); padding: 3.5rem 0 3rem; }
.footer-inner { max-width: 720px; margin: 0 auto; padding: 0 2rem; }
.footer-brand-name { font-family: var(--font-serif); font-size: 22px; margin-bottom: 0.75rem; }
.footer-contact { font-size: 13px; color: var(--text-tertiary); line-height: 1.8; margin-bottom: 2rem; }
.footer-contact a { color: var(--text-secondary); text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 2rem; }
.footer-links a { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-about { padding-top: 1.75rem; border-top: 0.5px solid var(--border); font-size: 12px; color: var(--text-tertiary); line-height: 1.7; }
.footer-about strong { color: var(--text-secondary); font-weight: 500; }
.footer-legal { margin-top: 1.25rem; font-size: 12px; color: var(--text-tertiary); line-height: 1.7; }

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 26px; }
}
@media (max-width: 600px) {
  h1 { font-size: 28px; }
  .definition { font-size: 17px; }
  .related-grid { grid-template-columns: 1fr; }
  .finding-row { flex-direction: column; gap: 3px; }
  .finding-name { min-width: 0; }
  .criteria-table, .dx-table { font-size: 14px; }
  .nav-cta { font-size: 12px; padding: 5px 11px; }
}
