:root {
  --blue:#3477F6;
  --blue-dark:#174EA6;
  --red:#F04A55;
  --ink:#172033;
  --muted:#667085;
  --line:#DDE7F7;
  --bg:#F5F8FF;
  --soft:#EAF2FF;
  --cream:#FFF5E8;
  --shadow:0 24px 70px rgba(24,63,130,.14);
  --radius:28px
}
* {
  box-sizing:border-box
}
html {
  scroll-behavior:smooth
}
body {
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:var(--ink);
  background:radial-gradient(circle at 10% -5%,rgba(52,119,246,.18),transparent 34%),radial-gradient(circle at 90% 0%,rgba(240,74,85,.12),transparent 28%),linear-gradient(180deg,#fff 0%,var(--bg) 46%,#fff 100%)
}
a {
  color:inherit;
  text-decoration:none
}
.container {
  width:min(1180px,calc(100% - 44px));
  margin:0 auto
}
.header {
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line)
}
.nav {
  min-height:82px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px
}
.logo {
  display:flex;
  align-items:center;
  gap:14px;
  font-weight:950;
  letter-spacing:-.04em
}
.logo-img {
  width:54px;
  height:54px;
  object-fit:contain
}
.logo-mark {
  width:48px;
  height:48px;
  border-radius:17px;
  background:linear-gradient(135deg,var(--blue),#83B4FF);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:24px;
  box-shadow:0 14px 30px rgba(52,119,246,.26)
}
.logo small {
  display:block;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  letter-spacing:.03em;
  margin-top:3px
}
.menu {
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap
}
.menu a {
  padding:10px 14px;
  border-radius:999px;
  font-size:14px;
  font-weight:850;
  color:#38465E
}
.menu a:hover,.menu a.active {
  background:var(--soft);
  color:var(--blue-dark)
}
.mobile-menu {
  display:none
}
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border:0;
  background:var(--blue);
  color:#fff;
  font-weight:950;
  border-radius:999px;
  padding:14px 20px;
  box-shadow:0 16px 30px rgba(52,119,246,.25);
  cursor:pointer
}
.btn.secondary {
  background:#fff;
  color:var(--blue-dark);
  border:1px solid var(--line);
  box-shadow:none
}
.btn.small {
  padding:10px 14px;
  font-size:14px
}
.hero {
  padding:74px 0 48px
}
.hero-grid {
  display:grid;
  grid-template-columns:1.06fr .94fr;
  gap:42px;
  align-items:center
}
.kicker {
  display:inline-flex;
  gap:8px;
  align-items:center;
  background:#fff;
  border:1px solid var(--line);
  border-radius:999px;
  padding:9px 13px;
  color:var(--blue-dark);
  font-weight:950;
  font-size:14px
}
h1 {
  font-size:clamp(34px,4.5vw,58px);
  line-height:.95;
  letter-spacing:-.07em;
  margin:20px 0
}
h2 {
  font-size:clamp(30px,3.2vw,48px);
  line-height:1.02;
  letter-spacing:-.055em;
  margin:0 0 14px
}
h3 {
  font-size:22px;
  margin:0 0 10px;
  letter-spacing:-.03em
}
p {
  line-height:1.68
}
.lead {
  font-size:17px;
  color:#45546D;
  max-width:760px;
  margin:0 0 28px
}
.actions {
  display:flex;
  gap:12px;
  flex-wrap:wrap
}
.hero-card {
  background:linear-gradient(145deg,#fff,#EEF5FF);
  border:1px solid var(--line);
  border-radius:38px;
  padding:24px;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden
}
.cover-art {
  position:relative;
  z-index:2;
  border-radius:30px;
  min-height:385px;
  background:linear-gradient(145deg,rgba(52,119,246,.93),rgba(131,180,255,.88)),repeating-linear-gradient(45deg,transparent 0 14px,rgba(255,255,255,.18) 14px 16px);
  padding:30px;
  color:#fff;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden
}
.cover-art:before {
  content:"";
  position:absolute;
  inset:24px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:24px
}
.cover-art b {
  font-size:34px;
  line-height:1;
  letter-spacing:-.06em;
  position:relative
}
.cover-art span {
  position:relative;
  align-self:flex-start;
  background:rgba(255,255,255,.2);
  border:1px solid rgba(255,255,255,.32);
  border-radius:999px;
  padding:8px 12px;
  font-weight:900
}
.player {
  background:#F7FAFF;
  border:1px solid var(--line);
  border-radius:22px;
  padding:14px;
  margin-top:16px
}
audio {
  width:100%
}
.stats {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:32px
}
.stat {
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:18px;
  box-shadow:0 12px 34px rgba(33,61,113,.08)
}
.stat b {
  display:block;
  font-size:32px;
  color:var(--blue-dark);
  letter-spacing:-.04em
}
.stat span {
  color:var(--muted);
  font-weight:800;
  font-size:13px
}
.section {
  padding:58px 0
}
.section-head {
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:end;
  margin-bottom:24px
}
.section-head p {
  margin:0;
  color:var(--muted);
  max-width:650px
}
.cards {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px
}
.info-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 16px 45px rgba(30,65,130,.09)
}
.icon {
  width:54px;
  height:54px;
  border-radius:19px;
  background:var(--soft);
  display:grid;
  place-items:center;
  font-size:25px;
  margin-bottom:16px
}
.project-text {
  background:#fff;
  border:1px solid var(--line);
  border-radius:34px;
  padding:30px;
  box-shadow:var(--shadow);
  font-size:16px
}
.project-text p {
  margin:0 0 18px
}
.project-text p:last-child {
  margin-bottom:0
}
.strip {
  background:linear-gradient(135deg,var(--blue-dark),var(--blue));
  color:#fff;
  border-radius:34px;
  padding:34px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:20px;
  align-items:center;
  box-shadow:var(--shadow)
}
.strip p {
  color:#DCE8FF;
  margin:0
}
.catalog-hero {
  padding:50px 0 26px
}
.search-panel {
  display:grid;
  grid-template-columns:1fr 220px 180px 150px;
  gap:12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:26px;
  padding:14px;
  box-shadow:var(--shadow);
  margin-top:24px
}
input,select,textarea {
  width:100%;
  border:1px solid var(--line);
  border-radius:17px;
  padding:14px 15px;
  font:inherit;
  background:#FAFCFF;
  color:var(--ink);
  outline:none
}
input:focus,select:focus,textarea:focus {
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(52,119,246,.12)
}
.catalog-layout {
  display:grid;
  grid-template-columns:260px 1fr;
  gap:22px;
  align-items:start
}
.sidebar {
  background:#fff;
  border:1px solid var(--line);
  border-radius:28px;
  padding:20px;
  position:sticky;
  top:100px;
  box-shadow:0 14px 35px rgba(30,65,130,.08)
}
.filter {
  display:flex;
  justify-content:space-between;
  padding:13px 0;
  border-bottom:1px solid #EEF2FA;
  font-weight:850;
  color:#43506A
}
.filter:last-child {
  border-bottom:0
}
.books {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px
}
.book {
  background:#fff;
  border:1px solid var(--line);
  border-radius:30px;
  overflow:hidden;
  display:grid;
  grid-template-columns:155px 1fr;
  box-shadow:0 18px 48px rgba(30,65,130,.10)
}
.book-cover {
  min-height:260px;
  color:#fff;
  padding:18px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background-size:cover;
  background-position:center
}
.book-cover.blue {
  background:linear-gradient(145deg,#2F6DF6,#7AAEFF)
}
.book-cover.dark {
  background:linear-gradient(145deg,#151B2E,#43527A)
}
.book-cover.red {
  background:linear-gradient(145deg,#E84A5F,#FFB199)
}
.book-cover.green {
  background:linear-gradient(145deg,#16875A,#75D09A)
}
.book-cover.gold {
  background:linear-gradient(145deg,#A86B17,#F8C86A)
}
.book-cover.no-cover {
  background:linear-gradient(145deg,#F0F6FF,#fff);
  color:var(--blue-dark);
  border-right:1px dashed var(--line)
}
.book-cover strong {
  font-size:24px;
  line-height:1.02;
  letter-spacing:-.04em
}
.badge {
  align-self:flex-start;
  background:#fff;
  color:var(--blue-dark);
  padding:6px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:950
}
.book-body {
  padding:19px
}
.meta {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:10px 0 12px
}
.pill {
  background:#F0F6FF;
  border:1px solid #DCE9FF;
  color:#294A8A;
  border-radius:999px;
  padding:6px 9px;
  font-size:12px;
  font-weight:900
}
.empty {
  padding:40px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:28px;
  text-align:center;
  color:var(--muted)
}
.author-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px
}
.author-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:30px;
  padding:24px;
  box-shadow:0 16px 45px rgba(30,65,130,.09)
}
.avatar {
  width:78px;
  height:78px;
  border-radius:25px;
  background:linear-gradient(135deg,#EAF2FF,#fff);
  border:1px solid var(--line);
  display:grid;
  place-items:center;
  font-size:34px;
  margin-bottom:18px;
  background-size:cover;
  background-position:center
}
.avatar.photo {
  font-size:0
}
.author-books {
  margin-top:14px;
  display:flex;
  gap:8px;
  flex-wrap:wrap
}
.contacts-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px
}
.contact-card {
  background:#fff;
  border:1px solid var(--line);
  border-radius:28px;
  padding:24px;
  box-shadow:0 16px 45px rgba(30,65,130,.09)
}
.contact-card b {
  display:block;
  margin-bottom:8px
}
.socials {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px
}
.socials a {
  background:var(--soft);
  border:1px solid var(--line);
  color:var(--blue-dark);
  border-radius:999px;
  padding:9px 12px;
  font-weight:900
}
.footer {
  margin-top:60px;
  background:#102B61;
  color:#DCE8FF;
  padding:42px 0
}
.footer-grid {
  display:grid;
  grid-template-columns:1.2fr .8fr .8fr;
  gap:28px
}
.footer p {
  color:#B8C9EA;
  margin:10px 0 0
}
.footer a {
  display:block;
  color:#DCE8FF;
  margin:8px 0
}
.map {
  height:150px;
  border-radius:22px;
  background:linear-gradient(135deg,#DCE8FF,#fff);
  display:grid;
  place-items:center;
  color:#153D86;
  font-weight:950
}
.metrics-informer {
  margin-top:14px;
  opacity:.85
}
@media (max-width:960px) {
.hero-grid,.catalog-layout {
  grid-template-columns:1fr
}
.cards,.books,.stats,.author-grid,.footer-grid,.contacts-grid {
  grid-template-columns:1fr
}
.book {
  grid-template-columns:1fr
}
.search-panel {
  grid-template-columns:1fr
}
.sidebar {
  position:static
}
.strip {
  grid-template-columns:1fr
}
.menu {
  display:none
}
.mobile-menu {
  display:inline-flex
}

}
.ym-advanced-informer {
  display:block!important;
  max-width:80px!important
}

/* ===== FIX v4: карточка с полноценной книжной обложкой без голубых краев ===== */

/* Карточка: левая колонка стала шире и пропорциональнее книжной обложке */
.book  {
   grid-template-columns: 220px 1fr !important;
   min-height: 310px !important;

}

/* Левая колонка теперь работает как постер */
.book-cover  {
   min-height: 310px !important;
   padding: 0 !important;
   border-right: 1px solid var(--line);
   position: relative;
   overflow: hidden;

/* ключевое: заполняем всю область, но область теперь правильной формы */
 background-size: cover !important;
   background-repeat: no-repeat !important;
   background-position: center center !important;
   background-color: #eef3fb !important;

}

/* Цветовые классы не должны ломать фон-обложку */
.book-cover.blue, .book-cover.dark, .book-cover.red, .book-cover.green, .book-cover.gold  {
   background-size: cover !important;
   background-repeat: no-repeat !important;
   background-position: center center !important;
   background-color: #eef3fb !important;

}

/* Для карточек с реальной обложкой убираем все надписи поверх изображения */
.book-cover[style] strong, .book-cover[style] > span  {
   display: none !important;

}

/* Небольшое затемнение для более дорогого вида обложки */
.book-cover[style]::after  {
   content: "";
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg, rgba(5,18,45,.05), rgba(5,18,45,.14));
   pointer-events: none;

}

/* Если обложки нет — оставляем красивую заглушку */
.book-cover.no-cover  {
   padding: 22px !important;
   background: linear-gradient(145deg,#dfe9fb,#f7fbff) !important;
   color: var(--blue-dark) !important;
   display: flex !important;
   flex-direction: column !important;
   justify-content: space-between !important;

}
.book-cover.no-cover strong, .book-cover.no-cover > span, .book-cover.no-cover .badge  {
   display: block !important;

}

/* Текстовая часть */
.book-body  {
   padding: 26px !important;
   display: flex;
   flex-direction: column;

}
.book-body h3  {
   font-size: 24px !important;
   line-height: 1.15 !important;

}
.book-body p  {
   font-size: 16px !important;
   line-height: 1.65 !important;

}
.book-body .player  {
   margin-top: auto !important;

}

/* На главной, где нет сайдбара, две карточки в ряд выглядят лучше чуть компактнее */
.section .books .book  {
   grid-template-columns: 200px 1fr !important;

}

/* На странице каталога с сайдбаром карточки компактнее, чтобы не ломалась сетка */
.catalog-layout .books .book  {
   grid-template-columns: 190px 1fr !important;

}

/* Мобильная версия */
@media (max-width:960px)  {
.book, .section .books .book, .catalog-layout .books .book  {
   grid-template-columns: 1fr !important;

}
.book-cover  {
   min-height: 520px !important;
   border-right: 0;
   border-bottom: 1px solid var(--line);
   background-size: cover !important;

}
.book-cover.no-cover  {
   min-height: 240px !important;

}

}

/* Узкие телефоны */
@media (max-width:520px)  {
.book-cover  {
   min-height: 430px !important;

}

}

/* ===== FINAL FIX: главное лого и каталог в одну колонку ===== */
.hero-card .cover-art.hero-logo-card {
   background:#fff !important;
   min-height:385px !important;
   padding:24px !important;
   display:flex !important;
   align-items:center !important;
   justify-content:center !important;
   border:1px solid var(--line);
   border-radius:30px;

}
.hero-card .cover-art.hero-logo-card:before {
  display:none !important;

}
.hero-card .cover-art.hero-logo-card img {
   display:block;
   width:100%;
   height:auto;
   max-height:340px;
   object-fit:contain;

}

/* В каталоге карточки идут по одной в строку, чтобы плеер был широким */
.catalog-layout .books {
   grid-template-columns:1fr !important;

}
.catalog-layout .books .book {
   grid-template-columns:260px 1fr !important;
   min-height:330px !important;

}
.catalog-layout .books .book-cover {
   min-height:330px !important;

}
.catalog-layout .books .book-body {
   padding:32px !important;

}
.catalog-layout .books .book-body .player {
   margin-top:auto !important;
   padding:18px !important;

}
.catalog-layout .books audio {
   width:100% !important;

}
@media (max-width:960px) {
.catalog-layout .books .book {
  grid-template-columns:1fr !important;

}
.hero-card .cover-art.hero-logo-card {
  min-height:300px !important;

}

}

/* ===== Mobile navigation ===== */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue-dark);
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
}

.mobile-nav-btn {
  margin-top: 8px;
  width: 100%;
}

@media (max-width: 960px) {
  .nav {
    min-height: 72px;
  }

  .logo-img {
    width: 46px;
    height: 46px;
  }

  .logo span {
    font-size: 14px;
    line-height: 1.1;
  }

  .logo small {
    font-size: 10px;
  }

  .menu {
    display: none !important;
  }

  .mobile-menu {
    display: none !important;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .mobile-nav {
    position: fixed;
    top: 73px;
    left: 12px;
    right: 12px;
    z-index: 60;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .mobile-nav.open {
    display: flex;
  }

  .mobile-nav a {
    padding: 13px 14px;
    border-radius: 16px;
    font-weight: 900;
    color: #38465E;
  }

  .mobile-nav a.active,
  .mobile-nav a:hover {
    background: var(--soft);
    color: var(--blue-dark);
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* ===== Authors page clean layout ===== */
.author-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 24px !important;
}

.author-card {
  display: grid !important;
  grid-template-columns: 180px 1fr !important;
  gap: 28px !important;
  align-items: center !important;
  padding: 28px !important;
  min-height: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 16px 45px rgba(30, 65, 130, .09);
}

/* Поддержка нового варианта renderAuthors() */
.author-photo-wrap {
  width: 180px;
  height: 220px;
  border-radius: 28px;
  overflow: hidden;
  background: #eef5ff;
  border: 1px solid #d7e6ff;
  box-shadow: 0 18px 40px rgba(16, 43, 97, .08);
  flex: 0 0 auto;
}

.author-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.author-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-dark);
  font-size: 52px;
}

/* Поддержка старого варианта renderAuthors(), где фото выводится как .avatar.photo */
.author-card > .avatar {
  width: 180px !important;
  height: 220px !important;
  margin: 0 !important;
  border-radius: 28px !important;
  background-size: cover !important;
  background-position: center !important;
  background-color: #eef5ff !important;
  border: 1px solid #d7e6ff !important;
  box-shadow: 0 18px 40px rgba(16, 43, 97, .08);
}

.author-card > .avatar:not(.photo) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--blue-dark);
  font-size: 52px !important;
}

.author-content h3,
.author-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 25px;
  line-height: 1.2;
}

.author-content p,
.author-card p {
  max-width: 850px;
  margin: 0 0 18px;
  color: #26364f;
}

.author-books {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 760px) {
  .author-card {
    grid-template-columns: 1fr !important;
    padding: 22px !important;
  }

  .author-photo-wrap,
  .author-card > .avatar {
    width: 100% !important;
    height: 320px !important;
  }

  .author-content h3,
  .author-card h3 {
    font-size: 23px;
  }
}
