/* Lesson catalog + teaching player (laptop-first) */

.lessons-page {
  padding-bottom: var(--space-xl);
}

.lessons-page .content {
  max-width: 900px;
}

.lessons-intro {
  margin-bottom: var(--space-lg);
  max-width: 70ch;
}

.catalog-pack-title {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  font-size: 1.25rem;
}

.catalog-pack-note {
  margin: 0 0 var(--space-md);
  max-width: 70ch;
  color: var(--color-muted, #555);
}

.course-catalog {
  list-style: none;
  margin: var(--space-lg) 0 0;
  padding: 0;
}

.course-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  color: var(--color-text);
}

@media (min-width: 640px) {
  .course-item {
    grid-template-columns: minmax(180px, 280px) 1fr;
    align-items: center;
    gap: var(--space-md);
  }
}

.course-item:hover .course-item__title {
  color: var(--color-primary);
}

.course-item:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.course-item--soon {
  opacity: 0.65;
  cursor: default;
}

.course-item__cover {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--color-tint, #eee);
}

.course-item__body {
  min-width: 0;
}

.course-item__title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.course-item__meta {
  font-size: 14px;
  margin: 0 0 0.35rem;
}

.course-item__summary {
  font-size: 1rem;
  margin: 0;
  max-width: 70ch;
}

.course-hero-cover {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin: 0 0 var(--space-md);
  background: var(--color-tint, #eee);
}

.course-back {
  margin: 0 0 var(--space-sm);
}

.course-back a {
  text-decoration: none;
}

.course-back a:hover {
  text-decoration: underline;
}

.catalog {
  list-style: none;
  margin: 0;
  padding: 0;
}

.catalog-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid #e5e5e5;
  color: var(--color-text);
  align-items: start;
  min-height: 44px;
}

.catalog-item__main {
  display: contents;
  text-decoration: none;
  color: inherit;
}

.catalog-item__main:focus-visible .catalog-item__title {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.catalog-item:hover .catalog-item__title {
  color: var(--color-primary);
}

.catalog-item__thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  background: var(--color-tint);
  grid-row: 1 / span 2;
}

.catalog-item__title {
  font-size: 18px;
  font-weight: 900;
  margin: 0 0 0.25rem;
}

.catalog-item__skills {
  font-size: 14px;
  margin: 0;
  color: var(--color-text);
}

.catalog-item__meta {
  font-size: 14px;
  margin: 0.25rem 0 0;
}

.catalog-item__notes {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 900;
  color: var(--color-primary);
}

@media (min-width: 640px) {
  .catalog-item {
    grid-template-columns: 180px 1fr;
    gap: var(--space-md);
    padding: var(--space-md) 0;
  }

  .catalog-item__thumb {
    width: 180px;
    height: 101px;
  }

  .catalog-item__title {
    font-size: 22px;
  }
}

/* ========== Teaching layout ========== */

html.teach-html,
body.teach-body {
  height: 100%;
  overflow: hidden;
}

.teach-body {
  background: var(--color-bg);
}

.teach-app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  height: 100dvh;
}

.teach-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  justify-content: space-between;
  padding: 0.65rem var(--space-sm);
  background: var(--color-bg-alt);
  border-bottom: 2px solid var(--color-accent);
}

.teach-topbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.teach-topbar__brand {
  font-size: 14px;
  font-weight: 400;
}

.teach-topbar__title {
  font-size: 16px;
  font-weight: 900;
  margin: 0;
}

.teach-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.teach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid var(--color-text);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

.teach-btn:hover {
  opacity: 0.7;
}

.teach-btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.teach-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.teach-main {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

@media (min-width: 900px) {
  .teach-main {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

.teach-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  min-height: 0;
  background: #000;
}

.teach-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: var(--space-sm);
  background: #111;
}

.teach-slide[hidden],
.teach-slide--player[hidden] {
  display: none !important;
}

.teach-slide--player {
  padding: 0;
  background: #142533;
}

.teach-slide--player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #142533;
}

.teach-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.teach-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.65rem var(--space-sm);
  background: var(--color-bg);
  border-top: 1px solid #e5e5e5;
}

.teach-controls__nav {
  display: flex;
  gap: var(--space-xs);
}

.teach-controls__status {
  font-size: 14px;
  font-weight: 900;
}

.teach-notes {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-bg);
  border-top: 1px solid #e5e5e5;
}

@media (min-width: 900px) {
  .teach-notes {
    border-top: none;
    border-left: 2px solid var(--color-accent);
  }
}

.teach-notes__header {
  padding: var(--space-sm);
  background: var(--color-panel-soft);
  border-bottom: 1px solid #e5e5e5;
}

.teach-notes__header h2 {
  font-size: 16px;
  margin: 0 0 0.25rem;
}

.teach-notes__hint {
  font-size: 14px;
  margin: 0;
}

.teach-notes__scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
  min-height: 180px;
}

.note-block {
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-left: 4px solid transparent;
  background: var(--color-bg-alt);
  cursor: pointer;
}

.note-block.is-current {
  border-left-color: var(--color-accent);
  background: var(--color-panel-warm);
}

.note-block__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.note-block__title {
  margin: 0;
}

.note-block__timing {
  white-space: nowrap;
  color: var(--color-text);
}

.note-block__body {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.note-block__body p {
  margin: 0 0 0.75rem;
}

.note-block__body p:last-child {
  margin-bottom: 0;
}

.teach-laptop-note {
  display: none;
  padding: var(--space-sm);
  background: var(--color-tint);
  font-size: 14px;
}

@media (max-width: 899px) {
  .teach-laptop-note {
    display: block;
  }

  .teach-app {
    height: auto;
    overflow: auto;
  }

  html.teach-html,
  body.teach-body {
    height: auto;
    overflow: auto;
  }

  .teach-stage {
    min-height: 50vh;
  }
}

/* ========== Slides-only share window ========== */

body.slides-only {
  background: #111;
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.slides-only-app {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
}

.slides-only-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 1rem;
}

.slides-only-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.slides-only-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.65rem 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}

.slides-only-bar__status {
  font-size: 14px;
  font-weight: 900;
}
