:root {
  --bg: #0f1217;
  --panel: #151a22;
  --text: #e9eef5;
  --muted: #a8b0bd;
  --accent: #e74c3c;
  --accent-2: #f1c40f;
  --border: #2a3140;
  --focus: #2ecc71;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
a:focus, button:focus, input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

body {
  margin: 0;
  padding: 0;
/*  background-image: url('images/bg.jpg');  путь к  картинке */
  background-size: cover;       /* растягиваем с сохранением пропорций */
  background-position: center;  /* центрируем */
  background-repeat: no-repeat; /* не повторяем */
  background-attachment: fixed; /* эффект параллакса на десктопах */
  color: #fff;                   /* белый текст для контраста */
  background: rgba(15,18,23,.9);
}

h3 {
  margin: 0;
  font-size: inherit;
}
.videobtn {
position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 1em;
  color: #fdfdfd;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f60;
}
.videobtn:hover {
background: #c33;
}




/* Затемнение для читаемости текста */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); /* полупрозрачный чёрный слой */
  z-index: -1;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll; /* убираем fixed на мобильных */
    background-image: url('images/bg-mobile.jpg'); /* облегчённая версия */
  }
}

#main {
background-color: #0f1217;
  color: #fff;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
    margin-top: 0px;
    margin-bottom: 0px;
/*  border-radius: 8px;
  margin-top: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border); */
  border-left: 1px solid var(--border); 
  border-right: 1px solid var(--border);
}


