/* Лекция 9: Основы JavaScript — стили по референсу МТИ */

:root {
  --header-bg: #2C2C2C;
  --content-bg: #FFFFFF;
  --text-dark: #222222;
  --text-white: #FFFFFF;
  --yellow: #FFE100;
  --yellow-dark: #FFD900;
  --border-light: #E0E0E0;
  --font-sans: 'Open Sans', 'Segoe UI', Arial, Helvetica, sans-serif;
  --header-height: 72px;
  --slide-width: 1280px;
  --slide-height: 720px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: #1a1a1a;
  color: var(--text-dark);
  overflow: hidden;
  height: 100%;
}

.lecture {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: calc(100vh * 16 / 9);
  margin: 0 auto;
  background: var(--content-bg);
  overflow: hidden;
}

.slide {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  background: var(--content-bg);
}

.slide.active {
  display: flex;
}

.slide--title {
  background: var(--header-bg);
  color: var(--text-white);
  padding: 48px 56px 0;
  justify-content: flex-start;
}

.slide--title .title-institute {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: uppercase;
}

.slide--title .title-institute .line1 {
  font-size: 1em;
  display: block;
}

.slide--title .title-institute .line2 {
  font-size: 0.85em;
  display: block;
}

.slide--title .title-institute .line3 {
  font-size: 0.7em;
  display: block;
}

.slide--title .title-topic {
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-top: 24px;
  color: var(--text-white);
}

.slide--title .yellow-pattern {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent 0%, transparent 20%, var(--yellow) 20%, var(--yellow) 100%);
  clip-path: polygon(0% 60%, 5% 40%, 15% 70%, 25% 30%, 35% 65%, 45% 25%, 55% 75%, 65% 35%, 75% 70%, 85% 45%, 95% 65%, 100% 50%, 100% 100%, 0% 100%);
  pointer-events: none;
}

.slide-header {
  flex-shrink: 0;
  height: var(--header-height);
  background: var(--header-bg);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.slide-header .logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slide-header .logo-mti {
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
}

.slide-header .logo-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.5);
}

.slide-header .logo-name {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.slide-header .nav-discipline {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-white);
  text-transform: none;
}

.slide-body {
  flex: 1;
  overflow: auto;
  padding: 32px 56px 48px;
  background: var(--content-bg);
}

.slide-body h1 {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 20px 0;
  line-height: 1.25;
}

.slide-body .slide-text {
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.5;
  color: var(--text-dark);
  margin: 0 0 20px 0;
}

.slide-body .slide-text ul {
  margin: 0;
  padding-left: 1.25em;
}

.slide-body .slide-text li {
  margin-bottom: 0.35em;
}

.slide-body.slide-body--compact h1 {
  font-size: clamp(26px, 2.8vw, 32px);
}

.slide-body.slide-body--compact .slide-text {
  font-size: clamp(20px, 1.8vw, 24px);
}

.slide-layout {
  display: grid;
  gap: 24px;
  align-items: start;
  min-height: 200px;
}

.slide-layout--image-right {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}

.slide-layout--image-left {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}

.slide-layout--image-right .slide-content {
  order: 1;
}

.slide-layout--image-right .placeholder-wrap {
  order: 2;
}

.slide-layout--image-left .placeholder-wrap {
  order: 1;
}

.slide-layout--image-left .slide-content {
  order: 2;
}

.slide-layout--image-bottom {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
}

/* Картинка под текстом — всегда по центру (см. PROMPT_LECTION.md) */
.slide-layout--image-bottom .placeholder-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.slide-layout--image-bottom .placeholder-wrap .slide-img {
  margin: 0 auto;
}

.slide-content {
  min-width: 0;
}

.yellow-deco-block {
  position: relative;
  width: 100%;
  min-height: 180px;
  margin-top: 8px;
}

.yellow-deco-block__shape {
  position: absolute;
  background: var(--yellow);
  opacity: 0.95;
}

.yellow-deco-block__shape--1 {
  width: 28%;
  height: 28px;
  transform: skewX(-12deg);
  left: 0;
  top: 20px;
}

.yellow-deco-block__shape--2 {
  width: 24%;
  height: 24px;
  transform: skewX(10deg);
  left: 22%;
  top: 50px;
}

.yellow-deco-block__shape--3 {
  width: 22%;
  height: 22px;
  transform: skewX(-8deg);
  left: 42%;
  top: 15px;
}

.yellow-deco-block__shape--4 {
  width: 20%;
  height: 20px;
  transform: skewX(6deg);
  left: 60%;
  top: 55px;
}

.yellow-deco-block__shape--5 {
  width: 26%;
  height: 26px;
  transform: skewX(-10deg);
  left: 76%;
  top: 25px;
}

.placeholder-wrap {
  min-height: 180px;
}

.placeholder {
  width: 100%;
  min-height: 180px;
  background: #F5F5F5;
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
}

.placeholder-wrap .slide-img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(38vmin, 85vh);
  object-fit: contain;
  border-radius: 8px;
  display: block;
  cursor: pointer;
}

.slide-body--compact .placeholder-wrap .slide-img {
  max-height: min(50vmin, 85vh);
}

.placeholder-wrap.placeholder-wrap--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.placeholder-wrap.placeholder-wrap--centered .slide-img {
  margin: 0 auto;
}

.placeholder-wrap--img-large .slide-img {
  max-height: min(55vmin, 85vh);
}

.lecture-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.lecture-modal.lecture-modal--open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.lecture-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.lecture-modal__content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.lecture-modal__img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.lecture-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--header-bg);
  color: var(--text-white);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lecture-modal__close:hover {
  background: #444;
}

.placeholder-caption {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
}

.slide-counter {
  position: absolute;
  bottom: 16px;
  right: 24px;
  font-size: 0.8rem;
  color: #999;
}

@media (max-width: 900px) {

  .slide-layout--image-right,
  .slide-layout--image-left {
    grid-template-columns: 1fr;
  }

  .slide-layout--image-right .slide-content,
  .slide-layout--image-right .placeholder-wrap,
  .slide-layout--image-left .placeholder-wrap,
  .slide-layout--image-left .slide-content {
    order: unset;
  }

  .slide-header .logo-name {
    font-size: 0.7rem;
  }

  .slide-body {
    padding: 24px 32px 40px;
  }
}