/* HIDE MOBILE FEATURES */

@media (pointer: fine) {

  .mobile-menu,
  .mobile-button,
  .mobile-settings-modal {
    display: none;
  }
}

/* FONTS */

@font-face {
  font-family: "MainFont";
  src: url("../content/UI/Fonts/Cinzel-Regular.otf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "RegularTextFont";
  src: url("../content/UI/Fonts/DeathRecord.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* SIDE PANEL */
  /* ======================================================================================================= */
  --desktop-sidepanel-width: 380px;

  --logosvg: url("../content/UI/MBLogo.svg");
  --logobling: url("../content/UI/MBLogoBling.png");
  --logo-brightness: 2;

  --bg_image: url("../content/UI/BG.jpg");
  --main-background-width: calc(var(--desktop-sidepanel-width)*2);
  --main-background-height: calc(var(--main-background-width)*var(--main-background-ratio));
  --main-background-ratio: 1.777;
  --main-background-size: var(--main-background-width) var(--main-background-height);
  --main-background_brightness: 1.1;

  --brightness_brandtext: 1;

  /* GALLERY WRAPPER */
  /* ======================================================================================================= */
  /* --gallery_columns: 9; */
  --gallery_tile_width: max(190px, 8.2vw);
  --wrapperMargin: 12px;
  --wrapperRightMargin: 30px;
  --tile_gap: 8px;
  --tile_borderradius: 15px;

  /* --brightness_frameborders: 6; */
  --backdrop_opacity: 0.8;
  --tile_saturation: 0.15;
  --blur: 5px;
  --transition-time: 0.666s ease-out;
  --video-fade-time: 333ms ease-out;


  --lightbox_border_radius: 30px;

  /* UI IMAGES */
  /* --border-image: url("../content/UI/BG_BorderAlpha.png"); */
  --border-image-resolution: 256;
  --border-image-slice: calc(var(--border-image-resolution)/4);
  --border-image: url("../content/UI/UI_Border256.jpg");

  --bg_image_horizontal: url("../content/UI/BG_horizontal.jpg");
  --bg_noise: url("../content/UI/Noise128.png");
  --mbphoto: url("../content/UI/MBPhoto1.jpg");
  --whiteops_example: url("../content/UI/WhiteOpsExample.png");

  /* WINDOWS */
  --about_width: max(50vw, 1024px);
  --about_height: max(55vh, 740px);
  --about_topmargin: 0px;
  --about_topmargin_textphoto: 30px;
  --about_photogap: 30px;
  --about_rightmargin: 50px;
  --about_bottommargin: 30px;

  --modal_title_height: 50px;
  --button_close_size: calc(var(--modal_title_height) * 0.8);
  --button_close_roundness: calc(var(--button_close_size) * 0.2);

  /* --about_photo_sidemargins: 500px; */
  /* --about_photo_bottommargin: 200px; */
  --about_photo_minimalsize: 60px;

  --contactpanel_width: max(25vw, 500px);
  --contactpanel_height: max(40vh, 520px);


  /* LOADING OVERLAY */
  --loader-bg: #000;
  --loader-overlaycolor: #221d10;
  --loader-bar-h: 6px;
  --loader-fade: 350ms;
  --loader-logo-fade: var(--transition-time);
  --loader-overlay-fade: var(--transition-time);

  /* COLORS */
  --color_text_main: #d5ab67e1;
  --color_text_darker: #7d6741;
  --color_text_accent: #ffd99c;
  --color_text_bright: #fff5e4;
  --color_glow: #4a2801;
  --color_tagbg_active: #956932b2;
  --col2: #947543c1;
  --col3-1: #4a2801;
  --col3-2: #342718a2;
  --col3-3: #1a140d;
  --col4: #ddb26d;
  --col5: #ffe1a4;
  --modal_title_background_color: #263d1117;

  /* TEXT */
  font-family: "MainFont";
  --text_size_tag: 18px;
  --text_button_size: 20px;
  --text_modal_header_size: 36px;
  --text_base_size: 18px;
  --letter_spacing_header: 2pt;
  --letter_spacing_main: 2px;
  --line-height: 1.5;

  /* WATERMARK */
  --wm_tile_size: 35;
  --wm_overlay_intensity: 0.05;
  --wm_scale_min: 0.75;
  --wm_scale_max: 1.0;
  --wm_opacity_min: 0.2;
  --wm_opacity_max: 0.7;

  /* GLOW & SHADOW FILTERS */
  --glow-filter:
    drop-shadow(0 0 3px var(--col5)) drop-shadow(0 0 8px var(--col2)) drop-shadow(0 0 12px var(--col3-1));
  --glow-filter-strong:
    drop-shadow(0 0 2px var(--color_tagbg_active)) drop-shadow(0 0 16px var(--color_glow));
  --glow-filter-light:
    drop-shadow(0 0 2px var(--col5)) drop-shadow(0 0 40px var(--col3-1));
  --glow-filter-button:
    drop-shadow(0 0 10px var(--col2));
  --glow-text:
    0 0 4px var(--color_tagbg_active),
    0 0 20px var(--color_tagbg_active),
    0 0 40px var(--color_tagbg_active);

  --shadow-filter-strong:
    drop-shadow(0 0 6px black) drop-shadow(0 0 10px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
  --shadow-filter:
    drop-shadow(0 0 4px black) drop-shadow(0 0 8px rgba(0, 0, 0, 0.666)) drop-shadow(0 0 20px rgba(0, 0, 0, 0.333));
  --shadow-filter-bot:
    drop-shadow(0 10px 4px black) drop-shadow(0 20px 8px rgba(0, 0, 0, 0.666)) drop-shadow(0 30px 20px rgba(0, 0, 0, 0.333));
  --shadow-text:
    0 0 5px black,
    0 0 5px black,
    0 0 5px black,
    0 0 10px black,
    0 0 10px black
}

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}


/* IMAGES */

.img_whiteops {
  width: 100%;
  height: auto;
  background-image: var(--whiteops_example);
  background-size: contain;
  background-repeat: no-repeat;
  filter: var(--shadow-filter);
}

#lightboxWatermarkCanvas {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 999;
  display: none;

  mix-blend-mode: hard-light;
  opacity: var(--wm_overlay_intensity);

  border-radius: var(--lightbox_border_radius);
}





/* ====================================================================================================
   DESKTOP
   ==================================================================================================== */

/* CSS DESKTOP */

html {
  scrollbar-width: none;
  /* scrollbar-gutter: stable; */
}

/* html::-webkit-scrollbar {
  display: none;
}

/* BODY */
html,
body {
  min-height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: -30px;
  z-index: -1;
  background: var(--bg_image) left top / contain repeat-y;
  background-color: black;
  background-size: var(--main-background-size);
  aspect-ratio: var(--main-background-aspect-ratio);
  filter: url(#wavy) brightness(var(--main-background_brightness));
}

body {
  scrollbar-width: none;
  margin: 0;
  font-family: "MainFont";
  background-repeat: no-repeat;
  background-size: contain;
  background-position: left center;
  background-attachment: fixed;
  background-color: #000000;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;

  background-image: var(--bg_noise);
  background-repeat: repeat;
  background-size: 512px 512px;
  opacity: 0.8;

  mix-blend-mode: soft-light;

  filter: url(#wavyNoise) blur(4px) contrast(1.2);

  animation: noisePan 40s linear infinite;
  will-change: filter, background-position;
}


@keyframes noisePan {
  from {
    background-position: 0px 512px;
  }

  to {
    background-position: 0px 0px;
  }
}

/* LOADING SCREEN */
.loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  background: var(--loader-bg);
  opacity: 1;
}

.loading.is-active {
  display: grid;
  place-items: center;
}

/* ważne: logoWrap fade'uje jako pierwsze */
.loading_logoWrap {
  position: relative;
  width: min(200px, 30vmin);
  height: min(200px, 30vmin);
  opacity: 1;
  transform: translateZ(0);
  transition: opacity var(--loader-logo-fade);
  will-change: opacity;
}

.loading_video {
  width: 100%;
  height: 100%;
}


.loading.video-ready .loading_tint {
  opacity: 1;
}


/* Logo fade */
.loading.is-logoOut .loading_logoWrap {
  opacity: 0;
}

/* Overlay fade */
.loading.is-hiding {
  opacity: 0;
  transition: opacity var(--loader-overlay-fade);
}

.loading.is-hidden {
  display: none !important;
}




/* SIDE PANEL */

.side-panel-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.3) 10%,
      rgba(0, 0, 0, 0) 25%),
    linear-gradient(to top,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.5) 10%,
      rgba(0, 0, 0, 0.0) 40%);
}