.site-header { padding: 16px 24px; display: flex; gap: 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(15,18,23,.9); backdrop-filter: blur(8px); z-index: 11; }
.brand h1 { margin: 0; font-size: 23px; }
.brand img {
position: relative;
  float: left;
  height: 20%;
  width: 20%;
  margin-right: 20px;
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.main-nav ul { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.lang-switch button { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; }
.lang-switch button[aria-pressed="true"] { background: var(--panel); border-color: var(--accent-2); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: #fff; color: #000; padding: 8px; border-radius: 6px; }

.section { padding: 20px 24px; max-width: 1200px; margin: 0 auto;  scroll-margin-top: 125px;}
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 24px; max-width: 1200px; margin: 0 auto; align-items: center; position: absolute; }
.hero-stats { display: grid; gap: 12px; background: var(--panel); padding: 16px; border-radius: 12px; border: 1px solid var(--border); }
.hero-stats div { display: flex; align-items: baseline; gap: 12px; }
.hero-stats strong { font-size: 28px; color: var(--accent-2); }

.btn { background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 8px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: #c44134; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.map { height: 480px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; z-index: 8;}
.map-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.map-sidebar { margin-top: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; } 

.timeline-controls { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.timeline-item { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.timeline-item time { color: var(--accent-2); font-weight: 600; }

.voices-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.voice-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; position: relative; min-height: 165px; }
dialog { border: none; border-radius: 12px; width: min(700px, 96vw); color:white; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog article { background: var(--panel); border: 1px solid var(--border); padding: 16px; border-radius: 12px; }
.close { float: right; background: transparent; border: none; color: var(--text); font-size: 24px; cursor: pointer; margin-top: -10px;}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.archive-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.archive-item figure { margin: 0; }
.archive-item figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

/* скрытые элементы */
.archive-item.hidden {
  display: none;
}

/* кнопка */
.archive-toggle-btn {
  margin-top: 15px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.archive-toggle-btn:hover {
  background: var(--border);
}






.quiz-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-width: 720px; }
.quiz-question { font-size: 18px; margin-bottom: 12px; }
.quiz-answers { display: grid; gap: 8px; }
.quiz-answers button { text-align: left; }
.quiz-progress { margin-top: 8px; color: var(--muted); }


.wall-list { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wall-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }

.site-footer { padding: 24px; color: var(--muted); border-top: 1px solid var(--border); text-align: center; background: rgba(15,18,23,.9); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
}



.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
}






button {
  margin: 5px 0;
  padding: 6px 12px;
  background: #c33;
  color: #fff;
  border: none;
  border-radius: 4px;
}

/*
button:hover {
  background: #e44;
}
*/



.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-header h3 {
  margin: 0;
  flex: 1;
}

/* Стрелка */
.arrow {
  transition: transform 0.3s ease;
  font-size: 1.2em;
}

/* В свернутом виде стрелка направо */
.post-card.collapsed .arrow {
  transform: rotate(0deg);
}



.post-photo {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 10px;
}

.post-text {
  width: 100%;
  background: rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 6px;
  color: #eee;
}


/* Форма */
.wall-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.wall-form input,
.wall-form textarea {
  width: 100%;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
  color: #ffa500;
  font-size: 1em;
  outline: none;
}
.wall-form textarea {
  height: 260px;
  resize: vertical;
}
.explore-btn {
  background: linear-gradient(90deg, #ff7b00, #ffae00);
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 25px;
  padding: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.explore-btn:hover {
  transform: translateY(-2px);
/*  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4); */
}

/* Миниатюры */
.post-card {
 background: var(--panel);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
  position: relative;
  min-height: 180px;
  border: 1px solid var(--border);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(128, 128, 128, 0.4);
}
/* 
.post-photo-thumb {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  margin-bottom: 8px;
}
*/
.post-photo-thumb {
  max-width: 100%;
  max-height: 150px;
  border-radius: 6px;
  margin: 0 auto 8px; /* сверху/снизу 0 и 8px, по бокам auto */
  display: block;     /* чтобы margin auto сработал */
}

.post-date {
  font-size: 0.9em;
  color: #ccc;
}
.post-title {
  margin: 8px 0;
  font-size: 1.2em;
  color: #ffa500;
}
.post-preview {
  margin-top: 6px;
  font-size: 0.95em;
  color: #ddd;
  line-height: 1.4;
  white-space: pre-wrap;   /* ✅ сохраняем форматирование */
}
.read-more {
position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.75em;
  color: #fff;
  background: #222;
  padding: 3px 7px;
  border-radius: 3px;
}

/* Раскрытый пост */
.overlay {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.8);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.overlay.hidden {
  display: none;
}
.expanded-post {
  max-width: 60%;
  max-height: 90vh;
  background: #222;
  color: #ffa500;
  padding: 20px;
  border-radius: 12px;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.expanded-photo {
  width: 100%;
  max-height: 440px;   
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 15px;
}
.expanded-text {
  width: 100%;
  max-height: none;
  overflow-y: visible;
  background: rgba(255,255,255,0.05);
  padding: 12px;
  border-radius: 6px;
  color: #eee;
  margin-bottom: 10px;
  white-space: pre-wrap;   /* ✅ сохраняем форматирование */
}
.post-author {
  margin: 4px 0 10px;
  font-size: 0.95em;
  color: #ccc;
}
/*
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c33;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 28px;
  text-align: center;
}

.close-btn:hover {
  background: #e44;
}
*/
/* Toast */
#toast {
  visibility: hidden;
  min-width: 200px;
  margin-left: -100px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 12px;
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 30px;
  font-size: 14px;
}
#toast.show {
  visibility: visible;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}
@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}

.hidden {
  display: none;
}

.wall-description,
.wall-instructions,
.wall-note {
  margin-bottom: 15px;
}

.overlay-content {
  max-width: 90%;
  max-height: 90%;
  background: #111;
  padding: 10px;
  border-radius: 8px;
  overflow: auto;
  text-align: center;
}
.overlay-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  max-height: 740px;
}
.overlay-content figcaption {
  margin-top: 10px;
  color: #eee;
  font-size: 16px;
}
.close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 32px;
  background: none;
  color: #fff;
  cursor: pointer;
}
.close-btn:hover {
  color: #f66;
}

.map-overlay-bar {
  position: absolute;
  bottom: 0;
  right: 0;
width: 100%;
  height: 20px;
  background: black;
  z-index: 9999;
  pointer-events: none; /* чтобы не мешала кликам по карте */
  text-align: center;
  color: slategray;
}
.range-wrapper {
  width: 100%; /* контейнер растягивается */
  max-width: 400px; /* можно ограничить ширину */
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 6px 2px; /* отступ снизу, чтобы не прилипало к ползунку */
  font-size: 12px;
  color: var(--muted, #ccc);
}

.range-labels span {
  flex: 0 0 auto;
 /* width: 1px;  чтобы текст не растягивался */
  text-align: center;
}



.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 612 / 122;
  min-width: 612px;
  border-bottom: 1px solid var(--border);
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: white;
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,1) 100%);
}

.video-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.45) 1px, transparent 1px);
  background-size: 3px 3px;
  z-index: 0; /* ниже overlay-content */
  pointer-events: none;
}

.overlay-content {
  position: relative;
  z-index: 1; /* выше точек */
  text-align: center;
}






#mapSearch {
  background-color: #2c2c2c;
  border: 2px solid orange;
  color: orange;
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
}

fieldset {
  border: none;
}

.map-sidebar {
  max-height: 1200px;
}
.map-sidebar figure {
  margin: 12px 0;
}
.map-sidebar img {
  max-width: 100%;
  border-radius: 6px;
}



.map-sidebar .media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.map-sidebar figure {
  margin: 0;
}

.map-sidebar img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.map-sidebar figcaption {
  font-size: 0.9em;
  color: #555;
  margin-top: 6px;
}

