/* ==========================================================================
   Echo Hearing Solutions: blog article design v2
   Load AFTER /assets/css/ehs-blog.css. Everything is scoped to .ehs-article,
   so the rest of the website is not affected.
   ========================================================================== */

.ehs-article .article-content *,
.ehs-article .article-content *::before,
.ehs-article .article-content *::after { box-sizing: border-box; }

.ehs-article {
  --ehs-blue: #0b63ce;
  --ehs-navy: #0d2a4f;
  --ehs-ink: #33475b;
  --ehs-muted: #5b6b7d;
  --ehs-pale: #f2f7ff;
  --ehs-pale-2: #f8fbff;
  --ehs-line: #d9e5f2;
  --ehs-amber: #f2a541;
  --ehs-red: #c2410c;
  --ehs-radius: 12px;
}

/* ---------- Reading typography ---------- */
.ehs-article .article-content {
  color: var(--ehs-ink);
  font-size: 17px;
  line-height: 1.75;
}
.ehs-article .article-content p { margin: 0 0 1.1em; }
.ehs-article .article-content h2 {
  color: var(--ehs-navy);
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.7em;
  scroll-margin-top: 100px;
}
.ehs-article .article-content h3 {
  color: var(--ehs-navy);
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.35;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
  scroll-margin-top: 100px;
}
.ehs-article .article-content strong { color: var(--ehs-navy); }
.ehs-article .article-content a:not(.ehs-btn) {
  color: var(--ehs-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ehs-article .article-content a:not(.ehs-btn):hover { text-decoration-thickness: 2px; }
.ehs-article .article-content ul,
.ehs-article .article-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.ehs-article .article-content li { margin: 0.4em 0; padding-left: 0.2em; }
.ehs-article .article-content li::marker { color: var(--ehs-blue); font-weight: 700; }

/* ---------- Quick answer box (one clean box, no double border) ---------- */
/* Neutralise any old inline-styled wrapper around .ehs-answer (older posts) */
.ehs-article .article-content div:has(> .ehs-answer) {
  border: 0 !important; background: none !important; padding: 0 !important;
  margin: 0 !important; box-shadow: none !important; border-radius: 0 !important;
}
.ehs-article .ehs-answer *,
.ehs-article .ehs-answer *::before,
.ehs-article .ehs-answer *::after { border: 0 !important; box-shadow: none !important; }
.ehs-article .ehs-answer::before,
.ehs-article .ehs-answer::after,
.ehs-article .ehs-answer p::before,
.ehs-article .ehs-answer p::after { content: none !important; display: none !important; }
.ehs-article .ehs-answer {
  margin: 28px 0 !important;
  padding: 22px 24px 22px 26px !important;
  background: var(--ehs-pale) !important;
  border: 0 !important;
  border-left: 5px solid var(--ehs-blue) !important;
  border-radius: 0 var(--ehs-radius) var(--ehs-radius) 0 !important;
  box-shadow: none !important;
}
.ehs-article .ehs-answer p {
  margin: 0 !important; padding: 0 !important; background: transparent !important;
  color: var(--ehs-ink) !important; font-style: normal !important;
}
.ehs-article .ehs-answer .ehs-box-label {
  margin: 0 0 8px !important;
  color: var(--ehs-navy) !important;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

/* ---------- Key takeaways ---------- */
.ehs-article .ehs-takeaways {
  margin: 28px 0 !important;
  padding: 22px 24px !important;
  background: #fff !important;
  border: 1px solid var(--ehs-line) !important;
  border-radius: var(--ehs-radius) !important;
  box-shadow: none !important;
}
.ehs-article .ehs-takeaways::before,
.ehs-article .ehs-takeaways::after { content: none !important; }
.ehs-article .ehs-takeaways .ehs-box-label {
  margin: 0 0 10px !important; color: var(--ehs-navy) !important;
  font-size: 18px; font-weight: 800;
}
.ehs-article .ehs-takeaways ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.ehs-article .ehs-takeaways li { position: relative; margin: 0.5em 0 !important; padding-left: 32px !important; }
.ehs-article .ehs-takeaways li::before {
  content: "" !important;
  position: absolute; left: 0; top: 0.3em;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ehs-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Tables ---------- */
/* One frame only, even if a table gets wrapped twice */
.ehs-article .ehs-table-wrap {
  margin: 28px 0 !important;
  padding: 0 !important;
  border: 1px solid var(--ehs-line) !important;
  border-radius: var(--ehs-radius) !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  background: #fff !important;
  box-shadow: none !important;
}
.ehs-article .ehs-table-wrap .ehs-table-wrap,
.ehs-article .article-content div[style*="overflow"] > .ehs-table-wrap:only-child {
  margin: 0 !important;
}
.ehs-article .ehs-table-wrap .ehs-table-wrap { border: 0 !important; border-radius: 0 !important; }
.ehs-article .ehs-table-wrap:focus-visible { outline: 3px solid var(--ehs-blue); outline-offset: 2px; }

.ehs-article .article-content table {
  width: 100% !important;
  min-width: 600px;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  font-size: 15.5px;
  line-height: 1.55;
}
.ehs-article .article-content th,
.ehs-article .article-content td {
  padding: 14px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ehs-line) !important;
  text-align: left !important;
  vertical-align: top !important;
  color: var(--ehs-ink) !important;
  background: transparent !important;
}
.ehs-article .article-content thead th {
  background: var(--ehs-navy) !important;
  color: #fff !important;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 0 !important;
}
.ehs-article .article-content tbody th {
  color: var(--ehs-navy) !important;
  font-weight: 700;
  min-width: 150px;
}
.ehs-article .article-content tbody tr:nth-child(even) > * { background: var(--ehs-pale-2) !important; }
.ehs-article .article-content tbody tr:last-child > * { border-bottom: 0 !important; }
@media (hover: hover) {
  .ehs-article .article-content tbody tr:hover > * { background: #eef5fd !important; }
}

/* Phones: tables turn into stacked cards (template JS adds .ehs-stack + data-label) */
@media (max-width: 640px) {
  .ehs-article .ehs-table-wrap:has(table.ehs-stack) { overflow: visible !important; }
  .ehs-article table.ehs-stack { min-width: 0 !important; font-size: 15px; }
  .ehs-article table.ehs-stack thead {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .ehs-article table.ehs-stack,
  .ehs-article table.ehs-stack tbody,
  .ehs-article table.ehs-stack tr,
  .ehs-article table.ehs-stack th,
  .ehs-article table.ehs-stack td { display: block !important; width: 100% !important; box-sizing: border-box !important; }
  .ehs-article table.ehs-stack tr { padding: 0 0 8px; border-bottom: 1px solid var(--ehs-line); }
  .ehs-article table.ehs-stack tbody tr:last-child { border-bottom: 0; }
  .ehs-article table.ehs-stack tbody tr:nth-child(even) > * { background: transparent !important; }
  .ehs-article table.ehs-stack tbody tr:nth-child(n) > th {
    background: var(--ehs-pale) !important;
    padding: 12px 16px !important;
    font-size: 16px;
  }
  .ehs-article table.ehs-stack td { border-bottom: 0 !important; padding: 8px 16px 0 !important; }
  .ehs-article table.ehs-stack td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    color: var(--ehs-blue);
    font-size: 12.5px;
    font-weight: 700;
  }
  .ehs-article table.ehs-stack td[data-label=""]::before { display: none; }
}

/* ---------- Problem cards (troubleshooting posts) ---------- */
.ehs-article .ehs-problem {
  margin: 22px 0;
  padding: 22px 24px 10px;
  background: #fff;
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius);
}
.ehs-article .ehs-problem h3 {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px !important;
}
.ehs-article .ehs-num {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ehs-blue); color: #fff;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.ehs-article .ehs-why,
.ehs-article .ehs-try,
.ehs-article .ehs-visit {
  margin: 0 0 14px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid #c3d1e2;
}
.ehs-article .ehs-try { border-left-color: var(--ehs-blue); }
.ehs-article .ehs-visit { border-left-color: var(--ehs-amber); }
.ehs-article .ehs-problem p,
.ehs-article .ehs-problem ul,
.ehs-article .ehs-problem ol { margin-bottom: 0.4em; }
.ehs-article .ehs-lbl {
  display: block;
  margin: 0 0 2px;
  color: var(--ehs-navy);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

/* ---------- Step lists (sequences) ---------- */
.ehs-article ol.ehs-steps { list-style: none; counter-reset: ehs-step; padding-left: 0; }
.ehs-article ol.ehs-steps > li {
  counter-increment: ehs-step;
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 0 46px;
}
.ehs-article ol.ehs-steps > li::before {
  content: counter(ehs-step);
  position: absolute; left: 0; top: 0.1em;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ehs-pale); color: var(--ehs-blue);
  border: 2px solid var(--ehs-blue);
  font-size: 14px; font-weight: 800; line-height: 1;
}

/* ---------- Do / don't and checklist lists ---------- */
.ehs-article ul.ehs-dont,
.ehs-article ul.ehs-check { list-style: none; padding: 18px 22px; border-radius: var(--ehs-radius); }
.ehs-article ul.ehs-dont { background: #fff7f2; border: 1px solid #f6d9c8; }
.ehs-article ul.ehs-check { background: var(--ehs-pale); border: 1px solid var(--ehs-line); }
.ehs-article ul.ehs-dont > li,
.ehs-article ul.ehs-check > li { position: relative; padding-left: 32px; }
.ehs-article ul.ehs-dont > li::before,
.ehs-article ul.ehs-check > li::before {
  content: "";
  position: absolute; left: 0; top: 0.3em;
  width: 20px; height: 20px; border-radius: 50%;
  background-position: center; background-repeat: no-repeat; background-size: 11px;
}
.ehs-article ul.ehs-dont > li::before {
  background-color: var(--ehs-red);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
.ehs-article ul.ehs-check > li::before {
  background-color: var(--ehs-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- Clinic / location box ---------- */
.ehs-article .ehs-clinic {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--ehs-navy);
  border-radius: var(--ehs-radius);
  color: #dbe7f7;
}
.ehs-article .ehs-clinic p { margin: 0 0 6px; color: #dbe7f7; }
.ehs-article .ehs-clinic strong { color: #fff; }
.ehs-article .ehs-clinic a:not(.ehs-btn) { color: #fff; }

/* ---------- FAQ spacing (keeps the theme's own accordion icons) ---------- */
.ehs-article .ehs-faq-item {
  margin: 0 0 12px;
  border: 1px solid var(--ehs-line);
  border-radius: var(--ehs-radius);
  background: #fff;
  overflow: hidden;
}
.ehs-article .ehs-faq-item[open] { border-color: #b9d2f0; }
.ehs-article .ehs-faq-item summary h3 { margin: 0 !important; font-size: 18px; }
.ehs-article .ehs-faq-body p:last-child { margin-bottom: 0; }

/* ---------- Disclaimer ---------- */
.ehs-article .ehs-disclaimer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--ehs-line);
  color: var(--ehs-muted);
  font-size: 14.5px;
}

@media (max-width: 640px) {
  .ehs-article .article-content { font-size: 16.5px; }
  .ehs-article .ehs-problem { padding: 18px 16px 6px; }
  .ehs-article .ehs-answer { padding: 18px 18px 18px 20px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ehs-article * { scroll-behavior: auto !important; }
}
