/* ==========================================================================
   E-learning module styles.
   Builds on ../../style.css: colour tokens (--pcb-*), buttons, links, cards,
   headings, header/footer and the page background. Only module-specific rules
   live here. Hover/focus signal effects for .el-option are defined in style.css.
   ========================================================================== */

/* The shared .button / .notice rules set `display`, which would override the
   [hidden] attribute. Make hidden always win. */
[hidden] {
  display: none !important;
}

/* ---------- Progress bar (fixed at the top) ---------- */

.el-progress {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-bottom: 1px solid var(--pcb-line);
  background: var(--pcb-surface);
}

.el-progress__bar {
  width: 0;
  height: 100%;
  background: var(--pcb-gold);
  transition: width 500ms ease;
}

/* ---------- Module container ---------- */

.el-view {
  padding-bottom: 24px;
}

.el-view .page-intro {
  padding-block: 96px 40px;
}

.el-module {
  margin-top: 40px;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid var(--pcb-line);
  background: var(--pcb-surface);
}

.el-module--center {
  text-align: center;
}

.el-module--center .lead,
.el-module--center .hero-actions {
  margin-inline: auto;
  justify-content: center;
}

.el-module__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pcb-line);
}

.el-module__header .eyebrow {
  margin: 0;
}

/* Keep the "1 / 5" counter on one line when the course title is long. */
.el-module__header .eyebrow:last-child {
  flex: none;
  white-space: nowrap;
}

/* ---------- Slides ---------- */

.slide {
  display: grid;
  min-height: 420px;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px 36px;
  align-content: start;
}

.slide--with-image {
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
}

.slide__header {
  grid-column: 1 / -1;
}

.slide__number {
  margin: 0 0 8px;
  color: var(--pcb-text-dim);
  font-family: var(--pcb-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}

.slide__title {
  max-width: 800px;
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.slide__content {
  min-width: 0;
}

.slide__content > :last-child {
  margin-bottom: 0;
}

/* Dashed box marking where real content goes. Delete the placeholder
   markup in the slide's `content` and this styling disappears with it. */
.placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--pcb-line-strong);
  color: var(--pcb-text-dim);
  font-family: var(--pcb-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
}

.slide__image {
  display: flex;
  min-height: 260px;
  margin: 0;
  flex-direction: column;
  align-self: start;
  border: 1px solid var(--pcb-line);
  background: var(--pcb-bg);
}

.slide__image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Image placeholder: fine CAD grid plus a single diagonal. */
.slide__image-placeholder {
  display: flex;
  min-height: 260px;
  align-items: flex-end;
  padding: 16px;
  background-color: var(--pcb-bg);
  background-image:
    linear-gradient(135deg, transparent 49.8%, var(--pcb-line-strong) 49.8%, var(--pcb-line-strong) 50.2%, transparent 50.2%),
    linear-gradient(rgba(199, 204, 209, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 204, 209, 0.06) 1px, transparent 1px);
  background-size: auto, 20px 20px, 20px 20px;
  color: var(--pcb-text-dim);
  font-family: var(--pcb-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.slide__image-placeholder span {
  padding: 6px 8px;
  background: var(--pcb-bg);
}

.slide__image figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--pcb-line);
  color: var(--pcb-text-dim);
  font-family: var(--pcb-mono);
  font-size: 12px;
}

.slide__image figcaption:empty {
  display: none;
}

/* ---------- Navigation ---------- */

.el-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--pcb-line);
}

.el-nav__counter {
  color: var(--pcb-silver);
  font-family: var(--pcb-mono);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.el-nav .button {
  min-width: 130px;
}

/* ---------- Quiz ---------- */

.el-question {
  margin: 0 0 20px;
  padding: 20px 22px;
  border: 1px solid var(--pcb-line);
  background: var(--pcb-bg);
}

.el-question legend {
  padding: 0 8px;
  color: var(--pcb-text-dim);
  font-family: var(--pcb-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.el-question__text {
  margin: 0 0 14px;
  color: var(--pcb-silver-hi);
  font-size: 17px;
  font-weight: 500;
}

.el-option {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--pcb-line-strong);
  background: var(--pcb-surface);
  color: var(--pcb-text);
  cursor: pointer;
  font-size: 15px;
  transition: border-color var(--pcb-ease), background-color var(--pcb-ease), color var(--pcb-ease);
}

.el-option:last-of-type {
  margin-bottom: 0;
}

.el-option:hover {
  border-color: var(--pcb-gold);
  background: var(--pcb-surface-2);
}

.el-option input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--pcb-gold);
}

.el-option:has(input:checked) {
  border-color: var(--pcb-gold);
  background: rgba(212, 175, 55, 0.07);
  color: var(--pcb-silver-hi);
}

.el-option:has(input:focus-visible) {
  outline: 2px solid var(--pcb-gold);
  outline-offset: 3px;
}

.el-question__feedback {
  margin: 12px 0 0;
  color: var(--pcb-silver);
  font-family: var(--pcb-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* After grading: line style + text label carry the meaning, not colour alone. */
.el-question.is-correct {
  border-color: var(--pcb-silver);
  background: var(--pcb-surface-2);
}

.el-question.is-wrong {
  border-style: dashed;
  border-color: var(--pcb-line-strong);
}

.el-question.is-locked .el-option {
  cursor: default;
}

.el-result {
  margin-top: 28px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--pcb-line-strong);
  background: var(--pcb-bg);
}

.el-result__score {
  margin: 0 0 4px;
  color: var(--pcb-silver-hi);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.el-result__status {
  margin: 0;
  color: var(--pcb-silver);
  font-size: 17px;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .el-view .page-intro {
    padding-block: 64px 24px;
  }

  .el-module {
    margin-top: 24px;
  }

  .slide {
    min-height: 0;
  }

  .slide--with-image {
    grid-template-columns: minmax(0, 1fr);
  }

  .placeholder,
  .slide__image,
  .slide__image-placeholder {
    min-height: 180px;
  }

  .el-nav .button {
    min-width: 0;
    padding-inline: 14px;
  }
}

@media (max-width: 420px) {
  /* Buttons stay side by side; the counter in the header still shows progress. */
  .el-nav__counter {
    display: none;
  }

  .el-nav .button {
    flex: 1;
    justify-content: center;
  }
}
