/* TypeScript practice lesson: mobile-first JavaScript/TypeScript comparisons. */

.page-typescript-practice .lesson-eyebrow,
.page-typescript-practice .example-kicker {
  margin: 0 0 8px;
  color: #f7d88a;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.page-typescript-practice .lesson-lead {
  max-width: 76ch;
  font-size: 1.04rem;
}

.page-typescript-practice .lesson-route {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.page-typescript-practice .lesson-route a {
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid rgba(245, 185, 66, 0.24);
  border-radius: 10px;
  background: rgba(245, 185, 66, 0.055);
  text-decoration: none;
}

.page-typescript-practice .lesson-route strong {
  color: #f7d88a;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-typescript-practice .lesson-route span {
  color: #ffffff;
  line-height: 1.4;
}

.page-typescript-practice .lesson-part-heading {
  scroll-margin-top: 18px;
  border-left-color: #9dbef7;
  background: linear-gradient(
    145deg,
    rgba(111, 145, 190, 0.12),
    rgba(255, 255, 255, 0.018)
  );
}

.page-typescript-practice .theory-topic {
  scroll-margin-top: 18px;
}

.page-typescript-practice .theory-topic__content > :first-child,
.page-typescript-practice .theory-introduction > :first-child {
  margin-top: 0;
}

.page-typescript-practice .theory-topic__content > :last-child,
.page-typescript-practice .theory-introduction > :last-child {
  margin-bottom: 0;
}

.page-typescript-practice .theory-topic__content hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-typescript-practice .theory-topic__content h3,
.page-typescript-practice .theory-topic__content h4 {
  color: #f7d88a;
}

.page-typescript-practice .theory-topic__content blockquote p {
  margin: 0;
}

.page-typescript-practice .lesson-note {
  padding: 16px;
  margin-top: 22px;
  border: 1px solid rgba(157, 190, 247, 0.24);
  border-radius: 12px;
  background: rgba(111, 145, 190, 0.08);
}

.page-typescript-practice .lesson-note h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.page-typescript-practice main > .lesson-toc {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(111, 145, 190, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(49, 120, 198, 0.19), transparent 34%),
    linear-gradient(145deg, rgba(16, 30, 49, 0.97), rgba(10, 16, 27, 0.97));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.page-typescript-practice main > .lesson-toc::before {
  content: "TS";
  position: absolute;
  top: -30px;
  right: 12px;
  color: rgba(111, 145, 190, 0.07);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(7rem, 18vw, 12rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.page-typescript-practice .lesson-toc__header,
.page-typescript-practice .lesson-toc__groups {
  position: relative;
  z-index: 1;
}

.page-typescript-practice .lesson-toc__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-typescript-practice .lesson-toc__eyebrow {
  margin: 0 0 6px;
  color: #79aef1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-typescript-practice .lesson-toc__header h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.page-typescript-practice .lesson-toc__intro {
  max-width: 62ch;
  margin: 8px 0 0;
  color: #aebed2;
  line-height: 1.55;
}

.page-typescript-practice .lesson-toc__count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(121, 174, 241, 0.3);
  border-radius: 999px;
  background: rgba(49, 120, 198, 0.13);
  color: #cfe2fb;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.page-typescript-practice .lesson-toc__groups {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.page-typescript-practice .lesson-toc__group {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.page-typescript-practice .lesson-toc__group h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 11px;
  color: #f7d88a;
  font-size: 0.88rem;
  letter-spacing: 0.025em;
}

.page-typescript-practice .lesson-toc__group h3 > span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(247, 216, 138, 0.25);
  border-radius: 7px;
  background: rgba(245, 185, 66, 0.08);
  color: #f7d88a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.64rem;
}

.page-typescript-practice .lesson-toc__list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-typescript-practice .lesson-toc__list a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #dbe7f6;
  font-size: 0.88rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, transform 160ms ease;
}

.page-typescript-practice .lesson-toc__number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(111, 145, 190, 0.13);
  color: #9dbef7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  font-weight: 800;
}

