/* Galeria — zakładki kategorii + toolbar (tylko .content.gallery) */
/* mobile-tabs-toolbar: 2026-10-30 */

.content.gallery section.add.mobile {
  display: none !important;
}

.gallery .sectionTopBar {
  background-color: #1d1d1d;
  color: #fff;
  font-size: 14px;
  padding: 0 !important;
}

.gallery .sectionTopBar .container {
  max-width: 1200px;
}

.gallery .galleryCategoryTabs {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid #ffffff;
}

.gallery .galleryCategoryTabs__item {
  flex: 1 1 0;
  min-width: 0;
}

.gallery .galleryCategoryTabs__link {
  display: block;
  height: 100%;
  padding: 14px 18px;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  border: 1px solid #ffffff;
  opacity: 1;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gallery .galleryCategoryTabs__item + .galleryCategoryTabs__item .galleryCategoryTabs__link {
  border-left: none;
}

.gallery .galleryCategoryTabs__link:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.gallery .galleryCategoryTabs__link.is-active {
  background-color: #fff;
  color: #1d1d1d;
}

.gallery .galleryCategoryTabs__title {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: #ffffff;
}

.gallery .galleryCategoryTabs__link.is-active .galleryCategoryTabs__title {
  color: #1d1d1d;
}

.gallery .galleryCategoryTabs__desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: #ffffff;
  opacity: 1;
}

.gallery .galleryCategoryTabs__link.is-active .galleryCategoryTabs__desc {
  color: #1d1d1d;
  opacity: 1;
}

.gallery .sectionTopBar,
.gallery .sectionTopBar .container,
.gallery .sectionTopBar__toolbar {
  overflow: visible;
}

.gallery .sectionTopBar__toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  min-height: 65px;
  max-height: none;
  background-color: #1d1d1d;
}

.gallery .sectionTopBar__toolbar > .sectionTopBar__cell {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
}

.gallery .sectionTopBar__cell {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  background-color: #1d1d1d;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery .sectionTopBar__cell--search {
  flex: 0 0 auto !important;
  width: auto;
  min-width: 0;
}

.gallery .sectionTopBar__cell--sort {
  flex: 0 0 auto;
  border-right: 0;
}

/* Reset legacy padding z style.css / extra.css (nie na .sectionTopBar__cell) */
.gallery .sectionTopBar .search:not(.sectionTopBar__cell),
.gallery .sectionTopBar .rangeWorks:not(.sectionTopBar__cell),
.gallery .sectionTopBar .filtr:not(.sectionTopBar__cell) {
  padding: 0 !important;
  margin: 0;
  border-left: 0 !important;
  border-right: 0;
  opacity: 1;
  flex-grow: 0;
}

.gallery .sectionTopBar__randomLabel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-family: "Archivo", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 17px;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  color: #ffffff;
  opacity: 1;
}

.gallery .sectionTopBar__randomInput {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gallery .sectionTopBar__randomSwitch {
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 65px;
  height: 35px;
  border: 2px solid #31c47a;
  border-radius: 100px;
  background: transparent;
  opacity: 1;
  transition: border-color 0.2s ease;
}

.gallery .sectionTopBar__randomSwitch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}

.gallery .sectionTopBar__randomInput:checked + .sectionTopBar__randomSwitch {
  background: transparent;
  border-color: #31c47a;
}

.gallery .sectionTopBar__randomInput:checked + .sectionTopBar__randomSwitch::after {
  transform: translateX(30px);
  background: #31c47a
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5.2 4.2 8.4 11 1.6' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat center / 12px 9px;
}

.gallery .sectionTopBar .sectionTopBar__cell.search {
  display: flex;
  width: auto;
  flex: 0 0 auto !important;
}

.gallery .sectionTopBar .search form {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  margin: 0;
  padding: 0;
  gap: 16px;
}

.gallery .sectionTopBar .search input,
.gallery .sectionTopBar .rangeWorks input {
  background-color: transparent;
  border: 1px solid #ffffff;
  opacity: 1;
  height: 36px;
  line-height: 36px;
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  box-sizing: border-box;
}

