/* ===== MeteringLab enhancements v1.3 =========================================
   Loaded AFTER main.css, so rules here win. Covers: chat-widget kill switch,
   larger article titles, mobile readability, responsive tables, a cleaner
   share bar, and quotable heading anchors.
   ============================================================================ */

/* --- 1. Kill any third-party chat / support bubble ---------------------------
   The site ships no chat widget, but this defends against any provider that
   might be injected (Crisp, Tawk, Tidio, Intercom, Drift, LiveChat, HubSpot,
   Messenger, floating-WhatsApp plugins, etc.). Harmless if none is present. */
#crisp-chatbox, .crisp-client,
#tawkchat-container, #tawkchat-minified, .tawk-min-container,
#tidio-chat, #tidio-chat-iframe,
#intercom-container, .intercom-lightweight-app, .intercom-launcher, .intercom-launcher-frame,
#drift-widget, .drift-frame-controller, .drift-frame-chat,
#chat-widget-container,
#hubspot-messages-iframe-container,
.fb-customerchat, .fb_dialog, .fb_customer_chat_bounce_in_v2,
.joinchat, .ht-ctc, .ht-ctc-chat, #whatsapp-chat, .wp-chat-app,
[class*="chat-widget"], [id*="chat-widget"],
[class*="livechat"], [id*="livechat"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* --- 2. Larger, more prominent article title -------------------------------- */
.article-title {
  font-size: 2.6rem;
  line-height: 1.18;
  letter-spacing: -.015em;
  margin: .4rem 0 1.25rem;
}
.hero-title { font-size: 2rem; line-height: 1.22; }

/* Featured image: give it more presence but cap height on tall images */
.article-thumb img { width: 100%; max-height: 480px; object-fit: cover; }

/* --- 3. Responsive type scale ---------------------------------------------- */
@media (max-width: 900px) {
  .article-title { font-size: 2.15rem; }
  .hero-title { font-size: 1.7rem; }
}
@media (max-width: 640px) {
  .article-title { font-size: 1.95rem; line-height: 1.2; }   /* overrides main.css 1.5rem */
  .hero-title { font-size: 1.5rem; }
  .article-content { font-size: 1.06rem; line-height: 1.75; max-width: 100%; }
  .container { padding: 0 1rem; }
  .article-content h2 { font-size: 1.28rem; }
  .article-content h3 { font-size: 1.12rem; }
  /* bigger tap targets */
  .primary-nav .nav-list a { padding: .8rem .85rem; font-size: 1rem; }
  .btn-read { padding: .7rem 1.4rem; }
}
@media (max-width: 400px) {
  .article-title { font-size: 1.72rem; }
}

/* --- 4. Responsive tables: scroll instead of breaking the layout ------------ */
.article-content .ml-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid #e0e7f0;
  border-radius: 8px;
}
.article-content .ml-table-wrap table { margin: 0; min-width: 520px; }
@media (max-width: 640px) {
  .article-content table { font-size: .85rem; }
  .article-content pre { font-size: .8rem; padding: 1rem; }
}

/* --- 5. Cleaner, friendlier share bar -------------------------------------- */
.share-bar { flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.share-bar .share-label { font-weight: 700; color: #0a1628; margin-right: .35rem; font-size: .95rem; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1rem; font-size: .85rem; line-height: 1; font-weight: 600;
  border-radius: 6px; border: none; cursor: pointer; font-family: inherit;
}
.share-btn:hover { opacity: .88; text-decoration: none; }
.share-x        { background: #000;     color: #fff; }
.share-linkedin { background: #0a66c2;  color: #fff; }
.share-whatsapp { background: #25d366;  color: #fff; }
.share-email    { background: #455a64;  color: #fff; }
.share-copy     { background: #1565c0;  color: #fff; }
.share-copy.copied { background: #2e7d32; }
@media (max-width: 640px) {
  .share-btn { padding: .6rem 1.05rem; font-size: .9rem; flex: 1 1 auto; }
  .share-bar .share-label { flex-basis: 100%; margin-bottom: .25rem; }
}

/* Hide the redundant AddToAny auto-appended row on posts — the share bar above
   now covers X / LinkedIn / WhatsApp / Email / Copy in one clean strip. */
.single .addtoany_content_bottom,
.single .addtoany_content_top { display: none !important; }

/* --- 6. Quotable heading anchors (deep-link to any section) ----------------- */
.article-content h2, .article-content h3 { position: relative; scroll-margin-top: 84px; }
.article-content .ml-anchor {
  opacity: 0; margin-left: .4rem; color: #1565c0; font-weight: 400;
  text-decoration: none; transition: opacity .15s;
}
.article-content h2:hover .ml-anchor,
.article-content h3:hover .ml-anchor,
.article-content .ml-anchor:focus { opacity: .65; }
