/* Kill Switch blog post chrome — recycled from the Divinci blog:
   - scrolling Table of Contents (fixed left rail, expands on hover)
   - social sharing icons (fixed right rail)
   - bottom "share this horror story" call-to-action
   Recolored to the Kill Switch dark theme; uses inline SVG icons (no FontAwesome).
   Behavior lives in /blog/blog-post.js. */

:root { --ks-accent: #5ce2e7; --ks-orange: #e06800; }

/* ───────────────────────── Table of Contents (left rail) ───────────────────── */
.table-of-contents {
  position: fixed;
  left: 8px;
  top: calc(var(--nav-h, 58px) + 48px);
  width: 60px;
  max-height: calc(100vh - var(--nav-h, 58px) - 96px);
  overflow-y: auto;
  overflow-x: visible;
  background: rgba(16, 22, 46, 0.96);
  border-radius: 14px;
  padding: 1rem 0;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(92, 226, 231, 0.18);
  z-index: 90;
  display: none;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.table-of-contents.is-ready { display: block; opacity: 1; }
.table-of-contents:hover { width: 290px; overflow-x: hidden; }

.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; position: relative; }
/* Connecting line threaded through the icons */
.toc-list::before {
  content: ''; position: absolute; left: 30px; top: 1.4rem; bottom: 1.4rem; width: 2px;
  background: linear-gradient(to bottom, rgba(92,226,231,0.12) 0%, rgba(92,226,231,0.38) 50%, rgba(92,226,231,0.12) 100%);
  z-index: 0;
}
.toc-list li { margin-bottom: 0.35rem; width: 100%; position: relative; z-index: 1; }

.toc-list a {
  display: flex; align-items: center; gap: 0.75rem;
  color: #c4c5ca; text-decoration: none; font-size: 0.95rem; line-height: 1.5;
  padding: 0.5rem; border-radius: 9px; transition: all 0.2s ease;
  border-left: 4px solid transparent; width: 100%; box-sizing: border-box;
  justify-content: center; position: relative; background: rgba(16, 22, 46, 0.96);
}
.table-of-contents:hover .toc-list a { justify-content: flex-start; padding: 0.6rem 0.9rem; }

.toc-icon { flex-shrink: 0; width: 18px; height: 18px; opacity: 0.7; transition: all 0.2s ease; color: var(--ks-accent); }
.toc-text {
  flex: 1; word-wrap: break-word; overflow-wrap: break-word; white-space: nowrap;
  opacity: 0; visibility: hidden; width: 0; overflow: hidden; transition: all 0.3s ease;
}
.table-of-contents:hover .toc-text { opacity: 1; visibility: visible; width: auto; white-space: normal; }

.toc-list a:hover { background: rgba(92, 226, 231, 0.1); border-left-color: var(--ks-accent); color: #fff; }
.toc-list a:hover .toc-icon { opacity: 1; transform: scale(1.1); }
.toc-list a.active {
  background: linear-gradient(135deg, rgba(92,226,231,0.18), rgba(92,226,231,0.08));
  border-left-color: var(--ks-accent); font-weight: 700; color: #fff;
  box-shadow: 0 2px 10px rgba(92, 226, 231, 0.12);
}
.toc-list a.active .toc-icon { opacity: 1; }

/* Nested headings (h3) indent only once the rail is expanded */
.toc-list li.toc-h3 a { font-size: 0.88rem; opacity: 0.95; }
.table-of-contents:hover .toc-list li.toc-h3 { margin-left: 1.25rem; }

.table-of-contents::-webkit-scrollbar { width: 6px; }
.table-of-contents::-webkit-scrollbar-track { background: rgba(92,226,231,0.08); border-radius: 3px; }
.table-of-contents::-webkit-scrollbar-thumb { background: rgba(92,226,231,0.3); border-radius: 3px; }
.table-of-contents::-webkit-scrollbar-thumb:hover { background: rgba(92,226,231,0.5); }

/* ───────────────────────── Social sharing (right rail) ─────────────────────── */
.social-sharing-fixed {
  position: fixed; right: 2rem; top: 50%; transform: translateY(-50%);
  z-index: 90; display: none; opacity: 0; transition: opacity 0.3s ease;
}
.social-sharing-fixed.is-ready { opacity: 1; }
.social-buttons-vertical { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-end; }

.social-btn-icon {
  display: flex; align-items: center; justify-content: flex-start;
  width: 48px; min-width: 48px; height: 48px; border-radius: 50px;
  text-decoration: none; font-size: 18px; transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.06); color: #c4c5ca;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; overflow: hidden; white-space: nowrap; gap: 0; padding: 0; position: relative;
}
.social-btn-icon svg { width: 20px; height: 20px; min-width: 48px; flex-shrink: 0; }
.social-btn-icon .btn-label {
  padding-right: 1rem; padding-left: 0.25rem; visibility: hidden; opacity: 0; width: 0;
  transition: all 0.3s ease; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.social-btn-icon:hover { width: auto; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.social-btn-icon:hover .btn-label { visibility: visible; opacity: 1; width: auto; }

.social-btn-icon.twitter:hover   { background-color: #ffffff; color: #000; border-color: #fff; }
.social-btn-icon.linkedin:hover  { background-color: #0a66c2; color: #fff; border-color: #0a66c2; }
.social-btn-icon.facebook:hover  { background-color: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn-icon.copy:hover,
.social-btn-icon.back-to-top:hover,
.social-btn-icon.focus-mode-toggle:hover { background-color: var(--ks-accent); color: #0a0f24; border-color: var(--ks-accent); }

/* ───────────────────────── Focus mode ──────────────────────────────────────── */
body.focus-mode .table-of-contents { display: none !important; }
body.focus-mode .social-sharing-fixed .social-btn-icon:not(.focus-mode-toggle) { display: none !important; }
body.focus-mode .navbar { display: none !important; }
body.focus-mode .article { max-width: 820px; padding-top: 48px; }
body.focus-mode .focus-mode-toggle { background-color: var(--ks-accent); color: #0a0f24; }

/* ───────────────────────── Bottom CTAs: share + newsletter, two columns ─────── */
/* Side-by-side row whose total width matches the article column (.endcta above). */
.post-ctas {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch;
  max-width: 760px; margin: 0 auto 96px; padding: 0 24px; box-sizing: border-box;
}
.post-ctas .share-cta,
.post-ctas .newsletter-cta { max-width: none; margin: 0; width: auto; }
@media (max-width: 680px) { .post-ctas { grid-template-columns: 1fr; gap: 16px; } }

.share-cta {
  max-width: 560px; margin: 3.4em auto 0; text-align: center;
  background: linear-gradient(135deg, rgba(224,104,0,0.06), rgba(92,226,231,0.05));
  border: 1px solid rgba(92, 226, 231, 0.18); border-radius: 16px; padding: 30px 24px;
}
.share-cta h3 {
  font-family: 'Outfit', sans-serif; font-weight: 700; color: #fff;
  font-size: clamp(18px, 2.4vw, 22px); margin: 0 0 0.4em;
}
.share-cta p { font-size: 14px; color: #aeb1bf; line-height: 1.55; margin: 0 auto 20px; max-width: 460px; }
.share-buttons-overlay { display: flex; gap: 18px; justify-content: center; }
.share-btn-overlay {
  width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04); border: 2px solid rgba(255,255,255,0.14); color: #c4c5ca;
  cursor: pointer; font-family: inherit; padding: 0; transition: all 0.3s ease;
}
.share-btn-overlay svg { width: 20px; height: 20px; }
.share-btn-overlay:hover { transform: scale(1.1); }
.share-btn-overlay.twitter:hover  { background: #fff; color: #000; border-color: #fff; }
.share-btn-overlay.linkedin:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-btn-overlay.facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-btn-overlay.copy:hover     { background: var(--ks-accent); color: #0a0f24; border-color: var(--ks-accent); }

/* ───────────────────────── Responsive ──────────────────────────────────────── */
/* Rails only appear when there's room outside the 760px article column. */
@media (min-width: 1180px) {
  .social-sharing-fixed { display: block; }
  .table-of-contents.is-ready { display: block; }
}
@media (max-width: 1179px) {
  .table-of-contents,
  .social-sharing-fixed { display: none !important; }
}
@media (max-width: 768px) {
  .share-btn-overlay { width: 44px; height: 44px; }
  .share-buttons-overlay { gap: 12px; }
}
