
:root{
  --brand-dark:#123A29; /* Черный фон */
  --brand-green:#8B805F; /* Золотой акцент */
  --brand-green-2:#8B805F; /* Вариант золотого */
  --bg:#123A29; /* Темный фон для body */
  --text:#8B805F; /* Золотой текст */
  --muted:#8B805F; /* Мьютед золотой */
  --border:#8B805F; /* Граница золотая */
  --card-bg: #FBF6EA;        /* кремовый фон карточек */
  --section-bg: #FBF6EA;     /* кремовый фон секций */
  --text-dark: #0B0B0B;
  --bg-black: #141414;       /* чёрный фон шапки/футера */
  --radius:16px;
  --maxw:1100px;
}

/* Reset / base */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html,body{
  background:var(--bg);
  color:var(--text);
  font-family:'Wix Madefor Display', system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  line-height:1.6;
}

a,
a:visited{
  color:var(--brand-dark);
  text-decoration:none;
}

a:hover{
  color:var(--brand-dark);
  text-decoration:none;
}

/* Layout helpers */
.container{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 16px;
}


/* Header / nav */


/* шапка: логотип слева, меню по центру */

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  white-space:nowrap;
  flex:0 0 auto;
}


/* меню по центру */


/* Текст в херое */


/* Кнопки в херое */

.btn-gold {
  background: var(--brand-green);
  color: var(--bg-black);
}


/* Generic grid */

/* Cards */

/* Clickable cards */


/* Library overview grid (library.html) */

.lib-card{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:140px;
}

/* Доп. утилита */
.muted{
  color:var(--muted);
}

/* Book grids */
.book-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:20px;
  margin-top:16px;
}

.book-grid.four{
  grid-template-columns:repeat(4, minmax(0,1fr));
}

/* Book card shared styles */


.book-body{
  padding:12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.book-title{
  font-weight:700;
}

.book-author{
  font-size:14px;
  color:var(--muted);
}


.book .btn{
  padding:6px 12px;
  font-size:14px;
}

/* Contacts */

.contacts-form textarea{
  width:100%;
  min-height:120px;
  resize:vertical;
  padding:8px;
  border-radius:8px;
  border:1px solid var(--border);
  font:inherit;
}

/* Events tables */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:8px;
  font-size:14px;
}

th,td{
  padding:6px 8px;
  border:1px solid var(--border);
}

th{
  background:#f8fafc;
  text-align:left;
}

/* Footer */

/* Breadcrumbs */

/* Responsive */
@media (max-width:900px){
  .grid{
    grid-template-columns:1fr;
  }
  .contacts-grid{
    grid-template-columns:1fr;
  }
  .hero{
    padding:32px 0 24px;
  }
}

