#R-header-wrapper {
  background-color: var(--INTERNAL-MENU-SECTIONS-BG-color);
}

#R-logo.R-default.k8s-logo {
  align-items: center;
  color: #ffffff;
  flex-direction: row;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-block: 1.75rem 2rem;
  padding-inline: 1.75rem 1.25rem;
}

#R-logo.R-default.k8s-logo:hover,
#R-logo.R-default.k8s-logo:hover * {
  color: #ffffff;
}

#R-logo.R-default.k8s-logo .k8s-logo-image {
  display: block;
  flex: 0 0 auto;
  width: 4.5rem;
}

#R-logo.R-default.k8s-logo .k8s-logo-image img {
  display: block;
  height: auto;
  max-width: 100%;
}

#R-logo.R-default.k8s-logo .logo-title {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: start;
  overflow-wrap: normal;
  width: min-content; /* one word per line */
  word-break: normal;
}

#R-logo.R-default.k8s-logo .logo-title > .k8s-logo-byline {
  color: #94a3b8;
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-top: 0.3rem;
  white-space: nowrap;
}

.k8s-resource {
  color: var(--K8S-RESOURCE-color);
}

/* Code blocks of the reveal shortcode stay blurred until clicked; see static/js/reveal.js */
.k8s-reveal {
  position: relative;
}

.k8s-reveal:not(.k8s-revealed) {
  cursor: pointer;
}

.k8s-reveal:not(.k8s-revealed) > * {
  pointer-events: none;
  user-select: none;
}

.k8s-reveal:not(.k8s-revealed) code {
  filter: blur(6px);
}

