/*
 * Style treści VEditora – wspólne dla edytora i strony wyświetlającej zapisany HTML.
 * Na stronie publicznej: <link rel="stylesheet" href="…/veditor-content.css"> i kontener <div class="veditor-content">.
 */

.veditor-content::after {
  content: "";
  display: table;
  clear: both;
}

.veditor-content blockquote {
  margin: 1em 0;
  padding: 0 0 0 1em;
  border-left: 4px solid #c9ced6;
  color: #4a5059;
  font-style: italic;
}

.veditor-content hr {
  margin: 1em 0;
  border: 0;
  border-top: 2px solid #c9ced6;
  clear: both;
}

.veditor-content a {
  color: #0b57d0;
}

.veditor-content ul ul,
.veditor-content ol ol,
.veditor-content ul ol,
.veditor-content ol ul {
  margin: 0;
}

.veditor-content img {
  max-width: 100%;
  height: auto;
}

/* Obraz blokowy: domyślnie wyśrodkowany, szerokość obrazu (display: table zawęża podpis do obrazu). */
.veditor-content figure.image {
  display: table;
  clear: both;
  margin: 1em auto;
  text-align: center;
}

.veditor-content figure.image img {
  display: block;
  margin: 0 auto;
}

.veditor-content figure.image figcaption {
  display: table-caption;
  caption-side: bottom;
  padding: .4em;
  background: #f5f6f8;
  color: #4a5059;
  font-size: .875em;
  word-break: break-word;
}

.veditor-content figure.image-align-left {
  float: left;
  clear: none;
  max-width: 50%;
  margin: .25em 1.5em 1em 0;
}

.veditor-content figure.image-align-right {
  float: right;
  clear: none;
  max-width: 50%;
  margin: .25em 0 1em 1.5em;
}

/* Zmieniony rozmiar: szerokość z atrybutu style (w %), obraz ją wypełnia. */
.veditor-content figure.image-resized {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
}

.veditor-content figure.image-resized img {
  width: 100%;
}

.veditor-content figure.image-resized figcaption {
  display: block;
}

/* Tabele */
.veditor-content table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
  clear: both;
}

.veditor-content td,
.veditor-content th {
  min-width: 2em;
  padding: .4em .6em;
  border: 1px solid #c9ced6;
  vertical-align: top;
  overflow-wrap: break-word;
}

.veditor-content th {
  background: #f5f6f8;
  font-weight: 600;
  text-align: left;
}

/* Podpis tabeli (nad tabelą) */
.veditor-content caption {
  caption-side: top;
  padding: 0 0 .4em;
  color: #4a5059;
  font-weight: 600;
  text-align: left;
}

/* Podział strony: w druku nowa strona, na ekranie niewidoczny */
.veditor-content hr.page-break {
  visibility: hidden;
  break-after: page;
  page-break-after: always;
}

/* Wcięcie akapitów i nagłówków (margines od strony początku tekstu, także RTL) */
.veditor-content .indent-1 { margin-inline-start: 2em; }
.veditor-content .indent-2 { margin-inline-start: 4em; }
.veditor-content .indent-3 { margin-inline-start: 6em; }
.veditor-content .indent-4 { margin-inline-start: 8em; }

/* Kod w linii */
.veditor-content :not(pre) > code {
  padding: .1em .3em;
  border-radius: 3px;
  background: #eef0f3;
  font: .9em ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Blok kodu */
.veditor-content pre {
  margin: 1em 0;
  padding: .8em 1em;
  overflow-x: auto;
  border-radius: 6px;
  background: #1f2328;
  color: #e6edf3;
  font: .9em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
  white-space: pre;
}

.veditor-content pre code {
  font: inherit;
}

/* Osadzone media */
.veditor-content figure.media {
  clear: both;
  margin: 1em 0;
}

.veditor-content figure.media iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

.veditor-content figure.media video,
.veditor-content figure.media audio {
  display: block;
  width: 100%;
}

.veditor-content figure.media-ratio-4-3 iframe { aspect-ratio: 4 / 3; }
.veditor-content figure.media-ratio-1-1 iframe { aspect-ratio: 1 / 1; }

/* Film pionowy: węższa ramka, wyśrodkowana */
.veditor-content figure.media-ratio-9-16:not(.image-resized) {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.veditor-content figure.media-ratio-9-16 iframe { aspect-ratio: 9 / 16; }

.veditor-content figure.media.image-align-left,
.veditor-content figure.media.image-align-right {
  width: 50%;
}

.veditor-content figure.media figcaption {
  padding: .4em;
  background: #f5f6f8;
  color: #4a5059;
  font-size: .875em;
  text-align: center;
}

/* Spis treści */
.veditor-content ul.toc {
  padding: .6em 1em .6em 2em;
  border-left: 3px solid #c9ced6;
  background: #f8f9fa;
}

/* Lista zadań */
.veditor-content ul.task-list {
  padding-left: 2em;
  list-style: none;
}

.veditor-content ul.task-list > li {
  position: relative;
}

.veditor-content ul.task-list > li::before {
  content: "";
  position: absolute;
  left: -1.6em;
  top: .25em;
  width: 1em;
  height: 1em;
  box-sizing: border-box;
  border: 2px solid #8a9099;
  border-radius: 3px;
}

.veditor-content ul.task-list > li.checked::before {
  border-color: #0b57d0;
  background: #0b57d0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8l3.5 3.5L13 5' fill='none' stroke='white' stroke-width='2.5'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.veditor-content ul.task-list > li.checked {
  color: #6b7280;
  text-decoration: line-through;
}

/* Sekcja rozwijana */
.veditor-content details {
  margin: 1em 0;
  padding: .5em 1em;
  border: 1px solid #c9ced6;
  border-radius: 6px;
}

.veditor-content details > summary {
  font-weight: 600;
  cursor: pointer;
}

.veditor-content details[open] > summary {
  margin-bottom: .5em;
}

/* Kolory, wyróżnienia i rozmiary (predefiniowane klasy) */
.veditor-content .color-red { color: #d32f2f; }
.veditor-content .color-orange { color: #e65100; }
.veditor-content .color-green { color: #2e7d32; }
.veditor-content .color-blue { color: #1565c0; }
.veditor-content .color-purple { color: #6a1b9a; }
.veditor-content .color-gray { color: #616161; }
.veditor-content .background-yellow { background-color: #fff59d; }
.veditor-content .background-green { background-color: #c8e6c9; }
.veditor-content .background-blue { background-color: #bbdefb; }
.veditor-content .background-pink { background-color: #f8bbd0; }
.veditor-content .background-gray { background-color: #e0e0e0; }
.veditor-content .size-tiny { font-size: .7em; }
.veditor-content .size-small { font-size: .85em; }
.veditor-content .size-big { font-size: 1.4em; }
.veditor-content .size-huge { font-size: 1.8em; }
