.program-page .program-main {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background:
    url("../images/Web-Sochifo-18.png") center 255px / 100% auto no-repeat,
    linear-gradient(to bottom, var(--white) 0, var(--white) 780px, #e4e5e7 1270px, #e4e5e7 100%);
}

.program-section {
  position: relative;
  z-index: 1;
  padding: 10px 0 238px;
}

.program-intro {
  padding-inline: 20px;
  margin: 0 auto 45px;
  text-align: center;
}

.program-intro__title {
  display: flex;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 24px;
  color: #7ec3d2;
  font-family: var(--condensed-font);
  font-size: clamp(31px, 2.65vw, 38px);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-transform: uppercase;
}

.program-intro__dot {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--navy);
}

.program-intro p {
  margin: 10px 0 0;
  color: #252525;
  font-size: 15px;
}

.program-books {
  display: grid;
  gap: 112px;
}

.program-book {
  min-width: 0;
}

.program-book__header {
  padding-inline: 20px;
  margin: 0 auto 23px;
  text-align: center;
}

.program-book__header p {
  margin: 0 0 3px;
  color: var(--navy);
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.program-book__header h2 {
  margin: 0;
  color: #171313;
  font-family: var(--condensed-font);
  font-size: clamp(28px, 2.45vw, 35px);
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
  text-transform: uppercase;
}

.program-book__header h2 span {
  color: #7ec3d2;
}

.book-reader {
  width: min(calc(100% - 48px), 1340px);
  margin-inline: auto;
  outline: none;
  touch-action: pan-y;
}

.book-reader__stage {
  position: relative;
  width: 100%;
  padding-inline: 55px;
}

.book-reader__book {
  position: relative;
  display: grid;
  width: min(100%, 1230px);
  max-width: 1230px;
  aspect-ratio: 1224 / 792;
  margin-inline: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #f8f8f5;
  box-shadow: 0 13px 34px rgba(24, 40, 84, 0.18), 0 2px 9px rgba(24, 40, 84, 0.14);
  perspective: 2400px;
  transform-style: preserve-3d;
}

.book-reader:focus-visible .book-reader__book {
  box-shadow: 0 0 0 4px rgba(36, 56, 132, 0.4), 0 13px 34px rgba(24, 40, 84, 0.18);
}

.book-page {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: #ffffff;
}

.book-page--left {
  box-shadow: inset -20px 0 27px -25px rgba(18, 32, 70, 0.6);
}

.book-page--right {
  box-shadow: inset 20px 0 27px -25px rgba(18, 32, 70, 0.6);
}

.book-page.is-blank {
  background:
    linear-gradient(100deg, rgba(225, 225, 220, 0.8), rgba(255, 255, 255, 0.22) 9%, rgba(255, 255, 255, 0.78)),
    #f8f7f2;
}

.book-page img,
.book-turn img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.book-reader__gutter {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 34px;
  background: linear-gradient(90deg, rgba(10, 29, 70, 0.11), rgba(255, 255, 255, 0.44) 48%, rgba(10, 29, 70, 0.1));
  pointer-events: none;
  transform: translateX(-50%);
}

.book-arrow {
  position: absolute;
  z-index: 12;
  top: 50%;
  display: inline-grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(36, 56, 132, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(28, 45, 91, 0.13);
  color: var(--navy);
  cursor: pointer;
  font-size: 33px;
  line-height: 1;
  transform: translateY(-50%);
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.book-arrow--previous {
  left: 0;
}

.book-arrow--next {
  right: 0;
}

.book-arrow:hover:not(:disabled),
.book-arrow:focus-visible:not(:disabled) {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-50%) scale(1.06);
}

.book-arrow:focus-visible,
.book-action:focus-visible {
  outline: 3px solid #57c4eb;
  outline-offset: 3px;
}

.book-arrow:disabled {
  cursor: default;
  opacity: 0.28;
}

.book-reader__toolbar {
  display: flex;
  width: min(calc(100% - 110px), 1230px);
  min-height: 56px;
  margin: 17px auto 0;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.book-reader__counter {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.book-reader__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.book-action {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(36, 56, 132, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  cursor: pointer;
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.book-action:hover,
.book-action:focus-visible {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

.book-action i {
  font-size: 14px;
}

.book-reader__help,
.book-reader__fallback {
  width: min(calc(100% - 110px), 1230px);
  margin: 2px auto 0;
  color: #585b64;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.book-reader__fallback a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.book-turn {
  position: absolute;
  z-index: 10;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: #f8f7f2;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

.book-turn::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 37, 84, 0.02), rgba(17, 37, 84, 0.23));
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.book-turn--next {
  right: 0;
  transform-origin: left center;
}

.book-turn--previous {
  left: 0;
  transform-origin: right center;
}

.book-turn--previous::after {
  background: linear-gradient(270deg, rgba(17, 37, 84, 0.02), rgba(17, 37, 84, 0.23));
}

.book-turn.is-turning::after {
  opacity: 1;
}

.book-turn--next.is-turning {
  animation: book-turn-next 620ms cubic-bezier(0.55, 0.08, 0.35, 0.98) forwards;
}

.book-turn--previous.is-turning {
  animation: book-turn-previous 620ms cubic-bezier(0.55, 0.08, 0.35, 0.98) forwards;
}

@keyframes book-turn-next {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-180deg); }
}

@keyframes book-turn-previous {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(180deg); }
}

.book-reader:fullscreen,
.book-reader.is-expanded {
  display: grid;
  padding: 18px 28px 14px;
  align-content: center;
  overflow: auto;
  background: #17265e;
}

.book-reader.is-expanded {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: 100%;
  height: 100%;
}

.book-reader:fullscreen .book-reader__book,
.book-reader.is-expanded .book-reader__book {
  width: min(calc(100vw - 170px), calc((100vh - 160px) * 1.54545));
  max-width: none;
}

.book-reader:fullscreen .book-reader__toolbar,
.book-reader:fullscreen .book-reader__help,
.book-reader.is-expanded .book-reader__toolbar,
.book-reader.is-expanded .book-reader__help {
  width: min(calc(100vw - 170px), calc((100vh - 160px) * 1.54545));
  max-width: none;
  color: var(--white);
}

.book-reader:fullscreen .book-reader__counter,
.book-reader.is-expanded .book-reader__counter {
  color: var(--white);
}

body.book-reader-expanded {
  overflow: hidden;
}

.program-page .site-footer {
  z-index: 3;
}

@media (min-width: 901px) {
  .program-page .site-footer {
    min-height: 218px;
    margin-top: -96px;
  }

  .program-page .site-footer__content {
    min-height: 218px;
  }
}

@media (max-width: 900px) {
  .program-page .hero {
    height: 300px;
    min-height: 300px;
  }

  .program-page .program-main {
    background-position: center 300px, center;
    background-size: auto 1000px, auto;
  }

  .program-section {
    padding-top: 10px;
    padding-bottom: 215px;
  }

  .program-books {
    gap: 95px;
  }

  .book-reader {
    width: min(calc(100% - 32px), 770px);
  }

  .book-reader__stage {
    padding-inline: 65px;
  }

  .book-reader__book {
    width: min(100%, 612px);
    max-width: 612px;
    aspect-ratio: 612 / 792;
    grid-template-columns: minmax(0, 1fr);
  }

  .book-page--right,
  .book-reader__gutter {
    display: none;
  }

  .book-reader__toolbar,
  .book-reader__help {
    width: min(calc(100% - 130px), 612px);
  }

  .book-turn {
    right: auto;
    left: 0;
    width: 100%;
  }

  .book-turn--next {
    transform-origin: left center;
  }

  .book-turn--previous {
    transform-origin: right center;
  }

  .book-reader:fullscreen .book-reader__book,
  .book-reader.is-expanded .book-reader__book {
    width: min(calc(100vw - 130px), calc((100vh - 178px) * 0.77273));
  }

  .book-reader:fullscreen .book-reader__toolbar,
  .book-reader:fullscreen .book-reader__help,
  .book-reader.is-expanded .book-reader__toolbar,
  .book-reader.is-expanded .book-reader__help {
    width: min(calc(100vw - 130px), calc((100vh - 178px) * 0.77273));
  }
}

@media (max-width: 620px) {
  .program-intro {
    margin-bottom: 42px;
  }

  .program-intro__title {
    gap: 15px;
    font-size: clamp(28px, 8.4vw, 34px);
  }

  .program-intro__dot {
    width: 20px;
    height: 20px;
  }

  .program-intro p {
    max-width: 310px;
    margin: 11px auto 0;
    font-size: 13px;
  }

  .program-book__header {
    margin-bottom: 18px;
  }

  .program-book__header p {
    font-size: 11px;
  }

  .program-book__header h2 {
    font-size: clamp(27px, 8.5vw, 33px);
    overflow-wrap: anywhere;
  }

  .program-book__header h2 span {
    display: block;
  }

  .book-reader {
    width: calc(100% - 20px);
  }

  .book-reader__stage {
    padding-inline: 0;
  }

  .book-reader__book {
    width: 100%;
  }

  .book-arrow {
    width: 44px;
    height: 44px;
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(36, 56, 132, 0.88);
    color: var(--white);
    font-size: 30px;
  }

  .book-arrow--previous {
    left: 8px;
  }

  .book-arrow--next {
    right: 8px;
  }

  .book-arrow:disabled {
    background: rgba(36, 56, 132, 0.5);
    opacity: 0.46;
  }

  .book-reader__toolbar {
    width: 100%;
    margin-top: 15px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .book-reader__counter {
    text-align: center;
  }

  .book-reader__actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .book-action {
    min-width: 0;
    padding-inline: 8px;
    gap: 6px;
    font-size: 11px;
  }

  .book-reader__help {
    width: 100%;
    margin-top: 8px;
    padding-inline: 12px;
    font-size: 11px;
  }

  .book-reader:fullscreen,
  .book-reader.is-expanded {
    padding: 12px 10px;
  }

  .book-reader:fullscreen .book-reader__book,
  .book-reader.is-expanded .book-reader__book {
    width: min(calc(100vw - 20px), calc((100vh - 184px) * 0.77273));
  }

  .book-reader:fullscreen .book-reader__toolbar,
  .book-reader:fullscreen .book-reader__help,
  .book-reader.is-expanded .book-reader__toolbar,
  .book-reader.is-expanded .book-reader__help {
    width: min(calc(100vw - 20px), calc((100vh - 184px) * 0.77273));
  }
}

@media (max-width: 560px) {
  .program-page .hero {
    height: 300px;
    min-height: 300px;
  }

  .program-section {
    padding-top: 10px;
    padding-bottom: 190px;
  }

  .program-books {
    gap: 82px;
  }
}

@media (max-width: 380px) {
  .program-intro__title {
    gap: 11px;
    font-size: 27px;
  }

  .program-intro__dot {
    width: 17px;
    height: 17px;
  }

  .book-action {
    min-height: 40px;
    font-size: 10px;
  }

  .book-action i {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-turn--next.is-turning,
  .book-turn--previous.is-turning {
    animation-duration: 1ms;
  }
}