.side-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--desktop-sidepanel-width);
  height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 40px 30px;
  box-sizing: border-box;
}

/* LOGO */
.logo {
  width: 300px;
  height: 200px;
  min-height: 200px;
  min-width: 270px;

  background-image: var(--logosvg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 30px;
  filter: var(--shadow-filter-strong) brightness(var(--logo-brightness));
  transition: filter var(--transition-time);
}

/* .logo:hover {
  filter: var(--glow-filter-light);
  transition: filter var(--transition-time);
} */

/* BRAND */
.brand-text {
  text-align: center;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 1px var(--color_text_main)) var(--shadow-filter) brightness(var(--brightness_brandtext));
}

.brand-text .brand-accent {
  color: var(--color_text_accent);
  filter: var(--shadow-filter);
}

.brand-text div {
  font-size: 32px;
  letter-spacing: var(--letter_spacing_header);
  color: var(--color_text_main);
  filter: var(--shadow-filter);
}



.tag-cloud {
  /* margin-top: 100px; */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 12px;
}

.tag-cloud .tag {
  background-color: var(--col3-3);
  color: var(--color_text_main);
  opacity: 1;
  transform: scale(1);

  filter: var(--shadow-filter-strong);
  cursor: pointer;

  border: 4px solid transparent;
  /* border-image: var(--border-image);
  border-image-slice: 50; */
  border-radius: 10px;

  padding: 0px 15px;
  font-family: "RegularTextFont";
  font-size: var(--text_size_tag);

  transition:
    filter var(--transition-time),
    transform var(--transition-time),
    opacity var(--transition-time),
    color var(--transition-time),
    background-color var(--transition-time);
}

