/* Galerie jako vyvazena vystava: editorial rytmus se opakuje napric celym souborem. */
#gallery.gallery--editorial { display:block; width:min(94%, 1500px); margin-inline:auto; }
#gallery.gallery--editorial .gallery-chapter {display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:clamp(14px,1.65vw,24px);margin:0 0 clamp(28px,3.2vw,50px);align-items:stretch;}
#gallery.gallery--editorial .gallery-chapter > .card {min-width:0;border-color:rgba(255,255,255,.12);background:#101010;box-shadow:0 12px 36px rgba(0,0,0,.15);}
#gallery.gallery--editorial .gallery-chapter--feature > .card {grid-column:span 3;}
#gallery.gallery--editorial .gallery-chapter--feature > .card:first-child {grid-column:span 6;grid-row:span 2;display:flex;flex-direction:column;}
#gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card:first-child {grid-column:7 / span 6;grid-row:1 / span 2;}
#gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card:nth-child(2) {grid-column:1 / span 3;grid-row:1;}
#gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card:nth-child(3) {grid-column:4 / span 3;grid-row:1;}
#gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card:nth-child(4) {grid-column:1 / span 3;grid-row:2;}
#gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card:nth-child(5) {grid-column:4 / span 3;grid-row:2;}
#gallery.gallery--editorial .gallery-chapter--feature > .card:first-child .card-image {flex:1 1 auto;aspect-ratio:auto;min-height:380px;}
#gallery.gallery--editorial .gallery-chapter--feature > .card:first-child .card-body {padding:clamp(18px,2vw,26px);}
#gallery.gallery--editorial .gallery-chapter--feature > .card:first-child h3 {font-size:clamp(1.6rem,2vw,2.25rem);}
#gallery.gallery--editorial .gallery-chapter--feature > .card:not(:first-child) .card-image {aspect-ratio:4/4.65;}
#gallery.gallery--editorial .gallery-chapter > .card .card-body {padding:clamp(12px,1.15vw,18px);}
#gallery.gallery--editorial .gallery-chapter--remainder > .card {grid-column:span 4;}
#gallery.gallery--editorial .gallery-chapter--remainder[data-count="2"] > .card {grid-column:span 6;}
#gallery.gallery--editorial .gallery-chapter--remainder[data-count="1"] > .card {grid-column:span 4;}
#gallery.gallery--editorial .gallery-chapter--remainder .card-image {aspect-ratio:4 / 5.15;}
#gallery.gallery--editorial .gallery-chapter > .card:hover,
#gallery.gallery--editorial .gallery-chapter > .card:focus-visible {border-color:rgba(200,168,117,.46);box-shadow:0 16px 40px rgba(0,0,0,.28);}
@media (max-width:1099px) {
  #gallery.gallery--editorial {width:94%;}
  #gallery.gallery--editorial .gallery-chapter {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:28px;}
  #gallery.gallery--editorial .gallery-chapter > .card,
  #gallery.gallery--editorial .gallery-chapter--feature > .card,
  #gallery.gallery--editorial .gallery-chapter--feature > .card:first-child,
  #gallery.gallery--editorial .gallery-chapter--feature.gallery-chapter--reverse > .card,
  #gallery.gallery--editorial .gallery-chapter--remainder > .card,
  #gallery.gallery--editorial .gallery-chapter--remainder[data-count] > .card {grid-column:auto;grid-row:auto;display:block;}
  #gallery.gallery--editorial .gallery-chapter .card-image,
  #gallery.gallery--editorial .gallery-chapter--feature > .card:first-child .card-image {aspect-ratio:4/5.3;min-height:0;}
  #gallery.gallery--editorial .gallery-chapter > .card .card-body {padding:15px;}
}
@media (max-width:600px) {
  #gallery.gallery--editorial .gallery-chapter {grid-template-columns:minmax(0,1fr);gap:20px;margin-bottom:20px;}
  #gallery.gallery--editorial .gallery-chapter .card-image,
  #gallery.gallery--editorial .gallery-chapter--feature > .card:first-child .card-image {aspect-ratio:4/5.45;}
}
@media (prefers-reduced-motion:reduce) {#gallery .card{transition:none;}}

/* OPRAVA MOBILNI GALERIE 2026-11-03:
   Vypnuti desktopovych explicitnich CSS grid souradnic vcetne reverse varianty.
   Flex layout zabraní uzkym sloupcum a pretekani textu. */
@media (max-width: 1099px) {
  #gallery.gallery--editorial .gallery-chapter {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 18px;
  }
  #gallery.gallery--editorial .gallery-chapter > .card {
    grid-column: auto;
    grid-row: auto;
    flex: 0 0 calc((100% - 18px) / 2);
    width: calc((100% - 18px) / 2);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  #gallery.gallery--editorial .gallery-chapter--feature > .card:first-child {
    display: block;
  }
  #gallery.gallery--editorial .gallery-chapter > .card .card-body {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }
}
@media (max-width: 700px) {
  #gallery.gallery--editorial,
  #gallery.gallery--editorial .gallery-chapter { width: 100%; max-width: 100%; }
  #gallery.gallery--editorial .gallery-chapter {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 20px;
    margin-bottom: 20px;
  }
  #gallery.gallery--editorial .gallery-chapter > .card {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  #gallery.gallery--editorial .gallery-chapter .card-image,
  #gallery.gallery--editorial .gallery-chapter--feature > .card:first-child .card-image {
    aspect-ratio: 4 / 5.2;
    min-height: 0;
  }
  #gallery.gallery--editorial .gallery-chapter .card-body { padding: 16px; }
}
