/* Course-wide navigation, image framing and language control refinements. */
.language-toggle-label {
  color: #d8edf7;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.module {
  position: relative;
}

.module > img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.course-part {
  margin: 3.5rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: #f8fcfe;
}

.course-part-head,
.part-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.course-part-head h2 { margin: .35rem 0 0; }
.course-part-head p, .part-review p { margin: .35rem 0 0; color: var(--muted); }

.part-status {
  flex: 0 0 auto;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: #dff2e7;
  color: #185b36;
  font-size: .78rem;
  font-weight: 800;
}

.course-part .module-grid { margin: 1.5rem 0; }

.part-review {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.course-part-planned { background: #f4f7f9; }
.course-part-planned .part-status { background: #e6edf1; color: #536a7a; }

.module-upcoming {
  display: block;
  min-height: 100%;
  cursor: default;
  opacity: .76;
}

.module-placeholder {
  display: grid;
  height: 180px;
  place-items: center;
  background: linear-gradient(135deg, #173b59, #6a879a);
  color: #fff;
  font-size: 3rem;
  font-weight: 900;
}

.module.locked {
  cursor: not-allowed;
  opacity: .68;
  filter: saturate(.55);
}

.module.locked:hover {
  transform: none;
  box-shadow: none;
}

.module.locked::after {
  content: "🔒 " attr(data-lock-message);
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(7, 28, 50, .9);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

/* Fill every image frame within a lesson while preserving proportions. */
#app .lesson-head > .hero-image,
#app .practice-visual img,
#app .word-order-visual img,
#app .location-intro img,
#app .location-diagrams img,
#app .location-key img,
#app .verb-tense-intro img,
#app .procedure-intro img,
#app .sentence-intro img,
#app .endings-intro img,
#app .ending-visual img,
#app .prefix-intro img,
#app .review-image {
  display: block;
  width: 100%;
  max-height: none;
  object-fit: cover;
}

#app .lesson-head > .hero-image {
  min-height: 330px;
}

#app .practice-visual,
#app .word-order-visual figure,
#app .location-intro figure,
#app .location-diagrams figure,
#app .location-key figure,
#app .verb-tense-intro figure,
#app .procedure-intro figure,
#app .sentence-intro figure,
#app .endings-intro figure,
#app .prefix-intro figure {
  height: auto;
}

#app .practice-visual img,
#app .word-order-visual img,
#app .location-intro img,
#app .location-diagrams img,
#app .location-key img,
#app .verb-tense-intro img,
#app .procedure-intro img,
#app .sentence-intro img,
#app .endings-intro img,
#app .ending-visual img,
#app .prefix-intro img {
  height: 320px;
}

#app .review-image {
  height: 320px;
}

@media (max-width: 760px) {
  .language-toggle-label {
    font-size: 12px;
  }

  .module > img {
    height: 210px;
  }

  .course-part-head,
  .part-review { align-items: flex-start; flex-direction: column; }

  .module-placeholder { height: 210px; }

  #app .lesson-head > .hero-image,
  #app .review-image {
    height: 250px;
    min-height: 0;
  }

  #app .practice-visual img,
  #app .word-order-visual img,
  #app .location-intro img,
  #app .location-diagrams img,
  #app .location-key img,
  #app .verb-tense-intro img,
  #app .procedure-intro img,
  #app .sentence-intro img,
  #app .endings-intro img,
  #app .ending-visual img,
  #app .prefix-intro img {
    height: 250px;
  }
}

/* A consistent, touch-friendly select control for every lesson activity. */
#app select {
  appearance: none;
  min-height: 46px;
  padding: 11px 44px 11px 14px;
  border: 1px solid #8cbdd2;
  border-radius: 12px;
  background-color: #fff;
  background-image: linear-gradient(45deg, transparent 50%, #0b5278 50%), linear-gradient(135deg, #0b5278 50%, transparent 50%), linear-gradient(90deg, #d6eaf3, #d6eaf3);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px, calc(100% - 40px) 50%;
  background-size: 6px 6px, 6px 6px, 1px 26px;
  background-repeat: no-repeat;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(20, 78, 108, .08);
  font: 700 14px/1.25 Quicksand, inherit;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}

#app select:hover { border-color: #28759b; box-shadow: 0 4px 0 rgba(20, 78, 108, .11); }
#app select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(246, 166, 52, .22), 0 4px 0 rgba(20, 78, 108, .11); }
#app select.is-correct { border-color: #37965d; background-color: #f1fbf4; }
#app select.is-incorrect { border-color: #ce5160; background-color: #fff8f8; }

/* The language preference applies consistently without navigating away. */
body.spanish-off #app .bilingual,
body.spanish-off #app [lang="es"],
body.spanish-off #app .course-introduction-es,
body.spanish-off #app .spanish-information,
body.spanish-off #app .glossary-spanish {
  display: none !important;
}