@media (max-width:700px){
  .library-grid{
    grid-template-columns:1fr;
  }
  .book-grid.four{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:480px){
  .book-grid.four{
    grid-template-columns:1fr;
  }
}

/* Шапка и секции — больше воздуха */


/* Кнопки – более округлые и аккуратные */

/* Карточки (главная, библиотека, контакты) – мягкие тени и скругления */
.card,
.book{
  border-radius:20px;
  border-color:#ecf0f4;
  box-shadow:0 4px 16px rgba(15,23,42,0.06);
  transition:transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover,
.book:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 26px rgba(15,23,42,0.12);
  border-color:var(--brand-green-2);
}

/* Плейсхолдер обложки – более нежный градиент */
/* Художественная литература: фон из обложки (covers.js ставит --cover) */


/* Карточки на странице контактов не «сплющиваются» */

/* Немного увеличим расстояния между карточками библиотеки */

/* Чуть крупнее весь текст на сайте */

/* Меню в шапке – только размер шрифта */

/* Заголовки на главной */


/* Кнопки мероприятий */

/* Карточки на главной / контактах / библиотеке */

/* Заголовки разделов */
h1, h2{
  line-height:1.25;
}

/* Заголовки разделов (h1 + h2) во внутренних страницах библиотеки */
.section .container > h1{
  margin-bottom: 4px;          /* маленький отступ под h1 */
}

/* h2, который прямо следует за h1 */
.section .container > h1 + h2{
  margin-top: 2px;             /* почти без верхнего отступа */
  margin-bottom: 18px;         /* нормальный отступ до сетки книг */
  line-height: 1.15;           /* более плотный межстрочный интервал */
}

/* ====== Футер всегда внизу (страницы с <main>) ====== */

html, body{
  background: var(--brand-dark);
  color: var(--brand-green);
  height: 100%;
}


main{
  flex:1 0 auto;
}


/* ====== Фикс цвета текста на кнопках ====== */

.btn,
.btn:visited{
  color:#ffffff;
}


/* ====== Точечные стили только для вкладки "Мероприятия" ====== */


/* ссылка прижата ближе к низу карточки */

/* ====== Скрываем пункт "Пользовательское соглашение" в меню ====== */
.menu a[href="terms.html"]{
  display:none;
}

/* ====== Страница "Электронная библиотека" ====== */


/* ====== Страница "Контакты" ====== */

.contacts-page h1{
  margin-bottom:24px;
}


/* поле "Обратная связь" — круглая рамка, широкий, нормальный шрифт */


/* Типографика на странице "Контакты" — как в разделах библиотеки */


/* Заголовок карточки: размер и отступ как у разделов библиотеки */

/* Подзаголовок "Часы работы" — как обычный текст с лёгким акцентом */

/* Абзацы в карточке — по стилю как описания разделов библиотеки */
.contacts-page .card p{
  font-size:16px;
  margin-bottom:4px;
  line-height:1.4;
}
/* ====== Контакты: отключаем hover-анимацию карточек ====== */

.contacts-page .card{
  line-height: 1.5;
  transition: none;
}

/* состояние hover такое же, как обычное */
.contacts-page .card:hover{
  transform:none;
  box-shadow:0 4px 16px rgba(15,23,42,0.06);
  border-color:#ecf0f4;
}
/* ====== Footer alignment ====== */


.footer-left{
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.footer-right a{
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}

.footer-right a:hover {
  text-decoration: underline;
}


/* Заголовки разделов библиотек (library-*.html) */
.section > .container > h1{
  margin-bottom:6px;
}
.section > .container > h1 + h2{
  margin-top:0;
  margin-bottom:18px;
  line-height:1.2;
}


/* Заголовок "Мероприятия и библиотека" */

/* Подзаголовок */
/* Отступ между подзаголовком и кнопками */

/* ====== Мероприятия: сетка + карточки + детальный блок ====== */


.events-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:24px;
  margin-top:22px;
}

.event-card{
  display:block;
  text-decoration:none;
  border-radius:16px;
  overflow:hidden;

  /* обычная рамка */
  border:1px solid rgba(139,128,95,0.35);

  background:var(--card-bg);
  box-shadow:0 6px 18px rgba(15,23,42,0.10);

  /* чтобы hover был плавный */
  transition: box-shadow 0.2s ease, outline 0.2s ease;
}
.event-card:hover{
  outline: 4px solid var(--border); /* ← ТОЛСТАЯ рамка */
  outline-offset: -5px;             /* ← рамка уходит ВНУТРЬ */
}


.event-thumb{
  aspect-ratio: 4 / 3;
  background:#eee;
}
.event-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.event-info{
  padding:12px 14px 14px;
}
.event-title{
  font-weight:700;
  color:var(--text-dark);
  line-height:1.25;
  margin-bottom:6px;
}
.event-date{
  font-size:14px;
  color:#6b7a4b;
}

/* Детальный блок */
.event-detail h2{
  margin-bottom:18px;
}


.event-block{
  margin-bottom:18px;
}
.event-block-title{
  font-weight:700;
  margin-bottom:8px;
  color:var(--text-dark);
}
.event-block-text{
  margin-top:6px;
  font-size:16px;
  line-height:1.55;
  color:var(--text-dark);
  font-weight:600;
}


/* Адаптив */
@media (max-width: 1100px){
  .events-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px){
  .events-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .event-detail-grid{ grid-template-columns:1fr; }
  .event-dates{ grid-template-columns:1fr; }
  .event-dates-time{ border-left:0; padding-left:0; margin-top:8px; }
}
@media (max-width: 520px){
  .events-grid{ grid-template-columns:1fr; }
}
/* ====== MENU: bigger & more expressive (override at end) ====== */


/* Header: плотнее и дороже */

/* Menu: выразительнее, hover без "рамки" */
.menu{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 560;
  letter-spacing: .02em;
}
.menu a{
  color: var(--brand-green);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.menu a:hover{
  background: rgba(139,128,95,.14);
  box-shadow: 0 0 0 1px rgba(139,128,95,.18);
  transform: translateY(-1px);
}

/* Hero: чуть глубже и контрастнее */

/* Buttons: премиально, без "input-рамки" */

/* если есть зелёная кнопка */

/* Cards: дорогая тень + hover, аккуратнее типографика */
.grid{
  display: grid;
  grid-template-columns: repeat(12, minmax(0,1fr));
  gap: 22px;
}
.card{
  background: var(--card-bg);
  color: var(--bg-black);
  border: 1px solid rgba(139,128,95,.18);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
  min-height: 190px;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover{
  transform: translateY(-3px);
  box-shadow: 0 26px 70px rgba(0,0,0,.22);
  border-color: rgba(139,128,95,.38);
}
.card h2, .card h3{
  letter-spacing: -0.01em;
}
.card p{
  line-height: 1.55;
}

/* Links in cards */
.card a{
  font-weight: 650;
  text-decoration: none;
}
.card a:hover{
  text-decoration: underline;
}

/* Footer: читабельнее, но без лишнего */
.footer .footer-left,
.footer .footer-right a{
  opacity: .85;
}
.footer .footer-right a:hover{
  opacity: 1;
}


.section{
  padding: 40px 0;
}
/* ===== HEADER: brand solid background ===== */
/* ===== FIX: header must be solid var(--bg-black) (brandbook) ===== */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-black) !important;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(139,128,95,.45);
  background-color: var(--bg-black) !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* на всякий: если были декоративные псевдо-слои */
.header::before,
.header::after{
  display: none !important;
  content: none !important;
}

/* чтобы логотип не “подчернялся” тенями */
/* 1) Чуть меньше пустоты снизу на главной */

/* 2) Карточки: чуть “весомее”, ровнее, приятнее hover */
.events-page .grid{
  align-items: stretch;
}

.events-page .card{
  padding: 32px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
}

/* Текст на кремовом фоне: чуть контрастнее */
.events-page .card p{
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(11,11,11,.82);
}

/* Hover без “рамочки”: мягкая внутренняя подсветка + тень */


/* 3) Лёгкая полировка заголовков в карточках */
.events-page .card h2{
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 4) Аккуратный фокус (tab) */
.events-page a:focus-visible,
.events-page .btn:focus-visible,
.menu a:focus-visible{
  outline: 3px solid rgba(139,128,95,.55);
  outline-offset: 4px;
  border-radius: 999px;
}
body, button, input, textarea, select{
  font-family:'Wix Madefor Display', system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
/* меньше пустоты на главной */
.events-page main { padding-bottom: 0; }
.btn:active { transform: translateY(0); }
.nav{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 10px 0;
}
.brand img{
  height: 38px;
  width: auto;
  filter: none !important;
  display: block;
}
.menu a.active{
  background: rgba(139,128,95,.78);
  color: #1a1a1a;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.btn{
  display: inline-block;
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 999px;
  border: 1px solid rgba(139,128,95,.22);
  background: rgba(20,20,20,.22);
  color: var(--card-bg);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .18s ease, background .18s ease;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  border-color: rgba(139,128,95,.22);
}
.btn:hover{
  opacity: 0.92;
  transform: translateY(-1px);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
  border-color: rgba(139,128,95,.42);
  background: rgba(20,20,20,.34);
}

.events-page .section{
  padding-top: 40px;
  padding-bottom: 24px;
}
/* Secondary (Прошедшие) — тёмная “ghost” */

/* Primary (Предстоящие) — золото */

/* общий hover/active */

/* аккуратный фокус */
/* === Library cards: premium hover === */
.library-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 28px;
  margin-top: 24px;
}

.card.lib-card{
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 34px 36px;            /* немного “богаче” */
  min-height: 190px;             /* чтобы все 4 выглядели одинаково */
  border: 1px solid rgba(20,20,20,.06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

/* тонкая “золотая” нить сверху (без текста/иконок) */
.card.lib-card::before{
  content:"";
  position:absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(139,128,95,0),
    rgba(139,128,95,.85),
    rgba(139,128,95,0)
  );
  opacity: .9;
}

.card.lib-card:hover{
  transform: translateY(-4px);
  border-color: rgba(139,128,95,.28);
  box-shadow: 0 24px 44px rgba(0,0,0,.22);
}

.card.lib-card:focus-visible{
  outline: 2px solid rgba(139,128,95,.7);
  outline-offset: 3px;
}

/* чуть спокойнее абзацы, чтобы заголовки доминировали */
.card.lib-card p{
  opacity: .92;
  line-height: 1.55;
}
.section.library-page{
  padding-bottom: 80px;
}
/* ================================
   LIBRARY (library.html) — polish
   Работает только внутри .library-page
================================== */


/* Заголовок и подзаголовок */


/* Подзаголовок “Разделы библиотеки” + тонкая линия сверху */


/* Сетка карточек */

/* Карточки-разделы */
.library-page .lib-card{
  border-radius: 24px;
  padding: 34px 36px;
  min-height: 190px;

  /* мягкая рамка вместо “жёсткого” золота */
  border: 1px solid rgba(139,128,95,.40);

  /* чуть “дороже” фон */
  background: linear-gradient(180deg, var(--card-bg) 0%, #F6EFDF 100%);

  /* тень глубже (вау-эффект), но без грязи */
  box-shadow: 0 10px 26px rgba(0,0,0,.18);

  /* чтобы текст в карточке был корректно тёмным */
  color: var(--bg-black);

  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* Тонкая золотая линия сверху (появляется на hover) */
.library-page .lib-card::after{
  content:"";
  position:absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: rgba(139,128,95,.75);
  opacity: 0;
  transition: opacity .18s ease;
}

.library-page .lib-card h3{
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.library-page .lib-card p{
  line-height: 1.5;
  margin-bottom: 6px;
  font-size: 16px;
  color: rgba(11,11,11,.72);
  margin: 0;
}

/* Hover: приподняли + усилили рамку + показали верхнюю линию */
.library-page .lib-card:hover{
  transform: translateY(-2px);
  border-color: rgba(139,128,95,.85);
  box-shadow: 0 14px 34px rgba(0,0,0,.24);
}

.library-page .lib-card:hover::after{
  opacity: 1;
}

/* Красивый фокус для клавиатуры (важно!) */
.library-page .lib-card:focus-visible{
  outline: none;
  border-color: rgba(139,128,95,.95);
  box-shadow:
    0 0 0 2px rgba(139,128,95,.35),
    0 14px 34px rgba(0,0,0,.24);
}

/* Адаптив: на узких экранах — 1 колонка */
@media (max-width: 900px){
  .library-page .library-grid{
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .library-page h1{
    font-size: 34px;
  }
}
/* фикс: чтобы работало (у тебя сейчас .section.library-page не матчится) */
.library-page .section{
  padding: 64px 0 72px;
  padding-top: 64px;
  padding-bottom: 96px;
}

/* Заголовок + подзаголовок (чуть выразительнее) */
.library-page h1{
  text-align: center;
  font-size: 38px;
  margin-bottom: 6px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}

.library-page .library-subtitle{
  margin-top: 6px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--muted);
  white-space: normal;
  font-size: 16px;
  line-height: 1.6;
  opacity: .9;
}

/* “Разделы библиотеки” + тонкий разделитель сверху */
.library-page .library-sections-title{
  margin-top: 34px;
  margin-bottom: 18px;
  font-size: 22px;
  text-align: center;
  font-weight: 600;
  position: relative;
  padding-top: 18px;
}

.library-page .library-sections-title::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 140px;
  height: 1px;
  background: rgba(139,128,95,.35);
}

/* Сетка: чуть уже + аккуратнее расстояния */
.library-page .library-grid{
  margin-top: 22px;
  gap: 28px 32px;
  max-width: 1060px;
  margin: 26px auto 0;
}

/* Карточки: чуть “премиальнее” по пропорциям */
.library-page .card.lib-card{
  padding: 34px 38px;
  min-height: 168px;
  border-radius: 22px;
}

/* Типографика внутри карточек */
.library-page .card.lib-card h3{
  font-size: 20px;
  margin-bottom: 14px;
}

.library-page .card.lib-card p{
  font-size: 15px;
  opacity: .9;
}

/* Адаптив */
@media (max-width: 980px){
  .library-page .library-grid{
    grid-template-columns: 1fr;
    max-width: 640px;
  }
  .library-page .card.lib-card{
    padding: 28px 28px;
  }
}
/* Растягиваем две карточки на одинаковую высоту */
.contacts-page .grid{
  align-items: stretch;
}

/* Делаем карточки контактной страницы более “собранными” */
.contacts-page .grid > .card{
  display: flex;
  flex-direction: column;
  min-height: 260px; /* можно 240-280 по вкусу */
}

/* Заголовки внутри карточек (чуть аккуратнее по ритму) */
.contacts-page .card h2{
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.25;
}

.contacts-page .card h3{
  font-size: 16px;
  font-weight: 600;
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--text-dark);
  line-height: 1.25;
  opacity: 0.9;
}

.contacts-page .contact-email{
  margin-top: 12px;   /* ← вот это увеличит расстояние */
  margin-bottom: 0;
  font-weight: 600;
}


/* Форма: занимает высоту карточки, кнопка прижата вниз */
.contacts-form{
  margin-top: 14px;     /* вместо inline */
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Поле ввода — фирменное, не “браузерное” */
.contacts-textarea{
  width: 100%;
  flex: 1;              /* главное: растягивается */
  min-height: 140px;    /* базовая высота */
  resize: vertical;

  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(139,128,95,0.55); /* золото мягче */
  background: rgba(251,246,234,0.70);      /* кремовый, но не “белый лист” */
  color: var(--text-dark);
  font: inherit;

  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.contacts-textarea::placeholder{
  color: rgba(11,11,11,0.45);
}

/* Фокус — аккуратный “ореол” фирменным золотом */
.contacts-textarea:focus{
  outline: none;
  border-color: rgba(139,128,95,0.95);
  box-shadow: 0 0 0 4px rgba(139,128,95,0.18);
  background: rgba(251,246,234,0.95);
}

/* Кнопка внизу */
.contacts-actions{
  margin-top: auto; /* прижимает к низу карточки */
  display: flex;
  gap: 10px;
}

/* Точная фиксация цвета для btn-gold (у тебя глобально btn принудит белый текст) */
.btn.btn-gold{
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: var(--bg-black);
}

.btn.btn-gold:hover{
  opacity: 0.95;
  transform: translateY(-1px);
  color: var(--bg-black);
}
/* ================================
   BUSINESS BOOK CARDS (premium + no artifacts)
   ================================ */

.library-business-page .book-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 26px;
  margin-top: 16px;
  margin-bottom: 34px;
}


/* Карточка */


/* Обложка */


/* Если картинка битая — прячем img, остаётся красивый фон .book-cover */

/* Текстовая часть */
.library-business-page .book-meta{
  padding: 14px 16px 16px;
}

.library-business-page .book-title{
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(11,11,11,.92);

  /* чтобы карточки были ровными */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.library-business-page .book-author{
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(11,11,11,.60);

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

/* Бизнес-библиотека: фон от обложки + аккуратный плейсхолдер */
.library-business-page .book-ph{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
}

.library-business-page .book-ph::before{
  content:"";
  position:absolute;
  inset:-18px;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.15);
  opacity: .35;
  transform: scale(1.12);
}

.library-business-page .book-ph::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0) 45%, rgba(0,0,0,.16));
}

.library-business-page .book-ph img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  box-sizing: border-box;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.30));
}

