/* Video styling for course notes */
video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive video container */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 1rem 0;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Image styling - centered */
.md-content img:not(.twemoji):not(.emoji) {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1rem auto;
}

/* Markdown image wrapper centered */
.md-content p > img {
  display: block;
  margin: 1rem auto;
}

/* Article content images centered */
article img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Table image sizing */
table img {
  max-width: 300px;
  height: auto;
}

/* GIF styling */
img[src$=".gif"] {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Glightbox caption styling - allow long captions */
.glightbox-container .gslide-description {
  max-height: 40vh;  /* 最多占屏幕高度的40% */
  overflow-y: auto;  /* 超长时可滚动 */
  padding: 1rem 2rem;
}

.glightbox-container .gdesc-inner {
  max-width: 90vw;  /* 最大宽度为屏幕的90% */
  white-space: normal;  /* 允许换行 */
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 0.95rem;
}

.glightbox-container .gslide-title {
  white-space: normal;
  word-wrap: break-word;
  text-align: justify;
  max-width: 90vw;
}
