@import url('https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@400;500;600;700&display=swap');

: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;
  --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;
}

.section{
  padding:40px 0;
}

/* Header / nav */
.header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(20,20,20,0.96); /* #141414 с прозрачностью */
  backdrop-filter:blur(6px);
  border-bottom:1px solid #8B805F; /* Золотая граница */
}

.menu a {
  color:#8B805F;
}

.footer {
  background:#141414;
  color:#8B805F;
}

.card {
  background:#8B805F;
  color:#141414;
}

html, body {
  background:#123A29;
  color:#8B805F;
}

/* шапка: логотип слева, меню по центру */
.nav{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:20px;
  padding:12px 0;
}

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

.brand img{
  height:52px;
  width:auto;
}

.brand-title{
  font-size:14px;
  font-weight:550;
  color:var(--brand-dark);
  letter-spacing:0.08em;
  text-transform:uppercase;
  font-family:"Times New Roman","Georgia",serif;
}

/* меню по центру */
.menu{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:nowrap;
  white-space:nowrap;
  font-size:15px;
}

.menu a{
  padding:6px 10px;
  border-radius:999px;
}

.menu a.active{
  background:var(--brand-green);
  color:#FBF6EA;
}

.hero {
  background: #123A29; /* зелёный */
  color: #8B805F;
  padding: 60px 0;
}

/* Текст в херое */
.hero h1 {
  color: #8B805F;
}

.hero p {
  color: #8B805F;
}

/* Кнопки в херое */
.btn-black {
  background: #141414;
  color: #8B805F;
  border: 1px solid #8B805F;
}

.btn-gold {
  background: #8B805F;
  color: #141414;
}

.btn{
  display:inline-block;
  padding:10px 20px;
  font-size:15px;
  border-radius:999px;
  border:1px solid var(--brand-dark);
  background:var(--brand-dark);
  color:#FBF6EA;
  cursor:pointer;
  transition:background 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}

.btn:hover{
  opacity:0.92;
  transform:translateY(-1px);
  color:#FBF6EA;
}

.btn-green{
  background:var(--brand-green);
  border-color:var(--brand-green);
  color:#FBF6EA;
}

/* Generic grid */
.grid{
  display:grid;
  grid-template-columns:repeat(12, minmax(0,1fr));
  gap:24px;
}

/* Cards */
.card{
  background:#FBF6EA;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 2px 6px rgba(15,23,42,0.04);
}

/* Clickable cards */
.card-link{
  display:block;
  color:var(--text);
}

.card-link:hover{
  text-decoration:none;
  box-shadow:0 4px 14px rgba(15,23,42,0.12);
}

/* Library overview grid (library.html) */
.library-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:20px;
  margin-top:24px;
}

.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{
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:#FBF6EA;
  display:flex;
  flex-direction:column;
  text-decoration:none;
}

.book:hover{
  box-shadow:0 4px 14px rgba(15,23,42,0.12);
}

.book-ph{
  height:200px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, var(--brand-green-2), #e9f7ff);
  font-weight:600;
  font-size:15px;
}

.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-actions{
  margin-top:10px;
}

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

/* Contacts */
.contacts-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:24px;
  margin-top:20px;
}

.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 */
.footer{
  margin-top:40px;
  padding:18px 0;
  background:#141414;
  border-top:1px solid var(--border);
  font-size:13px;
  color:var(--muted);
}

/* Breadcrumbs */
.breadcrumbs{
  font-size:13px;
  color:var(--muted);
  margin:16px 0 8px;
}

/* 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;
  }
}

/* ===========================
   Soft UI – более «мягкий» вид
   =========================== */

/* Шапка и секции — больше воздуха */
.hero{
  padding:56px 0 48px;
}

.section{
  padding:40px 0;
}

/* Кнопки – более округлые и аккуратные */
.btn{
  padding:11px 22px;
  border-radius:999px;
  font-weight:500;
}

