/* MODULE COVER V1 */

.module-cover-field {
  display: grid;
  gap: 9px;
}

.module-cover-preview {
  position: relative;
  width: 100%;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line, rgba(255,255,255,.12));
  border-radius: 15px;
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--panel) 92%, #000),
      color-mix(in srgb, var(--panel) 82%, var(--accent) 8%)
    );
}

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

.module-cover-empty {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.module-cover-empty > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid
    color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 13px;
  background:
    color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
  font-size: 23px;
}

.module-cover-empty strong {
  color: var(--text);
  font-size: 14px;
}

.module-cover-empty small {
  font-size: 12px;
}

.module-cover-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.module-cover-file-button {
  cursor: pointer;
}

.module-cover-remove[hidden] {
  display: none !important;
}

.module-cover-help {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.module-cover-status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 650;
}

.module-cover-status[data-kind="loading"] {
  color: var(--muted);
}

.module-cover-status[data-kind="success"] {
  color: var(--accent);
}

.module-cover-status[data-kind="error"] {
  color: #ef6b6b;
}

@media (max-width: 640px) {
  .module-cover-preview,
  .module-cover-empty {
    min-height: 155px;
  }

  .module-cover-preview img {
    height: 180px;
  }

  .module-cover-actions {
    align-items: stretch;
  }

  .module-cover-actions .btn,
  .module-cover-actions label.btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}


.module-cover-file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.module-cover-file-button input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Module card text stability */
body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card {
  min-width: 0;
}

body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card > * {
  min-width: 0;
  max-width: 100%;
}

body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card strong {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  line-height: 1.18;
}

body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card small,
body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card .module-card-status {
  width: 100%;
  overflow-wrap: anywhere;
}

/* Module cards: normal word wrapping */
body[data-role="student"][data-active="home"]
.home-course-card-modules {
  grid-template-columns: repeat(auto-fill, minmax(190px, 200px));
}

body[data-role="student"][data-active="home"]
.home-course-card-modules .lesson-card strong {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-size: 16px;
  line-height: 1.2;
}