.gallery .sectionTopBar .search input {
  flex: 0 0 auto;
  width: 160px;
  max-width: 160px;
  min-width: 0;
  padding: 0 12px;
  text-align: left;
}

.gallery .sectionTopBar .search input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

.gallery .sectionTopBar .search button {
  flex-shrink: 0;
  height: 36px;
  line-height: 21px;
  padding: 0 22px;
  border: 1px solid #fa1dbb;
  background-color: #fa1dbb;
  font-family: "Archivo", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
  text-align: center;
  color: #ffffff;
  opacity: 1;
  cursor: pointer;
}

.gallery .sectionTopBar .rangeWorks form {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.gallery .sectionTopBar .rangeWorks input {
  width: 64px;
  text-align: center;
}

.gallery .sectionTopBar .rangeWorks__sep {
  opacity: 0.85;
}

.gallery .sectionTopBar .sectionTopBar__cell.filtr {
  display: flex;
  align-items: center;
  width: auto;
}

.gallery .sectionTopBar .filtr .sort {
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 170px;
  max-width: 170px;
  height: 36px !important;
  margin: 0;
  padding: 0 15px !important;
  border: 1px solid #ffffff !important;
  background: transparent;
  color: #ffffff;
  font-family: "Archivo", sans-serif;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  position: relative;
  overflow: visible;
  z-index: 20;
}

.gallery .sectionTopBar .filtr .sort img {
  flex-shrink: 0;
  margin: 0;
}

.gallery .sectionTopBar .filtr .sort:hover,
.gallery .sectionTopBar .filtr .sort.active {
  background: transparent;
  border-color: #ffffff !important;
}

.gallery .sectionTopBar .filtr .sort.active {
  border-bottom: none !important;
}

.gallery .sectionTopBar .filtr .sort ul {
  display: none !important;
  list-style: none;
  margin: 0;
  padding: 0 15px;
}

.gallery .sectionTopBar .filtr .sort.active ul {
  display: flex !important;
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  min-width: calc(100% + 2px);
  box-sizing: border-box;
  background-color: #1d1d1d;
  border: 1px solid #ffffff !important;
  border-top: none !important;
  z-index: 100;
}

.gallery .sectionTopBar .filtr .sort.active ul li {
  width: 100%;
}

.gallery .sectionTopBar .filtr .sort.active ul li a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  width: 100%;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
}

