/* The existing hero image geometry is retained; only its caption adds controls. */
.s-hero-art.s-gallery {
  mask-image: none;
}
.s-gallery-frame {
  position: relative;
  aspect-ratio: 1.5;
  mask-image:
    linear-gradient(to right, transparent, black 8%, black 94%, transparent),
    linear-gradient(to bottom, transparent, black 10%, black 84%, transparent);
  mask-composite: intersect;
}
.s-gallery-frame > .s-gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}
.s-gallery-frame > .s-gallery-current {
  opacity: 1;
}
.s-gallery-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0 8%;
  min-height: 44px;
  color: var(--s-muted, #a1a8af);
}
.s-gallery-caption {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
}
.s-gallery-choices {
  display: flex;
  gap: 2px;
  flex: none;
}
.s-gallery-choices button {
  appearance: none;
  position: relative;
  width: 32px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a1a8af;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}
.s-gallery-choices button::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 180ms ease;
}
.s-gallery-choices button[aria-pressed="true"] {
  color: var(--s-accent);
}
.s-gallery-choices button[aria-pressed="true"]::after {
  transform: scaleX(1);
}
.s-gallery-choices button:is(:hover, :focus-visible) {
  color: var(--s-accent);
  background: #ffb85e12;
}
@media (max-width: 760px) {
  .s-gallery-frame {
    aspect-ratio: 1.65;
  }
}
@media (prefers-reduced-motion: reduce) {
  .s-gallery-frame > .s-gallery-image,
  .s-gallery-choices button,
  .s-gallery-choices button::after {
    transition: none;
  }
}
@media (forced-colors: active) {
  .s-gallery-choices button[aria-pressed="true"] {
    outline: 1px solid ButtonText;
  }
}
/* A live Go example sits beneath the image; slide navigation stays available. */
.s-gallery-with-terminal { flex-wrap: wrap; }
.s-gallery-with-terminal > .s-gallery-caption { color: #7dcfe4; }
.s-gallery-terminal {
  flex: 0 0 100%;
  min-width: 0;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid #263640;
  border-radius: 10px;
  background: linear-gradient(125deg, #101b22, #0b1117 70%);
  box-shadow: 0 12px 32px #0003;
  text-align: left;
}
.s-gallery-terminal[hidden] { display: none; }
.s-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid #233039;
  color: #80becd;
  font: 10px/1.4 ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
}
.s-terminal-header button {
  border: 0;
  padding: 10px 0 10px 12px;
  background: transparent;
  color: #aab6c0;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}
.s-terminal-header button:is(:hover, :focus-visible) { color: #ffd071; }
.s-gallery-terminal pre {
  margin: 0;
  padding: 14px;
  min-height: 154px;
  box-sizing: border-box;
  overflow-x: auto;
  color: #e3edf2;
  background: transparent;
  font: 12px/18px ui-monospace, Consolas, monospace;
  tab-size: 2;
}
.s-gallery-terminal code { padding: 0; background: transparent; font: inherit; color: inherit; }
.s-code-keyword { color: #65cce6; }
.s-code-number { color: #ffd071; }
.s-gallery-terminal code::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: #ffd071;
}
.s-terminal-running code::after { animation: s-code-caret 1s steps(2, jump-none) infinite; }
@keyframes s-code-caret { to { opacity: 0; } }
@media (max-width: 480px) {
  .s-gallery-with-terminal { padding-inline: 4%; gap: 4px; }
  .s-gallery-terminal pre { font-size: 10px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-gallery-terminal code::after { display: none; }
}
@media (min-width: 761px) {
  .s-hero:has(.s-gallery-with-terminal) {
    min-height: max(595px, var(--s-terminal-hero-height, 760px));
  }
}
.s-code-string { color: #b4d9a4; }
