/* Стабилизация сетки картинок */
#grid {
    /* Резервируем минимальное пространство под галерею, 
       чтобы подвал сайта и нижние блоки не прыгали вверх-вниз при загрузке */
    min-height: 500px; 
    
    /* Сообщаем браузеру, что контент внутри сетки не должен влиять на размеры внешних блоков */
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}




/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */

.pswp {
  --pswp-bg: #121212;
  --pswp-placeholder-bg: #222;
  --pswp-root-z-index: 100000;
  --pswp-preloader-color: rgba(79, 79, 79, 0.4);
  --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9);
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: #4f4f4f;
  --pswp-icon-stroke-color: #4f4f4f;
  --pswp-icon-stroke-width: 2px;
  --pswp-error-text-color: var(--pswp-icon-color);
}

/* ============================================================
   БАЗОВАЯ ФУНКЦИОНАЛЬНОСТЬ (слайды, переходы)
   ============================================================ */

.pswp {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--pswp-root-z-index);
  display: none;
  touch-action: none;
  outline: 0;
  opacity: 0.003;
  contain: layout style size;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.pswp:focus {
  outline: 0;
}

.pswp * {
  box-sizing: border-box;
}

.pswp img {
  max-width: none;
}

.pswp--open {
  display: block;
}

.pswp,
.pswp__bg {
  transform: translateZ(0);
  will-change: opacity;
}

.pswp__bg {
  opacity: 0.005;
  background: var(--pswp-bg);
}

.pswp,
.pswp__scroll-wrap {
  overflow: hidden;
}

.pswp__scroll-wrap,
.pswp__bg,
.pswp__container,
.pswp__item,
.pswp__content,
.pswp__img,
.pswp__zoom-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pswp__img,
.pswp__zoom-wrap {
  width: auto;
  height: auto;
}