.tag-cloud .tag:hover {
  transform: scale(1.1);
  filter: var(--glow-filter-light);
}

.tag-cloud .tag.active {
  background-color: var(--color_tagbg_active);
  color: var(--col5);
  opacity: 1;
  filter: var(--glow-filter);
}



.side-bottom {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* WAŻNE – musi znać wysokość */
  padding: 14px 12px;
}

.side-bottom-actions {
  margin-top: auto;
  /* 🔥 SPYCHA NA DÓŁ */
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* odstęp między przyciskami */
}

/* .last-update {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 50;

  font-family: "MainFont";
  font-size: max(9px, 0.8vh);
  letter-spacing: 2px;
  color: var(--color_text_main);
  text-shadow: var(--shadow-text);
  filter: var(--shadow-filter);

  opacity: 0.65;
  pointer-events: none;
} */


/* WINDOWS */
.modal {
  position: fixed;
  inset: 0;
  z-index: 666;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--backdrop_opacity));
}

.modal_panel {
  position: relative;
  overflow: hidden;
  /* OK */
  width: var(--contactpanel_width);
  height: var(--contactpanel_height);
  /* OK */
  /* padding: 26px 26px 18px 26px; */
  box-sizing: border-box;

  background: rgba(0, 0, 0, 0.2);
  /* border-radius: 14px; */

  border: 7px solid transparent;
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);

  filter: var(--shadow-filter-strong);
  backdrop-filter: blur(var(--blur));

  display: flex;
  flex-direction: column;
  /* gap: var(--about_topmargin); */
}





