/* ================= DEV NOTES: MOBILE DEFAULT (320px–767px) ================= */

/* ======================== DEV NOTES PAGE STYLES ============================= */
/* page layout, lesson text helpers, and reusable styles for Dev Notes content */

/* Separate the main Dev Notes groups with a quiet divider */
.page-devnotes main > section {
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.018)
  );
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.page-devnotes main > section:last-child {
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* Add space between main Dev Notes sections */
.page-devnotes .section + .section {
  margin-top: 18px;
}

/* Add space below section headings */
.page-devnotes .section h1 + p,
.page-devnotes .section h2 + p,
.page-devnotes .section h2 + .devnotes-toggle-btn {
  margin-top: 12px;
}

/* Add space between module articles inside open content blocks */
.page-devnotes #html-content article + article,
.page-devnotes #js-content article + article,
.page-devnotes #react-content article + article {
  margin-top: 0;
}

/* Add space between article headings and their lesson lists */
.page-devnotes article h3 + ul {
  margin-top: 10px;
}

/* Smaller paragraph text used inside lesson pages */
.p-devnotes {
  font-size: 14px;
  line-height: 1.5;
  color: #ababab;
}

/* Shared list text styling used in lesson content */
.ul-devnotes {
  font-size: 14px;
  line-height: 1.5;
  color: #ababab;
}

/* Individual list items match the surrounding Dev Notes text */
.ul-devnotes li {
  font-size: 14px;
  line-height: 1.5;
  color: #ababab;
}

/* Shared helper class used for code-related text blocks */
.codetext-devnotes {
  font-size: 14px;
  line-height: 1.5;
  color: #ababab;
}

/* Crawlable and keyboard-friendly links between lessons. */
.lesson-pagination {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lesson-pagination__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 185, 66, 0.38);
  border-radius: 8px;
  background: rgba(245, 185, 66, 0.07);
  color: #f5d48f;
  text-align: center;
  text-decoration: none;
}

.lesson-pagination__link:hover,
.lesson-pagination__link:focus-visible {
  border-color: #f5b942;
  background: rgba(245, 185, 66, 0.14);
  color: #ffffff;
}

.lesson-pagination__link--previous {
  justify-content: flex-start;
}

.lesson-pagination__link--next {
  justify-content: flex-end;
}

/* ======================== DEV NOTES CODE BLOCKS <pre> ============================= */
/* prevent long code examples from stretching the page layout on mobile */

/* Scroll long code horizontally instead of pushing the layout sideways */
pre {
  overflow-x: auto;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background-color: #111111;
}

/* Match the code text size and color to the lesson design */
pre code {
  font-size: 14px;
  line-height: 1.5;
  color: #e7e1e1;
}

/* ======================== DEV NOTES TOGGLE BUTTON ============================= */
/* button styles for showing and hiding module lists on the Dev Notes page */

/* Toggle button used to show and hide Dev Notes module lists */
.devnotes-toggle-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 10px 16px;
  margin-top: 12px;
  margin-bottom: 16px;
  background-color: #161616;
  color: #ffffff;
  border: 1px solid #4a5568;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Small arrow indicator that rotates when the section opens */
.devnotes-toggle-btn::after {
  content: "▾";
  font-size: 12px;
  line-height: 1;
  transition: transform 0.2s ease;
}

/* Slightly brighten the button on hover */
.devnotes-toggle-btn:hover {
  background-color: #222222;
  border-color: #6b76f3;
}

/* Keep keyboard focus clearly visible */
.devnotes-toggle-btn:focus {
  outline: 2px solid #9dbef7;
  outline-offset: 2px;
}

/* Add a small pressed effect while clicking */
.devnotes-toggle-btn:active {
  transform: translateY(1px);
}

/* Open state styling uses a highlighted accent color */
.devnotes-toggle-btn[aria-expanded="true"] {
  background-color: #1f2638;
  border-color: #6b76f3;
}

/* Rotate the arrow when the controlled section is expanded */
.devnotes-toggle-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Match the main Devnotes collection with the site's card-based design. */
.page-devnotes > hr {
  display: none;
}

.page-devnotes main.container {
  display: grid;
  gap: 18px;
}

.page-devnotes main > section:first-of-type {
  position: relative;
  overflow: hidden;
  border-color: rgba(245, 185, 66, 0.24);
  background: linear-gradient(
    145deg,
    rgba(245, 185, 66, 0.1),
    rgba(255, 255, 255, 0.018)
  );
}

