/* Header consistency - prevent shake on scroll */
.md-header__topic .md-ellipsis {
  font-weight: 700;
}

.md-header__topic {
  transform: none !important;
  transition: none !important;
  opacity: 1 !important;
}

.md-header__topic ~ .md-header__topic {
  display: none;
}

/* Blog cards grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.blog-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--md-code-bg-color);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--md-default-bg-color);
}

.blog-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.5rem;
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--md-default-fg-color);
}

.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
  flex: 1;
}

/* Lightbox for expandable images */
.md-content img {
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.md-content img:hover {
  opacity: 0.85;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10000;
  background: none;
  border: none;
  font-family: system-ui, sans-serif;
}

.lightbox-close:hover {
  opacity: 1;
}

/* API Reference - permalink anchors on doc headings */
.doc.doc-heading {
  position: relative;
}

.doc.doc-heading::after {
  content: "¶";
  margin-left: 0.5em;
  opacity: 0;
  font-size: 0.7em;
  color: var(--md-accent-fg-color, #526cfe);
  transition: opacity 0.2s;
  cursor: pointer;
}

.doc.doc-heading:hover::after {
  opacity: 0.6;
}

.doc.doc-heading:hover::after:hover {
  opacity: 1;
}

/* Make doc headings themselves clickable anchor links */
.doc.doc-heading {
  cursor: pointer;
}

.doc.doc-heading code {
  cursor: pointer;
}