.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img {
  cursor: -webkit-zoom-in;
  cursor: -moz-zoom-in;
  cursor: zoom-in;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img {
  cursor: move;
  cursor: -webkit-grab;
  cursor: -moz-grab;
  cursor: grab;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active {
  cursor: -webkit-grabbing;
  cursor: -moz-grabbing;
  cursor: grabbing;
}

.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,
.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,
.pswp__img {
  cursor: -webkit-zoom-out;
  cursor: -moz-zoom-out;
  cursor: zoom-out;
}

.pswp__container,
.pswp__img,
.pswp__button,
.pswp__counter {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.pswp__item {
  z-index: 1;
  overflow: hidden;
}

.pswp__hidden {
  display: none !important;
}

.pswp__content {
  pointer-events: none;
}

.pswp__content > * {
  pointer-events: auto;
}

/* ============================================================
   UI – ОБЩИЕ ЭЛЕМЕНТЫ
   ============================================================ */

.pswp__error-msg-container {
  display: grid;
}

.pswp__error-msg {
  margin: auto;
  font-size: 1em;
  line-height: 1;
  color: var(--pswp-error-text-color);
}

.pswp .pswp__hide-on-close {
  opacity: 0.005;
  will-change: opacity;
  transition: opacity var(--pswp-transition-duration) cubic-bezier(0.4, 0, 0.22, 1);
  z-index: 10;
  pointer-events: none;
}

.pswp--ui-visible .pswp__hide-on-close {
  opacity: 1;
  pointer-events: auto;
}

.pswp__button {
  position: relative;
  display: block;
  width: 50px;
  height: 60px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
  border: 0;
  box-shadow: none;
  opacity: 0.85;
  -webkit-appearance: none;
  -webkit-touch-callout: none;
}

.pswp__button:hover,
.pswp__button:active,
.pswp__button:focus {
  transition: none;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  opacity: 1;
}

.pswp__button:disabled {
  opacity: 0.3;
  cursor: auto;
}

.pswp__icn {
  fill: var(--pswp-icon-color);
  color: var(--pswp-icon-color-secondary);
  position: absolute;
  top: 14px;
  left: 9px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  pointer-events: none;
}

.pswp__icn-shadow {
  stroke: var(--pswp-icon-stroke-color);
  stroke-width: var(--pswp-icon-stroke-width);
  fill: none;
}

.pswp__icn:focus {
  outline: 0;
}

div.pswp__img--placeholder,
.pswp__img--with-bg {
  background: var(--pswp-placeholder-bg);
}

.pswp__top-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  z-index: 10;
  pointer-events: none !important;
}

.pswp__top-bar > * {
  pointer-events: auto;
  will-change: opacity;
}

/* ============================================================
   КНОПКА ЗАКРЫТИЯ
   ============================================================ */

.pswp__button--close {
  margin-right: 6px;
}

/* ============================================================
   СТРЕЛКИ НАВИГАЦИИ
   ============================================================ */

.pswp__button--arrow {
  position: absolute;
  top: 50%;
  width: 75px;
  height: 100px;
  margin-top: -50px;
}

.pswp__button--arrow:disabled {
  display: none;
  cursor: default;
}

.pswp__button--arrow .pswp__icn {
  top: 50%;
  margin-top: -30px;
  width: 60px;
  height: 60px;
  background: none;
  border-radius: 0;
}

.pswp--one-slide .pswp__button--arrow {
  display: none;
}

.pswp--touch .pswp__button--arrow {
  visibility: hidden;
}

.pswp--has_mouse .pswp__button--arrow {
  visibility: visible;
}

.pswp__button--arrow--prev {
  right: auto;
  left: 0;
}

.pswp__button--arrow--next {
  right: 0;
}

.pswp__button--arrow--next .pswp__icn {
  left: auto;
  right: 14px;
  transform: scale(-1, 1);
}

/* ============================================================
   КНОПКА ЗУМА
   ============================================================ */

.pswp__button--zoom {
  display: none;
}

.pswp--zoom-allowed .pswp__button--zoom {
  display: block;
}

.pswp--zoomed-in .pswp__zoom-icn-bar-v {
  display: none;
}

/* ============================================================
   ИНДИКАТОР ЗАГРУЗКИ
   ============================================================ */

.pswp__preloader {
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 60px;
  margin-right: auto;
}

.pswp__preloader .pswp__icn {
  opacity: 0;
  transition: opacity 0.2s linear;
  animation: pswp-clockwise 600ms linear infinite;
}

.pswp__preloader--active .pswp__icn {
  opacity: 0.85;
}

@keyframes pswp-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================
   СЧЁТЧИК
   ============================================================ */

.pswp__counter {
  height: 30px;
  margin-top: 15px;
  margin-inline-start: 20px;
  font-size: 14px;
  line-height: 30px;
  color: var(--pswp-icon-color);
  text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
  opacity: 0.85;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

.pswp--one-slide .pswp__counter {
  display: none;
}

/* ============================================================
   EXIF-ПОДПИСЬ В PHOTOSWIPE (объединено)
   ============================================================ */

.pswp .lg-sub-html {
  font-family: system-ui, -apple-system, sans-serif;
  padding: 12px 25px;
  text-align: right;
  position: absolute;
  bottom: 0;
  right: 0;
  left: auto;
  box-sizing: border-box;
  z-index: 9999;
  background: rgba(33, 37, 41, 0.75);
  border-top-left-radius: 4px;
}

.pswp .lg-sub-html h4 {
  margin: 0;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  line-height: 1.4;
}

.pswp .lg-sub-html p {
  font-size: 12px;
  margin: 4px 0 0 0;
  color: #999;
  line-height: 1.4;
}

/* ============================================================
   ШРИФТ
   ============================================================ */

@font-face {
  font-family: 'lg';
  src: url("../fonts/lg.woff2?io9a6k") format("woff2"),
       url("../fonts/lg.ttf?io9a6k") format("truetype"),
       url("../fonts/lg.woff?io9a6k") format("woff"),
       url("../fonts/lg.svg?io9a6k#lg") format("svg");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* ============================================================
   1. СЕТКА ГАЛЕРЕИ (#grid) И КАРТОЧКИ
   ============================================================ */

#grid {
  margin: 25px 1em 1em 1em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.grid-item {
  height: 240px;
  flex-grow: calc(var(--aspect-ratio));
  flex-shrink: 1;
  flex-basis: calc(255px * var(--aspect-ratio));
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
  transition: none;
  border: none;
  box-shadow: none;
  contain: paint;
}

#grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  position: static;
}

@media (max-width: 480px) {
    #grid img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; 
        display: block !important;
    }
}

#grid {
  margin: 25px 1em 1em 1em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.grid-item {
	  overflow: hidden;
  box-sizing: border-box;
}

#grid .grid-item img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  
  /* КРИТИЧЕСКИЙ ФИКС: Заставляем фото заполнять всю выделенную 
     скриптом рамку ячейки без пустых щелей и растягивания пропорций */
  object-fit: cover !important;
  object-position: top !important;
  
  display: block !important;
  position: static !important;
}

/* ============================================================
   3. МОБИЛЬНАЯ ВЕРСИЯ (.mobile.portrait)
   ============================================================ */

.mobile.portrait #grid {
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  margin: 6px !important;
  border-radius: 0 !important;
  border-top: none !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-auto-rows: 2px !important;
  gap: 0 6px !important;
}

.mobile.portrait .grid-item {
  border: none !important;
  box-shadow: none !important;
  contain: none !important;
  margin-right: 0 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  flex: none !important;
  max-width: 100% !important;
  margin-bottom: 6px !important;
  aspect-ratio: auto !important;
  transform: none !important;
  border-radius: 0 !important;
}

.mobile.portrait #grid img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.mobile.portrait .grid-item:hover img {
  transform: none !important;
}

