/* ============================================================
   SOFTWARE DETAIL — hero (gallery beside info), how-to-run
   terminal, CP/M file listing, screenshot lightbox.
   Layered on retro-theme.css; reuses its --retro-* tokens.
   ============================================================ */

/* ----- Page shell ----- */
.sw-detail {

  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sw-toolbar {

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* ----- Hero: gallery shares the row with the info panel ----- */
.sw-hero {

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(0, 180, 255, 0.14), rgba(0, 18, 51, 0.65) 55%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 240, 255, 0.035) 3px 4px);
  box-shadow: 0 0 24px rgba(0, 180, 255, 0.18);
}

/* Side-by-side from tablet width up. The gallery column is capped so the image
   never dominates the page — the text gets the larger share of the row. */
@media (min-width: 900px) {

  .sw-hero {

    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    align-items: start;
  }
}

/* On phones keep the stacked gallery from filling the whole first screen. */
@media (max-width: 899px) {

  .sw-gallery {

    max-width: 480px;
    width: 100%;
    margin: 0 auto;
  }
}

.sw-info {

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.sw-chips {

  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.sw-chips .mud-chip {

  margin: 0;
}

.sw-title-row {

  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sw-title-row .nabu-icon {

  flex: 0 0 auto;
  image-rendering: pixelated;
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.35);
}

.sw-title {

  margin: 0 !important;
  font-family: "Orbitron", "IBM Plex Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem) !important;
  line-height: 1.15 !important;
  color: var(--retro-white);
  text-shadow: var(--retro-glow-blue);
  word-break: break-word;
}

.sw-byline {

  color: var(--retro-ice);
  font-size: 0.95rem;
}

.sw-byline strong {

  color: var(--retro-cyan);
  font-weight: 600;
}

.sw-tagline {

  font-size: 1.08rem !important;
  line-height: 1.55 !important;
  color: var(--retro-white);
}

/* Fact tiles: small label over a value. */
.sw-facts {

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
}

.sw-fact {

  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(0, 180, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 8, 20, 0.55);
  min-width: 0;
}

.sw-fact-label {

  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--retro-ice);
  opacity: 0.75;
}

.sw-fact-value {

  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  color: var(--retro-white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-actions {

  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ----- Gallery ----- */
.sw-gallery {

  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

/* NABU / TMS9918 output is 4:3; contain (not cover) so screenshots are never cropped. */
.sw-stage {

  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #04070d;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 18px rgba(0, 180, 255, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.sw-stage .software-media {

  border-radius: 0 !important;
  height: 100%;
}

.sw-stage-link {

  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.sw-stage-link img {

  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
}

.sw-stage-poster {

  cursor: pointer;
}

.sw-stage-poster img {

  object-fit: cover;
}

.sw-stage-video {

  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.sw-play-badge {

  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 18, 51, 0.75);
  border: 2px solid var(--retro-cyan);
  box-shadow: var(--retro-glow-cyan);
  color: var(--retro-white);
  transition: transform 0.15s ease, background 0.15s ease;
}

.sw-play-badge .mud-icon-root {

  font-size: 2.6rem;
}

.sw-stage-poster:hover .sw-play-badge {

  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(0, 180, 255, 0.55);
}

.sw-zoom-hint {

  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px;
  display: flex;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--retro-white);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.sw-stage:hover .sw-zoom-hint {

  opacity: 1;
}

.sw-stage-nav {

  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.5);
  background: rgba(0, 8, 20, 0.7);
  color: var(--retro-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.sw-stage-prev { left: 8px; }
.sw-stage-next { right: 8px; }

.sw-stage:hover .sw-stage-nav,
.sw-stage-nav:focus-visible {

  opacity: 1;
}

.sw-stage-nav:hover {

  background: rgba(0, 180, 255, 0.55);
}

/* Touch screens have no hover — keep the arrows visible there. */
@media (hover: none) {

  .sw-stage-nav {

    opacity: 0.85;
  }
}

.sw-stage-counter {

  position: absolute;
  left: 8px;
  top: 8px;
  padding: 1px 8px;
  border-radius: 10px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.6);
  color: var(--retro-white);
  pointer-events: none;
}

/* Thumbnail strip: scrolls sideways when there are many screenshots. */
.sw-thumbs {

  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.sw-thumb {

  position: relative;
  flex: 0 0 auto;
  width: 84px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #04070d;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.sw-thumb img {

  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sw-thumb:hover {

  opacity: 0.9;
}

.sw-thumb.active {

  opacity: 1;
  border-color: var(--retro-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.sw-thumb-play {

  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  pointer-events: none;
}

/* ----- Lightbox ----- */
.sw-lightbox {

  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 4rem;
  background: rgba(0, 4, 12, 0.92);
  backdrop-filter: blur(3px);
  outline: none;
  animation: sw-fade-in 0.15s ease;
}

@keyframes sw-fade-in {

  from { opacity: 0; }
  to   { opacity: 1; }
}

.sw-lb-figure {

  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.sw-lb-figure img {

  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 30px rgba(0, 180, 255, 0.35);
  background: #000;
}

.sw-lb-figure figcaption {

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  color: var(--retro-ice);
  font-size: 0.9rem;
}

.sw-lb-figure figcaption a {

  color: var(--retro-cyan);
}

.sw-lb-count {

  font-family: "Share Tech Mono", monospace;
}

.sw-lb-close,
.sw-lb-nav {

  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.5);
  background: rgba(0, 18, 51, 0.8);
  color: var(--retro-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sw-lb-close:hover,
.sw-lb-nav:hover {

  background: rgba(0, 180, 255, 0.55);
}

.sw-lb-close { top: 12px; right: 12px; }
.sw-lb-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.sw-lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {

  .sw-lightbox {

    padding: 3.5rem 0.5rem;
  }

  .sw-lb-prev,
  .sw-lb-next {

    top: auto;
    bottom: 12px;
    transform: none;
  }
}

/* ----- Content sections below the hero ----- */
.sw-section {

  padding: 1.25rem;
  border: 1px solid rgba(0, 180, 255, 0.22);
  border-radius: 8px;
  background: rgba(0, 12, 30, 0.6);
}

.sw-section-title {

  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem 0 !important;
  font-family: "Orbitron", sans-serif !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--retro-cyan);
  text-shadow: var(--retro-glow-cyan);
}

/* How-to-run: numbered steps for NABU channels. */
.sw-steps {

  list-style: none;
  counter-reset: sw-step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.sw-steps li {

  counter-increment: sw-step;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  line-height: 1.5;
}

.sw-steps li::before {

  content: counter(sw-step);
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Share Tech Mono", monospace;
  color: var(--retro-deeper);
  background: var(--retro-cyan);
  box-shadow: var(--retro-glow-cyan);
}

.sw-steps strong {

  color: var(--retro-white);
}

/* How-to-run: CRT terminal for Cloud CP/M. */
.sw-terminal {

  margin: 0.85rem 0 0 0;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 240, 255, 0.04) 2px 3px),
    #010810;
  font-family: "VT323", "Share Tech Mono", monospace;
  font-size: 1.3rem;
  line-height: 1.35;
  color: #9ff7ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.55);
  overflow-x: auto;
}

.sw-terminal > div {

  white-space: pre;
}

.sw-terminal .sw-prompt {

  color: var(--retro-ice);
  opacity: 0.75;
}

.sw-terminal .sw-comment {

  color: var(--retro-ice);
  opacity: 0.5;
}

.sw-cursor {

  display: inline-block;
  width: 0.6em;
  height: 1em;
  vertical-align: text-bottom;
  background: #9ff7ff;
  animation: sw-blink 1s steps(1) infinite;
}

@keyframes sw-blink {

  50% { opacity: 0; }
}

/* CP/M file listing — a DIR-style grid of tiles. */
.sw-files {

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.5rem;
}

.sw-file {

  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(0, 180, 255, 0.22);
  border-radius: 6px;
  background: rgba(0, 8, 20, 0.6);
  color: var(--retro-white) !important;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}

.sw-file:hover {

  border-color: var(--retro-cyan);
  background: rgba(0, 180, 255, 0.12);
}

.sw-file .mud-icon-root {

  flex: 0 0 auto;
  color: var(--retro-ice);
}

.sw-file-main {

  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.sw-file-main .mud-icon-root {

  color: var(--retro-cyan);
}

.sw-file-name {

  font-family: "Share Tech Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.sw-file-size {

  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--retro-ice);
  opacity: 0.75;
}

/* Created / updated line under the hero facts. */
.sw-dates {

  font-size: 0.8rem;
  color: var(--retro-ice);
  opacity: 0.7;
}
