/* =====================================================================
   Дигитални изложби – ОБЩ СЛОЙ НА ПОРЕДИЦАТА (_shared/series.css)
   ---------------------------------------------------------------------
   Зарежда се на страниците на ВСЯКА изложба, преди файловете на самата
   изложба. Съдържа компонентите (класове dx-*). Цветовете идват от CSS
   променливи (--dx-*) със стойности по подразбиране; всяка изложба ги
   задава в своя exhibition.css върху :root.

   Без селектори на шаблона. Рамката на страницата е в series-frame.css /
   frame.css.
   ===================================================================== */


/* ---------------------------------------------------------------------
   Компонент: времева линия (.dx-timeline)
   --------------------------------------------------------------------- */

.dx-timeline {
  max-width: 46rem;
  margin: 0 auto;
  color: var(--dx-text, #252525);
}

.dx-timeline__intro {
  font-size: 1.125rem;
  line-height: 1.65;
  margin: 0 0 2rem;
}

.dx-timeline__chapter {
  margin: 2.25rem 0 0;
}

.dx-timeline__chapter-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

.dx-timeline__chapter-years {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--dx-muted, #5a5246);
  font-variant-numeric: tabular-nums;
}

.dx-timeline .dx-timeline__list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.75rem;
}

.dx-timeline .dx-timeline__list::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: var(--dx-line, #d8ccb2);
}

.dx-event {
  position: relative;
  margin: 0 0 0.35rem;
  padding: 0;
}

.dx-event::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 0.75rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--dx-dot);
  box-shadow: 0 0 0 3px var(--dx-bg, #fffdea);
}

