/* other parts of site */

.article-section {
  --article-bg: var(--bs-body-bg);
  --article-surface: var(--bs-tertiary-bg);
  --article-border: rgba(var(--bs-emphasis-color-rgb), 0.12);
  --article-muted: var(--bs-secondary-color);
  --article-highlight: rgba(var(--bs-warning-rgb), 0.18);
  --article-callout-bg: rgba(var(--bs-primary-rgb), 0.08);
  --article-quote-border: var(--bs-primary);
  --navbar-height: 72px;

  position: relative;
  isolation: isolate;
  overflow: visible; /* otherwise aside sticky will not work */
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  padding: 0;
  border-radius: 1rem;
}

/* article section background image */
.article-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;

  background-image: var(--section-image);
  background-size: cover;
  background-position: left top;
  background-repeat: no-repeat;

  opacity: 0.24;
  transform-origin: center top;
  transform: scaleX(-1);

  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0vh,
    rgba(0, 0, 0, 0.95) 8vh,
    rgba(0, 0, 0, 0.80) 16vh,
    rgba(0, 0, 0, 0.55) 26vh,
    rgba(0, 0, 0, 0.28) 36vh,
    rgba(0, 0, 0, 0.10) 43vh,
    rgba(0, 0, 0, 0.015) 47vh,
    rgba(0, 0, 0, 0) 50vh
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0vh,
    rgba(0, 0, 0, 0.95) 8vh,
    rgba(0, 0, 0, 0.80) 16vh,
    rgba(0, 0, 0, 0.55) 26vh,
    rgba(0, 0, 0, 0.28) 36vh,
    rgba(0, 0, 0, 0.10) 43vh,
    rgba(0, 0, 0, 0.015) 47vh,
    rgba(0, 0, 0, 0) 50vh
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  filter: saturate(0.92) brightness(1.02);
}

.article-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bs-body-bg) 0%, transparent) 0%,
    color-mix(in srgb, var(--bs-body-bg) 4%, transparent) 9%,
    color-mix(in srgb, var(--bs-body-bg) 8%, transparent) 16%,
    color-mix(in srgb, var(--bs-body-bg) 14%, transparent) 24%,
    color-mix(in srgb, var(--bs-body-bg) 22%, transparent) 34%,
    color-mix(in srgb, var(--bs-body-bg) 38%, transparent) 40%,
    color-mix(in srgb, var(--bs-body-bg) 60%, transparent) 45%,
    color-mix(in srgb, var(--bs-body-bg) 82%, transparent) 59%,
    var(--bs-body-bg) 100%
  );
}

.section-article-footer {
  margin-top: 1rem;
  padding: 3rem 2rem;
  border-radius: 1rem;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.section-article-footer p {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

[data-bs-theme="light"] .section-article-footer,
.section-article-footer {
  color: #212529;
  border: 1px solid rgba(13, 110, 253, 0.12);
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, 0.12), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #eef4ff 100%);
  box-shadow: 0 1rem 2.5rem rgba(33, 37, 41, 0.08);
}

[data-bs-theme="dark"] .section-article-footer {
  color: #f8f9fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top left, rgba(13, 202, 240, 0.18), transparent 34%),
    linear-gradient(135deg, #111827 0%, #1f2937 52%, #0f172a 100%);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.content-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
}

.article-content {
  padding: 2rem;
}

.article-card, .article-card-sub {
  border: 1px solid var(--bs-border-color-translucent);
  border-radius: 1rem;
  box-shadow: var(--bs-box-shadow-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: color-mix(in srgb, var(--bs-body-bg) 80%, transparent);
}

[data-bs-theme="light"] .article-section::before {
  opacity: 0.44;
  filter: saturate(0.92) brightness(1.02);
}

[data-bs-theme="dark"] .article-section::before {
  opacity: 0.44;
  filter: grayscale(1) saturate(0) brightness(0.82) contrast(1.05);
}

[data-bs-theme="dark"] .article-card {
  background: color-mix(in srgb, var(--bs-body-bg) 72%, transparent);
}

.article-sidebar {
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
  align-self: start;
  z-index: 1010;
}

@media (max-width: 991.98px) {
  .article-sidebar {
    position: static !important;
    top: auto;
  }
}

.article-paper,
.sidebar-card {
  background-color: var(--article-bg);
  border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.15);
  border-radius: 1rem;
}

.article-paper {
  line-height: 1.85;
}

.article-header .lead {
  max-width: 60ch;
}

.article-paper h1,
.article-paper h2,
.article-paper h3,
.article-paper h4 {
  letter-spacing: -0.02em;
}

.article-paper p {
  color: var(--bs-body-color);
  font-size: 1.03rem;
}

.article-inline-highlight {
  background: linear-gradient(
    transparent 58%,
    var(--article-highlight) 58%
  );
  padding: 0 0.15rem;
  font-weight: 500;
}

.article-callout {
  border: 1px solid var(--article-border);
  background-color: var(--article-callout-bg);
}

.article-callout-accent {
  position: relative;
  overflow: hidden;
}

.article-callout-accent::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bs-primary);
}