.modal_title,
.mobile-settings-header {
  background-image: var(--logosvg);
  background-size: 270px auto;
  /* szerokość loga */
  height: var(--modal_title_height);
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--modal_title_background_color);

  border-radius: 10px;
  border-bottom: 3px solid transparent;
  /* border:  */
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);

  font-size: var(--text_modal_header_size);
  letter-spacing: var(--letter_spacing_header);
  color: var(--color_text_accent);
  text-align: center;
  text-shadow: var(--shadow-text);

  margin-top: var(--about_topmargin);
  padding-top: 4px;
  padding-bottom: 10px;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* X */
.modal_close,
.mobile-settings-close {
  position: absolute;
  right: 10px;
  top: 45%;
  transform: translateY(-50%);

  width: var(--button_close_size);
  height: var(--button_close_size);

  border-radius: var(--button_close_roundness);

  background: rgba(0, 0, 0, 0.35);
  color: var(--col4);
  border: 2px solid rgba(255, 255, 255, 0.08);

  cursor: pointer;
  filter: var(--shadow-filter);
  transition: filter var(--transition-time), transform var(--transition-time);
  z-index: 667;
}

.modal_close:hover {
  filter: var(--glow-filter-button);
  /* transform: scale(1.05); */
}


/* FORM */
.contact-form {
  display: flex;
  align-items: center;
  /* justify-content: center; */
  /* margin-top: auto; */

  padding: 26px 26px 26px 26px;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.contact-form_label {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 8px;
}

.contact-form_labelText {
  text-align: center;
  color: var(--color_text_main);
  text-shadow: var(--shadow-text);
  letter-spacing: 2px;
  z-index: 666;
}

.contact-form_inputemail,
.contact-form_textarea {
  font-family: "RegularTextFont";
  font-size: var(--text_base_size);
  line-height: var(--line-height);
  /* height: ; */
  width: 100%;
  box-sizing: border-box;
  min-height: 0;

  flex: 1 1 auto;

  background: rgba(0, 0, 0, 0.75);
  color: var(--color_text_main);
  border-radius: 10px;

  border: 7px solid transparent;
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);

  outline: none;
  filter: var(--shadow-filter);
  transition: filter var(--transition-time), transform var(--transition-time);
}

.contact-form_inputemail {
  height: 46px;
  padding: 10px 14px;
}

.contact-form_textarea {
  flex: 1;
  /* wypełnia panel */
  min-height: 220px;
  padding: 12px 14px;
  resize: none;
}

.contact-form_inputemail:focus,
.contact-form_textarea:focus {
  filter: var(--glow-filter-button);
  transform: translateZ(0);
}

/* .contact-form_actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
} */

/* .contact-form__submit {
  width: 160px;
  font-family: "MainFont";
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--color_accent);
  text-transform: uppercase;
  cursor: pointer;

  border: 70px solid transparent;
  border-image: var(--border-image);
  border-image-slice: 250;

  filter: var(--shadow-filter-strong);
  transition: filter var(--transition-time), transform var(--transition-time);
} */

/* .contact-form__submit:hover {
  filter: var(--glow-filter-light);
  transform: scale(1.03);
} */

/* responsywka */
/* @media (max-width: 900px) {
  .modal__panel {
    width: min(92vw, 760px);
    height: min(72vh, 520px);
  }
} */



/* ABOUT MODAL LAYOUT */
.modal_panel--about {
  position: relative;
  /* KLUCZ */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: var(--about_width);
  height: var(--about_height);
  overflow: hidden;
  padding: 0px;
  /* filter: var(--blur) var(--shadow-filter-strong); */
  /* background-color: #cec323; */
}



/* grid ma wypełnić resztę panelu */
.modal_panel--about .about {
  flex: 1 1 auto;
  /* KLUCZ: wypełnia resztę pod tytułem */
  min-height: 0;
  /* KLUCZ: pozwala dzieciom się "ścinać"/scrollować */
  height: 100%;

  overflow: hidden;
  /* przycina wszystko w środku */
}

