/* YMY – prohlížeč fotek (k assets/js/ymy-lightbox.js) */
html.ylb-open { overflow: hidden; }
.ylb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: hidden;
  display: none; grid-template-rows: auto minmax(0, 1fr) auto; font-family: 'Open Sans', sans-serif;
}
.ylb[open] { display: grid; animation: ylb-fade .25s ease both; }
.ylb::backdrop { background: rgba(24, 24, 26, .96); backdrop-filter: blur(6px); }
@keyframes ylb-fade { from { opacity: 0; } }

/* horní lišta: počítadlo, název, zavřít */
.ylb-top { display: flex; align-items: center; gap: 18px; padding: 14px 18px 10px 24px; }
.ylb-count { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #fff; min-width: 3.5em; }
.ylb-count:not(:empty)::after { content: ''; display: inline-block; width: 18px; height: 2px; margin-left: 14px; vertical-align: middle; background: #e13a3a; }
.ylb-title { flex: 1; font-size: 13px; letter-spacing: .3px; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tlačítka ve stylu ikonek u fotek (bílý čtverec, při najetí červený) */
.ylb button.ylb-btn {
  display: inline-flex; box-shadow: none; font-weight: normal; text-transform: none; letter-spacing: 0; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .25s ease;
}
.ylb button.ylb-btn:hover { background: #e13a3a; color: #fff; }
.ylb button.ylb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ylb-close { flex: none; }

/* plocha s fotkou */
.ylb-stage { position: relative; display: grid; padding-block: 4px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 18px; min-height: 0; }
.ylb button.ylb-nav { width: 56px; height: 72px; font-size: 30px; background: rgba(255,255,255,.08); }
.ylb-prev:hover i { transform: translateX(-3px); }
.ylb-next:hover i { transform: translateX(3px); }
.ylb-nav i { transition: transform .25s ease; }
.ylb.is-single .ylb-nav { visibility: hidden; }
.ylb-figure { position: relative; margin: 0; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ylb-img {
  display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.55)); user-select: none; -webkit-user-drag: none;
  transition: opacity .2s ease;
}
.ylb-figure.is-in .ylb-img { animation: ylb-in .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes ylb-in { from { opacity: 0; transform: translateX(calc(var(--ylb-dir, 0) * 28px)) scale(.985); } }
.ylb-figure.is-loading .ylb-img { opacity: .35; }
.ylb-spin { position: absolute; width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.2); border-top-color: #e13a3a; border-radius: 50%; opacity: 0; transition: opacity .2s; animation: ylb-spin .8s linear infinite; }
.ylb-figure.is-loading .ylb-spin { opacity: 1; transition-delay: .25s; }
@keyframes ylb-spin { to { transform: rotate(360deg); } }

/* náhledy */
.ylb-thumbs { display: flex; gap: 8px; justify-content: safe center; overflow-x: auto; padding: 14px 24px 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.ylb-thumbs[hidden] { display: none; }
.ylb-thumb { flex: none; width: 76px; height: 54px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; opacity: .45; transition: opacity .2s ease; }
.ylb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ylb-thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: #e13a3a; transform: scaleX(0); transition: transform .3s ease; }
.ylb-thumb:hover { opacity: .85; }
.ylb-thumb.is-active { opacity: 1; }
.ylb-thumb.is-active::after { transform: scaleX(1); }
.ylb-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media only screen and (max-width: 767px) {
  .ylb-top { padding: 10px 10px 8px 16px; gap: 10px; }
  .ylb-stage { grid-template-columns: minmax(0, 1fr); padding: 0 8px; }
  .ylb button.ylb-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 56px; margin-top: -28px; background: rgba(0,0,0,.35); }
  .ylb-prev { left: 8px; } .ylb-next { right: 8px; }
  .ylb-thumb { width: 60px; height: 44px; }
  .ylb-thumbs { padding: 12px 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ylb[open], .ylb-figure.is-in .ylb-img { animation: none; }
  .ylb-spin { animation-duration: 2s; }
}
