/* ECG+ — shared editorial stylesheet for content pages */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-tertiary: #888;
  --bg-primary: #ffffff;
  --bg-secondary: #f6f5f2;
  --border: #e0ddd8;
  --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; }

/* 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;
}
.nav-logo { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 500; color: var(--text-primary); }
.nav-logo img { width: 26px; height: 26px; display: block; }
.lang-switch { font-size: 13px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0.02em; }
.lang-switch a { color: var(--text-tertiary); }
.lang-switch a:hover { color: var(--text-primary); text-decoration: underline; }
.lang-switch .active { color: var(--text-primary); }

/* in-app: hide every download CTA (set via ?inapp=1) */
html.in-app .app-download { display: none !important; }

/* 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 { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--border); }

/* Article */
.article-wrap { max-width: 720px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }
.article-header { margin-bottom: 2rem; }
h1 {
  font-family: var(--font-serif); font-weight: 400; font-size: 34px; line-height: 1.2;
  color: var(--text-primary); margin-bottom: 0.75rem;
}
.article-meta {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.article-intro { font-size: 17px; line-height: 1.7; color: #444; margin-bottom: 1.75rem; font-style: italic; }
h2 {
  font-family: var(--font-serif); font-weight: 500; font-size: 23px; line-height: 1.3;
  color: var(--text-primary); margin: 2.75rem 0 0.9rem;
}
h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 1.5rem 0 0.5rem; line-height: 1.4; }
p { font-size: 16px; line-height: 1.75; color: #444; margin-bottom: 1rem; font-weight: 400; }
article a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
article a.pattern-item, article a.finding-item { text-decoration: none; }
ul, ol { padding-left: 1.4rem; margin-bottom: 1.1rem; }
li { font-size: 16px; line-height: 1.75; color: #444; margin-bottom: 0.4rem; font-weight: 400; }
li strong, p strong { font-weight: 600; color: var(--text-primary); }

.article-img { border-radius: 12px; overflow: hidden; margin: 1.75rem 0; border: 0.5px solid var(--border); }
.article-img img { width: 100%; }

/* Callout list */
.key-points {
  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 { margin-bottom: 0; }

/* Table */
.threshold-table, .compare-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.5rem; font-size: 14px; }
.threshold-table th, .compare-table th { text-align: left; font-weight: 600; color: var(--text-primary); padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); }
.threshold-table td, .compare-table td { padding: 0.65rem 0.85rem; border-bottom: 0.5px solid var(--border); color: #444; }
.threshold-table tr:last-child td, .compare-table tr:last-child td { border-bottom: none; }

/* Pattern / finding cards grid */
.pattern-grid, .finding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1.1rem; }
.pattern-item, .finding-item {
  display: block; background: var(--bg-secondary); border-radius: 10px;
  padding: 0.875rem 1rem; color: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}
.pattern-item:hover, .finding-item:hover { background: #efede8; transform: translateY(-2px); }
.pattern-item strong, .finding-item strong, .finding-item h3 { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0 0 0.2rem; }
.pattern-item span, .finding-item p { font-size: 13px; color: var(--text-tertiary); margin: 0; line-height: 1.5; }

/* Steps */
.steps-list { counter-reset: steps; list-style: none; padding: 0; margin-bottom: 1.1rem; }
.steps-list li { counter-increment: steps; padding-left: 2.4rem; position: relative; margin-bottom: 0.9rem; }
.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-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* End-of-article download CTA */
.end-cta { margin-top: 3.5rem; padding-top: 3rem; border-top: 0.5px solid var(--border); text-align: center; }
.end-cta-feelings {
  font-family: var(--font-serif); font-size: 21px; font-weight: 400;
  color: var(--text-tertiary); line-height: 1.6; margin: 0 0 1.25rem;
}
.end-cta-text {
  font-family: var(--font-serif); font-size: 24px; font-weight: 400;
  color: var(--text-primary); line-height: 1.45; margin: 0 auto 1.9rem; max-width: 520px;
}
.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; font-family: var(--font-sans); text-decoration: none;
}
.end-cta-note { font-size: 13px; color: var(--text-tertiary); margin-top: 0.875rem; }

/* FAQ */
.faq-item { padding: 1.4rem 0; border-bottom: 0.5px solid var(--border); }
.faq-item:last-of-type { border-bottom: none; }
.faq-item h3 { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--text-primary); margin: 0 0 0.5rem; }
.faq-item p { margin-bottom: 0; }

/* Related */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 0.5px solid var(--border); }
.related h3 {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 1rem;
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 0.5rem; }
.related a { font-size: 14px; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.related a:hover { color: var(--text-primary); }

/* Guide-page components */
figure.article-figure { margin: 1.75rem 0; }
.article-figure figcaption { margin-top: 0.6rem; font-size: 13px; color: var(--text-tertiary); text-align: center; line-height: 1.5; }

.bridge {
  background: var(--bg-secondary); border-left: 3px solid #c0392b;
  border-radius: 0 10px 10px 0; padding: 1.1rem 1.25rem; margin: 1.5rem 0;
}
.bridge p { margin-bottom: 0.5rem; color: #444; }
.bridge p:last-child { margin-bottom: 0; }
.bridge a { text-decoration: underline; font-weight: 600; color: var(--text-primary); }

.question-list { list-style: none; padding: 0; margin-bottom: 1.1rem; }
.question-list li {
  padding: 0.875rem 1.1rem; background: var(--bg-secondary); border-radius: 10px;
  margin-bottom: 0.5rem; color: #444; line-height: 1.6; font-size: 15px;
}
.question-list li::before { content: "Q: "; font-weight: 600; color: var(--text-primary); }

.group { margin-bottom: 3rem; }
.group-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 1rem;
}
.finding-row { display: flex; align-items: baseline; gap: 12px; 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); }
.finding-name a { text-decoration: underline; text-underline-offset: 3px; }
.finding-desc { font-size: 14px; color: var(--text-tertiary); }

.intro-card { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.intro-card p { margin-bottom: 0; }
.measure-list { 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; }
.measure-list li:last-child { margin-bottom: 0; }
.original-badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); border: 0.5px solid var(--border); border-radius: 999px; padding: 4px 10px; margin-bottom: 0.75rem; }
.cta-row { text-align: center; margin: 2.5rem 0 0.5rem; }
.cta-row img { display: inline-block; height: 44px; width: auto; }

/* Footer */
footer.site-footer { background: var(--bg-secondary); border-top: 0.5px solid var(--border); padding: 3.5rem 0 3rem; margin-top: 1rem; }
.footer-inner { max-width: 720px; margin: 0 auto; padding: 0 2rem; }
.footer-brand-name { font-family: var(--font-serif); font-size: 22px; color: var(--text-primary); margin-bottom: 0.75rem; }
.footer-contact { font-size: 13px; color: var(--text-tertiary); line-height: 1.8; margin-bottom: 2.75rem; }
.footer-contact a { color: var(--text-secondary); text-decoration: underline; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.footer-col h4 { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 13px; color: var(--text-secondary); line-height: 2; }
.footer-col a:hover { text-decoration: underline; }
.footer-about { margin-top: 2.75rem; 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; }

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 26px; }
  .finding-name { min-width: 220px; }
}
@media (max-width: 600px) {
  h1 { font-size: 29px; }
  .pattern-grid, .finding-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 2rem; }
}
