/* JB Builder CSS 3.2 – 02-content.css
   Obsah Composeru: text, obrázek, mezera, oddělovač, galerie.
   Pořadí registrace v JB Code Manageru: podle čísla v názvu souboru. */

/* ===== objects/text.css ===== */
/* JB Builder 2.8.23 — text fragments stay readable inside wide layouts. */
.jb-co--text > .jb-co__inner > :is(.jb-co-align--left, .jb-co-align--center, .jb-co-align--right) {
  width: 100%;
  max-width: var(--jb-text);
  min-width: 0;
  margin-inline: auto;
}

/* ===== objects/gallery.css ===== */
/* JB Builder 2.8.2 — objects/gallery
   Spravuje JB Code Manager; frontend CSS se nenačítá z PHP pluginu. */

.jb-co-gallery {
  display: grid;
  gap: 12px;
}

.jb-co-gallery--grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.jb-co-gallery--masonry {
  columns: 3 240px;
  display: block;
}

.jb-co-gallery--masonry img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 12px;
  break-inside: avoid;
}

.jb-co-gallery--media-text {
  grid-template-columns: 1fr 1fr;
}

.jb-co-gallery--media-text img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.jb-co-gallery--media-text img:nth-child(4n + 2),
.jb-co-gallery--media-text img:nth-child(4n + 3) {
  height: 300px;
}

@media (max-width: 640px) {
  .jb-co-gallery--media-text img {
    height: 160px;
  }
  .jb-co-gallery--media-text img:nth-child(4n + 2),
  .jb-co-gallery--media-text img:nth-child(4n + 3) {
    height: 220px;
  }
}

/* Audited media cap: gallery images preserve their aspect ratio and never
   exceed approximately 80% of the viewport height in ordinary content. */
.jb-co-gallery:not(.jb-co-gallery--media-text) img {
  max-height: var(--jb-media-max-height, 80svh);
  object-fit: contain;
}

/* ===== objects/gallery-enhancements.css ===== */
/* JB Builder 2.8.51 gallery enhancements.
   Additive stylesheet: preserves existing gallery.css, grid/masonry and media-text styles. */
.jb-co-gallery[data-jb-carousel="1"] {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--jb-media-radius, 20px);
}
.jb-co-gallery[data-jb-carousel="1"] .jb-co-gallery__track {
  display: flex;
  width: 100%;
  gap: 0;
  align-items: stretch;
  will-change: transform;
}
.jb-co-gallery[data-jb-carousel="1"] .jb-co-gallery__slide {
  display: block;
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.jb-co-gallery[data-jb-carousel="1"] .jb-co-gallery__slide img,
.jb-co-gallery.jb-co-gallery--media-text[data-jb-carousel="1"] .jb-co-gallery__slide img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
}

.jb-co-gallery[data-jb-carousel="1"] {
  touch-action: pan-y;
}

/* ===== objects/content-image.css ===== */
/* JB Builder 2.8.23 — single image Composer item: natural ratio, bounded height.
   Do not limit banner background images or FAPI/MioWeb markup. */
.jb-co .jb-co-content-image {
  display: block;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}
.jb-co .jb-co-content-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: var(--jb-media-max-height);
  object-fit: contain;
  border-radius: var(--jb-media-radius, 20px);
}
.jb-co .jb-co-align--center > .jb-co-content-image img {
  margin-inline: auto;
}
.jb-co .jb-co-align--right > .jb-co-content-image img {
  margin-inline-start: auto;
}

/* Composer images: 0 means original automatic responsive size. */
.jb-co .jb-co-content-image[style*="--jb-content-img-max"] {
  max-width: min(100%, var(--jb-content-img-max));
}

/* ===== Composer – mezera a oddělovač (dříve v pluginu) ===== */
/* Ordered content elements: inline Composer spacer / decorative divider. */
.jb-co-content-spacer {
  display: block;
  clear: both;
  width: 100%;
  height: var(--jb-content-spacer-height, 64px);
  min-height: 0;
  flex: 0 0 auto;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
}
.jb-co-content-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--jb-content-divider-height, 52px);
  opacity: var(--jb-content-divider-opacity, 0.8);
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.jb-co-content-divider--graphic img {
  display: block;
  max-height: var(--jb-content-divider-height, 52px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.jb-co-content-divider--line::after {
  content: "";
  display: block;
  width: min(100%, 240px);
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}
@media (max-width: 767px) {
  .jb-co-content-spacer {
    height: min(var(--jb-content-spacer-height, 64px), 22vw);
  }
}
