/* -------------------------------------------------------- */
/* 🔹 Course Page                                           */
/* -------------------------------------------------------- */
/* One page per course: hero, areas by group, answerable     */
/* sample questions and links to the other courses           */


/* -------------------------------------------------------- */
/* 🔹 Hero                                                  */
/* -------------------------------------------------------- */
/* Text beside a phone on desktop, phone below on mobile     */

.course-hero {
  padding-block: var(--space-xxxl) var(--website-section-spacing);
}

.course-hero__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xxxl) 48px;
}

.course-hero__content {
  flex: 1 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lxl);
}

.course-hero__title {
  font-size: var(--text-display-small);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

/* Shared label above the course name, the same on every course page */
.course-hero__eyebrow {
  display: block;
  font-size: 0.6em;
  font-weight: 700;
  color: var(--color-text-secondary);
}

/* Kept on one line so "Fysik 2" never splits from its digit or icon */
.course-hero__course {
  display: block;
  white-space: nowrap;
}

/* Course glyph — mirrors CourseIcon. Sized in em so it follows the line */
.course-hero__icon {
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.25em;
  vertical-align: -0.1em;
}

.course-hero__subtitle {
  max-width: 560px;
  font-size: var(--text-body-large);
  line-height: 1.6;
  color: var(--color-text-secondary);
  text-wrap: pretty;
}

.course-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  list-style: none;
}

.course-hero__fact {
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--radius-pill);
  background-color: var(--color-card-fill);
  font-size: var(--text-body-medium);
}

.course-hero__fact strong {
  color: var(--color-primary);
}

.course-hero__actions {
  margin-top: var(--space-xs);
}

/* Bezel composite from optimize-images.js — the frame is in the image */
.course-hero__phone {
  flex: 0 0 auto;
  width: 220px;
}

@media (min-width: 768px) {
  .course-hero {
    padding-top: var(--website-section-spacing);
  }

  .course-hero__phone {
    width: 270px;
  }
}

@media (min-width: 1000px) {
  .course-hero__title {
    font-size: 48px;
  }

  .course-hero__subtitle {
    font-size: var(--text-title-large);
  }
}


/* -------------------------------------------------------- */
/* 🔹 Areas                                                 */
/* -------------------------------------------------------- */

.course-groups {
  padding-block: var(--landing-section-spacing);
  background-color: var(--color-card-fill);
}

.course-groups__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-lxl);
  margin-top: var(--space-xxxl);
  align-items: start;
  list-style: none;
}

/* Six groups (Kemi 1) as two rows of three rather than four and two */
@media (min-width: 1000px) {
  .course-groups__grid:has(> :nth-child(5)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.course-group {
  padding: var(--space-xl);
  border-radius: var(--radius);
  background-color: var(--color-scaffold-bg);
}

.course-group__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-m);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--color-outline);
}

.course-group__title {
  font-size: var(--text-headline-medium);
  font-weight: 700;
  color: var(--color-primary);
}

.course-group__count {
  margin-left: auto;
  font-size: var(--text-body-medium);
  font-weight: 400;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.course-group__areas {
  list-style: none;
}

.course-group__area {
  display: flex;
  justify-content: space-between;
  gap: var(--space-m);
  padding-top: var(--space-m);
  font-size: var(--text-body-medium);
}

.course-group__area-count {
  color: var(--color-text-secondary);
}


/* -------------------------------------------------------- */
/* 🔹 Sample Questions                                      */
/* -------------------------------------------------------- */
/* Card and options come from sample_questions_section.css.  */
/* The verdicts repeat its --correct and --wrong modifiers,  */
/* applied by :has() once a radio is checked. No press fade  */
/* on the options — the color change is the response         */

/* Two cards a row — four or six questions never leave one alone */
.course-quiz-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
}

.course-quiz {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-quiz__option {
  position: relative;
  cursor: pointer;
}

/* Hidden but focusable — the label carries the focus ring */
.course-quiz__input {
  position: absolute;
  opacity: 0;
}

.course-quiz__option:has(:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.course-quiz__mark {
  display: none;
}

/* One answer per try — a wrong one can be cleared with the reset button */
.course-quiz:has(:checked) .course-quiz__option {
  pointer-events: none;
}

.course-quiz:has(:checked) .course-quiz__option--correct {
  border-color: var(--color-answer-correct-border);
  background-color: var(--color-answer-correct-fill);
  font-weight: var(--text-title-weight);
  color: var(--color-answer-correct);
}

.course-quiz__option:not(.course-quiz__option--correct):has(:checked) {
  border-color: var(--color-answer-incorrect-border);
  background-color: var(--color-answer-incorrect-fill);
  font-weight: var(--text-title-weight);
  color: var(--color-answer-incorrect);
}

.course-quiz:has(:checked) .course-quiz__option--correct .course-quiz__mark--right,
.course-quiz__option:not(.course-quiz__option--correct):has(:checked) .course-quiz__mark--wrong {
  display: block;
}

/* Status line — fixed height, so the card does not jump on answering */
.course-quiz__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-m);
  min-height: 44px;
  margin-top: var(--space-m);
  font-size: var(--text-body-medium);
  color: var(--color-text-secondary);
}

/* Dark, not green — green is the reset button's link color */
.course-quiz__right {
  display: none;
  font-weight: var(--text-title-weight);
  color: var(--color-on-surface);
}

.course-quiz__reset {
  display: none;
  min-height: 44px;
  padding-inline: var(--space-s);
  font-weight: var(--text-title-weight);
  color: var(--color-primary);
  cursor: pointer;
}

.course-quiz__reset:hover {
  text-decoration: underline;
}

.course-quiz:has(:checked) .course-quiz__hint {
  display: none;
}

.course-quiz:has(.course-quiz__option--correct :checked) .course-quiz__right,
.course-quiz:has(.course-quiz__option:not(.course-quiz__option--correct) :checked) .course-quiz__reset {
  display: inline;
}


/* -------------------------------------------------------- */
/* 🔹 Other Courses                                         */
/* -------------------------------------------------------- */

.course-others {
  padding-block: var(--landing-section-spacing);
  background-color: var(--color-card-fill);
}

.course-others__title {
  font-size: var(--text-headline-large);
  font-weight: 800;
  color: var(--color-on-surface);
}

.course-others__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: var(--space-l);
  margin-top: var(--space-xl);
  list-style: none;
}

.course-others__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  height: 100%;
  padding: var(--space-lxl);
  border-radius: var(--radius);
  background-color: var(--color-scaffold-bg);
  transition: opacity var(--animation-fast) var(--animation-curve);
}

.course-others__card:hover {
  opacity: var(--opacity-pressed);
  text-decoration: none;
}

.course-others__icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.course-others__name {
  font-size: var(--text-title-large);
  font-weight: 700;
  color: var(--color-primary);
}

.course-others__count {
  font-size: var(--text-body-medium);
  color: var(--color-text-secondary);
}