.gallery .sectionTopBar .filtr .sort.active ul li a:hover,
.gallery .sectionTopBar .filtr .sort.active ul li.active a {
  opacity: 1;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .gallery .sectionTopBar .container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
    box-sizing: border-box;
  }

  .gallery .galleryCategoryTabsNav {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .gallery .galleryCategoryTabs {
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    border-bottom: none;
  }

  .gallery .galleryCategoryTabs__item {
    flex: none;
    width: 100%;
    margin: 0;
    padding: 0;
    height: 65px;
    overflow: hidden;
  }

  .gallery .galleryCategoryTabs__link {
    border: 1px solid #ffffff;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 18px !important;
  }

  .gallery .galleryCategoryTabs__title {
    font-size: 14px;
    line-height: 1.1;
  }

  .gallery .galleryCategoryTabs__desc {
    margin-top: 1px;
    font-size: 11px;
    line-height: 1.15;
  }

  .gallery .galleryCategoryTabs__item + .galleryCategoryTabs__item .galleryCategoryTabs__link {
    border-left: 1px solid #ffffff;
  }

  .gallery .sectionTopBar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .gallery .sectionTopBar__toolbar {
    flex-wrap: wrap;
    min-height: 0;
    max-height: none;
    gap: 10px;
    margin: 0;
    padding: 0;
  }

  .gallery .sectionTopBar__cell,
  .gallery .sectionTopBar__toolbar > .sectionTopBar__cell,
  .gallery .sectionTopBar .sectionTopBar__cell.search,
  .gallery .sectionTopBar .sectionTopBar__cell.filtr {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100% !important;
    height: 65px !important;
    min-height: 65px !important;
    max-height: 65px !important;
    padding: 0 18px !important;
    border: 1px solid #ffffff;
    border-right: 1px solid #ffffff;
    justify-content: center;
    box-sizing: border-box;
  }

  .gallery .sectionTopBar__cell--sort,
  .gallery .sectionTopBar .sectionTopBar__cell.filtr {
    border: none;
    overflow: visible;
    height: auto !important;
    min-height: 52px !important;
    max-height: none !important;
  }

  .gallery .sectionTopBar__cell--search,
  .gallery .sectionTopBar .sectionTopBar__cell.search {
    border: none;
    height: auto !important;
    min-height: 65px !important;
    max-height: none !important;
  }

  .gallery .sectionTopBar__cell--random,
  .gallery .sectionTopBar__cell--range,
  .gallery .sectionTopBar__cell--search,
  .gallery .sectionTopBar__cell--sort {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100% !important;
  }

  .gallery .sectionTopBar .filtr {
    padding: 0 !important;
    width: 100%;
    justify-content: center;
  }

  .gallery .sectionTopBar__randomLabel {
    justify-content: center;
    width: 100%;
  }

  .gallery .sectionTopBar .rangeWorks form,
  .gallery .sectionTopBar .search form {
    width: 100%;
    justify-content: center;
  }

  .gallery .sectionTopBar .filtr .sort {
    max-width: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .gallery .sectionTopBar .search form {
    max-width: 100%;
    box-sizing: border-box;
  }

  .gallery .sectionTopBar .search input {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  .gallery .sectionTopBar__cell--search {
    flex: 1 1 100% !important;
  }
}

/* Admin — zakładki kategorii na liście zaakceptowanych */
.galleryCategoryTabs--admin {
  display: flex;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__item {
  flex: 1 1 0;
  min-width: 0;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__link {
  display: block;
  box-sizing: border-box;
  padding: 14px 16px;
  text-align: center;
  text-decoration: none !important;
  background-color: #ffffff;
  border: 1px solid #1d1d1d;
  color: #1d1d1d !important;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__item + .galleryCategoryTabs__item .galleryCategoryTabs__link {
  border-left: none;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__link:hover {
  background-color: #f5f5f5;
  color: #1d1d1d !important;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__link.is-active {
  background-color: #1d1d1d;
  border: 1px solid #ffffff;
  color: #ffffff !important;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 1px #1d1d1d;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__title {
  display: block;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: #1d1d1d;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__desc {
  display: block;
  margin-top: 4px;
  font-family: "Archivo", sans-serif;
  font-size: 12px;
  line-height: 1.3;
  color: #1d1d1d;
  opacity: 1;
}

.galleryCategoryTabs--admin .galleryCategoryTabs__link.is-active .galleryCategoryTabs__title,
.galleryCategoryTabs--admin .galleryCategoryTabs__link.is-active .galleryCategoryTabs__desc {
  color: #ffffff !important;
  opacity: 1;
}

section.gallery .adminApplicationVotesLine .text-success {
  color: #28a745 !important;
  font-weight: 700;
}

/* Mobile — menu boczne vs sticky .sectionTop (galeria) */
@media (max-width: 768px) {
  body.openMenu:has(.content.gallery) {
    overflow: hidden;
    touch-action: none;
  }

  .content.gallery .sectionTop {
    z-index: 80;
  }

  .content.gallery aside {
    z-index: 70;
    top: 57px;
    right: 0;
    left: auto;
    bottom: 0;
    height: auto;
    width: min(280px, 82vw);
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.45);
  }

  body.openMenu .content.gallery aside {
    opacity: 1;
    pointer-events: auto;
  }

  body.openMenu .content.gallery::before {
    content: "";
    position: fixed;
    top: 57px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 65;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
  }

  .content.gallery main {
    position: relative;
    z-index: 1;
  }
}
