/* =====================================================================
   Echo Hearing Solutions – blog styles
   Shared by /blogs (blogs.php) and /blog/{post} (details.php) so both
   pages use the same colours, type scale, banner, cards and buttons.
   Upload to: /assets/css/ehs-blog.css
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root{
  --ehs-accent:#0a58ca;
  --ehs-accent-dark:#084298;
  --ehs-text:#1d2733;        /* headings */
  --ehs-body:#3a4553;        /* body copy */
  --ehs-muted:#5f6b7a;       /* dates, captions (AA contrast on white and soft blue) */
  --ehs-border:#e3e8ef;
  --ehs-soft:#f3f7fd;        /* light blue panels */
  --ehs-soft-line:#d6e4fa;
  --ehs-wa:#1fa855;
  --ehs-focus:#f5b400;
  --ehs-r-lg:14px;           /* cards, panels, images */
  --ehs-r-md:10px;           /* buttons, tables */
  --ehs-r-sm:8px;            /* small chips */
  --ehs-shadow:0 10px 28px rgba(16,24,40,.08);
}

/* ---------- Fonts ----------
   Both pages use the site theme's fonts (same as header and footer).
   To lock one font for every blog page, uncomment and set it here:
.ehs-banner,.blog-area,.blog-details-area,.ehs-related{font-family:"Your Font",system-ui,-apple-system,"Segoe UI",sans-serif;}
*/

/* Predictable sizing for all blog components */
.ehs-card,.ehs-card *,.ehs-btn,.ehs-cta-box,.ehs-cta-box *,.ehs-toc,.ehs-author,.ehs-inline-cta,.ehs-action-bar,.ehs-pagination a,.ehs-pagination span{box-sizing:border-box;}

/* Type scale (identical on both pages) */
.ehs-banner h1{font-size:clamp(24px,3.2vw,38px);font-weight:700;line-height:1.25;}
.ehs-section-title{font-size:clamp(22px,2.4vw,28px);font-weight:700;line-height:1.3;color:var(--ehs-text);margin:0;}
.ehs-card-title{font-size:19px;font-weight:700;line-height:1.4;}
.ehs-heading-sm{font-size:19px;font-weight:700;line-height:1.35;color:var(--ehs-text);}

html{scroll-padding-top:110px;}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  .ehs-card,.ehs-btn,.ehs-faq-item summary::after,.ehs-pagination a{transition:none !important;}
}

/* Keyboard focus, same everywhere */
.ehs-banner a:focus-visible,.ehs-card a:focus-visible,.ehs-article a:focus-visible,.ehs-btn:focus-visible,
.ehs-toc a:focus-visible,.ehs-faq-item summary:focus-visible,.ehs-pagination a:focus-visible,
.ehs-share a:focus-visible,.ehs-share button:focus-visible,.ehs-related-head a:focus-visible{
  outline:3px solid var(--ehs-focus);outline-offset:2px;border-radius:4px;
}