/* если обложки нет */
.library-business-page .book-ph.no-cover::before{ display:none; }
.library-business-page .book-ph.no-cover::after{
  content:"Обложка отсутствует";
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  letter-spacing:.2px;
  color: rgba(20,20,20,.55);
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
}


/* Плавный переход по якорям */

/* Чтобы при переходе заголовок не прятался под верхним меню */
html{
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

/* Оформление списка разделов под заголовком */
.library-business-page .section-nav{
  margin: 12px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-business-page .section-nav a{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--brand-green);
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 600;
  background: rgba(20,20,20,0.35);
}

.library-business-page .section-nav a:hover{
  background: rgba(139,128,95,0.18);
}
.book-ph{
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
  font-weight: 600;
  font-size: 15px;
  position: relative;
  overflow: hidden;
}

.book-ph::before{
  content:"";
  position:absolute;
  inset:-18px;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.15);
  opacity: .35;
  transform: scale(1.12);
}

.book-ph::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,0) 45%, rgba(0,0,0,.18));
}

.book-ph img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.35));
}
.book{
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.book:hover{
  box-shadow: 0 16px 34px rgba(0,0,0,.24);
  transform: translateY(-3px);
}
/* ===== обложка целиком + размытый фон ===== */
.library-fiction-page .book-ph,
.library-authors-page .book-ph{
  position:relative;
  overflow:hidden;
}

.library-fiction-page .book-ph::before,
.library-authors-page .book-ph::before{
  content:"";
  position:absolute;
  inset:-18px;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.15);
  opacity:.35;
  transform: scale(1.12);
}