.mobile.portrait .pswp .lg-sub-html {
  left: 0 !important;
  right: 0 !important;
  text-align: center !important;
  border-top-left-radius: 0 !important;
  padding: 10px 15px !important;
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  will-change: height;
}

.mobile.portrait header.festheader {
  height: auto !important;
  position: relative !important;
  padding-bottom: 20px;
  text-align: center;
  padding-top: 20px;
}

.mobile.portrait header.festheader h1 {
  display: inline-block;
}

.mobile.portrait .header-download-archive {
  display: flex !important;
  flex-flow: column !important;
  align-items: center !important;
  align-content: center !important;
  width: 100%;
}

.header-download-archive a {
  color: #ffffff;
  text-decoration: none;
}

.header-download-archive span {
  color: #ffffff;
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  
  will-change: height;
  
  /* Для плавного уменьшения через JS */
  height: calc(500px - (500px - 75px) * var(--header-progress, 0));
  
  background-image: linear-gradient(
    to left, 
    rgba(14, 20, 37, calc(0.7 + var(--header-progress, 0) * 0.25)), 
    rgba(46, 51, 66, calc(0.7 + var(--header-progress, 0) * 0.25))
  );
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  
  will-change: height;
  
  /* Для плавного уменьшения через JS */
  height: calc(500px - (500px - 75px) * var(--header-progress, 0));
  
  background-image: linear-gradient(
    to left, 
    rgba(14, 20, 37, calc(0.7 + var(--header-progress, 0) * 0.25)), 
    rgba(46, 51, 66, calc(0.7 + var(--header-progress, 0) * 0.25))
  );
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  
  will-change: height;
  
  /* Для плавного уменьшения через JS */
  height: calc(500px - (500px - 75px) * var(--header-progress, 0));
  
  background-image: linear-gradient(
    to left, 
    rgba(14, 20, 37, calc(0.7 + var(--header-progress, 0) * 0.25)), 
    rgba(46, 51, 66, calc(0.7 + var(--header-progress, 0) * 0.25))
  );
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  
  will-change: height;
  
  /* Для плавного уменьшения через JS */
  height: calc(500px - (500px - 75px) * var(--header-progress, 0));
  
  background-image: linear-gradient(
    to left, 
    rgba(14, 20, 37, calc(0.7 + var(--header-progress, 0) * 0.25)), 
    rgba(46, 51, 66, calc(0.7 + var(--header-progress, 0) * 0.25))
  );
  
  /* Чтобы содержимое не перекрывалось */
  overflow: visible !important;
}

/* ============================================================
   4. ШАПКА (header)
   ============================================================ */

header.festheader {
  width: 100%;
  box-sizing: border-box;
  height: 500px;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 9;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  font-family: agenfbcyr, "Avenir Next", Avenir, 'Helvetica Neue', 'Lato', 'Segoe UI', Helvetica, Arial, sans-serif;
  flex-direction: column;
  justify-content: center;
  padding: 0 7px;
  
  will-change: height;
  
  /* Для плавного уменьшения через JS */
  height: calc(500px - (500px - 75px) * var(--header-progress, 0));
  
  background-image: linear-gradient(
    to left, 
    rgba(14, 20, 37, calc(0.7 + var(--header-progress, 0) * 0.25)), 
    rgba(46, 51, 66, calc(0.7 + var(--header-progress, 0) * 0.25))
  );
  
  overflow: visible !important;
}

