/* Single Post Additional Styles */

/* Sticky TOC sidebar */
@media (min-width: 1025px) {
  .sg-toc-sticky-sidebar {
    position: sticky;
    top: calc(var(--sg-header-h) + 20px);
    max-height: calc(100vh - var(--sg-header-h) - 40px);
    overflow-y: auto;
  }
}

/* Smooth anchor scroll */
html { scroll-behavior: smooth; }
* { scroll-margin-top: calc(var(--sg-header-h) + 20px); }

/* Content headings */
.sg-content h2::before {
  content: '';
  display: block;
  height: calc(var(--sg-header-h) + 20px);
  margin-top: calc(-1 * (var(--sg-header-h) + 20px));
  pointer-events: none;
  visibility: hidden;
}

/* Image lightbox */
.sg-content img { cursor: zoom-in; }
.sg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sg-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: var(--sg-radius);
}
.sg-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.sg-lightbox-close:hover { background: rgba(255,255,255,0.35); }

/* Code blocks */
.sg-content pre {
  position: relative;
}
.sg-copy-code {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: var(--sg-radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.15s;
}
.sg-copy-code:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Responsive tables */
.sg-content .wp-block-table,
.sg-content .tablepress {
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* Pull quote */
.sg-content .wp-block-pullquote {
  border-top: 3px solid var(--sg-primary);
  border-bottom: 3px solid var(--sg-primary);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  font-family: var(--sg-font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--sg-text);
}

/* Highlight box */
.sg-highlight-box {
  background: rgba(37,99,235,0.07);
  border: 1px solid rgba(37,99,235,0.2);
  border-left: 4px solid var(--sg-primary);
  border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* Warning box */
.sg-warning-box {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-left: 4px solid var(--sg-accent);
  border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* Info box */
.sg-info-box {
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.2);
  border-left: 4px solid var(--sg-success);
  border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* Reading mode  */
@media (min-width: 1280px) {
  .sg-article .sg-content {
    font-size: 1.125rem;
  }
}

/* Mobile reading */
@media (max-width: 768px) {
  .sg-single-title { font-size: 1.75rem; }
  .sg-share-bar { gap: 0.5rem; }
  .sg-share-btn { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
  .sg-share-label { display: none; }
}
