/* ========== MODERNIZOVAN EKOVANJA DIZAJN 2025 ========== */

:root {
  --bg-darker: #08130f;
  --bg-dark: #0b1d14;
  --card: #133024;
  --ink: #e6f2ea;
  --muted: #cfe3d6;
  --accent: #6bd08c;
  --accent-bright: #7de49d;
  --shadow: 0 16px 36px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-darker);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }

/* ========== NAVIGATION ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(8, 19, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(107, 208, 140, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid var(--accent);
}

nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ========== PAGE HEADER ========== */
.page-header {
  position: relative;
  min-height: 40vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1000px 60% at 50% 10%, rgba(107, 208, 140, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,.4), rgba(8,19,15,.8)),
    url('../slike/ekologija-i-zastita-zivotne-sredine-hero.webp') center/cover no-repeat;
  overflow: hidden;
}

.page-header__inner {
  position: relative;
  text-align: center;
  padding: 60px 24px;
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header h1 {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #e6f2ea 0%, #6bd08c 50%, #e6f2ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* ========== GALLERY GRID ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 2 / 3;
  background: #ffffff;
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 56px rgba(0,0,0,.7);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.gallery-item__category {
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--card);
  border-radius: 20px;
  border: 2px dashed rgba(107, 208, 140, 0.2);
}

.empty-state__icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 16px;
  color: var(--ink);
}

.empty-state p {
  font-size: 18px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 24px;
}

.empty-state__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: 50px;
  background: linear-gradient(135deg, #7de49d 0%, #6bd08c 100%);
  color: #0b1d14;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(107, 208, 140, 0.35);
  margin-top: 8px;
}

.empty-state__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(107, 208, 140, 0.5);
}

/* ========== FOOTER ========== */
.footer {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(107, 208, 140, 0.1);
  margin-top: 60px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav {
    padding: 12px 20px;
  }

  nav {
    gap: 16px;
  }

  .page-header {
    min-height: 30vh;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

.gallery-section {
  padding: 64px 0 80px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-header h1 {
  font-size: clamp(28px, 4vw, 34px);
  margin-bottom: 12px;
}

.gallery-header p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
}

.gallery-tabs {
  display: inline-flex;
  gap: 12px;
  margin: 0 auto 32px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(6, 40, 26, 0.9);
  box-shadow: var(--shadow);
}

.gallery-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.gallery-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #03140d;
  transform: translateY(-1px);
}

.gallery-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.gallery-grid.is-active {
  display: grid;
}

.gallery-item {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #ffffff;
}

.gallery-item figcaption {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 500;
}

/* === Mobilna optimizacija 360–414px (globalno) === */
@media (max-width: 480px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
  }

  nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a {
    font-size: 0.9rem;
  }

  .container {
    padding: 24px 16px;
  }

  .page-header {
    padding: 40px 16px;
    min-height: 30vh;
  }

  .page-header__inner {
    padding: 24px 0;
  }

  .stories-grid,
  .gallery-grid,
  .news-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .featured-story {
    grid-template-columns: 1fr;
  }
}

.guide-card {
  text-align: left;
  background: rgba(7, 32, 24, 0.9);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.guide-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.guide-card ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.download-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.download-buttons {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #22c55e;
  color: #02130f;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
  background: #4ade80;
}

.guide-footer {
  margin-top: 0.75rem;
}

.guide-pdf-link {
  font-size: 0.8rem;
  color: #6ee7b7;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-pdf-link:hover {
  color: #a7f3d0;
}

.coming-soon {
  margin: 1.5rem auto 2rem;
  max-width: 46rem;
  text-align: center;
  font-size: 0.98rem;
  color: #9ca3af;
}


/* === Mobile navigation toggle === */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(107, 208, 140, 0.4);
  background: rgba(8, 19, 15, 0.85);
  color: var(--ink, #e6f2ea);
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

@media (max-width: 768px) {
  .nav {
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav nav {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    background: rgba(8, 19, 15, 0.98);
    border-radius: 16px;
    padding: 12px 16px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 16px 40px rgba(0,0,0,.7);
    border: 1px solid rgba(107, 208, 140, 0.35);
  }

  body.nav-open .nav nav {
    display: flex;
  }

  .nav nav a {
    display: block;
    width: 100%;
  }
}



/* Hide nav on scroll (JS adds .nav.hidden) */
.nav.hidden {
  transform: translateY(-100%);
}
/* === Performance overrides (mobile) === */
@media (max-width: 640px) {
  .nav { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .badge, .category-badge { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .animate-on-scroll, .animated { transition: none !important; animation: none !important; }
}




/* === ACCESSIBILITY HELPERS === */
.sr-only{
  position:absolute !important;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
/* === LIGHTBOX === */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.86);
}
.lightbox.is-open{display:grid;}
.lightbox__img{
  max-width: min(92vw, 1200px);
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
.lightbox__close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover{background: rgba(0,0,0,.55);}
.lightbox__caption{
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  max-width: 80ch;
}
body.lightbox-open{overflow:hidden;}

.lightbox__content{display:flex; flex-direction:column; align-items:center;}



/* === BZR A4 SIGNS (portrait, no crop) === */
.gallery-item--a4 {
  aspect-ratio: 210 / 297;
}

.gallery-item--a4 img {
  object-fit: contain;
  background: #ffffff;
}

.gallery-item__downloads {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.gallery-item__downloads a {
  display: inline-block;
  margin: 6px 10px 0 0;
}


/* === BZR GRID UNIFORM FIX === */

/* === BZR GRID UNIFORM FIX ===
   Cilj: sve kartice u "BZR piktogrami" da budu iste visine (bez velikih praznih prostora u redu),
   čak i kad imamo A4 znakove sa download linkovima.
*/
#gallery-bzr .gallery-item{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  /* Ukloni osnovni square (aspect-ratio:1) za BZR, jer je to seklo prve slike */
  aspect-ratio: auto;
  height: auto;
}

#gallery-bzr .gallery-item img{
  width:100%;
  height: auto;
  /* A4 (portrait) – svi BZR piktogrami isti format */
  aspect-ratio: 210 / 297;
  object-fit: contain;
  background:#ffffff;
}

/* Neutralizuj portrait A4 odnos (da ne razbija redove) */
#gallery-bzr .gallery-item--a4{
  aspect-ratio: auto;
}

#gallery-bzr .gallery-item figcaption{
  margin-top: 10px;
  /* Stabilnija visina opisa */
  min-height: 64px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:6px;
}

#gallery-bzr .gallery-item__downloads{
  margin-top: 0;
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}

#gallery-bzr .gallery-item__downloads a{
  margin:0;
}


/* Perf: skip rendering offscreen gallery items (supported browsers) */
@supports (content-visibility: auto){
  .gallery-item{
    content-visibility:auto;
    contain-intrinsic-size: 320px 320px;
  }
}