.page-devnotes main > section:first-of-type::after {
  content: "</>";
  position: absolute;
  right: 14px;
  bottom: -0.18em;
  color: rgba(245, 185, 66, 0.045);
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.1em;
  pointer-events: none;
}

.page-devnotes main > section:first-of-type > * {
  position: relative;
  z-index: 1;
}

.page-devnotes main > section:first-of-type p {
  max-width: 72ch;
  line-height: 1.65;
}

.page-devnotes #html-content,
.page-devnotes #js-content,
.page-devnotes #react-content {
  gap: 14px;
  margin-top: 4px;
}

.page-devnotes #html-content:not([hidden]),
.page-devnotes #js-content:not([hidden]),
.page-devnotes #react-content:not([hidden]) {
  display: grid;
}

.page-devnotes main article {
  min-width: 0;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid rgba(245, 185, 66, 0.65);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 220ms ease, background-color 220ms ease,
    box-shadow 220ms ease, transform 220ms ease;
}

.page-devnotes main article:hover {
  border-color: rgba(245, 185, 66, 0.42);
  border-left-color: #f5b942;
  background: rgba(245, 185, 66, 0.035);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  transform: translateY(-2px);
}

.page-devnotes main article ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.page-devnotes main article li {
  margin: 0;
}

.page-devnotes main article a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #d9e4f5;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease,
    color 180ms ease, transform 180ms ease;
}

.page-devnotes main article a::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  border-radius: 50%;
  background: #f5b942;
  box-shadow: 0 0 7px rgba(245, 185, 66, 0.45);
}