/* Карточки (главная, библиотека, контакты) – мягкие тени и скругления */
.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);
}

/* Плейсхолдер обложки – более нежный градиент */
.book-ph{
  height:210px;
  background:linear-gradient(180deg,#8B805F,#FBF6EA);
  font-size:15px;
}
/* Художественная литература: фон из обложки (covers.js ставит --cover) */
.library-fiction-page .book-ph{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,#8B805F,#FBF6EA); /* fallback */
}

.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; /* целиком */
  padding: 10px;
  box-sizing: border-box;
  display: block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.28));
}

/* Карточки на странице контактов не «сплющиваются» */
.contacts-grid .card{
  min-height:220px;
}

/* Немного увеличим расстояния между карточками библиотеки */
.library-grid{
  gap:24px;
}

/* ====== Глобальное увеличение масштаба ====== */

/* Чуть крупнее весь текст на сайте */
body{
  font-size:17px;
}

/* Меню в шапке – только размер шрифта */
.menu{
  font-size:16px;
}

/* Заголовки на главной */
.hero h1{
  font-size:34px;
}

.hero p{
  font-size:17px;
}

/* Кнопки мероприятий */
.btn{
  font-size:16px;
  padding:12px 24px;
}

/* Карточки на главной / контактах / библиотеке */
.card{
  padding:26px;
  min-height:190px;
}

/* Заголовки разделов */
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{
  height:100%;
}

body{
  display:flex;
  flex-direction:column;
}

main{
  flex:1 0 auto;
}

.footer{
  flex-shrink:0;
}

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

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

.btn:hover{
  color:#ffffff;
}

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

.events-page .card{
  padding:32px;
  min-height:240px;
  display:flex;
  flex-direction:column;
  line-height:1.6;
}

.events-page .card h2{
  margin-bottom:12px;
  font-size:22px;
  font-weight:600;
}

.events-page .card p{
  margin-bottom:10px;
  font-size:16px;
  line-height:1.6;
}

/* ссылка прижата ближе к низу карточки */
.events-page .card-link-text{
  margin-top:auto;
  padding-top:14px;
  font-size:16px;
  font-weight:500;
  display:inline-block;
}

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

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

.library-page h1{
  text-align: center;
  font-size: 32px;
  margin-bottom: 4px;
}

.library-page .library-subtitle{
  margin-top: 8px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--muted);
  white-space: normal;         /* даём строке переноситься */
}

.library-page .library-sections-title{
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: 24px;
  text-align: center;
}

.library-page .lib-card p{
  line-height: 1.5;
  margin-bottom: 6px;
}


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

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

.contacts-page .card h2{
  margin-bottom:10px;
}

/* поле "Обратная связь" — круглая рамка, широкий, нормальный шрифт */
.contacts-page #messageText{
  width:100%;
  min-height:150px;
  padding:10px 14px;
  border-radius:16px;
  border:1px solid var(--border);
  font:inherit;
  resize:vertical;
  box-shadow:0 1px 2px rgba(15,23,42,0.04);
}

.contacts-page #messageText::placeholder{
  color:var(--muted);
}

.contacts-page #messageText:focus{
  outline:none;
  border-color:var(--brand-green);
  box-shadow:0 0 0 1px rgba(121,168,81,0.35);
}
/* Типографика на странице "Контакты" — как в разделах библиотеки */

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

/* Заголовок карточки: размер и отступ как у разделов библиотеки */
.contacts-page .card h2{
  font-size:20px;
  font-weight:600;
  margin-bottom:8px;
}

/* Подзаголовок "Часы работы" — как обычный текст с лёгким акцентом */
.contacts-page .card h3{
  font-size:16px;
  font-weight:600;
  margin-top:14px;
  margin-bottom:4px;
}

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

.contacts-page .card{
  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-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.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;
}

.footer-right {
  padding-right: 24px;
}

