/* Lingomu: lessons that teach a language, a few words at a time. */
.hidden { display: none !important; }

/* Icon: SVG files from assets/js/icons.js are used as masks so they follow the text colour */

/* Buttons */

/* The page is the header, the sidebar, and the main, directly in the body. The padding and the gap are the ones of the body: the three elements have none. */

.logo-mark { background-image: url("favicon.png"); }   /* the logo of the app: its favicon (the rest is in assets/css/style.css) */

/* The sidebar holds the status line and the copyright at its end */

/* The bar that fills while something is done: the goal of the day, the lesson */
.progress { flex: 1; height: calc(var(--unit) * 3); }
.progress-fill { transition: width 0.3s; }
.section-title { color: var(--fg-1); font-size: var(--font-size-extra-small); font-weight: 700; text-transform: uppercase; }

/* The lessons on one side, the main on the other */
#course-select { flex: none; width: 100%; }
.unit { display: flex; flex-direction: column; gap: var(--gap-extra-small); padding-block-end: var(--padding-small); }
.unit-title { display: flex; align-items: center; height: var(--height); padding: 0 var(--padding-medium); color: var(--fg-1); font-size: var(--font-size-extra-small); font-weight: 700; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item { text-transform: none; }
.sidebar-item-number { flex: none; display: flex; align-items: center; justify-content: center; width: calc(var(--unit) * 8); height: calc(var(--unit) * 8); border: var(--border-width) solid var(--border); border-radius: var(--border-radius-small); color: var(--fg-1); font-size: var(--font-size-extra-small); }
.sidebar-item.on .sidebar-item-number { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sidebar-item.done .sidebar-item-number { border-color: var(--ok); color: var(--ok); }
.sidebar-item.done.on .sidebar-item-number { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sidebar-item-title { flex: 1; min-width: 0; font-size: var(--font-size-small); text-align: start; }

.stats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-medium); }
.stat { display: flex; align-items: center; gap: var(--gap-small); min-width: 0; }
.stat > .icon { color: var(--brand); }
.stat-value { font-size: var(--font-size-large); font-weight: 700; }
.stat-label { color: var(--fg-1); font-size: var(--font-size-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-text { color: var(--fg-1); font-size: var(--font-size-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-summary .progress { flex: none; }

/* The main: the part that has a border around it. It shows a lesson (what is in it, and a button to start), the lesson itself, or the end of it. */
.main { padding: var(--padding-medium); }
.overview-view { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap-medium); }
.overview-heading { display: flex; align-items: center; gap: var(--gap-medium); }
.overview-number { flex: none; display: flex; align-items: center; justify-content: center; width: calc(var(--unit) * 14); height: calc(var(--unit) * 14); background: var(--brand); color: var(--brand-ink); border-radius: var(--border-radius-medium); font-size: var(--font-size-large); font-weight: 700; }
.overview-titles { min-width: 0; display: flex; flex-direction: column; gap: var(--gap-extra-small); }
.overview-title { font-size: var(--font-size-extra-large); font-weight: 700; overflow-wrap: anywhere; }
.overview-unit { color: var(--fg-1); font-size: var(--font-size-small); }
.overview-words { display: flex; flex-direction: column; gap: var(--gap-small); }
.word-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--gap-small) var(--gap-medium); padding: var(--padding-medium); border: var(--border-width) solid var(--border); border-radius: var(--border-radius-medium); background: var(--bg-1); }
.word-text { font-size: var(--font-size-large); font-weight: 700; overflow-wrap: anywhere; }
.word-roman { color: var(--fg-1); font-size: var(--font-size-medium); }
.word-meaning { flex: 1 1 calc(var(--unit) * 40); color: var(--fg-1); font-size: var(--font-size-medium); text-align: end; }
.overview-state { color: var(--fg-1); font-size: var(--font-size-small); }
.overview-view > button { flex: none; }

/* A lesson: the bar on top, the exercise, what was answered, and the button */
.lesson-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--gap-medium); }
.lesson-bar { display: flex; align-items: center; gap: var(--gap-small); height: var(--height); }
.lesson-bar > button { height: 100%; }
.hearts { display: flex; align-items: center; gap: var(--gap-extra-small); color: var(--danger); font-weight: 700; }
.hearts-count { min-width: calc(var(--unit) * 6); }

.exercise { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap-large); padding: var(--padding-medium); }
.exercise-prompt { color: var(--fg-1); font-size: var(--font-size-large); font-weight: 700; }
.exercise-word { display: flex; align-items: center; gap: var(--gap-small); font-size: var(--font-size-extra-large); font-weight: 700; }
.exercise-word > span { min-width: 0; overflow-wrap: anywhere; }
.exercise-roman, .exercise-hint { color: var(--fg-1); font-size: var(--font-size-medium); }
.exercise-hint { font-size: var(--font-size-small); }
.choice-roman { display: block; color: inherit; opacity: 0.7; font-size: var(--font-size-small); }
.choice.right { background: var(--ok); color: var(--on-color); border-color: var(--ok); }
.choice.wrong { background: var(--danger); color: var(--on-color); border-color: var(--danger); }
.choice.matched { opacity: 0.4; }
.type-input { height: var(--height); font-size: var(--font-size-medium); }
.match-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-medium); }
.match-column { display: flex; flex-direction: column; gap: var(--gap-small); }

.feedback { display: flex; flex-direction: column; gap: var(--gap-extra-small); padding: var(--padding-medium); border: var(--border-width) solid var(--border); border-radius: var(--border-radius-medium); }
.feedback.right { border-color: var(--ok); color: var(--ok); }
.feedback.wrong { border-color: var(--danger); color: var(--danger); }
.feedback-title { font-weight: 700; }
.feedback-answer { color: var(--fg); }
.lesson-actions { display: flex; }
.lesson-actions > button { flex: 1; }

/* The end of a lesson */
.result-view { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.result-card { width: 100%; max-width: calc(var(--unit) * 140); display: flex; flex-direction: column; align-items: stretch; gap: var(--gap-large); padding: var(--padding-extra-large); border: var(--border-width) solid var(--border); border-radius: var(--border-radius-large); background: var(--bg-1); }
.result-title { font-size: var(--font-size-extra-large); font-weight: 700; text-align: center; }
.result-lines { display: flex; flex-direction: column; align-items: center; gap: var(--gap-small); font-size: var(--font-size-medium); }
.result-line { display: flex; align-items: center; gap: var(--gap-small); }
.result-line > .icon { color: var(--brand); }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--gap-small); }
.result-actions > button { flex: 1 1 calc(var(--unit) * 60); }

/* Messages */
dialog { color: var(--fg); background: var(--bg); border: var(--border-width) solid var(--border); padding: 0; }
dialog::backdrop { background: color-mix(in srgb, var(--black) 70%, transparent); }

/* From a tablet up, the lessons stay beside the main */
@media (min-width: 48rem) {
  body { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .header { grid-column: 1; grid-row: 1; }
  .sidebar { display: flex; position: static; grid-column: 1; grid-row: 2; }
  .footer { grid-column: 1; grid-row: 3; flex-direction: column; align-items: flex-start; }
  #status { white-space: normal; overflow-wrap: anywhere; }
  .main { grid-column: 2; grid-row: 1 / -1; }
  .menu-button { display: none; }
}

/* Controls that keep their size have a set width: a multiple of the height (RULES.md, Control Width) */