/* ---------- Banner (same height and layout on both pages) ---------- */
.page-title-area.ehs-banner{padding-top:44px !important;padding-bottom:40px !important;min-height:0 !important;height:auto !important;}
.ehs-banner .page-title-content{max-width:920px;margin:0 auto;}
.ehs-banner h1{color:#fff;margin:10px auto 10px;}
.ehs-banner-sub{color:rgba(255,255,255,.9);font-size:16px;line-height:1.6;max-width:640px;margin:0 auto;}
@media (max-width:767px){
  .page-title-area.ehs-banner{padding-top:30px !important;padding-bottom:26px !important;}
  .ehs-banner-sub{font-size:15px;}
}

/* Breadcrumb */
.ehs-breadcrumb{list-style:none;padding:0;margin:0;display:flex;justify-content:center;flex-wrap:wrap;gap:6px;font-size:14px;line-height:1.5;}
.page-title-area .ehs-breadcrumb li{position:static !important;padding:0 !important;margin:0 !important;display:inline-flex !important;align-items:center;color:rgba(255,255,255,.85);}
.page-title-area .ehs-breadcrumb li::before,.page-title-area .ehs-breadcrumb li::after{content:none !important;}
.page-title-area .ehs-breadcrumb li+li::before{content:"›" !important;display:inline !important;position:static !important;margin:0 6px 0 0 !important;width:auto !important;height:auto !important;background:none !important;color:inherit !important;}
.ehs-breadcrumb a{color:#fff;text-decoration:none;}
.ehs-breadcrumb a:hover{text-decoration:underline;}
.ehs-breadcrumb li[aria-current]{max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block !important;}

/* Post byline in the banner */
.ehs-post-meta{display:flex;justify-content:center;flex-wrap:wrap;gap:6px 18px;color:rgba(255,255,255,.92);font-size:14px;margin:0;padding:0;list-style:none;}
.ehs-post-meta i{margin-right:4px;}
.page-title-area .ehs-post-meta li{position:static !important;padding:0 !important;margin:0 !important;display:inline-block !important;} /* inline-block keeps the space in "By Name" */
.page-title-area .ehs-post-meta li::before,.page-title-area .ehs-post-meta li::after{content:none !important;display:none !important;}
.ehs-post-meta a{color:#fff;text-decoration:underline;text-underline-offset:3px;}

/* ---------- Article cards (blog list AND related articles) ---------- */
.ehs-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px;list-style:none;margin:0;padding:0;}
.ehs-card-grid > li{margin:0;padding:0;}
@media (max-width:991px){ .ehs-card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;} }
@media (max-width:575px){ .ehs-card-grid{grid-template-columns:1fr;} }

.ehs-card{position:relative;display:flex;flex-direction:column;height:100%;background:#fff;border:1px solid var(--ehs-border);border-radius:var(--ehs-r-lg);overflow:hidden;transition:border-color .2s ease,box-shadow .2s ease;}
.ehs-card:hover{border-color:var(--ehs-soft-line);box-shadow:var(--ehs-shadow);}
.ehs-card:focus-within{border-color:var(--ehs-accent);}
.ehs-card-img{display:block;aspect-ratio:1200/630;background:var(--ehs-soft);overflow:hidden;}
.ehs-card-img img{display:block;width:100%;height:100%;object-fit:cover;}
.ehs-card-body{display:flex;flex-direction:column;flex:1;gap:8px;padding:20px 22px 22px;}
.ehs-card-meta{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0;padding:0;list-style:none;font-size:13.5px;line-height:1.5;color:var(--ehs-muted);}
.ehs-card-meta li{margin:0;padding:0;}
.ehs-card-meta li::before,.ehs-card-meta li::after{display:none;}
.ehs-card-title{margin:0;}
.ehs-card-title a{color:var(--ehs-text);text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.ehs-card-title a::after{content:"";position:absolute;inset:0;z-index:1;} /* whole card is one link */
.ehs-card-title a:focus-visible{outline:none;}
.ehs-card:hover .ehs-card-title a{color:var(--ehs-accent);}
.ehs-card-excerpt{margin:0;color:var(--ehs-muted);font-size:15px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.ehs-card-more{margin-top:auto;padding-top:6px;display:inline-flex;align-items:center;gap:4px;font-weight:600;font-size:15px;color:var(--ehs-accent);}

/* Pagination */
.ehs-pagination{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:44px 0 0;}
.ehs-pagination a,.ehs-pagination span{min-width:44px;height:44px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--ehs-border);border-radius:var(--ehs-r-md);background:#fff;color:var(--ehs-text);font-weight:600;text-decoration:none;transition:border-color .2s,color .2s;}
.ehs-pagination a:hover{border-color:var(--ehs-accent);color:var(--ehs-accent);}
.ehs-pagination .active span{background:var(--ehs-accent);border-color:var(--ehs-accent);color:#fff;}
.ehs-pagination .disabled span{opacity:.45;}
.ehs-pagination .dots span{border:none;background:transparent;min-width:20px;padding:0;}

.ehs-empty{text-align:center;padding:40px 0;}
.ehs-empty p{color:var(--ehs-body);font-size:17px;margin-bottom:18px;}

/* ---------- Buttons ---------- */
.ehs-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:12px 20px;min-height:46px;border-radius:var(--ehs-r-md);font-weight:600;font-size:15px;line-height:1.2;text-decoration:none !important;transition:background-color .2s,color .2s,border-color .2s;border:2px solid transparent;cursor:pointer;}
.ehs-btn-primary{background:var(--ehs-accent);color:#fff !important;}
.ehs-btn-primary:hover{background:var(--ehs-accent-dark);}
.ehs-btn-light{background:#fff;color:var(--ehs-accent) !important;}
.ehs-btn-light:hover{background:#eaf1fc;color:var(--ehs-accent-dark) !important;}
.ehs-btn-outline{border-color:rgba(255,255,255,.7);color:#fff !important;}
.ehs-btn-outline:hover{background:rgba(255,255,255,.12);}
.ehs-btn-line{border-color:var(--ehs-accent);color:var(--ehs-accent) !important;background:#fff;}
.ehs-btn-line:hover{background:var(--ehs-soft);}
.ehs-btn-wa{background:var(--ehs-wa);color:#fff !important;}
.ehs-btn-row{display:flex;flex-wrap:wrap;gap:10px;}

/* ---------- Article body (post page) ---------- */
.ehs-article{background:#fff;}
.ehs-article .article-image{margin:0;}
.ehs-article .article-image img{display:block;width:100%;height:auto;border-radius:var(--ehs-r-lg);aspect-ratio:1200/630;object-fit:cover;background:var(--ehs-soft);}
.ehs-article .article-content{margin-top:28px;color:var(--ehs-body);font-size:17px;line-height:1.8;}
.ehs-article .article-content h2{font-size:clamp(22px,2.4vw,26px);margin:38px 0 14px;color:var(--ehs-text);line-height:1.3;font-weight:700;}
.ehs-article .article-content h3{font-size:21px;margin:28px 0 12px;color:var(--ehs-text);line-height:1.35;font-weight:700;}
.ehs-article .article-content p{margin-bottom:18px;}
.ehs-article .article-content ul,.ehs-article .article-content ol{padding-left:22px;margin-bottom:18px;}
.ehs-article .article-content li{margin-bottom:8px;}
.ehs-article .article-content li::marker{color:var(--ehs-accent);}
.ehs-article .article-content a{color:var(--ehs-accent);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px;}
.ehs-article .article-content a:hover{color:var(--ehs-accent-dark);text-decoration-thickness:2px;}
.ehs-article .article-content img{max-width:100%;height:auto;border-radius:var(--ehs-r-md);margin:10px 0;}
.ehs-article .article-content iframe{max-width:100%;border-radius:var(--ehs-r-md);}
.ehs-article .article-content blockquote{border-left:4px solid var(--ehs-accent);background:var(--ehs-soft);padding:14px 18px;border-radius:0 var(--ehs-r-md) var(--ehs-r-md) 0;margin:20px 0;}

/* Tables */
.ehs-table-wrap{overflow-x:auto;margin:0 0 22px;border:1px solid var(--ehs-border);border-radius:var(--ehs-r-md);}
.ehs-table-wrap table{border-collapse:collapse;width:100%;min-width:520px;font-size:15px;line-height:1.55;margin:0;}
.ehs-table-wrap th,.ehs-table-wrap td{border-bottom:1px solid var(--ehs-border);padding:10px 14px;text-align:left;vertical-align:top;}
.ehs-table-wrap thead th,.ehs-table-wrap tr:first-child th{background:var(--ehs-soft);color:var(--ehs-text);font-weight:600;}
.ehs-table-wrap tr:last-child td{border-bottom:0;}

/* Quick answer / key takeaways */
.ehs-answer,.ehs-takeaways{border-radius:var(--ehs-r-lg);padding:18px 22px;margin:0 0 24px;}
.ehs-answer{background:var(--ehs-soft);border-left:4px solid var(--ehs-accent);}
.ehs-takeaways{background:#fff;border:1px solid var(--ehs-soft-line);}
.ehs-answer > *:last-child,.ehs-takeaways > *:last-child{margin-bottom:0 !important;}
.ehs-box-label{font-weight:700;color:var(--ehs-text);font-size:18px;margin-bottom:6px !important;}

/* FAQ accordion */
.ehs-faq{border-top:1px solid var(--ehs-border);margin-bottom:24px;}
.ehs-faq-item{border-bottom:1px solid var(--ehs-border);}
.ehs-faq-item summary{cursor:pointer;list-style:none;position:relative;padding:16px 40px 16px 0;}
.ehs-faq-item summary::-webkit-details-marker{display:none;}
.ehs-faq-item summary h3{font-size:18px !important;margin:0 !important;line-height:1.4;}
.ehs-faq-item summary::after{content:"+";position:absolute;right:6px;top:12px;font-size:26px;line-height:1;color:var(--ehs-accent);transition:transform .2s;}
.ehs-faq-item[open] summary::after{transform:rotate(45deg);}
.ehs-faq-body{padding:0 0 8px;}

.ehs-sources{font-size:15px;line-height:1.65;}
.ehs-disclaimer{font-size:14px;color:var(--ehs-muted);border-top:1px solid var(--ehs-border);padding-top:14px;margin-top:26px;}

/* Table of contents */
.ehs-toc{background:#fff;border:1px solid var(--ehs-border);border-radius:var(--ehs-r-lg);padding:18px 20px;margin-bottom:24px;}
.ehs-toc summary,.ehs-toc .ehs-toc-title{font-weight:700;font-size:17px;color:var(--ehs-text);margin:0;cursor:pointer;list-style:none;}
.ehs-toc summary::-webkit-details-marker{display:none;}
.ehs-toc summary::after{content:"▾";float:right;color:var(--ehs-accent);}
.ehs-toc[open] summary::after{content:"▴";}
.ehs-toc ol{list-style:none;margin:12px 0 0;padding:0;font-size:14.5px;line-height:1.45;}
.ehs-toc li{margin:0;}
.ehs-toc a{display:block;padding:6px 0 6px 12px;border-left:2px solid var(--ehs-border);color:var(--ehs-muted);text-decoration:none;}
.ehs-toc a:hover{color:var(--ehs-accent);}
.ehs-toc a.active{color:var(--ehs-accent);border-left-color:var(--ehs-accent);font-weight:600;}
.ehs-toc-side ol{max-height:46vh;overflow-y:auto;}
.ehs-toc-mobile{margin:24px 0 0;}

/* In-article call-outs */
.ehs-inline-cta{margin:32px 0;padding:24px 26px;border-radius:var(--ehs-r-lg);background:var(--ehs-soft);border:1px solid var(--ehs-soft-line);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;}
.ehs-inline-cta .ehs-cta-title{margin:0 0 4px;}
.ehs-inline-cta p{margin:0 !important;color:var(--ehs-muted);font-size:15px;line-height:1.5;}

/* Share + author */
.ehs-share{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:32px 0 0;padding-top:20px;border-top:1px solid var(--ehs-border);font-size:15px;color:var(--ehs-muted);}
.ehs-share a,.ehs-share button{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--ehs-border);background:#fff;border-radius:var(--ehs-r-sm);padding:7px 12px;color:var(--ehs-text);text-decoration:none;font-size:14px;cursor:pointer;}
.ehs-share a:hover,.ehs-share button:hover{border-color:var(--ehs-accent);color:var(--ehs-accent);}
.ehs-author{display:flex;gap:16px;align-items:flex-start;background:var(--ehs-soft);border-radius:var(--ehs-r-lg);padding:22px;margin-top:28px;}
.ehs-author img{width:64px;height:64px;border-radius:50%;object-fit:contain;background:#fff;padding:6px;flex-shrink:0;border:1px solid var(--ehs-border);}
.ehs-author .ehs-author-name{margin:0 0 4px;}
.ehs-author p{margin:0;font-size:15px;line-height:1.6;color:var(--ehs-body);}
.ehs-reviewer{display:flex;align-items:center;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid var(--ehs-soft-line);}
.ehs-reviewer img{width:48px;height:48px;border-radius:50%;object-fit:cover;padding:0;background:#fff;border:1px solid var(--ehs-border);flex-shrink:0;}
.ehs-reviewer p{margin:0;font-size:14.5px;line-height:1.55;color:var(--ehs-body);}
.ehs-reviewer a{color:var(--ehs-text);text-decoration:none;}
.ehs-reviewer a:hover{color:var(--ehs-accent);text-decoration:underline;}
.ehs-author small{display:block;margin-top:8px;color:var(--ehs-muted);font-size:13.5px;}

/* Sidebar */
@media (min-width:992px){ .ehs-sticky{position:sticky;top:110px;} }
.ehs-cta-box{background:var(--ehs-accent);color:#fff;border-radius:var(--ehs-r-lg);padding:26px 22px;}
.ehs-cta-box .ehs-cta-tag{display:inline-block;background:rgba(255,255,255,.18);border-radius:20px;padding:4px 12px;font-size:13px;font-weight:600;margin-bottom:12px;}
.ehs-cta-box .ehs-cta-title{color:#fff;margin:0 0 8px;}
.ehs-cta-box p{color:rgba(255,255,255,.92);font-size:15px;margin:0 0 18px;}
.ehs-cta-box .ehs-btn{width:100%;margin-bottom:10px;}
.ehs-cta-box .ehs-cta-points{list-style:none;padding:0;margin:10px 0 0;font-size:14px;color:rgba(255,255,255,.92);}
.ehs-cta-box .ehs-cta-points li{margin-bottom:4px;}
@media (max-width:991px){ .ehs-sidebar{margin-top:40px;} }

/* Related articles (uses the same .ehs-card as the blog list) */
.ehs-related{background:var(--ehs-soft);padding:64px 0;}
.ehs-related-head{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:12px;margin-bottom:28px;}
.ehs-related-head a{font-weight:600;color:var(--ehs-accent);text-decoration:none;}
.ehs-related-head a:hover{text-decoration:underline;}

/* Mobile quick-contact bar */
.ehs-action-bar{position:fixed;left:0;right:0;bottom:0;z-index:999;display:none;grid-template-columns:1fr 1fr 1.3fr;gap:8px;background:#fff;border-top:1px solid var(--ehs-border);padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));box-shadow:0 -4px 14px rgba(13,40,80,.08);}
.ehs-action-bar .ehs-btn{padding:9px 6px;font-size:14px;min-height:44px;}
@media (max-width:767px){ .ehs-action-bar{display:grid;} body{padding-bottom:72px;} }

.ehs-notfound{text-align:center;padding:30px 0;}