/* grid children w grid/flex: bez tego potrafią wypychać */
.modal_panel--about .about_left,
.modal_panel--about .about_right {
  min-width: 0;
  min-height: 0;
}

/* jeśli tekst ma rosnąć, to lepiej scroll niż wylewanie */
.modal_panel--about .about_right {
  overflow: auto;
  /* zmień na hidden jeśli koniecznie bez scrolla */
}


.about {
  display: grid;
  grid-template-columns: 0.7fr 1.2fr;
  gap: var(--about_photogap);
}

.about_left {
  /* background-color: #ff0000; */
  /* margin: 0px var(--about_photo_sidemargins) var(--about_photo_bottommargin) var(--about_photo_sidemargins); */
  margin-top: var(--about_photogap);
  /* top right bottom left */
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.photo_frame {
  display: inline-block;
  /* 🔑 dopasowuje się do zawartości */
  max-width: 100%;
  max-height: 100%;

  border: 7px solid transparent;
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);
  margin-left: var(--about_photogap);

  filter: var(--shadow-filter);
}

.about_photo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 550px;
  object-fit: contain;
}

.about_images {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  /* height: 550px; */
  object-fit: contain;
}


.about_right {
  /* scrollbar-width: thin;
  scrollbar-color: var(--color_text_main) rgba(0, 0, 0, 0.35); */
  scrollbar-gutter: stable;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: "RegularTextFont";

  /* gap: 12px; */
  /* padding-left: 10px; */
  /* padding-right: var(--about_rightmargin); */
  /* padding-bottom: 40px; */
  margin-top: var(--about_photogap);
  margin-bottom: var(--about_bottommargin);
  /* margin-right: 0px; */
  /* padding-left: 10px; */
  /* padding-left: 10px; */
  box-sizing: border-box;
}

.about_scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--about_rightmargin);

}

.about_image {
  overflow: hidden;
  display: flex;
  width: 100%;
  flex-direction: column;
  box-sizing: border-box;
}


/* ABOUT — SCROLLBAR */
.about_scroll::-webkit-scrollbar {
  width: 10px;
}

.about_scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  /* border-radius: 10px; */
}

.about_scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom,
      var(--col4),
      var(--col2));

  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.6);

  box-shadow:
    0 0 6px rgba(255, 210, 137, 0.4),
    inset 0 0 6px rgba(0, 0, 0, 0.6);
}

.about_scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom,
      var(--col5),
      var(--color_text_accent));

  box-shadow:
    0 0 10px rgba(255, 210, 137, 0.8),
    inset 0 0 6px rgba(0, 0, 0, 0.6);
}


/* progresywne bloki */
.about_block {
  display: none;
  color: var(--color_text_main);
  font-size: var(--text_base_size);
  text-shadow: var(--shadow-text);
  line-height: var(--line-height);
}

.about_block,
.about_block p {

  /* padding-top: 20px; */
  max-width: 100%;
  overflow-wrap: anywhere;
  /* twardo łamie, nawet długie ciągi */
  word-break: break-word;

}

.about_block.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.6s ease;
}

/* pinned bloki są zawsze widoczne, niezależnie od JS */
.about_block--pinned {
  display: block !important;
}

.about_block img {
  margin-top: 8px;
}

/* ===== ABOUT – PARAGRAPH TITLES ===== */

.about_paragraph_title {
  text-align: center;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--color_text_accent);
  text-shadow:
    0 0 6px rgba(255, 210, 137, 0.4),
    0 0 16px rgba(148, 117, 67, 0.4);
}


/* "więcej…" jako link */
.button_frameless {
  align-self: center;
  background: transparent;
  border: none;
  /* align-items: center; */
  /* justify-content: center; */
  padding: 0;

  font-family: "RegularTextFont";
  font-size: var(--text_base_size);
  color: var(--color_text_accent);
  cursor: pointer;

  /* letter-spacing: 2px; */
  text-shadow: var(--shadow-text);
  filter: var(--shadow-filter);
  transition: filter var(--transition-time), transform var(--transition-time);
}

