:root {
  --rh-color-brand-red: #ee0000;
  --rh-color-border: #d2d2d2;
  --rh-color-text-primary: #151515;
  --rh-color-text-secondary: #6a6e73;
  --rh-color-surface: #fff;
  --rh-color-muted: #f5f5f5;
  --rh-font-display: "Red Hat Display", "RedHatDisplay", sans-serif;
  --rh-font-text: "Red Hat Text", "RedHatText", sans-serif;
  --rh-font-mono: "Red Hat Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--rh-color-surface);
  color: var(--rh-color-text-primary);
  font-family: var(--rh-font-text);
  line-height: 1.5;
}
a { color: var(--rh-color-brand-red); }
a:hover { text-decoration: underline; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rh-color-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--rh-color-text-primary);
  text-decoration: none;
  font-family: var(--rh-font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand img { width: 22px; height: 22px; }
.brand:hover { text-decoration: none; color: var(--rh-color-brand-red); }
.top nav { display: flex; gap: 1.1rem; font-size: 0.95rem; }
.top nav a { color: var(--rh-color-text-primary); text-decoration: none; font-weight: 500; }
.top nav a[aria-current="page"] { color: var(--rh-color-brand-red); font-weight: 700; }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

h1 {
  font-family: var(--rh-font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.lede {
  color: var(--rh-color-text-secondary);
  max-width: 46rem;
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.lede code, figcaption code, .commands code {
  font-family: var(--rh-font-mono);
  font-size: 0.9em;
  background: var(--rh-color-muted);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  white-space: nowrap;
}

.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}
.chapters button {
  appearance: none;
  border: 1px solid var(--rh-color-border);
  background: #fff;
  color: var(--rh-color-text-primary);
  font-family: var(--rh-font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}
.chapters button[aria-current="true"] {
  background: var(--rh-color-brand-red);
  border-color: var(--rh-color-brand-red);
  color: #fff;
}
.chapters button:hover { border-color: var(--rh-color-brand-red); color: var(--rh-color-brand-red); }
.chapters button[aria-current="true"]:hover { color: #fff; }
.chapters a {
  border: 1px solid var(--rh-color-border);
  color: var(--rh-color-text-primary);
  text-decoration: none;
  font-family: var(--rh-font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.chapters a:hover { border-color: var(--rh-color-brand-red); color: var(--rh-color-brand-red); }

.hint {
  font-size: 0.8rem;
  color: var(--rh-color-text-secondary);
  margin: 0.65rem 0 0;
}

.journey-carousel {
  position: relative;
  background: #0f0f10;
  border: 1px solid var(--rh-color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
}
.journey-carousel:focus { outline: 2px solid var(--rh-color-brand-red); outline-offset: 3px; }
.journey-carousel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: #0f0f10;
}
body.journey-fs-open { overflow: hidden; }

.journey-viewport {
  position: relative;
  background: #151515;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(52vh, 420px);
}
.journey-slide {
  display: none;
  flex-direction: column;
  margin: 0;
  width: 100%;
}
.journey-slide.is-active { display: flex; }
.journey-slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 680px);
  object-fit: contain;
  object-position: center center;
  background: #1a1a1a;
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
}
.journey-slide img.is-diagram {
  object-fit: contain;
  background: #fff;
}
.journey-slide figcaption {
  padding: 0.85rem 1.25rem 1rem;
  background: #fff;
  border-top: 1px solid var(--rh-color-border);
}
.slide-num {
  display: inline-block;
  font-family: var(--rh-font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rh-color-brand-red);
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.journey-slide figcaption > strong {
  display: block;
  color: var(--rh-color-text-primary);
  font-family: var(--rh-font-display);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.journey-slide figcaption span.desc {
  display: block;
  color: var(--rh-color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

@media (min-width: 960px) {
  .journey-slide.is-active {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.85fr);
    align-items: stretch;
    min-height: min(72vh, 640px);
  }
  .journey-viewport { min-height: 0; }
  .journey-slide img {
    width: 100%;
    height: 100%;
    max-height: min(78vh, 720px);
    object-fit: contain;
    object-position: center center;
    margin: 0;
  }
  .journey-slide figcaption {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-left: 1px solid var(--rh-color-border);
    padding: 1.25rem 1.5rem;
  }
}

.journey-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid var(--rh-color-border);
}
.journey-nav { display: flex; gap: 0.5rem; }
.journey-btn {
  appearance: none;
  border: 1px solid var(--rh-color-border);
  background: #fff;
  color: var(--rh-color-text-primary);
  font-family: var(--rh-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.journey-btn:hover {
  border-color: var(--rh-color-brand-red);
  color: var(--rh-color-brand-red);
}
.journey-btn:focus-visible {
  outline: 2px solid var(--rh-color-brand-red);
  outline-offset: 2px;
}
.journey-btn:disabled { opacity: 0.45; cursor: default; }
.journey-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 0;
}
.journey-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #c8c8c8;
  cursor: pointer;
}
.journey-dot[aria-current="true"] {
  background: var(--rh-color-brand-red);
  transform: scale(1.25);
}
.journey-status {
  font-size: 0.8rem;
  color: var(--rh-color-text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.commands {
  margin-top: 1.75rem;
  border-top: 1px solid var(--rh-color-border);
  padding-top: 1.25rem;
}
.commands h2 {
  font-family: var(--rh-font-display);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}
.commands p {
  color: var(--rh-color-text-secondary);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
pre {
  background: #151515;
  color: #f5f5f5;
  font-family: var(--rh-font-mono);
  font-size: 0.82rem;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.45;
}
table.compat {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.75rem 0;
}
table.compat th, table.compat td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--rh-color-border);
}
table.compat th { color: var(--rh-color-text-secondary); font-weight: 600; }
#compat table.compat td:first-child {
  font-family: var(--rh-font-display);
  font-weight: 700;
  white-space: nowrap;
  width: 4.5rem;
}
#bridge table.compat.bridge-delta {
  table-layout: fixed;
  min-width: 40rem;
}
#bridge table.compat.bridge-delta th,
#bridge table.compat.bridge-delta td {
  width: 50%;
}
#bridge table.compat.bridge-delta td:first-child {
  font-family: var(--rh-font-display);
  font-weight: 600;
}

.commands h3 {
  font-family: var(--rh-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}
table.mapping {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 0;
  table-layout: fixed;
}
table.mapping th, table.mapping td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rh-color-border);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
table.mapping th { color: var(--rh-color-text-secondary); font-weight: 600; }
table.mapping col.cap { width: 15%; }
table.mapping col.poc { width: 16%; }
table.mapping col.rh { width: 17%; }
table.mapping col.comm { width: 16%; }
table.mapping col.gap { width: 36%; }
table.mapping td:first-child { font-family: var(--rh-font-display); font-weight: 600; }

.enterprise-diagram {
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--rh-color-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.enterprise-diagram img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}
.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(21, 21, 21, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.img-zoom[hidden] { display: none; }
.img-zoom img {
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.img-zoom-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  appearance: none;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-family: var(--rh-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.enterprise-diagram figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--rh-color-text-secondary);
  border-top: 1px solid var(--rh-color-border);
  background: var(--rh-color-muted);
}

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  color: var(--rh-color-text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .journey-status { display: none; }
  .journey-viewport { min-height: 220px; }
  .journey-slide img { max-height: min(48vh, 360px); }
  .top nav .hide-sm { display: none; }
  .journey-controls {
    flex-wrap: wrap;
  }
  .journey-dots {
    order: 3;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 0.35rem;
  }
  main { padding: 1rem 1rem 2.5rem; }
  h1 { font-size: 1.45rem; }
}

.journey-carousel.is-fullscreen .journey-viewport {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.journey-carousel.is-fullscreen .journey-slide.is-active {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.journey-carousel.is-fullscreen .journey-slide img,
.journey-carousel.is-fullscreen .journey-slide img.is-diagram {
  flex: 1 1 0;
  width: 100%;
  height: 0;
  max-width: none;
  max-height: none;
  min-height: 0;
  object-fit: contain;
  object-position: center center;
  margin: 0;
  background: #151515;
}
.journey-carousel.is-fullscreen .journey-slide figcaption {
  flex: 0 0 auto;
  border-left: none;
  border-top: 1px solid var(--rh-color-border);
  padding: 0.7rem 1.25rem;
}