.article-highlight-box {
  background-color: var(--article-surface);
  border: 1px solid var(--article-border);
}

.article-quote {
  border-color: var(--article-quote-border) !important;
}

.article-references {
  font-size: 0.98rem;
}

.references-list p {
  padding-left: 1.5rem;
  text-indent: -1.5rem;
}

.related-link {
  display: block;
  color: var(--bs-body-color);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--article-border);
  transition: color 0.2s ease, transform 0.2s ease;
}

.related-link:last-child {
  border-bottom: 0;
}

.related-link:hover {
  color: var(--bs-primary);
  transform: translateX(2px);
}

.letter-spacing {
  letter-spacing: 0.08em;
}

.article-media-card {
  --article-media-height: 340px;

  border-top-right-radius: 1rem;
  border-top-left-radius: 1rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--bs-tertiary-bg);
  box-shadow: var(--article-media-shadow);
  transform: translateZ(0);
}

.article-media-image {
  display: block;
  width: 100%;
  height: var(--article-media-height);
  object-fit: cover;
  border-radius: inherit;
  transform: scale(1.001);
}

.article-media-image-dark {
  display: none;
}

[data-bs-theme="dark"] .article-media-image-light {
  display: none;
}

[data-bs-theme="dark"] .article-media-image-dark {
  display: block;
}

.article-media-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: background 0.25s ease;
}

[data-bs-theme="light"] .article-media-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background-color: var(--bs-body-bg);
}

[data-bs-theme="light"] .article-media-overlay {
  background:
    linear-gradient(
      to top,
      rgba(21, 28, 40, 0.60) 0%,
      rgba(21, 28, 40, 0.34) 36%,
      rgba(21, 28, 40, 0.14) 64%,
      rgba(21, 28, 40, 0.04) 100%
    ),
    linear-gradient(
      to right,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.00) 45%
    );
}

[data-bs-theme="dark"] .article-media-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .article-media-overlay {
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.84) 0%,
      rgba(0, 0, 0, 0.58) 36%,
      rgba(0, 0, 0, 0.24) 64%,
      rgba(0, 0, 0, 0.10) 100%
    ),
    linear-gradient(
      to right,
      rgba(10, 14, 20, 0.20) 0%,
      rgba(10, 14, 20, 0.00) 45%
    );
}

.article-media-content {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  max-width: 78%;
  padding: 1.5rem;
}

.article-media-content .eyebrow {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-media-content h3 {
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.article-media-content p {
  margin-bottom: 0;
  line-height: 1.5;
}

[data-bs-theme="light"] .article-media-content .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

[data-bs-theme="dark"] .article-media-content .eyebrow {
  color: rgba(255, 255, 255, 0.64);
}

[data-bs-theme="light"] .article-media-content h3,
[data-bs-theme="dark"] .article-media-content h3 {
  color: #fff;
}

[data-bs-theme="light"] .article-media-content p {
  color: rgba(255, 255, 255, 0.90);
}

[data-bs-theme="dark"] .article-media-content p {
  color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 991.98px) {
  .article-media-card {
    --article-media-height: 300px;
  }

  .article-media-content {
    max-width: 88%;
    padding: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .article-media-card {
    --article-media-height: 250px;
    margin-block: 1.5rem;
  }

  .article-media-content {
    max-width: 100%;
    padding: 1rem;
  }

  .article-media-content h3 {
    font-size: 1.25rem;
  }

  .article-media-content p {
    font-size: 0.95rem;
  }
}


/* sidebar link cards */
.md-sidebar-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background:
    linear-gradient(
      180deg,
      rgba(var(--bs-primary-rgb), 0.055),
      transparent 46%
    ),
    var(--bs-body-bg);
  border-radius: 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.md-sidebar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .md-sidebar-card:hover {
  box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.35);
}

.md-sidebar-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.45rem;
  color: var(--bs-heading-color);
}

.md-sidebar-card-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--bs-secondary-color);
  margin-bottom: 1rem;
}

