/* ---------------------------------------------------------------
   Galerija page — hero with filter chips, grid
--------------------------------------------------------------- */

.gallery-hero {
  position: relative;
  min-height: 480px;
  color: var(--text-on-dark);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.gallery-hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-blue-16) 0%, var(--color-blue-26) 100%);
}

.gallery-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    rgba(10, 15, 61, 0.95) 0%,
    rgba(10, 15, 61, 0.4) 60%,
    rgba(10, 15, 61, 0.2) 100%);
}

.gallery-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 80px var(--section-padding-x) 52px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.gallery-hero__title {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: var(--font-weight-bold);
  line-height: 1.1;
  color: var(--color-white);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}

.gallery-filters__chip {
  padding: 9px 19px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  font-size: var(--fs-13);
  color: var(--accent);
  line-height: 1;
  transition: background-color .2s ease, color .2s ease;
}

.gallery-filters__chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-filters__chip:hover {
    background: rgba(209, 248, 1, 0.14);
    color: var(--accent);
  }
}

.gallery-filters__chip.is-active {
  background: var(--accent);
  color: var(--color-blue-14);
  font-weight: var(--font-weight-semibold);
}

.gallery-filters__status {
  width: 100%;
  margin-top: 3px;
  font-size: var(--fs-12);
  color: var(--color-grey-97);
}

/* ---------- Gallery grid ---------- */

.gallery {
  background: var(--bg-page);
  padding: 60px 0;
}

.gallery__grid {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-card {
  position: relative;
  height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-blue-63) 0%, var(--color-blue-14) 100%);
  color: var(--color-white);
  display: flex;
  align-items: flex-end;
  transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-card[hidden] {
  display: none;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(10, 15, 61, 0.25);
}

.gallery-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  color: rgba(255, 255, 255, 0.12);
  z-index: 0;
}

.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--color-blue-14-95) 0%, var(--color-blue-14-05) 55%);
  z-index: 1;
}

.gallery-card__content {
  position: relative;
  z-index: 2;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.gallery-card__title {
  font-size: var(--fs-16);
  font-weight: var(--font-weight-semibold);
}

/* ---------- Modal (gallery item detail) — matches Figma 76:677 ---------- */

.gallery-modal {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 900px;
  width: calc(100% - 32px);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 24px 64px rgba(4, 2, 39, 0.3);
}

.gallery-modal::backdrop {
  background: rgba(4, 2, 39, 0.75);
}

.gallery-modal__body {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  background: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
  height: 480px;
}

/* Left: image carousel */
.gallery-modal__media {
  position: relative;
  background: linear-gradient(135deg, var(--color-blue-26) 0%, var(--color-blue-16) 100%);
  min-height: 100%;
  overflow: hidden;
}

.gallery-modal__stage {
  position: absolute;
  inset: 0;
}

.gallery-modal__figure {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: var(--fs-13);
  opacity: 0;
  transition: opacity .4s ease;
}

.gallery-modal__figure.is-active {
  opacity: 1;
}

.gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: background-color .2s ease;
  z-index: 2;
}

.gallery-modal__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.gallery-modal__nav--prev { left: 14px; }
.gallery-modal__nav--next { right: 14px; }

.gallery-modal__nav img {
  width: 16px;
  height: 16px;
}

.gallery-modal__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
}

.gallery-modal__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 3.5px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: width .2s ease, background-color .2s ease;
}

.gallery-modal__dot:hover,
.gallery-modal__dot:focus-visible {
  background: rgba(255, 255, 255, 0.55);
}

.gallery-modal__dot.is-active {
  width: 20px;
  background: var(--color-white);
}

/* Right: details */
.gallery-modal__details {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  overflow-y: auto;
  min-width: 360px;
}

.gallery-modal__tag {
  display: inline-flex;
  padding: 5px 13px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-pill);
  font-size: var(--fs-11);
  color: var(--brand);
  line-height: 1;
  margin-bottom: 16px;
}

.gallery-modal__title {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 12px;
}

.gallery-modal__desc {
  font-size: var(--fs-14);
  line-height: 1.7;
  color: var(--color-grey-46-2);
  margin-bottom: 28px;
}

.gallery-modal__meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-modal__meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-13);
  color: var(--color-grey-46-2);
}

.gallery-modal__meta-row img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gallery-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: var(--bg-page);
  color: var(--color-blue-10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  z-index: 3;
  transition: background-color .2s ease;
}

.gallery-modal__close:hover {
  background: var(--color-grey-89);
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-modal__body {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 90vh;
  }
  .gallery-modal__media { min-height: 240px; }
  .gallery-modal__details { min-width: 0; }
}

@media (max-width: 767px) {
  .gallery-hero { min-height: 380px; }
  .gallery-hero__inner { padding: 60px var(--section-padding-x) 32px; }
  .gallery__grid { grid-template-columns: 1fr; }
  .gallery-modal__details { padding: 24px; }
}
