/* ══════════════════════════════════════════════════════════════
   course.css — Styles for course unit pages only.
   Loaded conditionally when courseUnit: true (see base.njk).
   Builds on main.css — never duplicates global rules.
   ══════════════════════════════════════════════════════════════ */


/* ── Page header ───────────────────────────────────────────── */

.course-page-header {
  padding-bottom: 1.5rem;
}

.course-back-link {
  display: inline-block;
  color: #aaaaaa;
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}

.course-back-link:hover {
  color: #ff8c00;
}


/* ── Sidebar ────────────────────────────────────────────────── */

.course-sidebar {
  top: 1.25rem;   /* offset from viewport top when sticky */
}

.course-nav-card,
.course-tools-card {
  background-color: #ffffff;
  border-color: #dddddd;
}

.course-nav-card .card-header,
.course-tools-card .card-header {
  background-color: #000000;
  color: #ff8c00;
  border-color: #000000;
  font-size: 0.875rem;
  padding: 0.6rem 0.875rem;
}

.course-unit-nav .list-group-item,
.course-tools-card .list-group-item {
  background-color: #ffffff;
  color: #000000;
  border-color: #eeeeee;
  font-size: 0.8rem;
  padding: 0.45rem 0.875rem;
  transition: background 0.15s, color 0.15s;
}

/* Override Bootstrap/main.css link pink for sidebar nav items */
.course-unit-nav .list-group-item:not(.active),
.course-tools-card .list-group-item {
  color: #000000 !important;
}

.course-unit-nav .list-group-item:hover,
.course-tools-card .list-group-item:hover {
  background-color: #fff5e6;
  color: #cc6f00 !important;
}

.course-unit-nav .list-group-item.active {
  background-color: #ff8c00;
  border-color: #ff8c00;
  color: #000000;
  font-weight: 600;
}

.course-nav-num {
  display: inline-block;
  width: 1.5rem;
  color: inherit;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.course-unit-nav .list-group-item.active .course-nav-num {
  opacity: 1;
}

.course-tool-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}


/* ── Section headings (inside .course-section) ──────────────── */

.course-section h2 {
  color: #ff8c00;
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: 1px solid #4a4a4a;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.course-section h2 .bi {
  margin-right: 0.4rem;
}


/* ── Learning objectives ────────────────────────────────────── */

.course-objectives {
  background-color: #000000;
  border-left: 4px solid #ff8c00;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.25rem 1.5rem;
}

.objectives-list {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  color: #e0e0e0;
}

.objectives-list li,
.objectives-list li a {
  color: #e0e0e0;
  margin-bottom: 0.375rem;
  line-height: 1.5;
}

/* Reset inherited link pink inside dark course cards */
.course-activity a:not(.btn),
.course-review a:not(.btn),
.course-objectives a:not(.btn) {
  color: #ffb3c1;  /* keep link pink where intentional */
}

/* code elements inside dark course cards */
.course-activity code,
.course-review code,
.course-objectives code {
  color: #e0e0e0;
  background-color: #444444;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  font-size: 0.875em;
}


/* ── Activity sections ──────────────────────────────────────── */

.course-activity {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.activity-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  background-color: #ff8c00;
  color: #000000;
  font-weight: 700;
  border-radius: 50%;
  font-size: 0.875rem;
}

.activity-title-text {
  color: #ff8c00;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  border: none;
  padding: 0;
}

/* Prevent the global .container h2 rule overriding activity titles */
.activity-header .activity-title-text {
  color: #ff8c00;
}


/* ── Review section ─────────────────────────────────────────── */

.course-review {
  background-color: #1e1e1e;
  border: 1px solid #ff8c00;
  border-radius: 0.5rem;
  padding: 1.5rem;
}


/* ── Shared button style ────────────────────────────────────── */

.course-btn {
  background-color: #ff8c00;
  border: none;
  color: #000000;
  font-weight: 500;
}

.course-btn:hover,
.course-btn:focus {
  background-color: #e67e00;
  color: #000000;
}


/* ── Audio player ───────────────────────────────────────────── */

.course-audio-wrap {
  background-color: #333333;
  border-radius: 0.5rem;
  padding: 1rem;
}

.course-audio-wrap audio {
  width: 100%;
  margin-bottom: 0.5rem;
}

.course-audio-caption {
  font-size: 0.825rem;
  color: #aaaaaa;
  margin: 0;
}


/* ── Video embed (responsive 16:9) ──────────────────────────── */

.course-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #000000;
}

.course-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.course-video-caption {
  font-size: 0.825rem;
  color: #aaaaaa;
  margin-top: 0.4rem;
}


/* ── Multiple-choice quiz ───────────────────────────────────── */

.course-quiz {
  background-color: #333333;
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.quiz-question {
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #e0e0e0;
  transition: background 0.15s;
  margin: 0;
}

.quiz-option:hover {
  background-color: #444444;
}

.quiz-option input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: #ff8c00;
}