.k8s-reveal:not(.k8s-revealed)::after {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  border-radius: 0.25rem;
  color: var(--MAIN-TITLES-TEXT-color);
  content: "Click to reveal";
  font-weight: 600;
  left: 50%;
  padding: 0.15rem 0.75rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.k8s-reveal:focus-visible {
  outline: 2px solid var(--K8S-RESOURCE-color);
  outline-offset: 2px;
}

/* Picture of the chaos gremlin at the top of an output block, see layouts/shortcodes/gremlin.html: 73 characters of
  the code font wide, as its 73 terminal cells, followed by a blank line */
.k8s-gremlin pre::before {
  aspect-ratio: 438 / 392;
  background: url(../images/chaos-gremlin-pixel.svg) no-repeat 0 0 / contain;
  content: "";
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 1.15em;
  width: 73ch;
}

/* Marks of the chaos gremlin in output blocks, see layouts/_default/_markup/render-codeblock.html */
.k8s-ok {
  color: var(--K8S-OK-color);
}

.k8s-fail {
  color: var(--K8S-FAIL-color);
}

/* Frame of the confidential shortcode, with the label "Confidential" on its top border */
.k8s-confidential {
  border: 1px solid var(--K8S-CONFIDENTIAL-color);
  border-radius: 0.25rem;
  margin: 2rem 0 1.5rem;
  padding: 0.5rem 1rem;
  position: relative;
}

.k8s-confidential-label {
  background-color: var(--MAIN-BG-color);
  color: var(--K8S-CONFIDENTIAL-color);
  font-size: 0.75rem;
  font-weight: 600;
  left: 0.75rem;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 0 0.4rem;
  position: absolute;
  text-transform: uppercase;
  top: 0;
  transform: translateY(-50%);
}

/* Password form of the shortcodes protected and confidential; see static/js/protected.js */
.k8s-protected {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.k8s-protected input {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  border-radius: 0.25rem;
  color: var(--MAIN-TEXT-color);
  margin: 0;
  padding: 0.3rem 0.6rem;
  width: 16rem;
}

.k8s-protected-error {
  color: #e5534b;
}

/* A lab page locked with {{% protected %}}: the panel with the password form lies on blurred placeholder lines.
   Both sit in the same grid cell, so the block grows with whichever is taller */
.k8s-locked {
  display: grid;
  margin: 2rem 0;
}

.k8s-locked > * {
  grid-area: 1 / 1;
}

.k8s-locked-placeholder {
  display: flex;
  filter: blur(3px);
  flex-direction: column;
  gap: 0.85rem;
  mask-image: linear-gradient(to bottom, #000 35%, transparent);
  padding-bottom: 3rem;
  pointer-events: none;
  user-select: none;
}

.k8s-locked-placeholder span {
  background-color: var(--CODE-INLINE-BG-color);
  border-radius: 0.25rem;
  display: block;
  height: 0.85rem;
}

.k8s-locked-placeholder > .k8s-locked-heading {
  background-color: var(--MENU-SEARCH-BORDER-color);
  height: 1.5rem;
  margin-top: 1rem;
  width: 42%;
}

.k8s-locked-placeholder > .k8s-locked-code {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: auto;
  padding: 1rem;
}

.k8s-locked-code > span {
  background-color: var(--MENU-SEARCH-BORDER-color);
  height: 0.7rem;
}

.k8s-locked-panel {
  align-self: start;
  background-color: var(--MAIN-BG-color);
  border: 1px solid var(--PRIMARY-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2.5rem rgba( 0, 0, 0, 0.5 );
  justify-self: center;
  margin: 3rem 1rem 0;
  max-width: 28rem;
  padding: 1.5rem 1.75rem;
  position: relative; /* above the placeholder, which its filter puts on a layer of its own */
  text-align: center;
  z-index: 1;
}

.k8s-locked-panel p {
  margin: 0 0 0.75rem;
}

.k8s-locked-panel .k8s-locked-title {
  color: var(--MAIN-TITLES-TEXT-color);
  font-size: 1.3rem;
  font-weight: 600;
}

.k8s-locked-title i {
  color: var(--PRIMARY-color);
  margin-inline-end: 0.3rem;
}

.k8s-locked-panel .k8s-protected {
  justify-content: center;
  margin: 1.25rem 0;
}

.k8s-locked-panel .k8s-protected input {
  max-width: 100%;
  width: 14rem;
}

.k8s-locked-panel .k8s-locked-booking {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0;
}

/* Questions of the page Feedback, each in a card: the shortcodes rating and answer */
.k8s-rating,
.k8s-answer {
  background-color: var(--MENU-SEARCH-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  border-radius: 0.6rem;
  margin: 0 0 1.5rem;
  min-width: 0;
  padding: 1rem 1.25rem 1.25rem;
}

/* The legend floats, so that it lies inside the card instead of on its border */
.k8s-rating legend {
  float: left;
  width: 100%;
}

.k8s-rating legend + * {
  clear: both;
}

.k8s-rating legend,
.k8s-answer > label {
  color: var(--MAIN-TITLES-TEXT-color);
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  padding: 0;
}

/* One button per answer, all as wide as the card; below 36rem, one below the other */
.k8s-rating-options {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(var(--k8s-rating-count), minmax(0, 1fr));
}

.k8s-rating-options label,
.k8s-rating-matrix label {
  cursor: pointer;
  display: flex;
  margin: 0;
  position: relative;
}

.k8s-rating-options input,
.k8s-rating-matrix input {
  cursor: pointer;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
}

.k8s-rating-options span {
  align-items: center;
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--MENU-SEARCH-BORDER-color);
  border-radius: 0.4rem;
  color: var(--MAIN-TEXT-color);
  display: flex;
  flex: 1;
  font-size: 0.9rem;
  font-weight: 400;
  justify-content: center;
  line-height: 1.25;
  min-height: 2.75rem;
  padding: 0.4rem 0.5rem;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s;
}

.k8s-rating-options label:hover span {
  border-color: var(--PRIMARY-HOVER-color);
}

.k8s-rating-options input:checked + span {
  background-color: var(--PRIMARY-color);
  border-color: var(--PRIMARY-color);
  color: #ffffff;
  font-weight: 600;
}

.k8s-rating-options input:focus-visible + span,
.k8s-rating-matrix input:focus-visible + span,
.k8s-answer textarea:focus-visible {
  outline: 2px solid var(--K8S-RESOURCE-color);
  outline-offset: 2px;
}

.k8s-rating-numbers {
  gap: 0.35rem;
}

.k8s-rating-numbers span {
  padding-inline: 0;
}

@media screen and (max-width: 36rem) {
  .k8s-rating-options:not(.k8s-rating-numbers) {
    grid-template-columns: 1fr;
  }

  .k8s-rating-options:not(.k8s-rating-numbers) span {
    justify-content: flex-start;
    padding-inline: 0.85rem;
    text-align: start;
  }
}

.k8s-rating-ends {
  color: #94a3b8;
  display: flex;
  font-size: 0.8rem;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 0.45rem;
}

/* The rows of rating chapters="true": a header with the labels, then a chapter per row, all in the same columns.
   Below 36rem, the chapter takes a line of its own above its buttons */
.k8s-rating-matrix {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) repeat(var(--k8s-rating-count), minmax(2.5rem, 5.5rem));
  row-gap: 0.15rem;
}

@media screen and (max-width: 36rem) {
  .k8s-rating-matrix {
    grid-template-columns: repeat(var(--k8s-rating-count), minmax(0, 1fr));
  }

  .k8s-rating-matrix .k8s-rating-label {
    grid-column: 1 / -1;
    padding-top: 0.2rem;
  }

  .k8s-rating-header {
    font-size: 0.7rem;
  }

  .k8s-rating-header > :first-child {
    display: none;
  }
}

.k8s-rating-row {
  align-items: center;
  border-radius: 0.4rem;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  padding: 0.3rem 0.5rem;
}

/* Stripes slightly darker than the card; the hovered row is tinted blue, lighter than both kinds of rows */
.k8s-rating-row:not(.k8s-rating-header):nth-child(even) {
  background-color: var(--MAIN-BG-color);
}

.k8s-rating-row:not(.k8s-rating-header):hover {
  background-color: color-mix(in srgb, var(--PRIMARY-color) 20%, var(--MENU-SEARCH-BG-color));
}

.k8s-rating-header {
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.2;
  overflow-wrap: normal;
  text-align: center;
  word-break: normal;
}

.k8s-rating-label {
  padding-inline-end: 0.75rem;
}

.k8s-rating-matrix label {
  justify-content: center;
  padding: 0.35rem 0;
}

.k8s-rating-matrix label span {
  border: 2px solid #64748b;
  border-radius: 50%;
  height: 1.25rem;
  transition: border-color 0.15s, background-color 0.15s;
  width: 1.25rem;
}

.k8s-rating-matrix label:hover span {
  border-color: var(--PRIMARY-HOVER-color);
}

.k8s-rating-matrix input:checked + span {
  background-color: var(--PRIMARY-color);
  border-color: var(--PRIMARY-color);
  box-shadow: inset 0 0 0 3px var(--CODE-BLOCK-BG-color);
}

.k8s-answer textarea {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--MENU-SEARCH-BORDER-color);
  border-radius: 0.4rem;
  color: var(--MAIN-TEXT-color);
  display: block;
  font: inherit;
  margin: 0;
  padding: 0.6rem 0.75rem;
  resize: vertical;
  width: 100%;
}

/* The button of the shortcode survey, its status ("Sending...") and the thanks after sending */
.k8s-survey-send {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.k8s-survey-send .btn button {
  font-size: 1rem;
  padding: 0.5rem 1.75rem;
}

.k8s-survey-status {
  color: #94a3b8;
}

.k8s-survey-thanks {
  color: var(--K8S-CLEANUP-color);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0;
}

/* The pages Slides and Feedback come last, but the sidebar shows them at its bottom instead of in the list of
   chapters; see sidebarfootermenus in config/_default/hugo.toml */
.R-shortcutmenu-main li[data-nav-id^="/slides/"],
.R-shortcutmenu-main li[data-nav-id^="/feedback/"] {
  display: none;
}

/* A PDF of the shortcode slides: one slide, drawn by static/js/slides.js, with the buttons and the slide number
   below it. The content may use the whole width of the page then, but the slide stays low enough for the window:
   --k8s-slides-ratio is the width of a slide divided by its height, set by slides.js from the PDF */
#R-body .flex-block-wrapper:has(.k8s-slides) {
  max-width: none;
  width: 100%;
}

.k8s-slides {
  margin-inline: auto;
  max-width: calc((100vh - 13rem) * var(--k8s-slides-ratio, 16 / 9));
}

.k8s-slides-stage {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  border-radius: 0.4rem;
  overflow: hidden;
}

.k8s-slides-stage canvas {
  display: block;
  height: auto;
  width: 100%;
}

.k8s-slides:not(.k8s-slides-ready) canvas,
.k8s-slides-ready .k8s-slides-status {
  display: none;
}

.k8s-slides-status {
  margin: 0;
  padding: 4rem 1rem;
  text-align: center;
}

.k8s-slides-bar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.k8s-slides-bar .btn {
  margin: 0;
}

.k8s-slides-bar button:disabled {
  cursor: default;
  opacity: 0.4;
}

.k8s-slides-number {
  align-items: center;
  display: flex;
  font-weight: 400;
  gap: 0.4rem;
  margin: 0;
  white-space: nowrap;
}

.k8s-slides-number input {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--MENU-SEARCH-BORDER-color);
  border-radius: 0.4rem;
  color: var(--MAIN-TEXT-color);
  margin: 0;
  padding: 0.3rem 0.4rem;
  text-align: center;
  width: 4.5rem;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Without the arrows to count up and down: the buttons and the arrow keys page through the slides */
.k8s-slides-number input::-webkit-inner-spin-button,
.k8s-slides-number input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.k8s-slides-title {
  font-weight: 600;
  margin-top: 2rem;
}

.k8s-answer textarea {
  background-color: var(--CODE-BLOCK-BG-color);
  border: 1px solid var(--CODE-BLOCK-BORDER-color);
  border-radius: 0.25rem;
  color: var(--MAIN-TEXT-color);
  font: inherit;
  padding: 0.5rem 0.75rem;
  resize: vertical;
  width: 100%;
}

/* Sub-section headings inside notice boxes, e.g. on the Setup page */
.box-content h5 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-block: 1.75rem 0.5rem;
}

.box-content h5:first-child {
  margin-block-start: 0.25rem;
}

/* The lines between the steps (---) reach over the text area to the edges of the content area,
   using the same widths as the padding of Relearn's #R-body-inner */
#R-body-inner hr {
  margin-inline: -3.25rem;
}

@media screen and (max-width: 59.999rem) {
  #R-body-inner hr {
    margin-inline: -2rem;
  }
}

@media screen and (max-width: 47.999rem) {
  #R-body-inner hr {
    margin-inline: -1.25rem;
  }
}

/* "## Optional Tasks" and its "### Task N: <Name>" headings */
h2#optional-tasks,
h3[id^="task-"] {
  color: var(--K8S-OPTIONAL-color);
}

/* "## Clean Up" heading at the end of a lab */
h2#clean-up {
  color: var(--K8S-CLEANUP-color);
}

#R-homelinks > .R-menu-divider {
  display: none;
}

#R-header-topbar {
  border-inline-end-color: transparent;
}

/* Estimated time of a lab in the topbar, see layouts/partials/topbar/button/duration.html. Faded and without the
   separator of the buttons, so it doesn't look like one */
.topbar-wrapper > .topbar-area-end > .topbar-button.topbar-duration {
  align-self: center;
  border-inline-start: none;
  color: var(--INTERNAL-TOPBAR-TEXT-color);
  cursor: default;
  opacity: 0.55;
  white-space: nowrap;
}