.library-fiction-page .book-ph::after,
.library-authors-page .book-ph::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,0) 45%, rgba(0,0,0,.14));
}

.library-fiction-page .book-ph img,
.library-authors-page .book-ph img{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  object-fit: contain;
  padding:10px;
  box-sizing:border-box;
  display:block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.28));
}

/* если нет обложки */
.library-fiction-page .book-ph.no-cover::before,
.library-authors-page .book-ph.no-cover::before{
  display:none;
}

.library-fiction-page .book-ph.no-cover::after,
.library-authors-page .book-ph.no-cover::after{
  content: attr(data-label);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  color: rgba(11,11,11,.55);
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
}

/* если data-label не задан */
.library-fiction-page .book-ph.no-cover:not([data-label])::after,
.library-authors-page .book-ph.no-cover:not([data-label])::after{
  content:"Обложка отсутствует";
}
/* ===== Художественная литература: фон из обложки (blur) ===== */


/* ===== Художественная литература: фон из обложки (covers.js ставит --cover) ===== */
.library-fiction-page .book-ph{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
}

.library-fiction-page .book-ph::before{
  content: "";
  position: absolute;
  inset: -18px;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.15);
  opacity: .35;
  transform: scale(1.12);
}

.library-fiction-page .book-ph::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,0) 45%, rgba(0,0,0,.14));
}