/* ============================================================
   ТЕКСТОВЫЕ БЛОКИ
   ============================================================ */

.headerdatacontainer {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.headertitlefest,
.headerdatafest,
.headerplacefest {
  align-self: center;
  color: rgba(255, 255, 255, 1);
  margin: 0;
  padding: 3px;
  text-align: center;
  font-weight: normal;
  z-index: 10;
  position: relative;
  pointer-events: auto;
}

.headertitlefest {
  font-size: 6vw;
  position: relative;
  transition: font-size 0.3s ease;
  pointer-events: auto;
}

.headertitlefest:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 1);
  z-index: 9999;
  pointer-events: none;
}

.headerplacefest {
  font-size: 1em;
  pointer-events: auto;
}

.headerdatafest {
  font-size: 1.5em;
  pointer-events: auto;
}

/* ============================================================
   КНОПКИ СКАЧИВАНИЯ
   ============================================================ */

.header-download-archive {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  display: flex;
  flex-direction: row;
  gap: 15px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.header-download-archive a {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 21;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
}

/* Анимация при наведении - только фон и граница */
.header-download-archive a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

.header-download-archive a:active {
  transform: scale(0.98);
}

.header-download-archive span {
  color: #ffffff;
  pointer-events: auto;
}

/* ============================================================
   КЛАСС .SMALLER (уменьшенная шапка)
   ============================================================ */

html:not(.mobile) header.festheader.smaller {
  height: 75px;
}

html:not(.mobile) header.smaller .headertitlefest,
html:not(.mobile) header.smaller .headerdatafest,
html:not(.mobile) header.smaller .headerplacefest {
  align-self: flex-end;
}

html:not(.mobile) header.smaller .headertitlefest {
  font-size: 34px;
}

html:not(.mobile) header.smaller .headerdatafest {
  font-size: 17px;
}

html:not(.mobile) header.smaller .headerplacefest {
  font-size: 17px;
}

html:not(.mobile) header.smaller .headerdatacontainer {
  flex-direction: row;
  align-self: flex-end;
}

/* ============================================================
   КЛАСС .SCROLLED (для JS анимации)
   ============================================================ */

html:not(.mobile) header.festheader.scrolled {
  height: 75px !important;
}

html:not(.mobile) header.festheader.scrolled .headertitlefest {
  font-size: 34px !important;
}

html:not(.mobile) header.festheader.scrolled .headerdatafest {
  font-size: 17px !important;
}

html:not(.mobile) header.festheader.scrolled .headerplacefest {
  font-size: 17px !important;
}

html:not(.mobile) header.festheader.scrolled .header-download-archive {
  display: none !important;
}

/* ============================================================
   HEADERSPACE
   ============================================================ */

.headerspace {
  height: calc(200px * var(--space-progress, 0));
  opacity: var(--space-progress, 0);
  transition: height 0.15s linear;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

/* ============================================================
   ПЛАВНЫЕ ПЕРЕХОДЫ (только для высоты и размера текста)
   ============================================================ */

header.festheader {
  transition: height 0.15s ease-out;
}

header.festheader .headertitlefest {
  transition: font-size 0.15s ease-out;
}

header.festheader .headerdatafest,
header.festheader .headerplacefest {
  transition: font-size 0.15s ease-out;
}

/* ============================================================
   АДАПТИВ: Планшеты и ниже (до 1024px)
   ============================================================ */

@media screen and (max-width: 1024px) {
  header.festheader {
    height: auto !important;
    position: relative !important;
    padding-bottom: 20px;
    padding-top: 20px;
    text-align: center;
    overflow: visible !important;
  }
  
  header.festheader h1 {
    display: inline-block;
  }
  
  .header-download-archive {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100%;
    position: relative;
    z-index: 20;
    pointer-events: auto;
  }
  
  .headerdatacontainer {
    display: block;
    position: relative;
    z-index: 10;
    pointer-events: auto;
  }
  
  .headerspace {
    height: 100px;
    pointer-events: none;
  }
}

/* ============================================================
   АДАПТИВ: Планшеты (769px - 1024px)
   ============================================================ */

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .header-download-archive {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  .header-download-archive a {
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 14px;
  }
}

/* ============================================================
   АДАПТИВ: Мобильные (до 768px)
   ============================================================ */

@media screen and (max-width: 768px) {
  header.festheader {
    height: auto !important;
    position: relative !important;
    padding-bottom: 20px;
    padding-top: 20px;
    text-align: center;
    overflow: visible !important;
  }
  
  header.festheader .headertitlefest {
    font-size: 34px;
  }
  
  header.festheader .headerdatafest {
    font-size: 17px;
  }
  
  header.festheader .headerplacefest {
    font-size: 17px;
  }
  
  header.festheader .headertitlefest,
  header.festheader .headerdatafest,
  header.festheader .headerplacefest {
    align-self: flex-end;
  }
  
  .headerdatacontainer {
    display: block;
    position: relative;
    z-index: 10;
    pointer-events: auto;
  }
  
  .headerspace {
    height: 100px;
    pointer-events: none;
  }
  
  .header-download-archive {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100%;
    position: relative;
    z-index: 20;
    pointer-events: auto;
  }
  
  .header-download-archive a {
    white-space: nowrap;
    padding: 5px 12px;
    font-size: 13px;
    pointer-events: auto;
    cursor: pointer;
  }
}

/* ============================================================
   АДАПТИВ: Очень маленькие экраны (до 480px)
   ============================================================ */

@media screen and (max-width: 480px) {
  header.festheader {
    padding-bottom: 15px;
    padding-top: 15px;
  }
  
  header.festheader .headertitlefest {
    font-size: 28px;
  }
  
  header.festheader .headerdatafest {
    font-size: 14px;
  }
  
  header.festheader .headerplacefest {
    font-size: 14px;
  }
  
  .headerspace {
    height: 80px;
  }
  
  .header-download-archive {
    gap: 6px !important;
  }
  
  .header-download-archive a {
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* ============================================================
   АДАПТИВ: Десктопы (от 1025px)
   ============================================================ */

@media screen and (min-width: 1025px) {
  header.festheader {
    display: flex;
  }
  
  .headerspace {
    display: block;
  }
}

/* ============================================================
   МОБИЛЬНЫЙ РЕЖИМ (класс .mobile на html)
   ============================================================ */

/* Шапка в мобильном режиме - отключаем все уменьшения */
html.mobile header.festheader {
  position: relative !important;
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 10px;
  height: auto !important;
  transition: none !important;
  overflow: visible !important;
}

html.mobile .header-download-archive {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100%;
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

html.mobile .header-download-archive a {
  color: #ffffff;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
}

html.mobile .header-download-archive a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

html.mobile .header-download-archive span {
  color: #ffffff;
  pointer-events: auto;
}

html.mobile .headerspace {
  display: none !important;
}

html.mobile .headerdatacontainer {
  display: block;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

html.mobile .headertitlefest,
html.mobile .headerdatafest,
html.mobile .headerplacefest {
  pointer-events: auto;
}

/* ============================================================
   5. БЭКГРАУНД (тяжёлая анимация — отключается на .mobile)
   ============================================================ */

.festbackground {
  position: absolute;
  background-size: cover;
  background-position: center;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  opacity: 0.5;
  transition: opacity 0.5s ease;
  pointer-events: none !important;
  z-index: 1;
}

/* Блюр для десктопа */
.bg-blur {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---- ОТКЛЮЧАЕМ ТЯЖЁЛУЮ АНИМАЦИЮ НА МОБИЛЬНЫХ ---- */
html.mobile .festbackground {
  opacity: 0.1 !important;
  transition: none !important;
  animation: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

html.mobile .bg-blur {
  opacity: 0 !important;
  transition: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

/* ============================================================
   ПОРТРЕТНЫЙ РЕЖИМ (для обратной совместимости)
   ============================================================ */

html.mobile.portrait .festbackground {
  opacity: 0.1 !important;
}

html.mobile.portrait header.festheader {
  background-image: linear-gradient(to left, rgba(14, 20, 37, 0.7), rgba(46, 51, 66, 0.7));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 10px;
}

html.mobile.portrait .headerspace {
  display: none;
}

/* ============================================================
   6. МЕНЮ-КНОПКА
   ============================================================ */

.menu-btn {
  z-index: 999;
  position: fixed;
  width: 50px;
  height: 50px;
  top: 12px;
  left: 12px;
  background-color: #fff;
  display: grid;
  grid-row-gap: 2px;
  grid-column-gap: 2px;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 14px;
  box-sizing: border-box;
  cursor: pointer;
}

.menu-btn:hover {
  padding: 9px;
  grid-row-gap: 4px;
  grid-column-gap: 4px;
}

.menu-btn div {
  background-color: #666;
  width: 6px;
  height: 6px;
}

.menu-btn:hover div {
  width: 8px;
  height: 8px;
}

/* ============================================================
   7. КНОПКИ УПРАВЛЕНИЯ PHOTOSWIPE (верхние)
   ============================================================ */

.pswp__button:not(.pswp__button--arrow),
.pswp--touch .pswp__button:not(.pswp__button--arrow) {
  width: 44px !important;
  height: 44px !important;
  margin: 8px 4px 0 4px !important;
  background-color: rgba(0, 0, 0, 0.4) !important;
  border-radius: 6px !important;
  opacity: 0.85 !important;
  transition: opacity 0.2s ease, background-color 0.2s ease !important;
}

.pswp__button:not(.pswp__button--arrow):hover,
.pswp--touch .pswp__button:not(.pswp__button--arrow):hover {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Иконки внутри верхних кнопок */
.pswp__button:not(.pswp__button--arrow) svg,
.pswp--touch .pswp__button:not(.pswp__button--arrow) svg {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: var(--pswp-icon-color) !important;
  stroke-width: var(--pswp-icon-stroke-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pswp__button--close svg,
.pswp__button--zoom svg,
.pswp--touch .pswp__button--close svg,
.pswp--touch .pswp__button--zoom svg {
  top: 6px !important;
  left: 6px !important;
  width: 32px !important;
  height: 32px !important;
}

.pswp__button--download-resize-button svg text {
  fill: var(--pswp-icon-color) !important;
  stroke: none !important;
}

/* ============================================================
   8. СТРЕЛКИ НАВИГАЦИИ (оформление)
   ============================================================ */

.pswp__button--arrow {
  width: 60px !important;
  height: 60px !important;
  margin-top: -30px !important;
}

.pswp__button--arrow--prev {
  left: 20px !important;
}

.pswp__button--arrow--next {
  right: 20px !important;
}

.pswp__button--arrow svg {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 60px !important;
  height: 60px !important;
  margin: 0 !important;
}

/* ============================================================
   9. БЛОКИРОВКА ПРОКРУТКИ
   ============================================================ */

html:has(.pswp--open),
body.pswp-active {
  overflow: hidden !important;
  padding-right: var(--removed-body-scrollbar-width, 0px);
}

/* ============================================================
   10. КНОПКИ СКАЧИВАНИЯ АРХИВА
   ============================================================ */

.header-download-archive {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  z-index:10 !important;
}

.archive-btn {
  display: inline-flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.archive-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.archive-btn:active {
  transform: scale(0.98);
}

.archive-btn svg {
  margin-right: 8px;
  display: block;
}

html:not(.mobile.portrait) .festheader.smaller .header-download-archive {
  position: absolute;
  align-self: center;
  margin-top: 0;
}

/* ============================================================
   11. ПРОЧЕЕ
   ============================================================ */

.lg-toolbar {
  background-image: none !important;
}

.lock {
  overflow-y: hidden;
}

/* Кнопка сжатой версии (Resize) — уменьшаем только саму ИКОНКУ */
.pswp__button--download-resize-button svg {
    transform: scale(0.9); /* Уменьшаем внутренний SVG до 75% */
    transform-origin: center; /* Центрируем масштабирование */
}

/* Кнопка оригинала — увеличиваем только саму ИКОНКУ */
.pswp__button--download-orig-button svg {
    transform: scale(1.11); /* Увеличиваем внутренний SVG на 15% */
    transform-origin: center; /* Центрируем масштабирование */
    transition: transform 0.2s;
}
/* Принудительно сдвигаем кнопку Fullscreen вправо, к остальным кнопкам */
.pswp__button--fullscreen-button {
    margin-left: auto !important;
}

/* 1. Задаем правильный порядок (order) справа налево */
.pswp__button--close { order: 15 !important; }
.pswp__button--zoom { order: 14 !important; }
.pswp__button--download-orig-button { order: 12 !important; }
.pswp__button--download-resize-button { order: 11 !important; }
.pswp__button--fullscreen-button { order: 13 !important; }

/* 2. Делаем кнопку Fullscreen распоркой, чтобы сдвинуть ВЕСЬ блок кнопок вправо */
.pswp__button--fullscreen-button {
    margin-left: auto !important;
}