/* Заголовки разделов библиотек (library-*.html) */
.section > .container > h1{
  margin-bottom:6px;
}
.section > .container > h1 + h2{
  margin-top:0;
  margin-bottom:18px;
  line-height:1.2;
}
.book-ph img{
  width:100%;
  height:100%;
  object-fit:contain; /* <-- целиком, без обрезки */
  border-radius:inherit;
}

.btn-past {
  background: #141414;   /* чёрная заливка */
  border-color: #8B805F; /* золотая рамка */
  color: #ffffff;       /* белый текст */
}

/* Заголовок "Мероприятия и библиотека" */
.events-page .hero h1 {
  line-height: 1.1;
  margin-bottom: 12px;
}

/* Подзаголовок */
.events-page .events-sub {
  line-height: 1.35;
}
/* Отступ между подзаголовком и кнопками */
.events-page .events-sub {
  margin-bottom: 28px; /* было ~12–16, стало заметно воздушнее */
}

.hero {
  border-bottom: 1px solid rgba(139, 128, 95, 0.6);
}
/* ====== Мероприятия: сетка + карточки + детальный блок ====== */

html { scroll-behavior: smooth; }

.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:#FBF6EA;
  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:#0B0B0B;
  line-height:1.25;
  margin-bottom:6px;
}
.event-date{
  font-size:14px;
  color:#6b7a4b;
}

/* Детальный блок */
.event-detail{
  margin-top:54px;
  padding-top:18px;
  border-top:1px solid rgba(139,128,95,0.35);
}
.event-detail h2{
  margin-bottom:18px;
}

.event-detail-grid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap:28px;
  align-items:start;
}

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

.event-detail-links{
  margin-top:14px;
}
.event-detail-links-title{
  font-weight:600;
  margin-bottom:6px;
  color:#0B0B0B;
}
.event-detail-links a{
  color:#6b7a4b;
  text-decoration:none;
}
.event-detail-links a:hover{
  text-decoration:underline;
}

.event-block{
  margin-bottom:18px;
}
.event-block-title{
  font-weight:700;
  margin-bottom:8px;
  color:#0B0B0B;
}
.event-block-text{
  margin-top:6px;
  font-size:16px;
  line-height:1.55;
  color:#0B0B0B;
  font-weight:600;
}

.event-dates{
  display:grid;
  grid-template-columns: 1fr 96px;
  gap:8px;
  align-items:start;
}
.event-dates-col{
  color:#6b7a4b;
  line-height:1.7;
}
.event-dates-time{
  color:#6b7a4b;
  padding-left:10px;
  border-left:2px solid rgba(139,128,95,0.35);
}

/* Адаптив */
@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) ====== */
.menu{
  font-size: 18px;          /* было 15–16 */
  font-weight: 550;         /* выразительнее */
  letter-spacing: 0.02em;
  gap: 14px;                /* больше воздуха между пунктами */
}

.menu a{
  padding: 8px 14px;        /* крупнее “кнопки” */
  border-radius: 999px;
}

.menu a:hover{
  background: rgba(139, 128, 95, 0.12);
  box-shadow: 0 0 0 1px rgba(139, 128, 95, 0.35);
}


.menu a.active{
  background: var(--brand-green);
  color: #FBF6EA;
  font-weight: 650;         /* активный пункт заметнее */
  box-shadow: 0 6px 16px rgba(0,0,0,0.25); /* чуть “дороже” */
}

/* ====== POLISH PACK (NO NEW CONTENT) ====== */

/* Header: плотнее и дороже */
.header{
  background: linear-gradient(180deg, rgba(18,18,18,.96), rgba(12,12,12,.92));
  border-bottom: 1px solid rgba(139,128,95,.55);
}
.nav{
  padding: 10px 0;
  align-items: center;
}
.brand img{
  height: 40px;
  width: auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.35));
}