.md-sidebar-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.35rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.18);
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.md-sidebar-card-link:hover,
.md-sidebar-card-link:focus {
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
}

.md-sidebar-card-link i {
  flex-shrink: 0;
  opacity: 0.72;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.md-sidebar-card:hover .md-sidebar-card-link i,
.md-sidebar-card-link:hover i {
  transform: translateX(4px);
  opacity: 1;
}

/* subnav media buttons */

.subnav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 68px;
  height: 28px;
  padding: 0 8px 0 0;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 6px;
  background-color: var(--bs-light, #f8f9fa);
  color: var(--bs-body-color, #212529);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  text-transform: uppercase;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.subnav-icon-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 100%;
  margin-right: 7px;
  background-color: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 12px;
  border-radius: 6px 0 0 6px;
}

.subnav-icon-btn span {
  text-align: left;
  white-space: nowrap;
}

.subnav-icon-btn:hover,
.subnav-icon-btn:focus {
  background-color: #eef1f4;
  border-color: #cfd4da;
  color: var(--bs-body-color, #212529);
}

.subnav-icon-btn:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb, 13, 110, 253), 0.35);
  outline-offset: 2px;
}

[data-bs-theme="dark"] .subnav-icon-btn {
  background-color: var(--bs-tertiary-bg, #2b3035);
  border-color: var(--bs-border-color, #495057);
  color: var(--bs-body-color, #f8f9fa);
}

[data-bs-theme="dark"] .subnav-icon-btn i {
  background-color: var(--bs-primary, #0d6efd);
  color: #fff;
}

[data-bs-theme="dark"] .subnav-icon-btn:hover,
[data-bs-theme="dark"] .subnav-icon-btn:focus {
  background-color: var(--bs-secondary-bg, #343a40);
  border-color: var(--bs-border-color-translucent, rgba(255, 255, 255, 0.15));
  color: var(--bs-body-color, #f8f9fa);
}

/* FULLSCREEN MODE */

.fullscreen-toggle-btn-container {
  text-align: center;
  padding: 2rem 1rem 1rem 1rem;
}

.fullscreen-toggle-btn {
  border-radius: 999px;
  padding: 4px 22px;
  font-weight: 900;
}

body.lesson-fullscreen-active .fullscreen-toggle-btn-container {
  margin-top: 4.9rem !important;
}

body.lesson-fullscreen-active {
  overflow: hidden;
}

body.lesson-fullscreen-active .lesson-hide-fullscreen {
  display: none !important;
}

body.lesson-fullscreen-active .lesson-main-fullscreen {
  min-height: 100vh;
  padding: 0;
}

body.lesson-fullscreen-active .lesson-main-fullscreen > .container {
  max-width: 100%;
  padding: 0;
}

body.lesson-fullscreen-active .lesson-shell {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
}

body.lesson-fullscreen-active .lesson-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 48px);
}

body.lesson-fullscreen-active .lesson-title {
  font-size: clamp(2rem, 4vw, 4rem);
}

body.lesson-fullscreen-active .lesson-subtitle {
  margin-bottom: 16px;
}

body.lesson-fullscreen-active .quote-card {
  flex: 1;
  min-height: 0;
  margin-top: 24px;
}

body.lesson-fullscreen-active .quote-card h2 {
  font-size: clamp(2.4rem, 6vw, 6.5rem);
}

@media (max-width: 767.98px) {
  .quote-card {
    min-height: 360px;
  }

  body.lesson-fullscreen-active .lesson-content {
    padding: 20px;
  }

  body.lesson-fullscreen-active .quote-card h2 {
    font-size: clamp(2rem, 11vw, 4rem);
  }
}

/* exercises */

.exercise-header {
    
}

.section-exercise-inner {
  padding: 2rem; 
}

/* quizes */

.quiz-main {
  border: 1px solid rgba(var(--bs-emphasis-color-rgb), 0.15);
  border-radius: 1rem;
  line-height: 1.85;
}

.quiz-main .quiz-header {
  background-color: var(--article-bg);
  padding: 2rem;
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

.quiz-main .quiz-header h1,
.quiz-main .quiz-header h2,
.quiz-main .quiz-header h3,
.quiz-main .quiz-header h4 {
  letter-spacing: -0.02em;
  padding: 0;
  margin: 0;
}