.button_frameless:hover {
  filter: var(--glow-filter-light);
  /* transform: translateY(-1px); */
}

.about_more--sticky {
  position: sticky;
  bottom: 0;

  display: block;
  width: 100%;
  text-align: center;

  padding: 12px 0 6px;
  /* margin-top: 10px; */


  /* background: linear-gradient(to top,
    rgba(0,0,0,1),
    rgba(0, 0, 0, 0)
  ); */
  /* backdrop-filter: blur(var(--blur)); */
}


/* responsywka */
/* @media (max-width: 600px) {
  .modal_panel--about {
    width: min(92vw, 280px);
    height: min(78vh, 720px);

  }

  .about {
    grid-template-columns: 1fr;
    grid-template-rows: 260px 1fr;

  }


} */

@media (max-width: 1200px) {
  .about {
    grid-template-columns: 1fr;
  }

  .about_left {
    display: none;
  }

  .about_right {
    margin-left: 0;
    margin-top: var(--about_photogap);
    margin-right: 0;
    width: 100%;
  }

  .about_scroll {
    padding-right: 20px;
  }
}







/* GALLERY GRID */

/* .wrapper {
  margin-left: var(--sidepanel_width);
  margin-right: 50px;
  padding: var(--wrapperMargin);
  filter: var(--shadow-filter-strong);
} */

.wrapper {
  margin-left: var(--desktop-sidepanel-width);
  margin-right: var(--wrapperRightMargin);
  /* usuwa “czarną przerwę” od prawej */
  padding: var(--wrapperMargin);
  filter: var(--shadow-filter-strong);

  width: calc(100vw - var(--desktop-sidepanel-width) - var(--wrapperRightMargin));
  min-width: 600px;
  /* wrapper = viewport minus menu */
  overflow: hidden;
  /* UCINA kafelki, nie skaluje ich “dziwnie” */
}

.grid {
  /* display: grid;
  grid-template-columns: repeat(var(--gallery_columns), 1fr);
  gap: var(--tile_gap); */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--gallery_tile_width), 1fr));
  gap: var(--tile_gap);

  /* pozwala "dopychać" elementy i wypełniać dziury gdy coś span-uje 2x2 */
  grid-auto-flow: dense;
}

/* @media (max-width: 800px) {
  :root {
    --gallery_columns: 3;
  }

  .grid {
    grid-template-columns: repeat(var(--gallery_columns), 1fr);
  }
} */

/* Featured tile: zajmuje miejsce 2x2 (4 kafelki) */
.tile.tile--featured {
  grid-column: span 2;
  grid-row: span 2;
}

/* Na bardzo wąskich ekranach lepiej nie robić 2x2 (zostawiamy 1x1) */
/* @media (max-width: 680px) {
  .tile.tile--featured {
    grid-column: span 1;
    grid-row: span 1;
  }
} */

.tile {
  position: relative;
  border-radius: var(--tile_borderradius);
  overflow: hidden;
  cursor: pointer;
  background: #000000;
  aspect-ratio: 1 / 1;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  box-shadow:
    inset 0 0 12px var(--color_tagbg_active),
    inset 0 0 30px var(--col3-1);

  opacity: 0;
  transition: opacity var(--transition-time);
  will-change: opacity;
}

.tile:hover::after {
  opacity: 1;
}

.tile:hover {
  filter: var(--glow-filter);
  transition: filter var(--transition-time);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;

  filter: saturate(var(--tile_saturation)) contrast(1.05) brightness(1);
  transform: scale(1);
  transition: transform var(--transition-time), filter var(--transition-time);
  will-change: transform, filter;
}

.tile:hover img {
  transform: scale(1.2);
  filter: saturate(1) contrast(1.05) brightness(1.1);
}

.tile .label {
  display: none;
  /* position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  font-size: 13px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.70), rgba(0, 0, 0, 0)); */
}