/* Menu: выразительнее, hover без "рамки" */
.menu{
  font-size: 18px;
  font-weight: 560;
  letter-spacing: .02em;
  gap: 14px;
}
.menu a{
  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);
}
.menu a.active{
  background: rgba(139,128,95,.88);
  color: #1a1a1a;
  font-weight: 650;
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
}

/* Hero: чуть глубже и контрастнее */
.hero{
  padding: 70px 0 52px;
  border-bottom: 1px solid rgba(139,128,95,.45);
}
.hero h1{
  font-size: clamp(34px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: rgba(139,128,95,.95);
  text-shadow: 0 10px 26px rgba(0,0,0,.30);
  margin-bottom: 10px;
}
.hero p,
.events-sub{
  font-size: 18px;
  line-height: 1.5;
  color: rgba(251,246,234,.72);
  max-width: 760px;
}

/* Buttons: премиально, без "input-рамки" */
.btn-row{
  margin-top: 18px;
  gap: 12px;
}
.btn{
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(139,128,95,.22);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
  border-color: rgba(139,128,95,.42);
}
.btn:active{
  transform: translateY(0);
}

/* если есть зелёная кнопка */
.btn-green{
  box-shadow: 0 16px 40px rgba(0,0,0,.20);
}
.btn-green:hover{
  box-shadow: 0 22px 54px rgba(0,0,0,.28);
}

/* Cards: дорогая тень + hover, аккуратнее типографика */
.section{
  padding: 54px 0;
}
.grid{
  gap: 22px;
}
.card{
  border-radius: 22px;
  border: 1px solid rgba(139,128,95,.18);
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
  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{
  border-top: 1px solid rgba(139,128,95,.40);
}
.footer .footer-left,
.footer .footer-right a{
  opacity: .85;
}
.footer .footer-right a:hover{
  opacity: 1;
}


.hero{ padding: 58px 0 40px; }
.section{ padding: 40px 0; }
.events-sub{
  color: rgba(251,246,234,.80);
  max-width: 680px;
}
/* ===== HEADER: brand solid background ===== */
.header{
  background-color: #141414 !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(139,128,95,.45);
}
.header::before,
.header::after{
  display: none !important;
}
/* ===== FIX: header must be solid #141414 (brandbook) ===== */
.header{
  background: #141414 !important;      /* убивает и градиенты и rgba */
  backdrop-filter: none !important;    /* убираем blur */
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;         /* если где-то добавляли тени */
}

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

/* чтобы логотип не “подчернялся” тенями */
.brand img{
  filter: none !important;
}
/* =========================
   INDEX (events-page) POLISH
   ========================= */

/* 1) Чуть меньше пустоты снизу на главной */
.events-page .section{
  padding-top: 40px;
  padding-bottom: 24px;
}

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

.events-page .card{
  min-height: 220px;          /* чтобы карточки выглядели солиднее */
  padding: 32px 34px;         /* чуть дороже по ощущениям */
  border: 1px solid rgba(139,128,95,.18);
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
}

/* Текст на кремовом фоне: чуть контрастнее */
.events-page .card p{
  color: rgba(11,11,11,.82);
}

/* Hover без “рамочки”: мягкая внутренняя подсветка + тень */
.events-page a.card-link{
  position: relative;
}

.events-page a.card-link::after{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(139,128,95,0) inset;
  transition: box-shadow .18s ease;
}

.events-page a.card-link:hover::after{
  box-shadow: 0 0 0 2px rgba(139,128,95,.42) inset;
}

/* 3) Лёгкая полировка заголовков в карточках */
.events-page .card h2{
  font-size: 24px;
  margin-bottom: 10px;
  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 .section { padding-bottom: 24px; }
.events-page main { padding-bottom: 0; }
.events-sub { color: rgba(251,246,234,.82); }
.btn { transition: transform .15s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.events-page a.card-link { position: relative; }
.events-page a.card-link::after{
  content:"";
  position:absolute; inset:0;
  border-radius: 22px;
  pointer-events:none;
  box-shadow: 0 0 0 0 rgba(139,128,95,0) inset;
  transition: box-shadow .18s ease;
}
.events-page a.card-link:hover::after{
  box-shadow: 0 0 0 2px rgba(139,128,95,.40) inset;
}
.nav { padding: 10px 0; align-items: center; }
.brand img { height: 38px; display:block; }
.menu a.active{
  background: rgba(139,128,95,.78);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.events-sub{ color: rgba(251,246,234,.82); }
.btn{ background: rgba(20,20,20,.22); border-color: rgba(139,128,95,.22); }
.btn:hover{ background: rgba(20,20,20,.34); }
.hero{ border-bottom: 1px solid rgba(139,128,95,.55); }
a.card-link{ position:relative; }
a.card-link::after{
  content:""; position:absolute; inset:0; border-radius:22px; pointer-events:none;
  box-shadow: 0 0 0 0 rgba(139,128,95,0) inset;
  transition: box-shadow .18s ease;
}
a.card-link:hover::after{
  box-shadow: 0 0 0 2px rgba(139,128,95,.35) inset;
}

.events-page .section{ padding-bottom: 24px; }
.footer-left, .footer-right a{ font-size: 16px; opacity: .9; }
/* ===== EVENTS: best buttons (primary/secondary) ===== */
.events-page .btn-row{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.events-page .btn-row .btn{
  font-size: 16px;
  font-weight: 650;
  padding: 13px 22px;
  min-height: 46px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  text-align: center;
  border: 1px solid rgba(139,128,95,.55);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

/* Secondary (Прошедшие) — тёмная “ghost” */
.events-page .btn-row .btn-past{
  background: rgba(20,20,20,.32) !important;
  color: #8B805F !important;
  border-color: rgba(139,128,95,.50) !important;
}
.events-page .btn-row .btn-past:hover{
  background: rgba(20,20,20,.50) !important;
  border-color: rgba(139,128,95,.75) !important;
}

/* Primary (Предстоящие) — золото */
.events-page .btn-row .btn-green{
  background: #8B805F !important;
  color: #141414 !important;
  border-color: rgba(139,128,95,.90) !important;
}
.events-page .btn-row .btn-green:hover{
  background: #9A8E6B !important; /* чуть светлее золота */
}

/* общий hover/active */
.events-page .btn-row .btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
}
.events-page .btn-row .btn:active{
  transform: translateY(0);
}

/* аккуратный фокус */
.events-page .btn-row .btn:focus-visible{
  outline: 3px solid rgba(139,128,95,.55);
  outline-offset: 4px;
}
/* === Library cards: premium hover === */
.library-grid{
  gap: 28px; /* чуть больше воздуха */
}

.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;
}
.footer{
  font-size: 14px;
  color: rgba(178,167,138,.9);
}
/* ================================
   LIBRARY (library.html) — polish
   Работает только внутри .library-page
================================== */

.library-page .section{
  padding: 64px 0 72px; /* больше “премиального” воздуха */
}

/* Заголовок и подзаголовок */
.library-page h1{
  text-align:center;
  font-size: 44px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  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;
  font-size: 16px;
  line-height: 1.55;
  opacity: .92;
}

/* Подзаголовок “Разделы библиотеки” + тонкая линия сверху */
.library-page .library-sections-title{
  margin-top: 46px;
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  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,.55); /* золото, но мягко */
}

/* Сетка карточек */
.library-page .library-grid{
  margin-top: 22px;
  gap: 28px; /* больше воздуха */
}

/* Карточки-разделы */
.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, #FBF6EA 0%, #F6EFDF 100%);

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

  /* чтобы текст в карточке был корректно тёмным */
  color: #141414;

  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: #0B0B0B;
}

.library-page .lib-card p{
  font-size: 16px;
  line-height: 1.5;
  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;
  }
}
/* === Library section polish (только для library.html) === */

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

/* Заголовок + подзаголовок (чуть выразительнее) */
.library-page h1{
  font-size: 38px;          /* можно 36–42 на вкус */
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.library-page .library-subtitle{
  font-size: 16px;
  line-height: 1.6;
  opacity: .9;
}

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

.library-page .library-sections-title::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:140px;
  height:1px;
  background: rgba(139,128,95,.35); /* золото, очень мягко */
}

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

/* Карточки: чуть “премиальнее” по пропорциям */
.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 — polish (wow)
   ========================= */

/* Растягиваем две карточки на одинаковую высоту */
.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;
  color: var(--text-dark);
  font-size: 20px;
  line-height: 1.25;
}

.contacts-page .card h3{
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 16px;
  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: #8B805F;
  border-color: #8B805F;
  color: #141414;
}

.btn.btn-gold:hover{
  opacity: 0.95;
  transform: translateY(-1px);
  color: #141414;
}
/* ================================
   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;
}


/* Карточка */
.library-business-page .book-card{
  border-radius: 22px;
  overflow: hidden; /* важно: срежет все углы/артефакты */
  background: linear-gradient(180deg, #FBF6EA 0%, #F6EFDF 100%);
  border: 1px solid rgba(139,128,95,.38);
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none;
  color: inherit;
}

.library-business-page .book-card:hover{
  transform: translateY(-3px);
  border-color: rgba(139,128,95,.80);
  box-shadow: 0 16px 38px rgba(0,0,0,.24);
}

/* Обложка */
.library-business-page .book-cover{
  height: 230px;
  background: linear-gradient(
    180deg,
    rgba(139,128,95,.22) 0%,
    rgba(20,20,20,.06) 55%,
    rgba(251,246,234,.20) 100%
  ); /* плейсхолдер без текста */
}

.library-business-page .book-cover img{
  width: 100%;
  height: 100%;
  display: block;      /* убирает “щели” и лишние линии */
  object-fit: cover;
}

/* Если картинка битая — прячем img, остаётся красивый фон .book-cover */
.library-business-page .book-cover img.is-broken{
  display: none;
}

/* Текстовая часть */
.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,#8B805F,#FBF6EA);
}

.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,#8B805F,#FBF6EA);
}