.dx-event--life  { --dx-dot: var(--dx-life, #1f3a5f); }
.dx-event--work  { --dx-dot: var(--dx-work, #7a1f2b); }
.dx-event--doc   { --dx-dot: var(--dx-doc, #6b5212); }
.dx-event--award { --dx-dot: var(--dx-award, #9a4a1c); }

.dx-event__summary {
  display: grid;
  grid-template-columns: 6rem 1fr;
  column-gap: 0.75rem;
  row-gap: 0.1rem;
  align-items: baseline;
  margin: 0;
  padding: 0.45rem 2.25rem 0.45rem 0.5rem;
  border-radius: 0.375rem;
  line-height: 1.45;
}

.dx-event__year {
  grid-row: 1 / span 2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dx-event__label {
  grid-column: 2;
}

.dx-event__type {
  grid-column: 2;
  justify-self: start;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--dx-muted, #5a5246);
  border-left: 3px solid var(--dx-dot);
  padding-left: 0.4rem;
  line-height: 1.3;
}

/* Разгъваеми записи (<details>) */
.dx-event__details > summary {
  position: relative;
  cursor: pointer;
  list-style: none;
}

.dx-event__details > summary::-webkit-details-marker {
  display: none;
}

.dx-event__details > summary::after {
  content: "+";
  position: absolute;
  right: 0.6rem;
  top: 0.45rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--dx-line, #d8ccb2);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1.15rem;
  text-align: center;
  color: var(--dx-muted, #5a5246);
}

.dx-event__details[open] > summary::after {
  content: "\2212";
}

.dx-event__details > summary:hover {
  background: var(--dx-hover, #f6efd6);
}

.dx-event__details > summary:focus-visible {
  outline: 2px solid var(--dx-focus, #c2360a);
  outline-offset: 2px;
}

.dx-event__details > p {
  margin: 0.15rem 0.5rem 0.6rem 7.25rem;
  line-height: 1.6;
}

@media (max-width: 575.98px) {
  .dx-timeline .dx-timeline__list {
    padding-left: 1.5rem;
  }

  .dx-event::before {
    left: -1.35rem;
  }

  .dx-event__summary {
    grid-template-columns: 1fr;
  }

  .dx-event__year {
    grid-row: auto;
  }

  .dx-event__label,
  .dx-event__type {
    grid-column: 1;
  }

  .dx-event__details > p {
    margin-left: 0.5rem;
  }
}

@media print {
  .dx-event__details > summary::after {
    display: none;
  }
}

/* ===== Край: времева линия ===== */

/* ---------------------------------------------------------------------
   Общо: уводен абзац (.dx-lead) – стои преди „Read more“, извън компонента.
   .dx-timeline__intro е включен тук, за да се изравни уводът на зала 1
   с ширината на времевата линия.
   --------------------------------------------------------------------- */

.dx-lead,
.dx-timeline__intro {
  max-width: 46rem;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  line-height: 1.65;
}


/* ---------------------------------------------------------------------
   Компонент: места (.dx-places) – зала „По стъпките“
   Номерата съответстват на точките върху картата.
   --------------------------------------------------------------------- */

.dx-places {
  max-width: 46rem;
  margin: 0 auto;
  color: var(--dx-text, #252525);
}

.dx-place {
  margin: 0 0 2.25rem;
  scroll-margin-top: 7rem; /* място за закачения хедър при преход по котва */
}

.dx-place__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.65rem;
  font-size: 1.375rem;
  line-height: 1.3;
  margin: 0 0 0.6rem;
}

.dx-place__num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--dx-place, #1f3a5f);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dx-place__note {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--dx-muted, #5a5246);
}

.dx-place p {
  line-height: 1.65;
}

.dx-place__links {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Мястото, към което води котва (#dx-place-...), се откроява. */
.dx-place:target .dx-place__title {
  text-decoration: underline;
  text-decoration-color: var(--dx-place, #1f3a5f);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

@media (max-width: 575.98px) {
  .dx-place__title {
    font-size: 1.25rem;
  }
}

/* ===== Край: места ===== */

/* ---------------------------------------------------------------------
   Компонент: текстова зала (.dx-prose) и кратки факти (.dx-facts)
   --------------------------------------------------------------------- */

.dx-prose {
  max-width: 46rem;
  margin: 0 auto;
  color: var(--dx-text, #252525);
}

.dx-prose section {
  margin: 0 0 2.25rem;
  scroll-margin-top: 7rem;
}

.dx-prose h2 {
  font-size: 1.375rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

.dx-prose p {
  line-height: 1.65;
}

.dx-facts {
  margin: 0;
}

.dx-facts dt {
  font-weight: 700;
  margin-top: 1rem;
}

.dx-facts dt:first-child {
  margin-top: 0;
}

.dx-facts__years {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--dx-muted, #5a5246);
  font-variant-numeric: tabular-nums;
  margin-left: 0.35rem;
}

.dx-facts dd {
  margin: 0.25rem 0 0;
  padding-left: 0.85rem;
  border-left: 3px solid var(--dx-line, #d8ccb2);
  line-height: 1.6;
}

.dx-more {
  font-size: 0.9rem;
}

/* ===== Край: текстова зала ===== */


/* ---------------------------------------------------------------------
   Компонент: карта с точки (.dx-map)
   Растерна основа (<img>) и слой с точки и надписи (HTML списък).
   Координатите са в % от изображението (--x, --y в style на всяка
   точка), затова точките следват картата при всяка ширина.
   Размерът на надписите следва ширината на картата (единица cqi).
   Под 36rem ширина картата не се смалява повече, а се превърта
   хоризонтално; в началото се вижда източната ѝ част.
   --------------------------------------------------------------------- */

.dx-map {
  max-width: 72rem;
  margin: 0 auto 2.5rem;
  container-type: inline-size;
}

@container (max-width: 35.99rem) {
  .dx-map__scroll {
    overflow-x: auto;
    direction: rtl;
  }

  .dx-map__frame {
    width: 36rem;
    direction: ltr;
  }
}

.dx-map__frame {
  position: relative;
  container-type: inline-size;
}

.dx-map__img {
  display: block;
  width: 100%;
  height: auto;
}

.dx-map__points {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dx-map__pt {
  --dot: 0.75rem;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.dx-map__pt::before {
  content: none;
}

.dx-map__pt a {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.15em;
  color: var(--dx-text, #252525);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 0.25rem;
}

/* Посока на надписа спрямо точката: изток (по подразбиране), запад (--w), юг (--s). */
.dx-map__pt a {
  left: calc(var(--dot) / -2 - 0.15em);
  top: 0;
  transform: translateY(-50%);
}

.dx-map__pt--w a {
  left: auto;
  right: calc(var(--dot) / -2 - 0.15em);
  flex-direction: row-reverse;
}

.dx-map__pt--s a {
  left: 0;
  top: calc(var(--dot) / -2 - 0.15em);
  transform: translateX(-50%);
  flex-direction: column;
  gap: 0.1em;
}

.dx-map__dot {
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--dx-map-dot, #7a1f2b);
  border: 2px solid var(--dx-bg, #fffdea);
  box-shadow: 0 0 0 1px rgba(37, 37, 37, 0.45);
}

.dx-map__label {
  font-size: 0.85rem;
  font-size: clamp(0.75rem, 1.35cqi, 1.05rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow:
    0 0 2px var(--dx-bg, #fffdea),
    0 0 3px var(--dx-bg, #fffdea),
    0 0 6px var(--dx-bg, #fffdea);
}

.dx-map__pt a:hover .dx-map__label {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.dx-map__pt a:focus-visible {
  outline: 3px solid var(--dx-focus, #c2360a);
  outline-offset: 1px;
}

.dx-map figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--dx-muted, #5a5246);
  text-align: center;
}

/* Преход от точка към глава: заглавието не остава под закачения хедър. */
.dx-timeline__chapter-title {
  scroll-margin-top: 7rem;
}

/* ===== Край: карта ===== */


/* ---------------------------------------------------------------------
   Компонент: галерия sigplus (.dx-gallery)
   Обвивка около {gallery} тага. Видимият надпис под слайдера идва от
   описанието (summary) в labels.txt; поставя го _shared/series.js.
   Синхронизирано с Helix → Custom Code → Custom CSS („PS event photos“).
   Галериите на изложбата са с id, започващ с "dx-"; от него sigplus
   прави id на прозореца за увеличение: boxplusx_dx-…
   --------------------------------------------------------------------- */

.dx-gallery {
  margin: 2rem 0 0;
}

.dx-gallery .slideplus-caption {
  display: none;
}

/* Снимката стои в долния край на рамката на слайдера, за да е надписът
   винаги на едно разстояние под нея (10px) при всякакви пропорции.
   !important е нужен: sigplus задава подравняването с правило по id. */
.dx-gallery .slideplus-content {
  align-items: flex-end !important;
}

/* Премахва празнината под inline-block контейнера на слайдера. */
.dx-gallery .slideplus-container {
  vertical-align: top;
}

.dx-gallery__caption {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 8px auto 1.5rem; /* + 2px отстъп на рамката = 10px под снимката */
  padding-inline: 0.5rem;
  text-align: start;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dx-gallery__caption[hidden] {
  display: none;
}

/* Галерия с една снимка: sigplus показва обикновен списък вместо слайдер.
   Премахва празнината под реда, за да е надписът също на 10px. */
.dx-gallery .sigplus-gallery > ul {
  line-height: 0;
}

.dx-gallery .sigplus-gallery > ul > li {
  vertical-align: top;
  margin-bottom: 2px;
}

/* Самостоятелен вертикален портрет (preview-width=340): надписът е
   широк колкото миниатюрата и центриран под нея. Класът се добавя в
   статията: <div class="dx-gallery dx-gallery--portrait">. */
.dx-gallery--portrait .dx-gallery__caption {
  max-width: 340px;
  text-align: center;
  text-wrap: balance; /* равни редове; стари браузъри го пропускат */
}

/* Две галерии една до друга (напр. два портрета); под 768px – една под
   друга. Снимките се изравняват по долния ръб, надписите – по горния,
   дори когато надписите са с различна дължина (subgrid). */
.dx-gallery-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
  margin: 2rem 0 0;
}

.dx-gallery-pair .dx-gallery {
  margin: 0;
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  justify-items: center;
}

.dx-gallery-pair .sigplus-gallery {
  align-self: end;
}

.dx-gallery-pair .dx-gallery__caption {
  align-self: start;
}

@media (max-width: 767.98px) {
  .dx-gallery-pair {
    grid-template-columns: 1fr;
  }
}

/* Дълъг надпис в прозореца за увеличение се превърта, вместо да избутва
   снимката. */
[id^="boxplusx_dx-"] .boxplusx-caption {
  max-height: min(30vh, 14rem);
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}

@supports (height: 1dvh) {
  [id^="boxplusx_dx-"] .boxplusx-caption {
    max-height: min(30dvh, 14rem);
  }
}

/* ===== Край: галерия ===== */

/* Блогова страница на изложбата: кръгла миниатюра вляво от анонса.
   Изображението е Intro Image на статията (квадрат 240–600px, WebP).
   Поле „Image Class“ на статията задава цвета на пръстена:
     float-none dx-ring--life | dx-ring--work | dx-ring--doc |
     dx-ring--award | dx-ring--focus
   Готова двойка с вграден пръстен и фон: float-none dx-thumb--pair.
   Helix добавя „float-“ пред първия клас, затова първият е float-none.
   Селекторите са по-силни от правилата на Helix за .article-intro-image
   (.article-list .article .article-intro-image – отрицателни полета,
   overflow: hidden, заоблени горни ъгли). */
.com-content-category-blog .article-list .article:has(> .article-intro-image) {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
}

.com-content-category-blog .article-list .article .article-intro-image {
  width: 7rem;
  margin: 0.35rem 0 0;
  border: 0;
  border-radius: 50%;
  overflow: visible;
}

.com-content-category-blog .article-list .article .article-intro-image a {
  display: block;
  border-radius: 50%;
}

.com-content-category-blog .article-list .article .article-intro-image img {
  display: block;
  width: 7rem;
  max-width: none;
  height: 7rem;
  margin: 0;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--dx-bg, #fffdea),
              0 0 0 4.5px var(--dx-ring, var(--dx-line, #d8ccb2));
  filter: sepia(0.25) saturate(0.85);
  transition: filter 0.3s ease;
}

.com-content-category-blog .article-list .article:hover .article-intro-image img,
.com-content-category-blog .article-list .article:focus-within .article-intro-image img {
  filter: none;
}

.com-content-category-blog .dx-ring--life  { --dx-ring: var(--dx-life,  #1f3a5f); }
.com-content-category-blog .dx-ring--work  { --dx-ring: var(--dx-work,  #7a1f2b); }
.com-content-category-blog .dx-ring--doc   { --dx-ring: var(--dx-doc,   #6b5212); }
.com-content-category-blog .dx-ring--award { --dx-ring: var(--dx-award, #9a4a1c); }
.com-content-category-blog .dx-ring--focus { --dx-ring: var(--dx-focus, #c2360a); }

/* Двойка: пръстените и фонът са във файла. */
.com-content-category-blog .article-list .article .dx-thumb--pair,
.com-content-category-blog .article-list .article .dx-thumb--pair a,
.com-content-category-blog .article-list .article .dx-thumb--pair img {
  border-radius: 0;
  box-shadow: none;
}

/* Без сепия: филтърът би оцветил вградения фон в различен тон от страницата. */
.com-content-category-blog .article-list .article .dx-thumb--pair img {
  filter: none;
}

@media (max-width: 575.98px) {
  .com-content-category-blog .article-list .article:has(> .article-intro-image) {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    column-gap: 1rem;
  }
  .com-content-category-blog .article-list .article .article-intro-image,
  .com-content-category-blog .article-list .article .article-intro-image img {
    width: 4.75rem;
  }
  .com-content-category-blog .article-list .article .article-intro-image img {
    height: 4.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .com-content-category-blog .article-list .article .article-intro-image img {
    transition: none;
  }
}

/* Заглавен блок на изложбата (описанието на категорията в блоговия изглед):
   надзаглавие (абзац) + H1. Без <hgroup> – JCE го разбива.
   <div class="dx-masthead"><p class="dx-masthead__kicker">…</p><h1>…</h1></div> */
.dx-masthead {
  margin: 0.5rem 0 2rem;
  text-align: center;
}

.dx-masthead__kicker {
  max-width: 46rem;
  margin: 0 auto 0.35rem;
  font-size: 0.95rem;
  font-style: normal;
  line-height: 1.5;
  color: var(--dx-muted, #5a5246);
}

.dx-masthead h1 {
  margin: 0;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  line-height: 1.2;
  text-wrap: balance;
}