.library-fiction-page .book-ph img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  display: block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.28));
  padding: 10px;
}

/* если обложки нет/битая */
.library-fiction-page .book-ph.no-cover::before{ display: none; }
.library-fiction-page .book-ph.no-cover::after{
  content: "Обложка отсутствует";
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: rgba(11,11,11,.55);
  background: linear-gradient(180deg,var(--brand-green),var(--card-bg));
}
/* Кнопка "Вернуться ко всем разделам" — всегда видимая */
.back-to-library,
.back-to-library:visited{
  color: var(--card-bg) !important;              /* светлый текст */
  background: rgba(0,0,0,.35);            /* тёмная подложка */
  border: 1px solid rgba(212,196,160,.55);
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-to-library:hover{
  background: rgba(0,0,0,.55);
  color: #D4C4A0 !important;
}
/* ===== Upcoming events: показывать детали только по клику (modal через :target) ===== */


/* белая “карточка-модалка” внутри оверлея */

/* заголовок внутри модалки */
.event-detail:target h2{
  margin-top: 0;
}

/* кнопка закрыть */
/* ===== Upcoming events: детали только по клику (modal через :target) ===== */


/* ===== Upcoming events modal (через :target) ===== */

.event-detail{
  margin-top: 54px;
  padding-top: 18px;
  border-top: 1px solid rgba(139,128,95,0.35);
  display: none;
}

.event-detail:target{
  display: flex;
  inset: 0;
  z-index: 9999;
  overflow: auto;
  padding: 24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  position: fixed;
  -webkit-backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
}

/* клик по затемнению закрывает */

/* белая карточка */

/* крестик справа сверху */
.event-close{
  position: absolute;
  top: 14px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-dark);
  background: rgba(139,128,95,0.12);
  border: 1px solid rgba(139,128,95,0.35);
  right: 14px;
}
.event-close:hover{
  background: rgba(139,128,95,0.20);
}