.img-missing{
  background: linear-gradient(180deg, rgba(139,128,95,.22), rgba(20,20,20,.06));
}
/* Плавный переход по якорям */
html { scroll-behavior: smooth; }

/* Чтобы при переходе заголовок не прятался под верхним меню */
html { 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 #8B805F;
  color: #8B805F;
  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{
  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{
  position: relative;
  z-index: 1;
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.35));
}
.book{
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
}

.book:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0,0,0,.24);
}
/* ===== обложка целиком + размытый фон ===== */
.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,#8B805F,#FBF6EA);
}

/* если 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) ===== */
.library-fiction-page .book-ph{
  position:relative;
  overflow:hidden;
  background: linear-gradient(180deg,#8B805F,#FBF6EA); /* fallback */
}

.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;
  padding:10px;
  box-sizing:border-box;
  display:block;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.28));
}
/* ===== Художественная литература: фон из обложки (covers.js ставит --cover) ===== */
.library-fiction-page .book-ph{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,#8B805F,#FBF6EA); /* fallback */
}

.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;
  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{ 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,#8B805F,#FBF6EA);
}
/* Кнопка "Вернуться ко всем разделам" — всегда видимая */
.back-to-library,
.back-to-library:visited{
  color: #FBF6EA !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{
  display: none;            /* СКРЫТО по умолчанию */
}

