/* ============================================================
📘 EPUB Demo CSS — демонстратор книги (Joomla 5)
Версия 1.0
============================================================ */

/* 🔹 Общая структура */
#epubDemoContainer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid #ddd;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

#epubDemoContainer.rtl {
  direction: rtl;
}

/* 🔹 Контейнер содержимого */
#pageContent {
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  line-height: 1.6;
  font-size: 1rem;
  color: #222;
  background: #fff;
  transition: all 0.25s ease;
}

/* 🔹 Состояние загрузки / ошибки */
#pageContent .loading {
  text-align: center;
  padding: 3em 1em;
  font-style: italic;
  color: #666;
}

#pageContent .error {
  text-align: center;
  color: #b20000;
  background: #fff3f3;
  border: 1px solid #f5c2c2;
  padding: 1em;
  border-radius: 8px;
}

/* 🔹 Панель управления */
#epubControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-top: 1px solid #ddd;
  background: #fafafa;
  padding: 0.6em 1.2em;
  gap: 0.5em;
  font-size: 0.9rem;
}

#epubControls button {
  appearance: none;
  border: none;
  background: #0074d9;
  color: #fff;
  border-radius: 8px;
  padding: 0.6em 1em;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

#epubControls button:hover {
  background: #005fa3;
}

#epubControls button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 🔹 Индикатор страниц */
#pageIndicator {
  font-family: "Roboto Mono", monospace;
  font-size: 0.95rem;
  color: #333;
  user-select: none;
}

/* 🔹 Мобильная адаптация */
#epubDemo.mobile {
  border-radius: 0;
  box-shadow: none;
  border: none;
}

#epubDemo.mobile #pageContent {
  padding: 14px;
  font-size: 1.05rem;
}

#epubDemo.mobile #epubControls {
  padding: 0.8em;
}

#epubDemo.mobile button {
  flex: 1;
}

/* 🔹 Плавная смена страниц */
#pageContent {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#pageContent.loading,
#pageContent.fadeout {
  opacity: 0;
  transform: scale(0.98);
}

/* 🔹 Защита от дрожания при смене страниц */
#epubDemo,
#pageContent {
  box-sizing: border-box;
  width: 100%;
}

/* ============================================================
🔹 Поддержка локальных направлений текста внутри RTL-книг
   (например, списки, цитаты, таблицы с dir="ltr")
============================================================ */

ul.lista-epub-fields[dir="ltr"] {
  list-style-type: none !important;  /* убираем маркеры */
  margin: 0 !important;
  padding: 0 !important;
  direction: ltr !important;
  text-align: left !important;       /* текст по левому краю */
}

ul.lista-epub-fields[dir="ltr"] li.voce-epub-fields {
  list-style: none !important;
  margin: 0.2em 0 !important;        /* небольшие интервалы между пунктами */
  direction: ltr !important;
  text-align: left !important;
}

ul.lista-epub-esempi[dir="ltr"] {
  list-style-type: none !important;   /* убираем маркеры */
  margin: 0.5em 0 !important;
  padding-left: 1em !important;       /* лёгкий отступ слева */
  direction: ltr !important;
  text-align: left !important;
}

ul.lista-epub-esempi[dir="ltr"] li.voce-epub-esempi {
  list-style: none !important;
  margin: 0.3em 0 !important;
  direction: ltr !important;
  text-align: left !important;
  line-height: 1.5;
  position: relative;
}

/* можно добавить визуальный штрих — тонкий тире перед каждым примером */
ul.lista-epub-esempi[dir="ltr"] li.voce-epub-esempi::before {
  content: " — ";
  position: absolute;
  left: -1em;
  color: #666;
}


.epub-image {
      	text-align: center;
      	max-height: 100%;
      	overflow: auto;
      	display: flex;
      	flex-direction: column;
      	justify-content: center;
      	align-items: center;
      	padding: 20px;
}

.epub-image h1,
  	.epub-image h2 {
    	color: #30638d;
}

.image-title {
  margin:0;
}

