/* fullscreen.css (clean, iOS/Safari friendly) */

:root{
  --fs-bg:
    radial-gradient(
      1200px 800px at 50% 40%,
      rgba(30,50,90,.35),
      rgba(5,10,20,.95) 60%
    ),
    rgba(5,10,20,.95);
}

/* =========================================================
   FULLSCREEN MODE: schovaj stránku pod overlayom
   ========================================================= */
body.is-fs-open main#top,
body.is-fs-open header.topbar,
body.is-fs-open nav#mobileNav,
body.is-fs-open #navBackdrop{
  visibility: hidden;
}

/* =========================================================
   FULLSCREEN MODE: pozadie musí byť rovnaké na html aj body
   (kvôli iOS Safari "pásom" pri lištách)
   ========================================================= */
html.no-scroll,
html.no-scroll body,
body.is-fs-open{
  background: var(--fs-bg) !important;
}

/* =========================================================
   FULLSCREEN MODE: scroll lock + iOS overscroll fix
   (toto zaberá aj keď JS občas nestihne)
   ========================================================= */
html.no-scroll,
html.no-scroll body{
  overflow: hidden !important;
  height: 100% !important;
}

body.is-fs-open{
  overflow: hidden !important;
  height: 100% !important;

  /* iOS safe-areas – aby okraje nemali inú farbu */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);

  /* iOS bounce/overscroll */
  overscroll-behavior: none;
}

/* =========================================================
   FULLSCREEN OVERLAY
   ========================================================= */
.fs{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh; /* iOS safari */
  z-index: 9999;

  display: none;
  opacity: 0;
  transition: opacity .25s ease;

  background: var(--fs-bg);

  /* dôležité: backdrop-filter na celý overlay často robí pásy */
  /* backdrop-filter: blur(10px); */

  /* aby sa nedalo scrollovať gestom na overlayi */
  touch-action: none;
  overscroll-behavior: none;
}

.fs.is-open{
  display: block;
  opacity: 1;
}

/* panel s obsahom */
.fs__panel{
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: clamp(16px, 4vw, 48px);
  box-sizing: border-box;
}

/* obrázok */
.fs__image{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;

  border-radius: 18px;
  background: none;

  box-shadow:
    0 20px 60px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.08);
}

/* popis */
.fs__caption{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: 90%;

  text-align: center;
  color: rgba(238,243,255,.85);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);

  pointer-events: none;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.fs__close{
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));

  width: 44px;
  height: 44px;
  border-radius: 50%;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,18,35,.55);
  color: #fff;

  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 3;

  /* blur iba na tlačidle je OK */
  backdrop-filter: blur(6px);
}

.fs__close:hover{
  background: rgba(20,30,60,.75);
}

.fs__nav{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);

  width: 46px;
  height: 46px;
  border-radius: 50%;

  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,18,35,.55);
  color: #fff;

  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 3;

  backdrop-filter: blur(6px);
}

.fs__nav:hover{
  background: rgba(20,30,60,.75);
}

.fs__prev{
  left: calc(18px + env(safe-area-inset-left));
}

.fs__next{
  right: calc(18px + env(safe-area-inset-right));
}

/* Badge: "x / y" hore v strede */
.fs__counter{
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);

  padding: 8px 12px;
  border-radius: 999px;

  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;

  color: rgba(238,243,255,.92);
  background: rgba(10,18,35,.55);
  border: 1px solid rgba(255,255,255,.14);

  backdrop-filter: blur(6px);
  z-index: 3;

  pointer-events: none;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 640px){
  .fs__caption{
    font-size: 13px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .fs__nav{
    width: 42px;
    height: 42px;
  }

  .fs__close{
    width: 42px;
    height: 42px;
  }
}