.event-detail:target{
  display: block;           /* показываем только выбранный якорь */
  position: fixed;
  inset: 0;
  z-index: 9999;

  overflow: auto;
  padding: 28px 0;

  background: rgba(0,0,0,.55); /* затемнение */
  backdrop-filter: blur(2px);
}

/* белая “карточка-модалка” внутри оверлея */
.event-detail:target > .event-detail-inner{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  background: #FBF6EA;
  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);
}

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

/* кнопка закрыть */
.event-close{
  position: sticky;
  top: 0;
  margin-left: auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  border-radius: 999px;

  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  color: #0B0B0B;

  background: rgba(139,128,95,0.12);
  border: 1px solid rgba(139,128,95,0.35);
}
.event-close:hover{
  background: rgba(139,128,95,0.20);
}
/* ===== Upcoming events: детали только по клику (modal через :target) ===== */

.event-detail{ display:none; }

.event-detail:target{
  display:block;
  position:fixed;
  inset:0;
  z-index:9999;

  overflow:auto;
  padding:28px 0;

  background:rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}

.event-detail:target > .event-detail-inner{
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
  background:#FBF6EA;
  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);
}

.event-close{
  position: sticky;
  top: 0;
  margin-left: auto;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:42px;
  height:42px;
  border-radius:999px;

  text-decoration:none;
  font-size:24px;
  line-height:1;
  color:#0B0B0B;

  background:rgba(139,128,95,0.12);
  border:1px solid rgba(139,128,95,0.35);
}
.event-close:hover{ background:rgba(139,128,95,0.20); }
/* ===== Upcoming events modal (через :target) ===== */

