.post-gallery {
  margin: 28px 0 32px;
  padding: 16px;
  color: #172e2d;
  background: #e7e7df;
  box-shadow:
    inset -1px -1px #fff,
    inset 1px 1px #808080,
    inset -2px -2px #dfdfdf,
    inset 2px 2px #0a0a0a;
}
.gallery-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.gallery-heading h2 {
  font-size: var(--text-heading);
  font-weight: bold;
}
.gallery-heading > span,
.gallery-hint {
  font-size: var(--text-small);
}
.gallery-heading > span {
  white-space: nowrap;
}
#post-content .gallery-hint,
.gallery-hint {
  margin: 4px 0 16px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 12px;
}
.gallery-item {
  min-width: 0;
}
.gallery-photo {
  display: block;
  text-decoration: none;
}
.gallery-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fafaf5;
  padding: 4px;
  border: 1px solid #808080;
  box-shadow: 1px 1px #fff;
}
.gallery-photo-name {
  display: block;
  margin: 7px 0 0;
  font-size: var(--text-small);
  line-height: 1.4;
}
.gallery-photo-name > span {
  color: #526260;
  font-variant-numeric: tabular-nums;
}
.gallery-photo:hover .gallery-photo-name {
  text-decoration: underline;
}
.gallery-photo:focus-visible {
  outline-offset: 4px;
}
.gallery-enhanced .gallery-caption {
  display: none;
}
.gallery-caption {
  margin-top: 10px;
  font-size: var(--text-small);
}
.course-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 8px;
}
.course-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  min-width: 0;
}
.course-card .title-bar-text {
  font-size: 12px;
}
.course-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}
.course-provider {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
}
.course-provider img {
  flex: none;
  image-rendering: pixelated;
}
.course-card h3 {
  font-size: var(--text-heading);
  font-weight: bold;
  line-height: 1.35;
}
#post-content .course-card p,
.course-card p {
  margin: 0;
  font-size: var(--text-small);
}
.course-action {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 8px;
  font-weight: bold;
  font-size: var(--text-small);
  text-decoration: underline;
}
.course-card:hover .course-action {
  text-decoration-thickness: 2px;
}
.gallery-open {
  overflow: hidden;
}
#media-gallery-dialog {
  width: min(1080px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
}
#media-gallery-dialog .gallery-viewer-body {
  padding: 12px;
  overscroll-behavior: contain;
}
#media-gallery-dialog.gallery-maximized {
  width: calc(100vw - 16px);
  height: calc(100dvh - 16px);
  max-height: none;
}
#media-gallery-dialog.gallery-maximized .gallery-viewer-body > figure {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 160px;
}
.gallery-maximized .gallery-image-stage {
  position: relative;
  flex: 1;
  min-height: 120px;
}
.gallery-maximized .gallery-image-stage img {
  position: absolute;
  inset: 0;
  height: 100%;
  min-height: 0;
}
#media-gallery-dialog.gallery-maximized figcaption {
  max-height: min(30dvh, 200px);
  overflow-y: auto;
  flex: none;
}
.gallery-image-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #24292b;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}
.gallery-image-stage img {
  display: block;
  width: 100%;
  height: min(60dvh, 680px);
  min-height: 120px;
  object-fit: contain;
}
#media-gallery-dialog figcaption,
.gallery-image-error {
  margin: 12px 2px 0;
  line-height: 1.5;
}
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 8px;
  padding: 8px 12px 12px;
}
.gallery-toolbar button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: var(--text-ui);
}
.gallery-toolbar p {
  font-size: var(--text-small);
  text-align: center;
}
.gallery-viewer-footer {
  flex-wrap: wrap;
}
.gallery-viewer-footer .status-bar-field {
  font-size: 12px;
}
.high-contrast .post-gallery,
.high-contrast .gallery-photo img {
  background: #fff;
  color: #000;
}
@media (max-width: 520px) {
  .post-gallery {
    padding: 12px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .course-links {
    grid-template-columns: 1fr;
  }
  .gallery-toolbar {
    padding: 8px;
  }
  .gallery-toolbar button {
    min-height: 44px;
    padding: 6px 8px;
  }
  .gallery-image-stage img {
    height: 44dvh;
  }
}
@media print {
  .gallery-enhanced .gallery-caption {
    display: block;
  }
}
