/*
 * Společné funkční styly: lightbox, stav formuláře, skryté prvky.
 * Barvy a písmo si nastavuje každá varianta vlastními proměnnými:
 * --lb-bg, --lb-text, --lb-accent, --stav-ok, --stav-chyba, --stav-info, --radius
 */
[hidden] { display: none !important; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 1000;
  padding: .75rem 1.25rem;
  background: #fff; color: #111;
  font-weight: 600;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.skip-link:focus { top: 1rem; }

/* past na roboty */
.pole-past {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Lightbox ---------- */
html.lightbox-open { overflow: hidden; }

.lightbox {
  width: 100vw; height: 100vh;
  height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: var(--lb-bg, rgba(10, 12, 16, .94));
  color: var(--lb-text, #fff);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox[open] { display: block; animation: lb-in .2s ease-out; }

.lightbox__stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 4.5rem 4.75rem 2rem;
}
.lightbox__figure {
  margin: 0;
  display: flex; flex-direction: column; align-items: center;
  max-width: 100%; max-height: 100%;
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 11rem);
  max-height: calc(100dvh - 11rem);
  width: auto; height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius, 6px) / 2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox__img.is-loaded { opacity: 1; }
.lightbox__caption {
  margin-top: 1rem;
  max-width: 46rem;
  text-align: center;
  line-height: 1.45;
}
.lightbox__caption strong { display: block; font-size: 1.05rem; }
.lightbox__caption span { display: block; opacity: .8; font-size: .95rem; margin-top: .2rem; }
.lightbox__counter {
  position: absolute; top: 1.4rem; left: 1.5rem;
  margin: 0;
  font-size: .9rem; letter-spacing: .08em;
  opacity: .75;
}
.lightbox__btn {
  position: absolute;
  display: grid; place-items: center;
  width: 3rem; height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.lightbox__btn:hover { background: var(--lb-accent, #f26a1b); border-color: transparent; }
.lightbox__btn:focus-visible { outline: 3px solid var(--lb-accent, #f26a1b); outline-offset: 3px; }
.lightbox__close { top: .9rem; right: 1rem; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox.is-single .lightbox__prev,
.lightbox.is-single .lightbox__next { display: none; }

@media (max-width: 640px) {
  .lightbox__stage { padding: 4rem .75rem 5.5rem; }
  .lightbox__img { max-height: calc(100dvh - 13rem); }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 1rem; transform: none; }
  .lightbox__prev { left: calc(50% - 3.75rem); }
  .lightbox__next { right: calc(50% - 3.75rem); }
  .lightbox__caption strong { font-size: 1rem; }
}

@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Stav formuláře ---------- */
.stav {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius, 6px);
  border-left: 4px solid currentColor;
  line-height: 1.5;
  outline: none;
}
.stav p { margin: 0 0 .5rem; }
.stav p:last-child { margin-bottom: 0; }
.stav a { color: inherit; font-weight: 600; }
.stav--ok { background: color-mix(in srgb, var(--stav-ok, #1d7a46) 12%, transparent); color: var(--stav-ok, #1d7a46); }
.stav--chyba { background: color-mix(in srgb, var(--stav-chyba, #b3261e) 10%, transparent); color: var(--stav-chyba, #b3261e); }
.stav--info { background: color-mix(in srgb, var(--stav-info, #1f4f8a) 9%, transparent); color: var(--stav-info, #1f4f8a); }
.stav__akce { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .85rem !important; }
.stav__btn {
  display: inline-flex; align-items: center;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 2px solid currentColor;
  border-radius: var(--radius, 6px);
  background: transparent;
  color: inherit;
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.stav__btn:not(.stav__btn--alt) {
  background: var(--stav-info, #1f4f8a);
  border-color: var(--stav-info, #1f4f8a);
  color: #fff;
}
.stav__text {
  width: 100%;
  margin-top: .75rem;
  font: inherit; font-size: .9rem;
  color: #222;
}

.chyba { margin: .35rem 0 0; font-size: .9rem; color: var(--stav-chyba, #b3261e); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
