/* Pedagogical cards shared across resources and QCM explanations */

:root {
  --pedago-card-radius: 16px;
  --pedago-card-border: rgb(148 163 184 / 0.18);
  --pedago-card-shadow: 0 12px 28px rgb(2 6 23 / 0.18);
  --pedago-card-surface:
    linear-gradient(95deg, rgb(148 163 184 / 0.08) 0%, rgb(9 16 35 / 0.86) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(255 255 255 / 0.06), transparent 45%);
}

.pedago-card-stack {
  display: grid;
  gap: 0.72rem;
}

.pedago-card {
  --pedago-accent: rgb(148 163 184 / 0.72);
  --pedago-title: rgb(226 232 240 / 0.96);
  --pedago-text: rgb(226 232 240 / 0.95);
  --pedago-strong: rgb(248 250 252 / 0.99);
  border: 1px solid var(--pedago-card-border);
  border-left-width: 4px;
  border-left-color: var(--pedago-accent);
  border-radius: var(--pedago-card-radius);
  overflow: hidden;
  background: var(--pedago-card-surface);
  box-shadow: var(--pedago-card-shadow);
}

.pedago-card__header {
  display: flex;
  align-items: center;
  gap: 0.66rem;
  padding: 0.9rem 1rem 0.62rem;
  border-bottom: 1px solid rgb(148 163 184 / 0.2);
}

.pedago-card__icon {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--pedago-accent);
  background: rgb(15 23 42 / 0.68);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12);
  font-size: 1rem !important;
  line-height: 1 !important;
  color: var(--pedago-title);
}

.pedago-card__header h2,
.pedago-card__header h3,
.pedago-card__header h4 {
  margin: 0;
  font-size: clamp(1rem, 0.8rem + 0.45vw, 1.22rem) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em;
  color: var(--pedago-title) !important;
}

.pedago-card__body {
  padding: 0.8rem 1rem 1rem;
  color: var(--pedago-text) !important;
}

/* Do not style MathJax internals in cards: CHTML uses nested spans for layout. */
.pedago-card__body,
.pedago-card__body p,
.pedago-card__body li,
.pedago-card__body ul,
.pedago-card__body ol {
  color: inherit !important;
  line-height: 1.56 !important;
}

.pedago-card__body p,
.pedago-card__body ul,
.pedago-card__body ol {
  margin: 0.22rem 0 0;
  font-size: 0.98rem !important;
}

.pedago-card__body p:first-child,
.pedago-card__body ul:first-child,
.pedago-card__body ol:first-child {
  margin-top: 0;
}

.pedago-card__body ul:not(.pedago-steps),
.pedago-card__body ol:not(.pedago-steps) {
  padding-left: 1.15rem;
}

.pedago-card__body li + li {
  margin-top: 0.22rem;
}

.pedago-card__body strong {
  color: var(--pedago-strong) !important;
}

.pedago-card--objective {
  --pedago-accent: rgb(56 189 248 / 0.88);
  --pedago-title: rgb(125 211 252 / 0.99);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(59 130 246 / 0.1) 0%, rgb(9 16 35 / 0.84) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(59 130 246 / 0.16), transparent 45%);
}

.pedago-card--method {
  --pedago-accent: rgb(74 222 128 / 0.82);
  --pedago-title: rgb(110 231 183 / 0.98);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(34 197 94 / 0.11) 0%, rgb(9 16 35 / 0.84) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(34 197 94 / 0.16), transparent 46%);
}

.pedago-card--concept {
  --pedago-accent: rgb(45 212 191 / 0.84);
  --pedago-title: rgb(153 246 228 / 0.99);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(20 184 166 / 0.11) 0%, rgb(9 16 35 / 0.84) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(20 184 166 / 0.16), transparent 45%);
}

.pedago-card--calculation {
  --pedago-accent: rgb(250 204 21 / 0.84);
  --pedago-title: rgb(253 224 71 / 0.99);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(245 158 11 / 0.11) 0%, rgb(9 16 35 / 0.84) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(245 158 11 / 0.16), transparent 45%);
}

.pedago-card--example {
  --pedago-accent: rgb(245 158 11 / 0.82);
  --pedago-title: rgb(253 224 71 / 0.98);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(245 158 11 / 0.11) 0%, rgb(9 16 35 / 0.84) 34%, rgb(9 16 35 / 0.74) 100%),
    radial-gradient(circle at 100% 0%, rgb(245 158 11 / 0.16), transparent 45%);
}

.pedago-card--warning {
  --pedago-accent: rgb(248 113 113 / 0.82);
  --pedago-title: rgb(252 165 165 / 0.98);
  --pedago-text: rgb(254 202 202 / 0.93);
  --pedago-strong: rgb(254 226 226 / 0.99);
  --pedago-card-surface:
    linear-gradient(90deg, rgb(248 113 113 / 0.08) 0%, rgb(9 16 35 / 0.86) 35%, rgb(9 16 35 / 0.76) 100%),
    radial-gradient(circle at 100% 0%, rgb(248 113 113 / 0.18), transparent 46%);
}

.pedago-card--neutral {
  --pedago-accent: rgb(148 163 184 / 0.7);
  --pedago-title: rgb(226 232 240 / 0.96);
}

.pedago-card--method .pedago-steps {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
  counter-reset: pedago-step;
}

.pedago-card--method .pedago-steps li {
  position: relative;
  margin: 0;
  min-height: 1.8rem;
  padding-left: 2.35rem;
  display: block;
  counter-increment: pedago-step;
}

.pedago-card--method .pedago-steps li::before {
  content: counter(pedago-step);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 1.58rem;
  height: 1.58rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgb(34 197 94 / 0.22);
  border: 1px solid rgb(34 197 94 / 0.55);
  color: rgb(220 252 231 / 0.98) !important;
  font-size: 0.76rem !important;
  font-weight: 700;
}

@media (max-width: 720px) {
  .pedago-card__header {
    padding: 0.78rem 0.86rem 0.56rem;
    gap: 0.56rem;
  }

  .pedago-card__icon {
    width: 1.68rem;
    height: 1.68rem;
    font-size: 0.94rem !important;
  }

  .pedago-card__body {
    padding: 0.72rem 0.86rem 0.88rem;
  }

  .pedago-card--method .pedago-steps li {
    min-height: 1.68rem;
    padding-left: 2.1rem;
  }
}

@media (max-width: 420px) {
  .pedago-card {
    border-left-width: 3px;
  }

  .pedago-card__header {
    padding: 0.68rem 0.72rem 0.5rem;
  }

  .pedago-card__body {
    padding: 0.64rem 0.72rem 0.78rem;
  }

  .pedago-card--method .pedago-steps li {
    min-height: 1.58rem;
    padding-left: 1.96rem;
  }

  .pedago-card--method .pedago-steps li::before {
    width: 1.42rem;
    height: 1.42rem;
    font-size: 0.69rem !important;
  }
}