.tile .countBadge {
  position: absolute;
  right: 0px;
  bottom: 0px;
  min-width: 10px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  /* font-weight: 700; */
  letter-spacing: 0.3px;
  background: rgba(0, 0, 0, 1);
  color: var(--col5);
  /* border: 1px solid rgba(255, 255, 255, 0.08); */
  /* backdrop-filter: blur(var(--blur)); */
  pointer-events: none;
}


/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, var(--backdrop_opacity));
  z-index: 300;
}

.lightbox.open {
  display: flex;
  z-index: 300;
}

/* czarna płyta dopasowywana z JS (tylko pozycja/rozmiar), bez animacji */
.lightboxPlate {
  position: absolute;
  background: #000;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
  border-radius: var(--lightbox_border_radius);
  display: none
    /* fallback, JS kopiuje z media */
}

/* WSPÓLNE */
.lightbox img,
.lightbox video {
  position: absolute;
  inset: 0;
  margin: auto;

  width: auto;
  max-width: 92vw;

  object-fit: contain;

  border: 4px solid transparent;
  border-radius: var(--lightbox_border_radius);

  z-index: 1;
  display: block;
}

/* IMG: nie wymuszaj wysokości -> box = realny rozmiar po contain */
.lightbox img {
  height: auto;
  max-height: 92vh;
}

/* VIDEO: możesz dalej trzymać “stałe” dopasowanie do ekranu */
.lightbox video {
  height: 92vh;
  max-height: 92vh;
}

/* IMG */
#lightboxImg {
  z-index: 666;
  opacity: 1;
  transition: opacity 500ms ease;
}

/* VIDEO A/B */
#lightboxVidA,
#lightboxVidB {
  z-index: 333;
  opacity: 0;
  transition: opacity var(--video-fade-time);
  /* możesz potem spiąć z configiem w JS */
}

.lightbox video.is-top {
  z-index: 666;
}

.lightbox video.is-bottom {
  z-index: 0;
}



/* LIGHTBOX CAPTION — layout jak na screenie (lewy dół) */

.lightboxCaption {
  z-index: 666;
  position: fixed;
  left: 50px;
  bottom: 50px;

  display: inline-flex;
  flex-direction: column;

  width: fit-content;
  max-width: min(620px, calc(100vw - 56px));

  padding: 14px 16px;
  border-radius: 14px;

  background: #000000cc;
  backdrop-filter: blur(var(--blur));
  pointer-events: none;

  filter: var(--shadow-text);
}




.lightboxTitleRow {
  /* margin: 0 0 4px 0; */
  margin-bottom: 12px;
  font-size: 22px;
  letter-spacing: var(--letter_spacing_main);
  line-height: 1.05;
  color: var(--color_text_accent);
  text-shadow: var(--shadow-text);
}

.lightboxDesc {
  /* margin: 12px 0 12px 0; */
  margin-bottom: 12px;
  color: var(--color_text_main);
  opacity: 0.95;
  font-size: 18px;
  font-family: "RegularTextFont";
  color: var(--color_text_darker);
  line-height: 1.3;
  letter-spacing: var(--letter_spacing_main);
  text-shadow: var(--shadow-text);
}

.lightboxYearRow {
  margin: 0;
  color: var(--color_text_main);
  font-size: 15px;
  letter-spacing: var(--letter_spacing_main);
}

.lightboxCaption .is-hidden {
  display: none;
}

/* .lbDesc,
.lbTitleRow,
.lbYearRow {
  white-space: normal;
  word-break: break-word;
} */

.lightboxDesc {
  white-space: pre-line;
}

.lightboxTitleRow,
.lightboxYearRow {
  white-space: normal;
}




/* BUTTONS */

.button_ui {
  padding: 0.5rem 1.2rem;
  font-size: var(--text_button_size);
  color: var(--color_text_main);
  letter-spacing: var(--letter_spacing_header);

  opacity: 1;
  width: 180px;
  font-family: "MainFont";
  cursor: pointer;
  background-color: black;
  border: 5px solid transparent;
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);
  filter: var(--shadow-filter);
  transition: all var(--transition-time);
  position: relative;
  overflow: hidden;
}