.quiz-option-correct {
  background-color: rgba(25, 135, 84, 0.25) !important;
  color: #75b798 !important;
}

.quiz-option-incorrect {
  background-color: rgba(220, 53, 69, 0.25) !important;
  color: #ea868f !important;
}

.quiz-feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.quiz-correct {
  color: #75b798;
  background: rgba(25, 135, 84, 0.15);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}

.quiz-incorrect {
  color: #ea868f;
  background: rgba(220, 53, 69, 0.15);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}

.quiz-correct .bi,
.quiz-incorrect .bi {
  margin-right: 0.3rem;
}


/* ── Tabbed content ─────────────────────────────────────────── */

.course-tabs .nav-link {
  color: #aaaaaa;
  border-color: #555555;
  background: transparent;
  font-size: 0.9rem;
}

.course-tabs .nav-link.active {
  color: #ff8c00;
  background-color: #2a2a2a;
  border-color: #555555 #555555 #2a2a2a;
}

.course-tabs .nav-link:hover:not(.active) {
  color: #f0f0f0;
  border-color: #666666;
}

.course-tab-content {
  background-color: #2a2a2a;
  border: 1px solid #555555;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 1.25rem;
  color: #e0e0e0;
}


/* ── Bold text colour ───────────────────────────────────────── */

/* On dark backgrounds, bold text uses pale yellow instead of white */
.course-activity strong, .course-activity b,
.course-review   strong, .course-review   b,
.course-objectives strong, .course-objectives b,
.course-tab-content strong, .course-tab-content b,
.course-quiz strong, .course-quiz b {
  color: #fffacd;  /* lemon chiffon — pale yellow, readable on dark bg */
}


/* ── Tool section (iCALL Suite) ─────────────────────────────── */

.course-tool-section {
  background-color: #2a2a2a;
  border: 2px solid #ff8c00;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.course-tool-section .activity-header {
  border-bottom: 1px solid #ff8c00;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.course-tool-section strong,
.course-tool-section b {
  color: #fffacd;
}

/* Tool UI elements */
.tool-input {
  width: 100%;
  background-color: #1a1a1a;
  color: #f0f0f0;
  border: 1px solid #555;
  border-radius: 0.375rem;
  padding: 0.6rem 0.875rem;
  font-size: 0.95rem;
  resize: vertical;
}

.tool-input:focus {
  outline: none;
  border-color: #ff8c00;
  box-shadow: 0 0 0 0.2rem rgba(255, 140, 0, 0.25);
}

.tool-output {
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-radius: 0.375rem;
  padding: 0.875rem;
  color: #f0f0f0;
  min-height: 3rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tool-output .highlight {
  color: #ff8c00;
  font-weight: 600;
}

.tool-output .changed {
  background-color: rgba(255, 140, 0, 0.15);
  border-radius: 3px;
  padding: 0 2px;
}

.tool-btn {
  background-color: #ff8c00;
  border: none;
  color: #000000;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.tool-btn:hover {
  background-color: #e67e00;
}

.tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tool-label {
  font-size: 0.8rem;
  color: #aaaaaa;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* answer-box (tool7 — Short Answers) */
.answer-box {
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-radius: 0.375rem;
  padding: 0.875rem;
  min-height: 3rem;
  font-size: 0.95rem;
  color: #f0f0f0;
}

.answer-box.positive { color: #75b798; }
.answer-box.negative { color: #ea868f; }

/* Tense parser (tool8) — custom elements */
token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0.25rem 0.2rem;
  vertical-align: bottom;
}

tense {
  font-size: 0.65rem;
  color: #ff8c00;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-height: 1.1em;
  display: block;
  text-align: center;
}

word {
  display: block;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}

word.verb {
  background-color: rgba(255, 140, 0, 0.2);
  border: 1px solid #ff8c00;
  color: #ff8c00;
  font-weight: 600;
}

/* Reported speech (tool10) — step display */
.step-item {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid #3a3a3a;
  font-size: 0.875rem;
}

.step-item:last-child { border-bottom: none; }

.step-label {
  color: #aaaaaa;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 14rem;
}

.step-value { color: #f0f0f0; }

/* Adjective order (tool1) — category colours */
span.quantity { color: #e67e22; }
span.opinion  { color: #9b59b6; }
span.size     { color: #27ae60; }
span.age      { color: #f39c12; }
span.shape    { color: #16a085; }
span.color    { color: #c0392b; }
span.origin   { color: #2980b9; }
span.material { color: #7f8c8d; }
span.purpose  { color: #d35400; }

.adj-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

.adj-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.adj-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Participle clauses (tool3) */
.w3-red  { color: #e74c3c; font-weight: 600; }
.w3-blue { color: #3498db; font-weight: 600; }

/* Polite requests (tool5) */
.red-text { color: #ff8c00; font-weight: 600; }


/* ── Mobile adjustments ─────────────────────────────────────── */

@media (max-width: 991.98px) {
  .course-sidebar {
    position: static !important;  /* disable sticky on mobile */
  }
}