.map-sidebar p {
  white-space: pre-wrap; /* сохраняет переносы и пробелы */
}








.map-sidebar {
  max-height: 1200px;
  display: none; /* скрыт по умолчанию */
  overflow-y: auto;       /* вертикальный скролл */
  scrollbar-width: thin;  /* тонкий скролл в Firefox */
  scrollbar-color: #ff6600 #e0e0e0; /* цвет ползунка и трека */
  scroll-margin-top: 125px; /* высота  header */
}

.map-sidebar::-webkit-scrollbar {
  width: 8px;
}

.map-sidebar::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.map-sidebar::-webkit-scrollbar-thumb {
  background-color: #ff6600;
  border-radius: 4px;
}

.map-sidebar.active {
  display: block; /* показывается при активации */
}

.map-sidebar .hide-btn {
  position: sticky;
  top: 0;
  right: 0;
  background: #ff6600;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
}

#sidebarToggle {
  display: block;
  margin: 10px auto;
  padding: 8px 16px;
  background: #ff6600;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: none;
}


#leafletMap {
  width: 100%;
  height: 700px; /* задай нужную высоту, например 600px */
  transition: all 0.4s ease-in-out;
}


a:hover {
color: #c44134;
}


body {
  position: relative; /* создаём контекст */
/*  background: rgba(15,18,23,.9); */
  background-image: url('/images/pattern.png');
}

/* фон */
.footer-bg {
  position: absolute;
  bottom: 138px;
  left: 0;
  width: 100%;
  height: 170vh; /* высота баннера */
  background: url('images/bg.png') center/cover no-repeat;
  z-index: -2; /* слой ниже */
  opacity: 0.7;
}

/* контент и футер всегда выше */
main,
.site-footer {
  position: relative;

}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}



.voice-card.hidden {
  display: none;
}
.voices-actions {
  margin-top: 16px;
  text-align: center;
}











.place-block {
  margin-bottom: 32px;
}

.place-title {
  font-weight: bold;
  font-size: 1.3em;
  margin: 12px 0;
}

.slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.place-voices.slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 0;
}

.place-voices::-webkit-scrollbar {
  display: none; /* убираем скроллбар */
}

.voice-card {
  flex: 0 0 260px; /* фиксированная ширина карточки */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.slider-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
  text-align: center;
  z-index: 1;
}

.slider-btn.prev {
  margin-right: 8px;
}

.slider-btn.next {
  margin-left: 8px;
}







/* Адаптация .hero */
.hero {
  position: relative; /* заменяем absolute */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 40px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .hero-stats {
    grid-template-columns: 1fr;
    padding: 12px;
    overflow-wrap: break-word;
    margin-top: 12px;
  }
}

/* Адаптация .site-header */
@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .main-nav ul {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand img {
    width: 60px;
    height: auto;
    margin-right: 12px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
  }
}



/* Общая адаптация для контейнеров */
@media (max-width: 768px) {
  .section,
  #main {
    padding: 12px;
  }

  .map-toolbar,
  .timeline-controls,
  .voices-list,
  .archive-grid,
  .wall-list,
  .posts-grid {
    grid-template-columns: 1fr !important;
  }

  .quiz-card,
  .timeline-item,
  .voice-card,
  .wall-card,
  .post-card,
  .expanded-post {
    max-width: 100%;
    width: 100%;
  }

  .expanded-post {
    max-width: 95%;
    margin: auto;
  }

  .slider-wrapper {
    flex-direction: column;
  }

  .slider-btn {
    margin: 8px 0;
  }

  .btn,
  .lang-switch button,
  .archive-toggle-btn {
    font-size: 14px;
    padding: 6px 10px;
  }
}

/* Адаптация шрифта и элементов на очень узких экранах */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  .brand h1 {
    font-size: 18px;
  }

  .btn,
  .lang-switch button,
  .archive-toggle-btn {
    font-size: 13px;
    padding: 5px 8px;
  }

  .site-header {
    gap: 6px;
  }
}

@media (max-width: 768px) {
  /* Убрать video-strip */
  .video-strip {
    display: none !important;
  }

  /* Уменьшить высоту шапки */
  .site-header {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .subtitle {
    font-size: 12px;
  }


  /* Исправление для input#yearRange */
  #yearRange {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  .range-wrapper {
    width: 100%;
    max-width: 100%;
  }
}


@media (max-width: 768px) {
  .main-nav a {
    font-size: 14px;
    padding: 4px 6px;
    white-space: nowrap; /* запрет на перенос строк */
  }

  .main-nav ul {
    gap: 8px;
    flex-wrap: wrap; /* чтобы текст не вылазил за пределы */
  }
}

#vk_comments {
  background: #1a212b;   /* тёмный фон контейнера */
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}





