: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; }
.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 {
  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/bg-header.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 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}
.featured-story {
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(107, 208, 140, 0.2);
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.featured-story__image {
  width: 100%;
  height: 100%;
  min-height: 350px;
  object-fit: cover;
}
.featured-story__content {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-story__badge {
  display: inline-block;
  background: rgba(107, 208, 140, 0.2);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  width: fit-content;
}
.featured-story__title {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--ink);
  line-height: 1.2;
}
.featured-story__excerpt {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 24px;
}
.section-header {
  margin-bottom: 32px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 8px;
  color: var(--ink);
}
.section-header p {
  font-size: 18px;
  color: var(--muted);
}

/* VBK legacy cards on main stories page - unified with story-card style */
.vbk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  align-items: stretch;
  margin-top: 32px;
}

.vbk-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(107, 208, 140, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  max-width: 360px;
}

.vbk-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.vbk-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 56px rgba(0,0,0,.6);
  border-color: rgba(107, 208, 140, 0.4);
}


.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.story-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(107, 208, 140, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.story-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 56px rgba(0,0,0,.6);
  border-color: rgba(107, 208, 140, 0.4);
}
.footer {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(107, 208, 140, 0.1);
  margin-top: 60px;
}
@media (max-width: 900px) {
  .featured-story {
    grid-template-columns: 1fr;
  }
  .featured-story__content {
    padding: 32px 24px;
  }
  .featured-story__image {
    min-height: 250px;
  }
}
@media (max-width: 768px) {
  .nav { padding: 12px 20px; }
  nav { gap: 16px; }
  .page-header { min-height: 30vh; }
  .stories-grid {
    grid-template-columns: 1fr;
  }
}

/* STRICT GRID: 2 columns on desktop, 1 on mobile */
.stories-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:28px;
  align-items:start;
}
@media (max-width:640px){
  .stories-grid{grid-template-columns:1fr;}
  .vbk-grid{grid-template-columns:1fr;}

  .story-card,
  .vbk-card{
    border-radius:16px;
  }

  .story-card__body,
  .story-card__content{
    padding:18px 16px 20px;
  }

  .story-card__meta{
    font-size:13px;
  }

  .story-card__title{
    font-size:20px;
    line-height:1.35;
  }
}

/* Uniform card image */
.story-card img, .vbk-card img{
  width:100% !important;
  aspect-ratio:16/9 !important;
  height:220px !important;
  object-fit:cover !important;
  border-radius:14px !important;
  display:block;
}
/* Title: max 2 lines with ellipsis */
.story-card h3, .vbk-card .vbk-title{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
  min-height:2.6em;
  margin:.35rem 0 .2rem;
  font-weight:700;
  color:#b7f2cb;
}

/* Paginacija priča */
.pagination {
  margin: 48px 0 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.pagination__item {
  min-width: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(107,208,140,0.35);
  background: rgba(11,29,20,0.9);
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  transition: all .2s ease;
}
.pagination__item--active {
  background: var(--accent);
  color: #051009;
  border-color: var(--accent-bright);
  font-weight: 600;
}
.pagination__item--disabled {
  opacity: .45;
  cursor: default;
  border-style: dashed;
}
.pagination__item:not(.pagination__item--active):not(.pagination__item--disabled):hover {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
  transform: translateY(-1px);
}

/* === 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;
  }
}

.story-search-bar {
      margin: 1.75rem 0 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .story-search-bar label {
      font-weight: 600;
      font-size: 1rem;
    }
    .story-search-bar input[type="search"] {
      max-width: 420px;
      padding: 0.55rem 0.9rem;
      border-radius: 999px;
      border: 1px solid #d0d0d0;
      font-size: 1rem;
      outline: none;
    }
    .story-search-bar input[type="search"]:focus {
      border-color: #3c8d3c;
      box-shadow: 0 0 0 2px rgba(60, 141, 60, 0.15);
    }
    .story-search-hint {
      font-size: 0.85rem;
      color: #666666;
      max-width: 480px;
    }
    .story-search-empty {
      margin-top: 1rem;
      font-size: 0.95rem;
      color: #666666;
    }

.back-to-top {
      position: fixed;
      right: 1.5rem;
      bottom: 1.5rem;
      padding: 0.5rem 0.9rem;
      border-radius: 999px;
      border: none;
      background: #3c8d3c;
      color: #ffffff;
      font-size: 0.95rem;
      font-weight: 500;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
      opacity: 0;
      pointer-events: none;
      transform: translateY(10px);
      transition: opacity 0.25s ease, transform 0.25s ease;
      z-index: 50;
    }
    .back-to-top--visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }
    .back-to-top:focus {
      outline: 2px solid #ffffff;
      outline-offset: 2px;
    }

.featured-story__title-link {
      color: inherit;
      text-decoration: none;
    }
    .featured-story__title-link:hover,
    .featured-story__title-link:focus {
      text-decoration: underline;
    }


/* === 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; }
}


/* Perf: skip rendering offscreen cards (supported browsers) */
@supports (content-visibility: auto){
  .vbk-card{
    content-visibility:auto;
    contain-intrinsic-size: 360px 420px;
  }
}