.page-devnotes main article a:hover {
  border-color: rgba(245, 185, 66, 0.38);
  background: rgba(245, 185, 66, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.page-devnotes .devnotes-toggle-btn {
  position: relative;
  overflow: hidden;
  border-color: #f5b942;
  background: rgba(245, 185, 66, 0.08);
  color: #f7d88a;
  font-weight: 650;
}

.page-devnotes .devnotes-toggle-btn:hover,
.page-devnotes .devnotes-toggle-btn[aria-expanded="true"] {
  border-color: #f5b942;
  background: rgba(245, 185, 66, 0.16);
  color: #ffffff;
  box-shadow: 0 5px 16px rgba(245, 185, 66, 0.16);
  transform: translateY(-2px);
}

.page-devnotes .devnotes-toggle-btn:focus-visible {
  outline: 2px solid #f7d88a;
  outline-offset: 3px;
}

/* ================= DEV NOTES: TABLET (768px+) ================= */
@media screen and (min-width: 768px) {
  .page-devnotes main.container {
    gap: 20px;
    padding: 32px clamp(28px, 5vw, 72px) 48px;
  }

  .page-devnotes main > section {
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
  }

  .page-devnotes .section + .section {
    margin-top: 0;
  }

  .page-devnotes main > section:first-of-type {
    padding: 34px;
  }

  .page-devnotes main > section:first-of-type::after {
    font-size: 8rem;
  }

  .page-devnotes #html-content:not([hidden]),
  .page-devnotes #js-content:not([hidden]),
  .page-devnotes #react-content:not([hidden]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ================= DEV NOTES: DESKTOP (1158px+) ================= */
@media screen and (min-width: 1158px) {
  .page-devnotes main.container {
    width: min(100%, 1440px);
    padding: 44px clamp(40px, 5vw, 80px) 64px;
  }

  .page-devnotes main > section {
    padding: clamp(30px, 3vw, 42px);
  }

  .page-devnotes main > section:first-of-type {
    padding: clamp(38px, 4vw, 54px);
  }

  .page-devnotes main > section:first-of-type::after {
    font-size: 10rem;
  }

  .page-devnotes #html-content:not([hidden]),
  .page-devnotes #js-content:not([hidden]),
  .page-devnotes #react-content:not([hidden]) {
    gap: 20px;
  }

  .page-devnotes main article {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-devnotes main article,
  .page-devnotes main article a,
  .page-devnotes .devnotes-toggle-btn {
    transition: none;
  }
}

/* ================= DEVNOTES LESSONS: MOBILE DEFAULT ================= */

.has-devnotes-search:not(.page-devnotes) > hr {
  display: none;
}

.has-devnotes-search:not(.page-devnotes) main.container {
  display: grid;
  gap: 14px;
}

.has-devnotes-search:not(.page-devnotes) main > p:first-child,
.has-devnotes-search:not(.page-devnotes) main > .devnotes-breadcrumbs + p {
  margin: 0 0 2px;
}

/* Lesson breadcrumbs: Dev Notes + lesson on mobile, full hierarchy on desktop. */
.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs {
  min-width: 0;
  padding: 2px 2px 0;
  color: #ababab;
  font-size: 0.86rem;
  line-height: 1.4;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs ol {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs li {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #ababab;
  font-size: inherit;
  line-height: inherit;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs li + li::before {
  content: "\203A";
  flex: 0 0 auto;
  margin: 0 8px;
  color: #666666;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs a,
.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs a:visited {
  color: #f7d88a;
  text-decoration: none;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs [aria-current="page"] {
  overflow: hidden;
  color: #d7d7d7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-home,
.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-category,
.has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-module {
  display: none;
}

.has-devnotes-search:not(.page-devnotes) main > section {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid rgba(245, 185, 66, 0.58);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.045),
    rgba(255, 255, 255, 0.015)
  );
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.17);
  transition: border-color 220ms ease, box-shadow 220ms ease,
    transform 220ms ease;
}

.has-devnotes-search:not(.page-devnotes) main > section:first-of-type {
  position: relative;
  overflow: hidden;
  border-color: rgba(245, 185, 66, 0.25);
  border-left-color: #f5b942;
  background: linear-gradient(
    145deg,
    rgba(245, 185, 66, 0.1),
    rgba(255, 255, 255, 0.018)
  );
}

.has-devnotes-search:not(.page-devnotes) main > section:not(:first-of-type):hover {
  border-color: rgba(245, 185, 66, 0.36);
  border-left-color: #f5b942;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.has-devnotes-search:not(.page-devnotes) main section h1,
.has-devnotes-search:not(.page-devnotes) main section h2,
.has-devnotes-search:not(.page-devnotes) main section h3 {
  overflow-wrap: anywhere;
}

.has-devnotes-search:not(.page-devnotes) main > section:first-of-type h1,
.has-devnotes-search:not(.page-devnotes) main > section:first-of-type h2,
.has-devnotes-search:not(.page-devnotes) main > section:first-of-type h3 {
  color: #ffffff;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2.1rem);
}

.has-devnotes-search:not(.page-devnotes) main section p,
.has-devnotes-search:not(.page-devnotes) main section li,
.has-devnotes-search:not(.page-devnotes) .p-devnotes,
.has-devnotes-search:not(.page-devnotes) .ul-devnotes,
.has-devnotes-search:not(.page-devnotes) .ul-devnotes li,
.has-devnotes-search:not(.page-devnotes) .codetext-devnotes {
  color: #d4d4d4;
  font-size: 0.95rem;
  line-height: 1.65;
}

.has-devnotes-search:not(.page-devnotes) main section p + p,
.has-devnotes-search:not(.page-devnotes) main section p + ul,
.has-devnotes-search:not(.page-devnotes) main section p + ol,
.has-devnotes-search:not(.page-devnotes) main section pre + p {
  margin-top: 12px;
}

.has-devnotes-search:not(.page-devnotes) main section ul,
.has-devnotes-search:not(.page-devnotes) main section ol {
  margin-top: 12px;
  padding-left: 24px;
}

.has-devnotes-search:not(.page-devnotes) main section li {
  margin-bottom: 8px;
  padding-left: 3px;
}

.has-devnotes-search:not(.page-devnotes) main section li::marker {
  color: #f5b942;
  font-weight: 700;
}

.has-devnotes-search:not(.page-devnotes) main section h4,
.has-devnotes-search:not(.page-devnotes) main section h5 {
  margin-top: 18px;
}

.has-devnotes-search:not(.page-devnotes) main section code:not(pre code) {
  padding: 0.14em 0.38em;
  border: 1px solid rgba(245, 185, 66, 0.2);
  border-radius: 5px;
  background: rgba(245, 185, 66, 0.07);
  color: #f7d88a;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.has-devnotes-search:not(.page-devnotes) main pre {
  max-width: 100%;
  padding: 16px;
  margin: 14px 0;
  border: 1px solid rgba(111, 145, 190, 0.28);
  border-left: 3px solid #6f91be;
  border-radius: 10px;
  background: #0d1117;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  scrollbar-color: #6f91be #151515;
}

.has-devnotes-search:not(.page-devnotes) main pre code {
  color: #d9e4f5;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  tab-size: 2;
}

.has-devnotes-search:not(.page-devnotes) main blockquote {
  padding: 14px 16px;
  margin: 14px 0;
  border-left: 3px solid #f5b942;
  border-radius: 0 9px 9px 0;
  background: rgba(245, 185, 66, 0.07);
  color: #e7e1e1;
}

.has-devnotes-search:not(.page-devnotes) main table {
  display: block;
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  overflow-x: auto;
}

.has-devnotes-search:not(.page-devnotes) main th,
.has-devnotes-search:not(.page-devnotes) main td {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  text-align: left;
}

.has-devnotes-search:not(.page-devnotes) main th {
  background: rgba(245, 185, 66, 0.1);
  color: #f7d88a;
}

.has-devnotes-search:not(.page-devnotes) main img {
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.has-devnotes-search:not(.page-devnotes) main a:not(.site-back-link) {
  color: #9dbef7;
  text-underline-offset: 3px;
}

.has-devnotes-search:not(.page-devnotes) main a:not(.site-back-link):hover {
  color: #f7d88a;
}

.has-devnotes-search:not(.page-devnotes) .site-back-link {
  margin: 0;
  border-color: rgba(245, 185, 66, 0.38);
  background: rgba(245, 185, 66, 0.08);
  color: #f7d88a;
}

.has-devnotes-search:not(.page-devnotes) .site-back-link:hover {
  border-color: #f5b942;
  background: rgba(245, 185, 66, 0.16);
  color: #ffffff;
}

/* Persistent Previous/Next navigation generated from the lesson index. */
.has-devnotes-pagination {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.devnotes-pagination {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 6px max(6px, env(safe-area-inset-right))
    calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  border-top: 1px solid rgba(245, 185, 66, 0.32);
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.devnotes-pagination .devnotes-nav-link,
.devnotes-pagination .devnotes-nav-link:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 7px;
  color: #f7d88a;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.devnotes-pagination a.devnotes-nav-link:hover {
  background: rgba(245, 185, 66, 0.13);
  color: #ffffff;
}

.devnotes-pagination .devnotes-nav-link:focus-visible {
  outline: 2px solid #9dbef7;
  outline-offset: -2px;
}

.devnotes-pagination .devnotes-nav-link.is-disabled {
  color: #666666;
  cursor: not-allowed;
}

.devnotes-pagination .devnotes-nav-name {
  display: none;
}

/* ================= DEVNOTES LESSONS: TABLET ================= */
@media screen and (min-width: 768px) {
  .has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs {
    padding-top: 0;
    font-size: 0.92rem;
  }

  .has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-home,
  .has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-category,
  .has-devnotes-search:not(.page-devnotes) main .devnotes-breadcrumbs .breadcrumb-module {
    display: flex;
  }

  .has-devnotes-search:not(.page-devnotes) main.container {
    gap: 18px;
    padding: 32px clamp(28px, 5vw, 72px) 48px;
  }

  .has-devnotes-search:not(.page-devnotes) main > section {
    padding: 26px;
    border-radius: 17px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  }

  .has-devnotes-search:not(.page-devnotes) main > section:first-of-type {
    padding: 32px;
  }

  .has-devnotes-search:not(.page-devnotes) main pre {
    padding: 18px;
  }
}

/* Padding shorthand diagrams used in CSS geometry lessons */
.padding-map {
  display: grid;
  grid-template-areas:
    ". top ."
    "left content right"
    ". bottom .";
  grid-template-columns: minmax(70px, 1fr) minmax(110px, 1.4fr) minmax(70px, 1fr);
  align-items: center;
  width: min(100%, 520px);
  min-height: 220px;
  margin: 24px auto 8px;
  color: #e8e8e8;
  text-align: center;
}

.padding-map__top { grid-area: top; align-self: end; }
.padding-map__right { grid-area: right; }
.padding-map__bottom { grid-area: bottom; align-self: start; }
.padding-map__left { grid-area: left; }

.padding-map__top::after,
.padding-map__right::before,
.padding-map__bottom::before,
.padding-map__left::after {
  display: block;
  color: #f5b942;
  font-size: 1.35rem;
  line-height: 1;
}

.padding-map__top::after { content: "\2193"; }
.padding-map__right::before { content: "\2190"; }
.padding-map__bottom::before { content: "\2191"; }
.padding-map__left::after { content: "\2192"; }

.padding-map__content {
  grid-area: content;
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 3px solid #f5b942;
  border-radius: 8px;
  background: rgba(245, 185, 66, 0.12);
  color: #fff;
  font-weight: 700;
}

.padding-map strong {
  color: #f5b942;
}

/* Horizontal spacing diagram for inline elements */
.inline-spacing-diagram {
  width: min(100%, 700px);
  margin: 26px auto 14px;
  padding: 22px 12px 18px;
  overflow-x: auto;
  border: 1px solid rgba(245, 185, 66, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.inline-spacing-diagram__labels,
.inline-spacing-diagram__line {
  display: grid;
  grid-template-columns: max-content 52px 58px max-content 58px 52px max-content;
  align-items: center;
  justify-content: center;
  min-width: 610px;
}

.inline-spacing-diagram__labels {
  margin-bottom: 10px;
  color: #d8d8d8;
  font-size: 0.72rem;
  text-align: center;
}

.inline-spacing-diagram__labels span::after {
  display: block;
  color: #f5b942;
  content: "\2193";
  font-size: 1.25rem;
  line-height: 1;
}

.inline-spacing-diagram__margin-label:first-child { grid-column: 2; }
.inline-spacing-diagram__padding-label { color: #9dbef7; }
.inline-spacing-diagram__padding-label:nth-child(2) { grid-column: 3; }
.inline-spacing-diagram__padding-label:nth-child(3) { grid-column: 5; }
.inline-spacing-diagram__margin-label:last-child { grid-column: 6; }

.inline-spacing-diagram__line {
  grid-template-columns: max-content 52px 58px max-content 58px 52px max-content;
  margin: 0;
  white-space: nowrap;
}

.inline-spacing-diagram__text-before { grid-column: 1; }
.inline-spacing-diagram__text-after { grid-column: 7; }

.inline-spacing-diagram__margin {
  grid-column: 2 / 7;
  display: grid;
  grid-template-columns: 52px 58px max-content 58px 52px;
  background:
    linear-gradient(
      to right,
      rgba(245, 185, 66, 0.22) 0 52px,
      transparent 52px calc(100% - 52px),
      rgba(245, 185, 66, 0.22) calc(100% - 52px)
    );
}

.inline-spacing-diagram__element {
  grid-column: 2 / 5;
  padding: 14px 0;
  border: 2px solid #9dbef7;
  border-radius: 5px;
  background: rgba(157, 190, 247, 0.2);
  color: #fff;
  font-weight: 700;
}

.inline-spacing-diagram figcaption {
  max-width: 590px;
  margin: 18px auto 0;
  color: #cfcfcf;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

/* ================= DEVNOTES LESSONS: DESKTOP ================= */
@media screen and (min-width: 1158px) {
  .has-devnotes-search:not(.page-devnotes) main.container {
    width: min(100%, 1080px);
    padding: 44px clamp(40px, 5vw, 80px) 64px;
  }

  .has-devnotes-search:not(.page-devnotes) main > section {
    padding: clamp(28px, 3vw, 38px);
  }

  .has-devnotes-search:not(.page-devnotes) main > section:first-of-type {
    padding: clamp(34px, 4vw, 46px);
  }

  .has-devnotes-search:not(.page-devnotes) main section p,
  .has-devnotes-search:not(.page-devnotes) main section li,
  .has-devnotes-search:not(.page-devnotes) .p-devnotes,
  .has-devnotes-search:not(.page-devnotes) .ul-devnotes,
  .has-devnotes-search:not(.page-devnotes) .ul-devnotes li {
    font-size: 1rem;
    line-height: 1.72;
  }

  .has-devnotes-search:not(.page-devnotes) main pre code {
    font-size: 0.9rem;
  }
}

@media screen and (min-width: 1400px) {
  .has-devnotes-pagination {
    padding-bottom: 0;
  }

  .has-devnotes-pagination main.container {
    width: min(calc(100% - 240px), 1080px);
    margin-right: 220px;
    margin-left: auto;
  }

  .devnotes-pagination {
    top: 50%;
    right: 22px;
    bottom: auto;
    left: auto;
    width: 180px;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(245, 185, 66, 0.32);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    transform: translateY(-50%);
  }

  .devnotes-pagination .devnotes-nav-link,
  .devnotes-pagination .devnotes-nav-link:visited {
    min-height: 46px;
    flex-wrap: wrap;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .devnotes-pagination .devnotes-nav-name {
    display: block;
    width: 100%;
    overflow: hidden;
    color: #ababab;
    font-size: 0.7rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-devnotes-search:not(.page-devnotes) main > section {
    transition: none;
  }
}