.page-typescript-practice .lesson-toc__list code {
  padding: 0.08em 0.32em;
  border: 1px solid rgba(121, 174, 241, 0.18);
  border-radius: 4px;
  background: rgba(49, 120, 198, 0.12);
  color: #b8d7ff;
  font-size: 0.88em;
}

.page-typescript-practice .lesson-toc__list a:hover {
  border-color: rgba(121, 174, 241, 0.2);
  background: rgba(49, 120, 198, 0.12);
  color: #ffffff;
  transform: translateX(3px);
}

.page-typescript-practice .lesson-toc__list a:focus-visible,
.page-typescript-practice .lesson-toc__summary:focus-visible {
  outline: 2px solid #f5b942;
  outline-offset: 2px;
}

.page-typescript-practice .lesson-toc__summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 9px;
  margin-top: 7px;
  border: 1px solid rgba(101, 193, 140, 0.22);
  border-radius: 9px;
  background: rgba(101, 193, 140, 0.08);
  color: #bde8cc;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.page-typescript-practice .lesson-toc__summary > span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(101, 193, 140, 0.13);
}

.page-typescript-practice .lesson-toc__summary:hover {
  border-color: rgba(101, 193, 140, 0.38);
  background: rgba(101, 193, 140, 0.13);
  color: #e4f7eb;
}

.page-typescript-practice .typescript-example {
  scroll-margin-top: 18px;
}

.page-typescript-practice .example-summary {
  max-width: 78ch;
}

.page-typescript-practice .code-comparison {
  display: grid;
  min-width: 0;
  gap: 14px;
  margin-top: 18px;
}

.page-typescript-practice .code-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #0d1117;
}

.page-typescript-practice .code-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page-typescript-practice .code-panel--javascript .code-panel__header {
  background: rgba(247, 223, 30, 0.09);
}

.page-typescript-practice .code-panel--typescript .code-panel__header {
  background: rgba(49, 120, 198, 0.13);
}

.page-typescript-practice .code-panel__header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
}

.page-typescript-practice .code-panel__header span {
  color: #ababab;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
}

.page-typescript-practice main .code-panel pre {
  min-height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.page-typescript-practice .example-output {
  margin-top: 16px;
}

.page-typescript-practice .example-output h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.page-typescript-practice main .example-output pre {
  margin: 0;
  border-left-color: #65c18c;
  background: rgba(31, 61, 45, 0.36);
}

.page-typescript-practice .example-explanation {
  display: grid;
  gap: 7px;
  margin-top: 20px;
}

.page-typescript-practice .example-explanation h3 {
  margin: 12px 0 0;
  color: #f7d88a;
  font-size: 1rem;
}

.page-typescript-practice .example-explanation p {
  margin: 0;
}

.page-typescript-practice .lesson-warning-title + p {
  padding: 12px 14px;
  border-left: 3px solid #f5b942;
  border-radius: 0 9px 9px 0;
  background: rgba(245, 185, 66, 0.07);
}

.page-typescript-practice main .lesson-error {
  margin-top: 0;
  border-left-color: #e57373;
  background: rgba(110, 35, 35, 0.16);
}

.page-typescript-practice .lesson-sources {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9da7b4;
  font-size: 0.82rem;
}

.page-typescript-practice .lesson-table-wrap {
  overflow-x: auto;
}

.page-typescript-practice .lesson-quiz__items {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.page-typescript-practice .lesson-quiz details {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.page-typescript-practice .lesson-quiz summary {
  color: #d9e4f5;
  font-weight: 650;
  cursor: pointer;
}

.page-typescript-practice .lesson-quiz details p {
  margin-top: 10px;
}

.page-typescript-practice .lesson-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

@media screen and (min-width: 768px) {
  .page-typescript-practice .lesson-route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-typescript-practice .lesson-toc__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media screen and (min-width: 980px) {
  .page-typescript-practice .code-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-typescript-practice .typescript-example,
  .page-typescript-practice .lesson-toc__list a {
    scroll-behavior: auto;
    transition: none;
  }
}