/* сетка внутри модалки (картинка + текст) */

/* картинка */
.event-detail-media img{
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  box-shadow: 0 10px 24px rgba(15,23,42,0.18);
}

/* адаптация */
@media (max-width: 900px){
  .event-detail:target{ align-items:flex-start; }
  .event-detail:target > .event-detail-inner{
    margin-top: 18px;
    max-height: calc(100vh - 36px);
  }
  .event-detail-grid{
    grid-template-columns: 1fr;
  }
}
.page-sticky-footer{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-sticky-footer .events-page{
  flex: 1;               /* растягиваем контент */
}

.page-sticky-footer .footer{
  margin-top: auto;      /* прижимаем подвал вниз */
}

/* ===== Consent modal ===== */
.no-scroll { overflow: hidden; }

.consent-overlay{
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}


.consent-topline{
  height: 6px;
  background: linear-gradient(90deg, rgba(183,155,98,0.95), rgba(214,193,138,0.95));
}


.consent-title{
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.consent-text{
  font-size: 14px;
  line-height: 1.45;
  color: rgba(15,23,42,0.78);
  margin-bottom: 14px;
}


.consent-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.consent-btn{
  appearance: none;
  border: 1px solid rgba(15,23,42,0.18);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: transform .08s ease, filter .12s ease, background .12s ease;
}

.consent-btn:active{ transform: translateY(1px); }

.consent-btn-ghost{
  background: transparent;
  color: #0f172a;
}

.consent-btn-danger{
  background: rgba(15,23,42,0.06);
  color: rgba(15,23,42,0.92);
}

.consent-btn-primary{
  background: rgba(183,155,98,0.95);
  border-color: rgba(183,155,98,0.95);
  color: #111827;
}

.consent-btn-primary:hover{ filter: brightness(1.03); }

.consent-hint{
  margin-top: 12px;
  font-size: 12px;
  color: rgba(15,23,42,0.55);
}

/* Сообщение на terms.html после отказа */

/* ===== Terms actions ===== */
.terms-hint{
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(15,23,42,0.72);
}

/* =========================
   Прошедшие мероприятия: видео и выбор качества
   ========================= */


@media (max-width: 900px){
  .event-detail-media .event-media-frame{ height:320px; }
}
@media (max-width: 520px){
  .event-detail-media .event-media-frame{ height:220px; }
}


/* Fix: не даём видео/грид-элементам раздувать модалку по ширине */
.event-detail-media,
.event-detail-text{
  min-width: 0;
}
.event-detail:target > .event-detail-inner{
  width: min(1100px, 100%);
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  border: 1px solid rgba(139,128,95,0.35);
  position: relative;
  z-index: 1;
  max-height: calc(100vh - 48px);
  overflow: auto;
  overflow-x: hidden;
}

/* =========================
   Video modal sizing FIX (override - keep at end)
   Makes video block behave like image block in event modals
   ========================= */
.event-detail-grid{
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.event-detail-grid > *{ min-width: 0; }
.event-detail-media{ min-width: 0; }

/* frame like image */
.event-detail-media .event-media-frame{
  position: relative;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 24px rgba(15,23,42,0.18);
  aspect-ratio: 16 / 9;
}

/* ensure the video itself doesn't force layout */
.event-detail-media .event-media-frame video.event-video{
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
  background: #000;
}

/* quality selector must stay as overlay on video */

/* on small screens keep 1 column, but still respect min-width */
@media (max-width: 900px){
  .event-detail-grid{ grid-template-columns: 1fr; }
  .event-detail-media .event-media-frame{ aspect-ratio: 16 / 9; }
}

/* Journals page: footer to bottom when content is short */
body.page-magazines{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
body.page-magazines .section{
  flex:1 0 auto;
}
body.page-magazines .footer{
  margin-top:auto;
}


/* чтобы модалка не вылезала за экран при длинном тексте */
.consent-modal{
  width: min(720px, 100%);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  border: 1px solid rgba(183,155,98,0.35);
  background: rgba(255,255,255,0.94);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}
.consent-body{
  padding: 20px 22px 18px;
  overflow: auto;
}

/* кнопка-линк в тексте */
.consent-link-btn{
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.consent-link-btn:hover{
  filter: brightness(0.92);
}

/* блок с текстом соглашения внутри модалки */
.consent-terms{
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.14);
  background: rgba(255,255,255,0.96);
  padding: 12px 14px;
  max-height: min(60vh, 520px);
  overflow: auto;
}
.consent-terms-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.consent-terms-title{
  font-size: 13px;
  font-weight: 700;
  color: rgba(15,23,42,0.85);
}
.consent-terms-ext{
  font-size: 12px;
  color: rgba(15,23,42,0.70);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.consent-terms-inner{
  color: rgba(15,23,42,0.90);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.consent-terms-inner p{
  margin: 0 0 10px;
}

/* Consent modal: hide "Open in new tab" link */
.consent-terms-head a,
a.consent-terms-ext{
  display:none !important;
}


/* If something left from old "quality" switcher — hide it */

/* Player mode selector under page title */

/* Custom controls */


/* Slightly improve range look on dark background */

/* Theater mode: make modal a bit wider */


/* делаем цвет спокойнее, шрифт компактнее, а разделитель — на всю высоту списка дат */

.event-dates-col{
  color: #556044;
  line-height: 1.35;
  font-family: sans-serif;
  font-size: 16px;
}
.event-dates-col > div{ margin:0 0 6px; }
.event-dates-col > div:last-child{ margin-bottom:0; }


/* адаптив: на узких экранах время уходит вниз, линию убираем */
@media (max-width: 900px){
  .event-dates{ grid-template-columns:1fr; }
  .event-dates-time{ border-left:0; padding-left:0; margin-top:8px; }
}

/* Materials links inside event modal */
.event-detail .event-material-link{
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
.event-detail .event-material-link:hover{
  text-decoration: none;
}


/* === v3: dates/time — closer line + vertically centered time === */
.event-dates{
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
  align-items: stretch;
}


/* === v4: move vertical line left, keep time where it is === */
.event-dates-time{
  color: #556044;
  padding-left: 10px;
  border-left: 0 !important;
  display: flex;
  align-items: flex-start;
  text-align: left;
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  align-self: stretch;
  justify-content: flex-start;
}

.event-dates-time::before{
  content:"";
  position:absolute;
  left:-10px;                 /* <-- линия чуть левее */
  top:0;
  bottom:0;
  width:2px;
  background:rgba(139,128,95,0.35);
  border-radius:2px;
}

/* адаптив: где линию мы уже прятали — прячем и псевдо-линию */
@media (max-width: 1100px){
  .event-dates-time::before{ display:none; }
}
@media (max-width: 900px){
  .event-dates-time::before{ display:none; }
}

/* ====== FOOTER FIX: единый стиль на всех вкладках ====== */
.footer-right{
  padding-right: 0 !important;
}
.footer-left,
.footer-right a{
  font-size: 14px;
  opacity: .9;
  line-height: 1.4;
}

/* ====== INDEX: отступ блоков от заголовка ====== */
.seminars-page-title {
  margin-bottom: 56px !important;
}

/* ====== FOOTER: текст по центру вертикально ====== */
.footer-flex{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  width: 100%;
}

/* ====== INDEX: блоки семинаров на главной ====== */
.seminar-btn {
  padding: 130px 60px !important;
  font-size: 30px !important;
  border-radius: 32px !important;
}
.seminar-btn .btn-icon {
  width: 84px !important;
  height: 84px !important;
  border-radius: 24px !important;
}
.seminar-btn .btn-icon svg {
  width: 44px !important;
  height: 44px !important;
}

.seminar-btn-upcoming {
  background: linear-gradient(145deg, #1b3028 0%, #162a22 100%) !important;
  color: #c8b88a !important;
  border: 1px solid rgba(139,128,95,0.50) !important;
  box-shadow: 0 16px 44px rgba(0,0,0,0.25) !important;
}
.seminar-btn-upcoming:hover {
  color: #ddd0b0 !important;
  border-color: rgba(139,128,95,0.80) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35) !important;
}
.seminar-btn-upcoming .btn-icon {
  background: rgba(139,128,95,0.16) !important;
}

.seminars-buttons {
  max-width: 1100px !important;
  gap: 36px !important;
}

/* ====== FOOTER: всегда внизу на всех страницах ====== */
body{
  font-size: 17px;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}
main, .events-page, .section:not(.seminars-section) {
  flex: 1 0 auto;
}
.footer{
  background: var(--bg-black);
  color: rgba(178,167,138,.9);
  margin-top: auto !important;
  padding: 20px 0 !important;
  border-top: 1px solid rgba(139,128,95,.40);
  font-size: 14px;
  flex-shrink: 0 !important;
  display: flex;
  align-items: center;
  min-height: 56px;
}

/* ====== FIX: авторские материалы — контейнер не даёт вылезать ====== */
.library-authors-page .container,
.library-authors-page .section > .container {
  max-width: var(--maxw) !important;
  overflow: hidden;
}
.library-authors-page .book-grid {
  max-width: 100% !important;
  overflow: hidden;
}

/* ====== FIX: авторские материалы — принудительно ограничиваем ширину ====== */
.library-authors-page {
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Страницы без <main> — секция сама растягивается */
section.section {
  width: 100% !important;
}

/* ====== FIX: страницы без <main> — секция-контейнер ====== */
body > section.section {
  max-width: 100vw;
  overflow-x: hidden;
}
body > section.section > .container {
  max-width: 1100px !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
}
body > section.section > .container .book-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  min-width: 0 !important;
}
body > section.section > .container .book {
  min-width: 0 !important;
}
