/* ==========================================================================
   РЕКЛАМНЫЙ БЛОК КНИГИ - главная страница
   Отдельный stylesheet подключается только на главной.
   ========================================================================== */

.page.page--home-sponsored {
  max-width: 1480px;
}

.home-sponsored-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.home-sponsored-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.book-ad {
  position: sticky;
  top: 102px;
  min-width: 0;
}

.book-ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(111, 78, 87, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 8%, rgba(138, 103, 112, 0.16), transparent 34%),
    linear-gradient(155deg, rgba(255, 252, 248, 0.98), rgba(247, 238, 231, 0.97));
  box-shadow:
    0 22px 52px rgba(71, 47, 27, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition:
    transform 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease;
  isolation: isolate;
}

.book-ad-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 28%,
    rgba(255, 255, 255, 0.38) 48%,
    transparent 68%
  );
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 0;
}

.book-ad-card:hover {
  transform: translateY(-3px);
  border-color: rgba(111, 78, 87, 0.46);
  box-shadow:
    0 30px 68px rgba(71, 47, 27, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.book-ad-card:hover::after {
  opacity: 1;
  animation: book-ad-shine 0.72s ease forwards;
}

.book-ad-card:focus-visible {
  outline: 3px solid rgba(168, 109, 71, 0.32);
  outline-offset: 4px;
}

.book-ad-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fffaf5;
  background: rgba(46, 36, 28, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.book-ad-visual {
  position: relative;
  min-height: 296px;
  display: grid;
  place-items: center;
  padding: 38px 26px 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(145deg, #e9d8cb 0%, #d7b9aa 42%, #90707a 100%);
}

.book-ad-visual::before,
.book-ad-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.book-ad-visual::before {
  width: 240px;
  height: 240px;
  right: -116px;
  top: -100px;
  box-shadow:
    0 0 0 30px rgba(255, 255, 255, 0.055),
    0 0 0 62px rgba(255, 255, 255, 0.035);
}

.book-ad-visual::after {
  width: 150px;
  height: 150px;
  left: -78px;
  bottom: -64px;
  box-shadow: 0 0 0 26px rgba(82, 54, 62, 0.055);
}

.book-ad-book {
  position: relative;
  z-index: 2;
  width: 178px;
  min-height: 232px;
  display: flex;
  flex-direction: column;
  padding: 22px 19px 18px 24px;
  border-radius: 7px 14px 14px 7px;
  color: #fff9f4;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 9px, transparent 9px),
    linear-gradient(155deg, #3d2e36, #604651 56%, #825f68);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    -9px 12px 0 rgba(67, 44, 49, 0.14),
    0 24px 42px rgba(53, 36, 42, 0.35);
  transform: rotate(-2deg);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.book-ad-card:hover .book-ad-book {
  transform: rotate(-1deg) translateY(-3px);
}

.book-ad-book::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.book-ad-book-kicker {
  margin-bottom: 24px;
  color: rgba(255, 249, 244, 0.72);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.book-ad-book-title {
  display: block;
  font-size: 25px;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.book-ad-book-subtitle {
  display: block;
  margin-top: 10px;
  color: rgba(255, 249, 244, 0.78);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.book-ad-book-author {
  margin-top: auto;
  padding-top: 24px;
  color: rgba(255, 249, 244, 0.9);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.book-ad-content {
  display: flex;
  flex-direction: column;
  padding: 21px 21px 22px;
}

.book-ad-overline {
  margin-bottom: 7px;
  color: #77555e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.25px;
  text-transform: uppercase;
}

.book-ad-title {
  display: block;
  margin: 0;
  font-size: 18px;
  line-height: 1.22;
  letter-spacing: -0.028em;
}

.book-ad-author {
  display: block;
  margin-top: 8px;
  color: #5d493d;
  font-size: 12px;
  font-weight: 800;
}

.book-ad-description {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.book-ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.book-ad-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(119, 85, 94, 0.18);
  border-radius: 999px;
  color: #684d55;
  background: rgba(119, 85, 94, 0.065);
  font-size: 10px;
  font-weight: 800;
}

.book-ad-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #fffaf5;
  background: linear-gradient(135deg, #6d4d58, #4a343d);
  box-shadow: 0 12px 24px rgba(74, 52, 61, 0.18);
  font-size: 13px;
  font-weight: 800;
}

.book-ad-cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.book-ad-card:hover .book-ad-cta svg {
  transform: translate(2px, -2px);
}

.book-ad-disclosure {
  display: block;
  margin: 10px 4px 0;
  color: #4f3a31;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.book-ad-note {
  display: block;
  margin: 4px 4px 0;
  color: rgba(113, 91, 74, 0.82);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

@keyframes book-ad-shine {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@media (max-width: 1240px) {
  .page.page--home-sponsored {
    max-width: 1280px;
  }

  .home-sponsored-layout {
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 22px;
  }

  .book-ad-visual {
    min-height: 270px;
  }

  .book-ad-book {
    width: 164px;
    min-height: 216px;
  }
}

@media (max-width: 1060px) {
  .page.page--home-sponsored {
    max-width: 1180px;
  }

  .home-sponsored-layout {
    grid-template-columns: 1fr;
  }

  .book-ad {
    position: static;
    order: -1;
  }

  .book-ad-card {
    display: grid;
    grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  }

  .book-ad-visual {
    min-height: 310px;
  }

  .book-ad-content {
    justify-content: center;
    padding: 28px;
  }

  .book-ad-note {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .book-ad {
    order: 0;
  }

  .book-ad-card {
    display: flex;
  }

  .book-ad-visual {
    min-height: 258px;
    padding: 36px 20px 24px;
  }

  .book-ad-book {
    width: 156px;
    min-height: 204px;
  }

  .book-ad-content {
    padding: 19px;
  }

  .book-ad-title {
    font-size: 17px;
  }

  .book-ad-description {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-ad-card,
  .book-ad-book,
  .book-ad-cta svg {
    transition: none !important;
  }

  .book-ad-card:hover::after {
    animation: none !important;
  }
}

/* ==========================================================================
   ФИНАЛЬНАЯ КОМПОНОВКА ДЛЯ ШИРОКОГО DESKTOP
   Основной контент по центру + рекламный rail справа
   ========================================================================== */

/* Заголовок на нарисованной обложке */
.book-ad-book-title {
  font-size: 20px;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

/* Чуть больше полезной ширины самой обложке */
.book-ad-book {
  width: 184px;
}


/* --------------------------------------------------------------------------
   Верхняя навигация
   На широком экране меню находится строго по центру окна.
   Логотип остаётся слева, промо ГИРУС-МГ - справа.
   -------------------------------------------------------------------------- */

@media (min-width: 1450px) {
  .top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 20px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .top-nav {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  .top-announce {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: auto;
  }
}


/* --------------------------------------------------------------------------
   Главная страница
   На очень широком desktop основная колонка визуально центрируется,
   а реклама прижимается к правому краю.
   -------------------------------------------------------------------------- */

@media (min-width: 1680px) {
  .page.page--home-sponsored {
    width: 100%;
    max-width: 1760px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .home-sponsored-layout {
    grid-template-columns: minmax(0, 1040px) 300px;
    column-gap: 32px;
    justify-content: end;
    align-items: start;
  }

  .home-sponsored-main {
    width: 100%;
    min-width: 0;
  }

  .book-ad {
    width: 300px;
    justify-self: end;
  }
}