/* ------------------------------------------------------------
   Custom UI tweaks (GitHub Pages safe)
   ------------------------------------------------------------ */

.post-header-image {
  margin: 1.5rem 0;
}

.post-header-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Post categories under title */
.post-categories {
  margin: 0.35rem 0 1rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.post-categories a {
  text-decoration: none;
}

.post-categories a:hover {
  text-decoration: underline;
}

/* Related posts block */
.related-posts {
  margin-top: 2rem;
  padding-top: 0.25rem;
}

.related-posts h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}

.related-posts ul {
  margin: 0;
  padding-left: 1.2rem;
}

.related-posts li {
  margin: 0.35rem 0;
}

.related-posts a {
  text-decoration: none;
}

.related-posts a:hover {
  text-decoration: underline;
}

/* Theme toggle button (fixed, top-right) */
#theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 9999;

  width: 40px;
  height: 40px;

  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);

  /* Nice glass effect (safe fallback) */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);

  cursor: pointer;

  font-size: 18px;
  line-height: 1;

  display: grid;
  place-items: center;

  /* Reduce tap highlight on mobile */
  -webkit-tap-highlight-color: transparent;

  /* Smooth transitions */
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

#theme-toggle:hover {
  transform: translateY(-1px);
}

#theme-toggle:active {
  transform: translateY(0px) scale(0.98);
}

/* Accessible focus ring */
#theme-toggle:focus {
  outline: none;
}
#theme-toggle:focus-visible {
  outline: 3px solid rgba(122, 180, 255, 0.7);
  outline-offset: 3px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #theme-toggle {
    transition: none;
  }
}