.event-detail{ display:none; }

.event-detail:target{
  display:flex;
  align-items:center;
  justify-content:center;

  position:fixed;
  inset:0;
  z-index:9999;

  padding:24px;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}

/* клик по затемнению закрывает */
.event-backdrop{
  position:fixed;
  inset:0;
  z-index:0;
}

/* белая карточка */
.event-detail:target > .event-detail-inner{
  position:relative;
  z-index:1;

  width:min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow:auto;

  background:#FBF6EA;
  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);
}

/* крестик справа сверху */
.event-close{
  position:absolute;
  top:14px;
  right:14px;

  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:#0B0B0B;
  background:rgba(139,128,95,0.12);
  border:1px solid rgba(139,128,95,0.35);
}
.event-close:hover{ background:rgba(139,128,95,0.20); }

/* сетка внутри модалки (картинка + текст) */
.event-detail-grid{
  display:grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap:24px;
  align-items:start;
}

/* картинка */
.event-detail-media img{
  width:100%;
  height:auto;
  border-radius:16px;
  display:block;
}

/* адаптация */
@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);
  backdrop-filter: blur(2px);
}

.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);
}

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

.consent-body{
  padding: 20px 22px 18px;
}

.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-link{
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.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-declined-note{
  margin: 14px auto;
  max-width: 1100px;
  width: calc(100% - 28px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(183,155,98,0.18);
  border: 1px solid rgba(183,155,98,0.30);
  color: rgba(255,255,255,0.9);
}

/* ===== Terms actions ===== */
.terms-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  margin: 14px 0 8px;
}
.terms-hint{
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(15,23,42,0.72);
}

/* =========================
   Прошедшие мероприятия: видео и выбор качества
   ========================= */
.event-detail-media .event-media-frame{
  position:relative;
  width:100%;
  height: clamp(220px, 30vw, 340px);
  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);
}

.event-detail-media .event-media-frame video.event-video{
  width:100% !important;
  height:100% !important;
  display:block;
  object-fit:contain;
  background:#000;
}

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

.event-quality-wrap{
  position:absolute;
  top:10px;
  z-index:5;
  pointer-events:auto;
right:10px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.80);
  backdrop-filter: blur(6px);
  box-shadow:0 6px 16px rgba(0,0,0,0.18);
}

.event-quality-label{
  font-size:12px;
  font-weight:600;
  color:#0B0B0B;
  white-space:nowrap;
}

.event-quality-select{
  font-size:12px;
  border:1px solid rgba(139,128,95,0.35);
  border-radius:999px;
  padding:4px 10px;
  background:transparent;
  color:#0B0B0B;
  outline:none;
}

.event-quality-select:disabled{
  opacity:0.65;
  cursor:not-allowed;
}