.button_ui::before {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(ellipse at center,
      rgb(255, 173, 42) 0%,
      rgba(168, 124, 41, 0.6) 40%,
      rgba(255, 210, 140, 0.08) 65%,
      rgba(255, 210, 140, 0) 85%);

  transform: scale(1.1, 0.6);
  filter: blur(16px);

  opacity: 0.3;

  pointer-events: none;
  z-index: 0;

  transition:
    opacity var(--transition-time),
    transform var(--transition-time),
    filter var(--transition-time);
}

.button_ui:hover {
  color: var(--color_text_bright);
  /* color: red; */

  /* filter: var(--glow-filter-light); */
  /* font-size: var(--text_button_size)*1.1; */
  transition: all var(--transition-time);
}

.button_ui:hover::before {
  opacity: 1;
  transform: scale(1.2, 0.9);
  filter: blur(10px);
  mix-blend-mode: screen;
}

/* .button_ui:hover::after {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(ellipse at center,
      rgb(255, 173, 42) 0%,
      rgba(168, 124, 41, 0.6) 40%,
      rgba(255, 210, 140, 0.08) 65%,
      rgba(255, 210, 140, 0) 85%);

  transform: scale(3, 2);
  filter: blur(16px);

  opacity: 0.3;

  pointer-events: none;
  z-index: 1;

  transition:
    opacity var(--transition-time),
    transform var(--transition-time),
    filter var(--transition-time);
} */


.button_ui>* {
  position: relative;
  z-index: 1;
}

/* .button_ui:focus-visible {
  outline: 2px solid red;
  outline-offset: 0px;
} */

/* .button_ui:hover {
  background: #261b0b84;
  color: var(--col5);
  filter: var(--glow-filter-button);
  transform: scale(1.05);
} */

.button_language {
  opacity: 1;
  border: none;
  font-family: "RegularTextFont";
  /* padding: 0.5rem 1.2rem; */
  background: transparent;
  font-size: var(--text_base_size);
  color: var(--color_text_main);
  text-transform: uppercase;
  cursor: pointer;
  /* background-color: #0000004b; */
  letter-spacing: var(--letter_spacing_header);
  filter: var(--shadow-filter);
  transition: all var(--transition-time);
  z-index: 999;
}


/* ==============================
   LIGHTBOX LOAD PROGRESS BAR
============================== */

.lightboxProgressWrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  /* 2-3px jak chcesz */
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 9999;
}

.lightboxProgressWrap.show {
  opacity: 1;
}


/* ==============================
   LIGHTBOX NAV LOCK (media loading)
============================== */
.lightbox.lightboxNavLocked img,
.lightbox.lightboxNavLocked video {
  pointer-events: none;
  /* blokuje spam klików NEXT/PREV na media */
  cursor: progress;
}

.lightboxProgressBar {
  height: 100%;
  width: 0%;
  background: var(--color_text_main);
  transform: translateZ(0);
  transition: width 40ms linear;
}





.contactSuccess {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.contactSuccessBox {
  padding: 20px 30px;
  background: #000;
  border: 7px solid transparent;
  border-image: var(--border-image);
  border-image-slice: var(--border-image-slice);
  font-family: "RegularTextFont";
  text-align: center;
  color: var(--color_text_main);
  font-size: 20px;
  filter: var(--shadow-filter-strong);
}


/* ===== UX: prevent blue selection / tap highlight on UI ===== */
.tile,
.lightbox,
.side-panel,
.tag-cloud .tag,
.button_ui,
.button_frameless,
.label,
.countBadge {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.about_scroll,
.about_scroll * {
  -webkit-user-select: text;
  user-select: text;
}

.contact-form_inputemail,
.contact-form_textarea {
  -webkit-user-select: text;
  user-select: text;
}