/* ============================================
   SHARED STYLES — loaded by all themes
   Copy button, 404 page, etc.
   ============================================ */

/* --- Copy-to-clipboard button --- */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-sans, -apple-system, sans-serif);
  color: var(--text-muted, #888);
  background: var(--bg-secondary, rgba(128,128,128,0.15));
  border: 1px solid var(--border, rgba(128,128,128,0.2));
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  z-index: 1;
  line-height: 1.4;
}

pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: var(--accent, #6c5ce7);
  color: #fff;
  border-color: var(--accent, #6c5ce7);
}

.copy-btn.copied {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
  opacity: 1;
}

/* --- Hero disclosure --- */
.hero-disclosure {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  line-height: 1.6;
  max-width: 560px;
  margin-top: 1.2rem;
}

.hero-disclosure a {
  color: var(--accent, #6c5ce7);
}

/* --- See-all link --- */
.see-all {
  margin-top: 0.5rem;
  font-size: 0.92rem;
}

.see-all a {
  color: var(--accent, #6c5ce7);
  font-weight: 500;
}

/* --- Footer disclosure link --- */
.site-footer a {
  color: var(--text-muted, #888);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--accent, #6c5ce7);
}

/* --- Themed SVG shortcode (dark/light switching) --- */
.themed-svg {
  margin: 1.5rem auto;
  text-align: center;
}
.themed-svg img {
  max-width: 100%;
  width: auto;
  height: auto;
  border: none !important;
}
.themed-svg figcaption {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin-top: 0.5rem;
  font-style: italic;
}
.themed-svg .themed-svg-dark { display: none; }
[data-theme="dark"] .themed-svg .themed-svg-light { display: none; }
[data-theme="dark"] .themed-svg .themed-svg-dark { display: block; }

/* --- Series external links --- */
.series-links {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-muted, #888);
}

.series-links a {
  color: var(--accent, #6c5ce7);
  text-decoration: none;
}

.series-links a:hover {
  text-decoration: underline;
}

/* --- Hero image dark/light switching --- */
.post-hero-dark { display: none; }
[data-theme="dark"] .post-hero .post-hero-light { display: none; }
[data-theme="dark"] .post-hero .post-hero-dark { display: block; }

/* --- Wide image shortcode — breaks out of content column for data viz --- */
.main-content {
  overflow-x: visible !important;
  overflow-y: visible !important;
}
.post-content {
  overflow: visible !important;
}
.post-content .wide-img {
  position: relative;
  width: 960px;
  max-width: calc(100vw - 2rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 2rem 0;
}
.post-content .wide-img img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border, #ddd);
  margin: 0 !important;
}
.post-content .wide-img figcaption {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- 404 Error Page --- */
.error-page {
  text-align: center;
  padding: 6rem 1rem 4rem;
}

.error-page h1 {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent, #6c5ce7);
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.error-message {
  font-size: 1.2rem;
  color: var(--text-secondary, #666);
  margin-bottom: 2.5rem;
}

.error-nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.error-nav a {
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  color: var(--accent, #6c5ce7);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}

.error-nav a:hover {
  background: var(--accent-glow, rgba(108,92,231,0.1));
  border-color: var(--accent, #6c5ce7);
  text-decoration: none;
}