/* Fix: не даём видео/грид-элементам раздувать модалку по ширине */
.event-detail-media,
.event-detail-text{
  min-width: 0;
}
.event-detail:target > .event-detail-inner{
  overflow-x: hidden;
}

/* =========================
   Video modal sizing FIX (override - keep at end)
   Makes video block behave like image block in event modals
   ========================= */
.event-detail-grid{
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.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%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 24px rgba(15,23,42,0.18);
}

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

/* quality selector must stay as overlay on video */
.event-quality-wrap{
  position: absolute !important;
  top: 10px;
  right: 10px;
  z-index: 5;
}

/* 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: terms inside modal
   ========================= */

/* чтобы модалка не вылезала за экран при длинном тексте */
.consent-modal{
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}
.consent-body{
  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;
}


/* =========================
   Past events: video player modes
   ========================= */

/* If something left from old "quality" switcher — hide it */
.event-quality-wrap,
.event-quality-label,
.event-quality-select{
  display:none !important;
}

/* Player mode selector under page title */
.events-player-pref{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 10px 0 18px;
}
.events-player-pref-label{
  font-weight: 600;
  color: rgba(255,255,255,0.90);
}
.events-player-pref-select{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  outline: none;
}

/* Custom controls */
.evp-frame{
  position: relative; /* for overlay controls */
}

.evp-ui{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
  border-radius: 16px;
  pointer-events: auto;
}

.evp-btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.28);
  color: rgba(255,255,255,0.95);
  border-radius: 10px;
  width: 38px;
  height: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.evp-btn:hover{
  background: rgba(0,0,0,0.40);
}

.evp-time{
  font-size: 12px;
  color: rgba(255,255,255,0.90);
  white-space: nowrap;
  min-width: 92px;
  text-align:center;
}

.evp-seek{
  flex: 1 1 auto;
  min-width: 140px;
}

.evp-vol{
  width: 110px;
}

/* Slightly improve range look on dark background */
.evp-ui input[type="range"]{
  accent-color: rgba(189,158,92,0.95);
}

/* Theater mode: make modal a bit wider */
body.events-player-theater .event-detail:target > .event-detail-inner{
  width: min(1400px, calc(100% - 32px));
}
body.events-player-theater .event-detail-grid{
  grid-template-columns: 1.35fr 0.65fr;
}


/* ====== FIX: Даты/время в модалке прошедших мероприятий ====== */
/* делаем цвет спокойнее, шрифт компактнее, а разделитель — на всю высоту списка дат */
.event-dates{
  display:grid;
  grid-template-columns: 1fr 96px;
  gap:8px;
  align-items:stretch; /* ключевое: растягивает колонку времени по высоте */
  margin-top:8px;
}

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

.event-dates-time{
  display:flex;                 /* чтобы время было сверху */
  justify-content:flex-start;
  align-items:flex-start;
  text-align:left;

  font-family:'Manrope', sans-serif;
  font-size:16px;
  line-height:1.35;
  font-weight:700;
  color:#556044;

  padding-left:10px;
  border-left:2px solid rgba(139,128,95,0.35); /* линия на всю высоту */
}

/* адаптив: на узких экранах время уходит вниз, линию убираем */
@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{
  grid-template-columns: 1fr 72px; /* было 96px */
  gap:4px;                         /* было 8px */
  align-items:stretch;             /* чтобы колонка времени растянулась и линия была на всю высоту */
}

.event-dates-time{
  align-self: stretch;
  display:flex;
  justify-content:flex-start;      /* ближе к линии */
  align-items:center;              /* ВРЕМЯ по центру линии по высоте */
  padding-left:6px;                /* было 10px */
}



/* === v4: move vertical line left, keep time where it is === */
.event-dates-time{
  border-left: 0 !important;   /* убираем линию как border */
  position: relative;
  /* padding-left оставляем как есть, чтобы время не уехало */
}

.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; }
}
